Search completed in 1.05 seconds.
1930 results for "valid":
Your results are loading. Please wait...
MerchantValidationEvent.validationURL - Web APIs
the merchantvalidationevent property validationurl is a read-only string value providing the url from which to fetch the payment handler-specific data needed to validate the merchant. this data should be passed into the complete() method to let the user agent complete the transaction. syntax validationurl = merchantvalidationevent.validationurl; value a read-only usvstring giving the url from which to load payment handler specific data needed to complete the merchant verification process. once this has been loaded, it should be passed into complete(), either directly or using a promise. see merchant validation in payment processing concepts for more information on the merchant validation process. specifications specification status comment payment request apit...
...er specific data needed to complete the merchant verification process. once this has been loaded, it should be passed into complete(), either directly or using a promise. see merchant validation in payment processing concepts for more information on the merchant validation process. specifications specification status comment payment request apithe definition of 'merchantvalidationevent.validationurl' in that specification. candidate recommendation initial definition. ...
Client-side form validation - Learn web development
previous overview: forms next before submitting data to the server, it is important to ensure all required form controls are filled out, in the correct format. this is called client-side form validation, and helps ensure data submitted matches the requirements set forth in the various form controls. this article leads you through basic concepts and examples of client-side form validation. prerequisites: computer literacy, a reasonable understanding of html, css, and javascript. ...
...mat. this is called client-side form validation, and helps ensure data submitted matches the requirements set forth in the various form controls. this article leads you through basic concepts and examples of client-side form validation. prerequisites: computer literacy, a reasonable understanding of html, css, and javascript. objective: to understand what client-side form validation is, why it's important, and how to apply various techniques to implement it. client-side validation is an initial check and an important feature of good user experience; by catching invalid data on the client-side, the user can fix it straight away. if it gets to the server and is then rejected, a noticeable delay is caused by a round trip to the server and then back to the client-sid...
...iques to implement it. client-side validation is an initial check and an important feature of good user experience; by catching invalid data on the client-side, the user can fix it straight away. if it gets to the server and is then rejected, a noticeable delay is caused by a round trip to the server and then back to the client-side to tell the user to fix their data. however, client-side validation should not be considered an exhaustive security measure! ...
...And 88 more matches
Constraint validation - Developer guides
the creation of web forms has always been a complex task. while marking up the form itself is easy, checking whether each field has a valid and coherent value is more difficult, and informing the user about the problem may become a headache. 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. basic, usual constraints can be checked, without the need for javascript, by setting new attributes; more complex constraints can be tested using the constraint validation api. for a basic introduction to these concepts, with examples, see the form validation tutorial. note: html5 constraint validation doesn't remove the need for validation on the server side. eve...
...ient side. basic, usual constraints can be checked, without the need for javascript, by setting new attributes; more complex constraints can be tested using the constraint validation api. for a basic introduction to these concepts, with examples, see the form validation tutorial. note: html5 constraint validation doesn't remove the need for validation on the server side. even though far fewer invalid form requests are to be expected, invalid ones can still be sent by non-compliant browsers (for instance, browsers without html5 and without javascript) or by bad people trying to trick your web application. 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 ...
...idate 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. by setting values on validation-related attributes, allowing basic constraints to be described in a simple way, without the need for javascript. semantic input types the intrinsic constraints for the type attribute are: input type constraint description associated violation <input type="url"> the value must be an absolute url, as defined in the ...
...And 29 more matches
Using the aria-invalid attribute - Accessibility
description this technique demonstrates how to use the aria-invalid attribute. 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. aria-invalid can also be used to indicate that a required field has not been filled in.the attribute should be programmatically set as a result of a validation process. this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. values vocabulary: false (default) no errors detected grammar a grammatical error has been detected. spelling a spelling error has been detected. true the value has failed validation. ...
... have an aria role assigned. values vocabulary: false (default) no errors detected grammar a grammatical error has been detected. spelling a spelling error has been detected. true the value has failed validation. any value not in this vocabulary should be treated as true. possible effects on user agents and assistive technology user agents should inform the user when a field is invalid. application authors should provide suggestions for correcting the problem, if possible. authors may prevent a form from being submitted. ...
...ser agents should inform the user when a field is invalid. application authors should provide suggestions for correcting the problem, if possible. authors may prevent a form from being submitted. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: simple form validation the following snippet shows a simplified version of two form fields with a validation function attached to the blur event. note that since the default value for aria-required is false, it is not strictly necessary to add the attribute to input. ...
...And 14 more matches
Constraint validation API - Web APIs
the constraint validation api enables checking values that users have entered into form controls, before submitting the values to the server. 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. however, you may want to impose more complex constraints, or to provide clearer reporting of validation failures than the defaults. this can be done using the constraint validation api. note: client-side constraint validation doesn't remove the need for validation on the server side. ...
... allowable values, using attributes like required and pattern to set basic constraints. however, you may want to impose more complex constraints, or to provide clearer reporting of validation failures than the defaults. this can be done using the constraint validation api. note: client-side constraint validation doesn't remove the need for validation on the server side. even though client-side validation can prevent many common kinds of invalid values, invalid ones can still be sent by older browsers or by attackers trying to trick your web application. 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. client side validation is a tool for giving quick feedback to the user. you should not rely on it to compl...
... values, invalid ones can still be sent by older browsers or by attackers trying to trick your web application. 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. client side validation is a tool for giving quick feedback to the user. you should not rely on it to completely sanitize data received by the server. validation of constraints through the constraint validation api is done either on a single form element or at the form level, on the <form> element itself. constraint validation interfaces validitystate the validitystate interface represents the validity states that a form control element can have, with respect to its defined constraints. together, they help explain whether and why an element's va...
...And 13 more matches
:valid - CSS: Cascading Style Sheets
Web › CSS › :valid
the :valid css pseudo-class represents any <input> or other <form> element whose contents validate successfully. this allows to easily make valid fields adopt an appearance that helps the user confirm that their data is formatted properly. /* selects any valid <input> */ input:valid { background-color: powderblue; } this pseudo-class is useful for highlighting correct fields for the user. ...
...alid css pseudo-class represents any <input> or other <form> element whose contents validate successfully. this allows to easily make valid fields adopt an appearance that helps the user confirm that their data is formatted properly. /* selects any valid <input> */ input:valid { background-color: powderblue; } this pseudo-class is useful for highlighting correct fields for the user. ...
...ents any <input> or other <form> element whose contents validate successfully. this allows to easily make valid fields adopt an appearance that helps the user confirm that their data is formatted properly. /* selects any valid <input> */ input:valid { background-color: powderblue; } this pseudo-class is useful for highlighting correct fields for the user. ...
...And 7 more matches
PaymentRequest: merchantvalidation event - Web APIs
merchantvalidation events are delivered by the payment request api to a paymentrequest object when a payment handler requires that the merchant requesting the purchase validate itself as permitted to use the payment handler. see merchant validation in payment processing concepts for details on how the merchant validation process works. bubbles no cancelable no interface merchantvalidationevent event handler property onmerchantvalidation examples in this example, an event handler is established for the merchantvalidation event. it uses the fetch() to send a request to its own server with an argument of the payment method's validation url, obtained from the event's validationurl property. ...
... interface merchantvalidationevent event handler property onmerchantvalidation examples in this example, an event handler is established for the merchantvalidation event. it uses the fetch() to send a request to its own server with an argument of the payment method's validation url, obtained from the event's validationurl property. the merchant server should access the validation url in accordance with the payment method documention. typically, a client should not access the validation url. ...
...ished for the merchantvalidation event. it uses the fetch() to send a request to its own server with an argument of the payment method's validation url, obtained from the event's validationurl property. the merchant server should access the validation url in accordance with the payment method documention. typically, a client should not access the validation url. ...
...And 6 more matches
:invalid - CSS: Cascading Style Sheets
Web › CSS › :invalid
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. syntax :invalid examples this example presents a simple form that colors elements green when they validate and red when they don't. ...
...people who have...
...people who have certain types of color blindness will be unabl...
...And 6 more matches
HTMLObjectElement.setCustomValidity - Web APIs
the setcustomvalidity() method of the htmlobjectelement interface sets a custom validity message for the element. syntax htmlobjectelement.setcustomvalidity(message); parameters error the message to use for validity errors. return value undefined exceptions none. 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. additionally you must call the reportvalidity method on the same element or nothing will happen. ...
...customvalidity(message); parameters error the message to use for validity errors. return value undefined exceptions none. 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. additionally you must call the reportvalidity method on the same element or nothing will happen. ...
...lidity errors. return value undefined exceptions none. 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. additionally you must call the reportvalidity method on the same element or nothing will happen. ...
...And 5 more matches
Test your skills: Form validation - Learn web development
this aim of this skill test is to assess whether you've understood our client-side form validation article. note: you can try out solutions locally, however it may be helpful to put your code in an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. 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. change the type of the "email address" and "phone number" fields to make the browser apply some more specific validation suitable for the data being asked for. give the "user name" ...
...e" field a required length of between 5 and 20 characters, the "phone number" field a maximum length of 15 characters, and the "comment" field a maximum length of 200 characters. try submitting your form — it should refuse to submit until the above constaints are followed, and give suitable error messages. to help, you might want to consider adding some simple css to show when a form field is valid or invalid. download the starting point for this task to work in your own editor or in an online editor. form validation 2 now we want you to take the same form you saw in the previous task (use your previous answer if you want to), and add some more specific pattern validation to the first three fields using regular expressions. all of the user names in our application consist of a singl...
...ific pattern validation to the first three fields using regular expressions. all of the user names in our application consist of a single letter, followed by a dot, followed by three or more letters or numbers. all letters should be lowercase. all of the email addresses for our users consist of one or more letters (lower or upper case) or numbers, followed by "@bigcorp.eu". remove the length validation from the phone number field if it is present, and set it so that it accepts 10 digits — either 10 digits in a row, or a pattern of three digits, three digits, then four digits, separated by either spaces, dashes, or dots. note: regular expressions are really challenging if you are new to them, but don't despair — have a go and see where you get to; there is no shame in asking for some...
...And 4 more matches
HTMLObjectElement.validity - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 4 more matches
ValidityState - Web APIs
the validitystate interface represents the validity states that an element can be in, with respect to constraint validation. together, they help explain why an element's value fails to validate, if it's not valid. properties for each of these boolean properties, a value of true indicates that the specified reason validation may have failed is true, with the exception of the valid property, which is true if the element's value obeys all constraints. badinput read only a boolean that is true if the user has provided input that the browser is unable to convert. customerror read only a boolean indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setcustomvalidity() method. patternmismatch read only a boolean that is true ...
...rovided input that the browser is unable to convert. customerror read only a boolean indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setcustomvalidity() method. patternmismatch read only a boolean that is true if the value does not match the specified pattern, and false if it does match. if true, the element matches the :invalid css pseudo-class. rangeoverflow read only a boolean that is true if the value is greater than the maximum specified by the max attribute, or false if it is less than or equal to the maximum. if true, the element matches the :invalid and :out-of-range and css pseudo-classes. rangeunderflow read only a boolean that is true if the value is less than the minimum specified by the min attribute, ...
... than the maximum specified by the max attribute, or false if it is less than or equal to the maximum. if true, the element matches the :invalid and :out-of-range and css pseudo-classes. rangeunderflow read only a boolean that is true if the value is less than the minimum specified by the min attribute, or false if it is greater than or equal to the minimum. if true, the element matches the :invalid and :out-of-range css pseudo-classes. stepmismatch read only a boolean that is true if the value does not fit the rules determined by the step attribute (that is, it's not evenly divisible by the step value), or false if it does fit the step rule. if true, the element matches the :invalid and :out-of-range css pseudo-classes. toolong read only a boolean that is true if the value exceeds the...
...And 4 more matches
SyntaxError: invalid regular expression flag "x" - JavaScript
in a regular expression literal, which consists of a pattern enclosed between slashes, the flags are defined after the second slash. they can also be defined in the constructor function of the regexp object (second parameter). ...
...in a regular expression literal, which consists of a pattern enclosed between slashes, the flags are defined after the second slash. they can also be defined in the constructor function of the regexp object (second parameter). ...
...in a regular expression literal, which consists of a pattern enclosed between slashes, the flags are defined after the second slash. they can also be defined in the constructor function of the regexp object (second parameter). ...
...And 4 more matches
HTMLObjectElement.validationMessage - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
...And 3 more matches
Validators - Firefox Developer Tools
this document lists different resources for developers to validate web pages. sidebar tabs are not available at this time. tune-up wizard links back to devedge if you're writing new code that isn't validating immediately, see the available standards-compliant authoring and development tools. firefox extensions for validation quick reference sidebar tabs install devedge toolbox sidebars for quick access to web development references. checky checky adds a submenu to your netscape or mozilla context menu that allows you to run whatever page you're on through one of (currently) 18 different online validaton and analysis services. applications and services devedge web tune-up wizard this interface to w3c services guides beginning-to-intermediate web authors through the process of ...
...ntext menu that allows you to run whatever page you're on through one of (currently) 18 different online validaton and analysis services. applications and services devedge web tune-up wizard this interface to w3c services guides beginning-to-intermediate web authors through the process of updating content to support netscape 7.x, mozilla and other browsers that support w3c standards. w3c html validator the w3c html validator will validate any web page according to the w3c html standards. it is very useful for detecting the use of proprietary html as well as invalid html. ...
... this interface to w3c services guides beginning-to-intermediate web authors through the process of updating content to support netscape 7.x, mozilla and other browsers that support w3c standards. w3c html validator the w3c html validator will validate any web page according to the w3c html standards. it is very useful for detecting the use of proprietary html as well as invalid html. w3c css validator the w3c css validator will validate the css within any web page or external css files according to the w3c css standards. w3c rdf validator the rdf validator service will validate the rdf/xml contained on a given uri. link checker this tool will check links on a given web page. html tidy html tidy is a tool that can be used to report errors in an html page and to format web pages for b...
...And 2 more matches
PaymentRequest.onmerchantvalidation - Web APIs
the paymentrequest event handler onmerchantvalidation is invoked when the merchantvalidation is fired, indicating that the payment handler (e.g., apple pay) requires the merchant to validate themselves. this is usually the first event to be fired, and the user won't be able to proceed with a payment until the merchant validate themselves. this event is not be fired by all payment handlers. in particular, it's used by apple pay. syntax paymentrequest.onmerchantvalidation = eventhandlerfunction; value an event handler function which is to be called whenever the merchantvalidation event is fired at the paymentrequest, indicating that the payment handler requires the merchant to validate themselves as allowed to use this payment handler. ...
...ent handlers. in particular, it's used by apple pay. syntax paymentrequest.onmerchantvalidation = eventhandlerfunction; value an event handler function which is to be called whenever the merchantvalidation event is fired at the paymentrequest, indicating that the payment handler requires the merchant to validate themselves as allowed to use this payment handler. ...
...tion = eventhandlerfunction; value an event handler function which is to be called whenever the merchantvalidation event is fired at the paymentrequest, indicating that the payment handler requires the merchant to validate themselves as allowed to use this payment handler. ...
...And 2 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...
... </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. if the values are too long or too short, or contain characters that aren't digits, patternmismatch will be true. ...
...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. if the values are too long or too short, or contain characters that aren't digits, patternmismatch will be true. when true, the element matches the :invalid css pseudo-classes. input:invalid { border: red solid 3px; } note, in this case, we get a patternmismatch not a validitystate.toolong or validitystate.tooshort if the values are too long or too short because it is the pattern that is dictating the length of the value. had we used minlength and maxlength attributes instead, we may have seen validitystate.toolong or validitystate.tooshort being true. note: the email input ty...
...And 2 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. if the type attribute expects specific strings, such as the email and url types and the value don't doesn't conform to the constraints set by the type, the typemismatch property will be true. the email input type expects one or more valid email addresses, depending on whether the multiple attribute is present. a valid email address includes an email prefix and a domain, with or without a top level domain. ...
...ypes and the value don't doesn't conform to the constraints set by the type, the typemismatch property will be true. the email input type expects one or more valid email addresses, depending on whether the multiple attribute is present. a valid email address includes an email prefix and a domain, with or without a top level domain. 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. the url input type expects one or more valid email urls, depending on whether the multiple attribute is present. a valid url includes a protocol, optionally with an ip address, or an optional subdomain, domain, and top level domain combination. if the value of the url inpu...
...ma separated email address if the multiple attribute is present, there is a typemismatch. the url input type expects one or more valid email urls, depending on whether the multiple attribute is present. a valid url includes a protocol, optionally with an ip address, or an optional subdomain, domain, and top level domain combination. if the value of the url input is not an empty string, a single valid url, or one or more comma separated urls if the multiple attribute is present, there is a typemismatch. type attribute conformance input type value expected value email x@y or x@y.z email address, with or without tld url x: or x://y.z protocol or full url with protocol examples given the following: <p> <label> enter an email addres...
...And 2 more matches
WebGL2RenderingContext.invalidateSubFramebuffer() - Web APIs
the webgl2renderingcontext.invalidatesubframebuffer() method of the webgl 2 api invalidates portions of the contents of attachments in a framebuffer. syntax void gl.invalidatesubframebuffer(target, attachments, x, y, width, height); parameters target a glenum specifying the binding point (target). possible values: gl.framebuffer: collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.draw_framebuffer: equivalent to gl.framebuffer. gl.read_framebuffer: used as a source for reading operations. attachments an array of glenum specifying the attachment points to invalidate. possible values: gl.color_attachment{0-15}: invalidates one of the framebuffer's color buffers. ...
...rage of color, alpha, depth and stencil buffers used to render an image. gl.draw_framebuffer: equivalent to gl.framebuffer. gl.read_framebuffer: used as a source for reading operations. attachments an array of glenum specifying the attachment points to invalidate. possible values: gl.color_attachment{0-15}: invalidates one of the framebuffer's color buffers. gl.depth_attachment: invalidates the framebuffer's depth buffer. gl.stencil_attachment: invalidates the framebuffer's stencil buffer. gl.depth_stencil_attachment: invalidates both the framebuffer's depth and stencil buffer. x a glint specifying the left origin of the pixel rectangle to invalidate. y a glint specifying the bottom origin of the pixel rectangle to invalidate. width a glsizei specifying the width o...
...h buffer. gl.stencil_attachment: invalidates the framebuffer's stencil buffer. gl.depth_stencil_attachment: invalidates both the framebuffer's depth and stencil buffer. x a glint specifying the left origin of the pixel rectangle to invalidate. y a glint specifying the bottom origin of the pixel rectangle to invalidate. width a glsizei specifying the width of the pixel rectangle to invalidate. height a glsizei specifying the height of the pixel rectangle to invalidate. return value none. ...
...And 2 more matches
:-moz-ui-invalid - CSS: Cascading Style Sheets
the :-moz-ui-invalid css pseudo-class represents any validated form element whose value isn't valid based on their validation constraints, in certain circumstances. this pseudo-class is applied according to the following rules: if the control does not have focus, and the value is invalid, apply this pseudo-class. if the control has focus, and the value was valid (including empty) when it gained focus, do not apply the pseudo-class. if the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke. if the element is required, the preceding rules apply only if the user has changed the value or attempted to submit the form. ...
...ss. if the control has focus, and the value was valid (including empty) when it gained focus, do not apply the pseudo-class. if the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke. if the element is required, the preceding rules apply only if the user has changed the value or attempted to submit the form. the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control. however, if the user is trying to correct a previously-flagged value, the control shows immediately when the value becomes valid. required items have the pseudo-class applied only if the user changes them or attempts to submit an unchanged valid value. by default, gecko ...
...if the user is trying to correct a previously-flagged value, the control shows immediately when the value becomes valid. required items have the pseudo-class applied only if the user changes them or attempts to submit an unchanged valid value. by default, gecko applies a style that creates a red "glow" (using the box-shadow property) around items, which have this pseudo-class applied. see the :invalid pseudo-class for an example that shows how to override the default style. the specification for :user-invalid is still in progress. ...
...And 2 more matches
RangeError: invalid array length - JavaScript
the javascript exception "invalid array length" occurs when creating an array or an arraybuffer which has a length which is either negative or larger or equal to 232, or when setting the array.length property to a value which is either negative or larger or equal to 232. ...
... the javascript exception "invalid array length" occurs when creating an array or an arraybuffer which has a length which is either negative or larger or equal to 232, or when setting the array.length property to a value which is either negative or larger or equal to 232. ...
...avascript exception "invalid array length" occurs when creating an array or an arraybuffer which has a length which is either negative or larger or equal to 232, or when setting the array.length property to a value which is either negative or larger or equal to 232. message rangeerror: array length must be a finite positive integer (edge) rangeerror: invalid array length (firefox) rangeerror: invalid array length (chrome) rangeerror: invalid array buffer length (chrome) error type rangeerror what went wrong? an invalid array length might appear in these situations: when creating an array or an arraybuffer which has a length which is either negative or larger or equal to 232, or when setting the array.length property to a value which is either negative or larger or equal to 232. why...
...And 2 more matches
RangeError: invalid date - JavaScript
the javascript exception "invalid date" occurs when a string leading to an invalid date has been provided to date or date.parse(). message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong? ...
... the javascript exception "invalid date" occurs when a string leading to an invalid date has been provided to date or date.parse(). message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong? ...
...ccurs when a string leading to an invalid date has been provided to date or date.parse(). message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong? ...
...And 2 more matches
GlobalEventHandlers.oninvalid - Web APIs
the oninvalid property of the globaleventhandlers mixin is an eventhandler that processes invalid events. the invalid event fires when a submittable element has been checked and doesn't satisfy its constraints. the validity of submittable elements is checked before submitting their owner form, or after the checkvalidity() method of the element or its owner form is called. syntax target.oninvalid = functionref; var functionref = target.oninvalid; value functionref is a function name or a function expression. the function receives a event object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a form. html <form id="form"> <p id="error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="cit...
... <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. ...
...for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. ...
..." id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. thanks!</p> javascript const form = document.getelementbyid('form'); const error = document.getelementbyid('error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = invalid; form.onsubmit = submit; function invalid(event) { error.removeattribute('hidden'); } function submit(event) { form.setattribute('hidden', ''); thanks.removeattribute('hidden'); // for this example, don't actually submit the form event.preventdefault(); } result specification specification status comment html living standardthe definition of 'oninvalid' in that specification. living standard ...
HTMLInputElement: invalid event - Web APIs
the invalid event fires when a submittable element has been checked for validity and doesn't satisfy its constraints. bubbles no cancelable yes interface event event handler property globaleventhandlers.oninvalid this event can be useful for displaying a summary of the problems with a form on submission. when a form is submitted, invalid events are fired at each form control that is invalid. the validity of submittable elements is checked before submitting their owner <form>, or after the checkvalidity() method of the element or its owner <form> is called. it is not checked on blur. ...
...ul for displaying a summary of the problems with a form on submission. when a form is submitted, invalid events are fired at each form control that is invalid. the validity of submittable elements is checked before submitting their owner <form>, or after the checkvalidity() method of the element or its owner <form> is called. it is not checked on blur. examples if a form is submitted with an invalid value, the submittable elements are checked and, if an error is found, the invalid event will fire on the invalid element. 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 ty...
...ue 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. living standard html 5.1the definition of 'invalid event' in that specification. ...
...r('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. living standard html 5.1the definition of 'invalid event' in that specification. recommendation html5the definition of 'invalid event' in that specification. recommendation ...
HTMLObjectElement.willValidate - Web APIs
living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
... living standard initial definition. ...
MerchantValidationEvent.complete() - Web APIs
the merchantvalidationevent method complete() takes merchant-specific information previously received from the validationurl and uses it to validate the merchant. all you have to do is call complete() from your handler for the merchantvalidation event, passing in the data fetched from the validationurl. syntax merchantvalidationevent.complete(validationdata); merchantvalidationevent.complete(merchantsessionpromise); parameters validationdata or merchantsessionpromise an object containing the data needed to complete the merchant validation process, or a promise which resolves to the validation data. return value undefined. ...
...event.complete(validationdata); merchantvalidationevent.complete(merchantsessionpromise); parameters validationdata or merchantsessionpromise an object containing the data needed to complete the merchant validation process, or a promise which resolves to the validation data. return value undefined. exceptions this exception may be passed into the rejection handler for the promise: invalidstateerror the event did not come directly from the user agent, but was instead dispatched by other code. another payment request is currently being processed, the current payment request is not currently being displayed to the user, or payment information is currently being updated. ...
...ler for the promise: invalidstateerror the event did not come directly from the user agent, but was instead dispatched by other code. another payment request is currently being processed, the current payment request is not currently being displayed to the user, or payment information is currently being updated. example in this example, we see the client-side code needed to support merchant validation for a payment request called payrequest: payrequest.onmerchantvalidation = event => { const validationdatapromise = getvalidationdata(event.validationurl); event.complete(validationdatapromise); } function getvalidationdata(url) { /* ...retrieve the validation data from the url... */ } this code sets up a handler for the merchantvalidation event. the event handler calls a function,...
...n for a payment request called payrequest: payrequest.onmerchantvalidation = event => { const validationdatapromise = getvalidationdata(event.validationurl); event.complete(validationdatapromise); } function getvalidationdata(url) { /* ...retrieve the validation data from the url... */ } this code sets up a handler for the merchantvalidation event. the event handler calls a function, getvalidationdata(), which retrieves the data from the validation url, then passes that data (or a promise to deliver the data) into complete(). specifications specification status comment payment request apithe definition of 'merchantvalidationevent.complete()' in that specification. candidate recommendation initial definition. ...
PaymentValidationErrors - Web APIs
properties error optional a general description of a payment error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment information. ...
... properties error optional a general description of a payment error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment information. ...
...ment information. error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment form. payer optional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation. paymentmethod optional any payment method specific errors which may have occurred. this object's contents will vary depending on the payment used. for example, if the user chose to pay by credit card using the basic-card payment method, this is a basiccarderrors object. shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shippi...
...ptional any payment method specific errors which may have occurred. this object's contents will vary depending on the payment used. for example, if the user chose to pay by credit card using the basic-card payment method, this is a basiccarderrors object. shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shipping address that failed validation. example specifications specification status comment payment request api candidate recommendation initial definition. basic card payment working draft defines basiccarderrors ...
TypeError: invalid assignment to const "x" - JavaScript
const columns = 80; // ... ...
... const columns = 80; // ... ...
...ror: assignment to constant variable. (chrome) typeerror: assignment to const (edge) typeerror: redeclaration of const 'x' (ie) error type typeerror what went wrong? a constant is a value that cannot be altered by the program during normal execution. it cannot change through re-assignment, and it can't be redeclared. in javascript, constants are declared using the const keyword. examples invalid redeclaration assigning a value to the same constant name in the same block-scope will throw. const columns = 80; // ... columns = 120; // typeerror: invalid assignment to const `columns' fixing the error there are multiple options to fix this error. check what was intended to be achieved with the constant in question. rename if you meant to declare another constant, pick another name and...
...y the const declaration creates a read-only reference to a value. ...
TypeError: invalid arguments - JavaScript
the javascript exception "invalid arguments" occurs when typed array constructors are provided with a wrong argument. message typeerror: invalid arguments (firefox) error type typeerror what went wrong? ...
...invalid arguments" occurs when typed array constructors are provided with a wrong argument. message typeerror: invalid arguments (firefox) error type typeerror what went wrong? ...
..., another typed array, array-like objects, iterable objects or an arraybuffer object to create a new typed array. other constructor arguments will not create a valid typed array. examples no strings in typed arrays typed arrays, for example a uint8array, can't be constructed from a string. in fact, strings can't be in typed arrays at all. ...
... iterable objects or an arraybuffer object to create a new typed array. other constructor arguments will not create a valid typed array. examples no strings in typed arrays typed arrays, for example a uint8array, can't be constructed from a string. in fact, strings can't be in typed arrays at all. ...
NPN_InvalidateRect - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary invalidates the specified portion of the plugin's drawing area, adding it to the region that needs to be redrawn when the plugin next repaints its contents. syntax #include <npapi.h> void npn_invalidaterect(npp instance, nprect *invalidrect); parameters the function has the following parameters: instance pointer to the plug-in instance to invalidate a portion of. invalidrect the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in's content area. ...
... nprect *invalidrect); parameters the function has the following parameters: instance pointer to the plug-in instance to invalidate a portion of. invalidrect the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in's content area. description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). npn_invalidaterect() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in. after calling this method, the plug-in receives a paint message asynchronously. the browser redraws invalid areas of the document and any windowless plug-ins at regularly timed intervals. to immediately send a p...
...eevent() method to pass an update event or a paint message to the plug-in. after calling this method, the plug-in receives a paint message asynchronously. the browser redraws invalid areas of the document and any windowless plug-ins at regularly timed intervals. ...
NPN_InvalidateRegion - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary invalidates the specified drawing region prior to repainting or refreshing a windowless plug-in. syntax #include <npapi.h> void npn_invalidateregion(npp instance, npregion invalidregion); parameters the function has the following parameters: instance pointer to the current plug-in instance. invalidregion the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in. description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). ...
...as the following parameters: instance pointer to the current plug-in instance. invalidregion the area to invalidate, specified in a coordinate system that originates at the top left of the plug-in. description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). npn_invalidateregion() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in. if a plug-in calls this method, it receives a paint message later. the browser redraws invalid areas of the document and windowless plug-ins at regularly timed intervals. to force a paint message, the plug-in can call npn_forceredraw() after calling this method. see also npn_forceredraw() np...
...egion() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in. if a plug-in calls this method, it receives a paint message later. ...
Validator - MDN Web Docs Glossary: Definitions of Web-related terms
a validator is a program that checks for syntax errors in code. validators can be created for any format or language, but in our context we speak of tools that check html, css, and xml. ...
... a validator is a program that checks for syntax errors in code. validators can be created for any format or language, but in our context we speak of tools that check html, css, and xml. ...
... a validator is a program that checks for syntax errors in code. validators can be created for any format or language, but in our context we speak of tools that check html, css, and xml. ...
MerchantValidationEvent() - Web APIs
the merchantvalidationevent() constructor creates a new merchantvalidationevent object. you should not have to create these events yourself; instead, just handle the merchantvalidation event. syntax merchantvalidationevent = new merchantvalidationevent(type, options); parameters type a domstring which must be merchantvalidation, the only type of event which uses the merchantvalidationevent interface. options optional an optional dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used. this is an empty string by default. ...
... parameters type a domstring which must be merchantvalidation, the only type of event which uses the merchantvalidationevent interface. options optional an optional dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used. this is an empty string by default. validationurl optional the url from which to retrieve payment handler specific verification information used to validate the merchant. this is an empty string by default. return value a newly-created merchantvalidationevent providing the information that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string specif...
...l optional the url from which to retrieve payment handler specific verification information used to validate the merchant. this is an empty string by default. return value a newly-created merchantvalidationevent providing the information that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string specified as validationurl could not be parsed as a url. rangeerror the specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier. specifications specification status comment payment request apithe definition of 'merchantvalidationevent()' in that specification. candidate recommendation initial definition.
MerchantValidationEvent - Web APIs
the merchantvalidationevent interface of the the payment request api enables a merchant to verify themselves as allowed to use a particular payment handler. to learn more about merchant validation, see merchant validation in payment processing concepts. constructor merchantvalidationevent() secure context creates a new merchantvalidationevent object describing a merchantvalidation event that will be sent to the payment handler to request that it validate the merchant. properties merchantvalidationevent.methodname secure context a domstring providing a unique payment method identifier for the payment handler that's requiring validation. this may be either one of the standard payment method identifier strings or a url that both identifies and handles requests for the payment handle...
...t it validate the merchant. properties merchantvalidationevent.methodname secure context a domstring providing a unique payment method identifier for the payment handler that's requiring validation. this may be either one of the standard payment method identifier strings or a url that both identifies and handles requests for the payment handler, such as https://apple.com/apple-pay. merchantvalidationevent.validationurl secure context a usvstring specifying a url from which the site or app can fetch payment handler specific validation information. once this data is retrieved, the data (or a promise resolving to the validation data) should be passed into complete() to validate that the payment request is coming from an authorized merchant. ...
...om/apple-pay. merchantvalidationevent.validationurl secure context a usvstring specifying a url from which the site or app can fetch payment handler specific validation information. once this data is retrieved, the data (or a promise resolving to the validation data) should be passed into complete() to validate that the payment request is coming from an authorized merchant. methods merchantvalidationevent.complete() secure context pass the data retrieved from the url specified by validationurl into complete() to complete the validation process for the paymentrequest. specifications specification status comment payment request apithe definition of 'merchantvalidationevent' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.onidpvalidationerror - Web APIs
the rtcpeerconnection.onidpvalidationerror event handler is a property containing the code to execute whent the idpvalidationerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection. such an event is sent when the associated identity provider (idp) encounters an error while validating an identity assertion. this event handler is obsolete. you should instead detect idp validation errors by watching for the promise returned by rtcpeerconnection.peeridentity to be rejected. syntax peerconnection.onidpvalidationerror = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, ...
...cpeerconnection.peeridentity to be rejected. syntax peerconnection.onidpvalidationerror = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type rtcidentityerrorevent. ...
... syntax peerconnection.onidpvalidationerror = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type rtcidentityerrorevent. ...
ValidityState.stepMismatch - Web APIs
if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and the step value is not any, if the value don't doesn't conform to the constraints set by the step and min values, then stepmismatch will be true. if the remainder of the form control's value less the min value, divided by the step value (which defaults to 1 if ommitted) is not zero, there is a mismatch. ...
...onstraints set by the step and min values, then stepmismatch will be true. if the remainder of the form control's value less the min value, divided by the step value (which defaults to 1 if ommitted) is not zero, there is a mismatch. given the following: <input type="number" min="20" max="40" step="2"/> if (value - min) / 2 != 0, stepmismatch will be true. ...
...e step value (which defaults to 1 if ommitted) is not zero, there is a mismatch. given the following: <input type="number" min="20" max="40" step="2"/> if (value - min) / 2 != 0, stepmismatch will be true. if true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status comment html living standardthe definition of 'validitystate.stepmismatch' in that specification. living standard html 5.1the definition of 'validitystate.stepmismatch' in that specification. recommendation html5the definition of 'validitystate.stepmismatch' in that specification. recommendation ...
WebGL2RenderingContext.invalidateFramebuffer() - Web APIs
the webgl2renderingcontext.invalidateframebuffer() method of the webgl 2 api invalidates the contents of attachments in a framebuffer. syntax void gl.invalidateframebuffer(target, attachments); parameters target a glenum specifying the binding point (target). possible values: gl.framebuffer: collection buffer data storage of color, alpha, depth and stencil buffers used to render an image. gl.draw_framebuffer: equivalent to gl.framebuffer. gl.read_framebuffer: used as a source for reading operations. attachments an array of glenum specifying the attachment points to invalidate. possible values: gl.color_attachment{0-15}: invalidates one of the framebuffer's color buffers. gl.depth_attachment: invalidates the framebuffer's depth buffer. gl.stencil_attachmen...
...ge. gl.draw_framebuffer: equivalent to gl.framebuffer. gl.read_framebuffer: used as a source for reading operations. attachments an array of glenum specifying the attachment points to invalidate. possible values: gl.color_attachment{0-15}: invalidates one of the framebuffer's color buffers. gl.depth_attachment: invalidates the framebuffer's depth buffer. gl.stencil_attachment: invalidates the framebuffer's stencil buffer. gl.depth_stencil_attachment: invalidates both the framebuffer's depth and stencil buffer. return value none. ...
...hment points to invalidate. possible values: gl.color_attachment{0-15}: invalidates one of the framebuffer's color buffers. gl.depth_attachment: invalidates the framebuffer's depth buffer. gl.stencil_attachment: invalidates the framebuffer's stencil buffer. gl.depth_stencil_attachment: invalidates both the framebuffer's depth and stencil buffer. return value none. examples gl.invalidateframebuffer(gl.read_framebuffer, [gl.color_attachment0, gl.color_attachment1]); specifications specification status comment webgl 2.0the definition of 'invalidateframebuffer' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glinvalidateframebuffer' in that specification. stan...
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Methods’ - HTTP
reason reason: invalid token ‘xyz’ in cors header ‘access-control-allow-methods’ what went wrong? ...
... reason reason: invalid token ‘xyz’ in cors header ‘access-control-allow-methods’ what went wrong? ...
...client know what http request methods it supports for cors requests. the header's value is a comma-delineated string of http method names, such as get, post, or head. if any of the specified values are not recognized by the client user agent, this error occurs. this is a problem that most likely can only be fixed on the server side, by modifying the server's configuration to no longer send the invalid or unknown method name with the access-control-allow-methods header. it may also be worth checking to ensure that the user agent or http library you're using on the client is up-to-date. ...
WebAssembly.validate() - JavaScript
the webassembly.validate() function validates a given typed array of webassembly binary code, returning whether the bytes form a valid wasm module (true) or not (false). syntax webassembly.validate(buffersource); parameters buffersource a typed array or arraybuffer containing webassembly binary code to be validated. return value a boolean that specifies whether buffersource is valid wasm code (true) or not (false). exceptions if buffersource is not a typed array or arraybuffer, a typeerror is thrown. examples using validate the following example (see the validate.html source code, and see it live too) fetches a .wasm module and converts it into a typed array. the validate() method is then used to check whether the module is valid. fetch('simple.wasm').then(response => respons...
...source is not a typed array or arraybuffer, a typeerror is thrown. examples using validate the following example (see the validate.html source code, and see it live too) fetches a .wasm module and converts it into a typed array. the validate() method is then used to check whether the module is valid. fetch('simple.wasm').then(response => response.arraybuffer() ).then(function(bytes) { var valid = webassembly.validate(bytes); console.log("the given bytes are " + (valid ? "" : "not ") + "a valid wasm module"); }); specifications specification webassembly javascript interfacethe definition of 'validate()' in that specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
RTCPeerConnection: idpvalidationerror event - Web APIs
an idpvalidationerror event informs the target, a rtcpeerconnection object's onidpvalidationerror event handler, that the identity provider (idp) encountered an error while validating an identity assertion. an event handler for this event can be added using the rtcpeerconnection.onidpvalidationerror property. bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror warning: this event is no longer used; instead, you can detect a validation error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected. ...
... rtcidentityerrorevent event handler property onidpvalidationerror warning: this event is no longer used; instead, you can detect a validation error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'idpvalidationerror' in that specification. candidate recommendation ...
RTCPeerConnection: idpvalidationerror event - Web APIs
an idpvalidationerror event informs the target, a rtcpeerconnection object, that the identity provider (idp) encountered an error when trying to validate an identity assertion. an event handler for this event can be added via the rtcpeerconnection.onidpvalidationerror property. bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror important: this event is no longer used; it was removed from the specification long ago. instead, you should watch for the rtcpeerconnection.peeridentity promise to be rejected with an operationerror. ...
...vent handler property onidpvalidationerror important: this event is no longer used; it was removed from the specification long ago. instead, you should watch for the rtcpeerconnection.peeridentity promise to be rejected with an operationerror. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'idpvalidationerror' in that specification. candidate recommendation initial definition. ...
validityState.badInput - Web APIs
the read-only badinput 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. example <input type="number" id="age"> var input = document.getelementbyid("age"); if (input.validity.badinput) { console.log("bad input detected…"); } else { console.log("content of input ok."); } specifications specification status comment html living standardthe definition of 'validitystate.badinput' in that specification. ...
...ge"> var input = document.getelementbyid("age"); if (input.validity.badinput) { console.log("bad input detected…"); } else { console.log("content of input ok."); } specifications specification status comment html living standardthe definition of 'validitystate.badinput' in that specification. living standard live standard html 5.1the definition of 'validitystate.badinput' in that specification. recommendation no change from the previous snapshot html5. html5the definition of 'validitystate.badinput' in that specification. recommendation first snapshot of html living standard containing this interface. ...
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. if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and a max value is set, if the value don't doesn't conform to the constraints set by the max value, the rangeoverflow property will be true. given the following: <input type="number" min="20" max="40" step="2"/> if value > 40, rangeoverflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. ...
...t conform to the constraints set by the max value, the rangeoverflow property will be true. given the following: <input type="number" min="20" max="40" step="2"/> if value > 40, rangeoverflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status comment html living standardthe definition of 'validitystate.rangeoverflow' in that specification. living standard html 5.1the definition of 'validitystate.rangeoverflow' in that specification. recommendation html5the definition of 'validitystate.rangeoverflow' in that specification. recommendation ...
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. if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and a min value is set, if the value don't doesn't conform to the constraints set by the min value, the rangeunderflow property will be true. given the following: <input type="number" min="20" max="40" step="2"/> if value < 20, rangeunderflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. ...
...conform to the constraints set by the min value, the rangeunderflow property will be true. given the following: <input type="number" min="20" max="40" step="2"/> if value < 20, rangeunderflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status comment html living standardthe definition of 'validitystate.rangeunderflow' in that specification. living standard html 5.1the definition of 'validitystate.rangeunderflow' in that specification. recommendation html5the definition of 'validitystate.rangeunderflow' in that specification. recommendation ...
WebGLRenderingContext.validateProgram() - Web APIs
the webglrenderingcontext.validateprogram() method of the webgl api validates a webglprogram. it checks if it is successfully linked and if it can be used in the current webgl state. syntax void gl.validateprogram(program); parameters program a webglprogram to validate. return value none. examples var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.validateprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } gl.useprogram(program); specifications specification status comment webgl 1.0the definition of 'val...
...getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } gl.useprogram(program); specifications specification status comment webgl 1.0the definition of 'validateprogram' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glvalidateprogram' in that specification. standard man page of the opengl api. ...
XPathResult.invalidIteratorState - Web APIs
the read-only invaliditeratorstate property of the xpathresult interface signifies that the iterator has become invalid. it is true if xpathresult.resulttype is unordered_node_iterator_type or ordered_node_iterator_type and the document has been modified since this result was returned. note: this feature is available in web workers. syntax var iteratorstate = result.invaliditeratorstate; return value a boolean value indicating whether the iterator has become invalid. example the following example shows the use of the invaliditeratorstate property. ...
...tate = result.invaliditeratorstate; return value a boolean value indicating whether the iterator has become invalid. example the following example shows the use of the invaliditeratorstate property. html <div>xpath example</div> <p>iterator state: <output></output></p> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); // invalidates the iterator state document.queryselector("div").remove(); document.queryselector("output").textcontent = result.invaliditeratorstate ? "invalid" : "valid"; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.invaliditeratorstate' in that specification. recommendation initi...
:-moz-ui-valid - CSS: Cascading Style Sheets
the :-moz-ui-valid css pseudo-class represents any validated form element whose value validates correctly based on its validation constraints. this pseudo-class is applied according to the following rules: if the control does not have focus, and the value is valid, apply this pseudo-class. if the control has focus, and the value was valid (including empty) when it gained focus, apply this pseudo-class. if the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke. if the element is required, the preceding rules apply only if the user has changed the value or attempted to submit the form. ...
...do-class. if the control has focus, and the value was valid (including empty) when it gained focus, apply this pseudo-class. if the control has focus, and the value was invalid when it gained focus, re-validate on every keystroke. if the element is required, the preceding rules apply only if the user has changed the value or attempted to submit the form. the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control. however, if the user is trying to correct a previously-flagged value, the control shows immediately when the value becomes valid. required items are flagged as invalid only if the user changes them or attempts to submit an unchanged invalid value. syntax syntax not foun...
RangeError: argument is not a valid code point - JavaScript
the javascript exception "invalid code point" occurs when nan values, negative integers (-1), non-integers (5.4), or values larger than 0x10ffff (1114111) are used with string.fromcodepoint(). message rangeerror: {0} is not a valid code point (firefox) rangeerror: invalid code point {0} (chromium) error type rangeerror what went wrong? string.fromcodepoint() throws this error when passed nan values, negative integers (-1), non-integers (5.4), or values larger than 0x10ffff (1114111). a code point is a value in the unicode codespace; that is, the range of integers from 0 to 0x10ffff. examples invalid cases string.fromcodepoint('_'); // rangeerror string.fromcodepoint(infinity); // rangeerror string.fromcodepoint(-1); // rangeerror string.fromcodepoint(3.14); // rangeer...
...de point is a value in the unicode codespace; that is, the range of integers from 0 to 0x10ffff. ...
TypeError: invalid 'instanceof' operand 'x' - JavaScript
the javascript exception "invalid 'instanceof' operand" occurs when the right hand side operands of the instanceof operator isn't used with a constructor object, i.e. an object which has a prototype property and is callable. message typeerror: invalid 'instanceof' operand "x" (firefox) typeerror: "x" is not a function (firefox) typeerror: right-hand side of 'instanceof' is not an object (chrome) typeerror: right-hand side of 'instanceof' is not callable (chrome) error type typeerror what went wrong? the instanceof operator expects the right hand side operands to be a constructor object, i.e. an object which has a prototype property and is callable. examples instanceof vs typeof "test" instanceof ""; // typeerror: invalid 'instanceof' operand "" 42 instanceof 0; // typeerror: inva...
... to be a constructor object, i.e. an object which has a prototype property and is callable. examples instanceof vs typeof "test" instanceof ""; // typeerror: invalid 'instanceof' operand "" 42 instanceof 0; // typeerror: invalid 'instanceof' operand 0 function foo() {} var f = foo(); // foo() is called and returns undefined var x = new foo(); x instanceof f; // typeerror: invalid 'instanceof' operand f x instanceof x; // typeerror: x is not a function to fix these errors, you will either need to replace the instanceof operator with the typeof operator, or to make sure you use the function name, instead of the result of its evaluation. typeof "test" == "string"; // true typeof 42 == "number" // true function foo() {} var f = foo; // do not call...
validate - Archive of obsolete content
this would be useful if the images are stored remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the image will be loaded from the cache if possible. ...
HTMLFormElement.reportValidity() - Web APIs
the htmlformelement.reportvalidity() method returns true if the element's child controls satisfy their validation constraints. when false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user. syntax htmlformelement.reportvalidity() return value boolean example document.forms['myform'].addeventlistener('submit', function() { document.forms['myform'].reportvalidity(); }, false); specifications specification status comment html living standardthe definition of 'htmlformelement.reportvalidity()' in that specification. living standard html 5.1the definition of 'htmlformelement.reportvalidity()' in that specification. recommendation initial definition ...
HTMLObjectElement.checkValidity - Web APIs
the checkvalidity() method of the htmlobjectelement interface returns a boolean that always is true, because object objects are never candidates for constraint validation. syntax const valid = htmlobjectelement.checkvalidity(); parameters none. return value true exceptions none. specifications specification status comment html living standardthe definition of 'checkvalidity' in that specification. living standard initial definition. ...
HTMLSelectElement.checkValidity() - Web APIs
the htmlselectelement.checkvalidity() method checks whether the element has any constraints and whether it satisfies them. if the element fails its constraints, the browser fires a cancelable invalid event at the element, and then returns false. syntax var result = selectelt.checkvalidity(); specifications specification status comment html living standardthe definition of 'htmlselectelement.checkvalidity()' in that specification. living standard no change since the latest snapshot, html5. html5the definition of 'htmlselectelement.checkvalidity()' in that specification. recommendation initial definition, snapshot of html living standard ...
HTMLSelectElement.setCustomValidity() - Web APIs
the htmlselectelement.setcustomvalidity() method sets the custom validity message for the selection element to the specified message. use the empty string to indicate that the element does not have a custom validity error. syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the error message. specifications specification status comment html living standardthe definition of 'htmlselectelement.setcustomvalidity()' in that specification. living standard no change since the latest snapshot, html5. html5the definition of 'htmlselectelement.setcustomvalidity()' in that specification. recommendation initial definition, snapshot of html living standard ...
MerchantValidationEvent.methodName - Web APIs
the merchantvalidationevent property methodname is a read-only value which returns a string indicating the payment method identifier which represents the payment handler that requires merchant validation. syntax methodid = merchantvalidationevent.methodname; value a read-only domstring which uniquely identifies the payment handler which is requesting merchant validation. see merchant validation in payment processing concepts for more information on the process. specifications specification status comment payment request apithe definition of 'merchantvalidationevent.methodname' in that specification. candidate recommendation initial definition. ...
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. specifications specification status comment html living standardthe definition of 'validitystate.toolong' in that specification. living standard html 5.1the definition of 'validitystate.toolong' in that specification. recommendation html5the definition of 'validitystate.toolong' in that specification. recommendation ...
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. specifications specification status comment html living standardthe definition of 'validitystate.tooshort' in that specification. living standard html 5.1the definition of 'validitystate.tooshort' in that specification. recommendation html5the definition of 'validitystate.tooshort' in that specification. recommendation ...
:-moz-submit-invalid - CSS: Cascading Style Sheets
the :-moz-submit-invalid css pseudo-class is a mozilla extension that represents any submit <button> on forms whose contents aren't valid based on their validation constraints. by default, no style is applied. you can use this pseudo-class to customize the appearance of the submit button when there are invalid form fields. syntax syntax not found in db! specifications not part of any standard. ...
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’ - HTTP
reason reason: invalid token ‘xyz’ in cors header ‘access-control-allow-headers’ what went wrong? the response to the cors request that was sent by the server includes an access-control-allow-headers header which includes at least one invalid header name. the access-control-allow-headers header is sent by the server in response to a preflight request; it lets the client know which http headers are permitted in cors requests. if the client user agent finds among the comma-delineated values provided by the header any header name it does not recognize, this error occurs. this is a problem that most likely can only be fixed on the server side, by modifying the server's configuration to no longer send the invalid or unknown header name with the access-control-allow-headers header. it m...
TypeError: invalid Array.prototype.sort argument - JavaScript
the javascript exception "invalid array.prototype.sort argument" occurs when the argument of array.prototype.sort() isn't either undefined or a function which compares its operands. message typeerror: argument is not a function object (edge) typeerror: invalid array.prototype.sort argument (firefox) error type typeerror what went wrong? the argument of array.prototype.sort() is expected to be either undefined or a function which compares its operands. examples invalid cases [1, 3, 2].sort(5); // typeerror var cmp = { asc: (x, y) => x >= y, dsc: (x, y) => x <= y }; [1, 3, 2].sort(cmp[this.key] || 'asc'); // typeerror valid cases [1, 3, 2].sort(); // [1, 2, 3] var cmp = { asc: (x, y) => x >= y, dsc: (x, y) => x <= y }; [1, 3, 2].sort(cmp[this.key || 'asc']); // [1, 2, 3] ...
ReferenceError: invalid assignment left-hand side - JavaScript
the javascript exception "invalid assignment left-hand side" occurs when there was an unexpected assignment somewhere. for example, a single "=" sign was used instead of "==" or "===". message referenceerror: invalid assignment left-hand side error type referenceerror. what went wrong? there was an unexpected assignment somewhere. this might be due to a mismatch of a assignment operator and a comparison operator, for example. while a single "=" sign assigns a value to a variable, the "==" or "===" operators compare a value. examples typical invalid assignments if (math.pi = 3 || math.pi = 4) { console.log('no way!'); } // referenceerror: invalid assignment left-hand side var str = 'hello, ' += 'is it me ' += 'you\'re looking for?'; // referenceerror: invalid assignment left-hand s...
Index - Web APIs
Web › API › Index
rty of the accelerometer interface returns a double precision integer containing the acceleration of the device along the its z axis. ...
...ce, payment address, payment request, payment request api, reference, payment, paymentaddress the addresserrors dictionary is used by the payment request api to to report validation errors in a physical address (typically a billing address or a shipping address). 30 addresserrors.addressline api, addresserrors, error, payment request, payment request api, property, reference, validation, addressline, payment an object based on addresserrors includes an addressline property when validation of the address finds one or more errors in the array of strings in the address's addressline. the returned string explains the error and should offer suggestions for how to correct it. 31 addresserrors.city api, address, addresserrors, error, payment request, payment r...
...ess finds one or more errors in the array of strings in the address's addressline. the returned string explains the error and should offer suggestions for how to correct it. ...
...And 103 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
input type="date" name="date"/> html5 datetime-local a control for entering a date and time, with no time zone. opens a date picker or numeric wheels for date- and time-components when active in supporting browsers. <input type="datetime-local" name="datetime-local"/> html5 email a field for editing an email address. looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards. <input type="email" name="email"/> html5 file a control that lets the user select a file. use the accept attribute to define the types of files that the control can select. <input type="file" accept="image/*, text/*" name="file"/> hidden a control...
...splays an image defined by the src attribute. the alt attribute displays if the image src is missing. <input type="image" name="image" src="" alt="image input"/> month a control for entering a month and year, with no time zone. <input type="month" name="month"/> html5 number a control for entering a number. displays a spinner and adds default validation when supported. displays a numeric keypad in some devices with dynamic keypads. <input type="number" name="number"/> html5 password a single-line text field whose value is obscured. will alert user if site is not secure. <input type="password" name="password"/> radio a radio button, allowing a single value to be selected out of multipl...
...ame="tel"/> html5 text the default value. a single-line text field. line-breaks are automatically removed from the input value. <input type="text" name="text"/> time a control for entering a time value with no time zone. <input type="time" name="time"/> html5 url a field for entering a url. looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and devices with dynamic keyboards. <input type="url" name="url"/> html5 week a control for entering a date consisting of a week-year number and a week number with no time zone. <input type="week" name="week"/> html5 obsolete values datetime a control for entering a date...
...And 77 more matches
Index
bi module and the user hasn't made any overriding trust decisions, or it can be found in a nss database file managed by the user or by the local environment). after having successfully verified the signatures in a (chain of) issuer certificate(s), we're still not done with verifying the certificate a. in a pki it's suggested/required to perform additional checks. ...
... nss has multiple apis to perform verification of certificates. there is a classic engine that is very stable and wor...
...sks the issuer(s) of the certificates whether there have been events that made it necessary to revoke the trust (revoke the validity of the cert). trust anchors contained in the ckbi module are usually self signed, which is defined as having identical subject name and issuer name fields. if a self-signed certificate is marked as explicitly trusted, nss will skip checking the self-signature for validity. nss has multiple apis to perform verification of certificates. there is a classic engine that is very stable and works fine in all simple scenarios, for example if all (b) candidate issuer certificates have the same subject and issuer names and differ by validity period; however, it works only in a limited amount of more advanced scenarios. unfortunately, the world of certificates has beco...
...And 32 more matches
<input type="email"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › email
e 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 source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid e-mail address or not. on browsers that don't support inputs of type email, a email input falls back to being a ...
... a single properly-formed e-mail address. this doesn't necessarily mean the e-mail address exists, but it is at least formatted correctly. in simple terms, this means username@...
... autocomplete, list, maxlength, minlength, multiple, name,pattern, placeholder, readonly, required, size, and type idl attributes list and value methods select() value the <input> element's value attribute contains a domstring which is automatically validated as conforming to e-mail syntax. more specifically, there are three possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. ...
...And 30 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
"%-30s - certificate signing request \n\n", "-r <csr>"); fprintf(stderr, "%-30s - generate a self-signed cert [optional]\n\n", "-x"); fprintf(stderr, "%-30s - to enable ascii [optional]\n\n", "-a"); fprintf(stderr, "%-30s - to save certificate to header file as sig verification [optional]\n\n", "-v"); exit(-1); } /* * validate the options used for generate csr command */ static void validategeneratecsrcommand(const char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fpri...
... const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name: \"%s\"\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"...
...certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */ static void validateaddcerttodbcommand(const char *progname, const char *dbdir, const char *nicknamestr, const char *truststr, const char *certfilename, const char *certreqfilename, ...
...And 27 more matches
<input type="number"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › number
the browser may opt to provide stepper arrows to let the user increase and decrease the value using their mouse or by simply tapping with a fingertip. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. on browsers that don't support inputs of type number, a number input falls back to type text. value any floating-point number, or empty. ...
...the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefi...
... suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. max the maximum value to accept for this input. ...
...And 27 more matches
<input type="url"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › url
<input> elements of type url are used to let the user enter and edit a url. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the input value is automatically validated to ensure that it's either empty or a properly-formatted url before the form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid url or not. on browsers that don't support inputs of type url, a url input falls back to being a standard text input. value a domstring representing a url, or empty events change and ...
... events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute contains a domstring which is automatically validated as conforming to url syntax. more specifically, there are two possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-formed absolute url. this doesn't necessarily mean the url address exists, but it is at least formatted correctly. in simple terms, this means urlscheme://restofu...
...nforming to url syntax. more specifically, there are two possible value formats that will pass validation: an empty string ("") indicating that the user did not enter a value or that the value was removed. a single properly-formed absolute url. this doesn't necessarily mean the url address exists, but it is at least formatted correctly. in simple terms, this means urlscheme://restofurl. see validation for details on how urls are validated to ensure that they're formatted properly. additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, url inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options ...
...And 25 more matches
sslerr.html
on encountered a certificate that was not one of the well known certificate types handled by the certificate library. ssl_error_unsupported_version -12279 "peer using unsupported version of security protocol." on a client socket, this means the remote server has attempted to negotiate the use of a version of ssl that is not supported by the nss library, probably an invalid version number. on a server socket, this means the remote client has requested the use of a version of ssl older than version 2. -12278 (unused) ssl_error_wrong_certificate -12277 "client authentication failed: private key in key database does not correspond to public key in certificate database." ssl_error_bad_cert_domain -12276 "unable to commun...
...this probably indicates a flaw in the remote peer's implementation. ssl_error_rx_malformed_hello_request -12261 "ssl received a malformed hello request handshake message." ssl_error_...
...ryption_failed_alert -12197 "peer was unable to decrypt an ssl record it received." ssl_error_record_overflow_alert -12196 "peer received an ssl record that was longer than is permitted." ssl_error_unknown_ca_alert -12195 "peer does not recognize and trust the ca that issued your certificate." ssl_error_access_denied_alert -12194 "peer received a valid certificate, but access was denied." ssl_error_decode_error_alert -12193 "peer could not decode an ssl handshake message." ssl_error_decrypt_error_alert -12192 "peer reports failure of signature verification or key exchange." ssl_error_export_restriction_alert -12191 "peer reports negotiation not in compliance with export regulations." ssl_err...
...And 23 more matches
<input type="tel"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › tel
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...les and send us a pull request. 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. using a specific input type for telephone numbers also makes adding custom validation and handling of phone numbers more convenient. note: browsers that don't support type tel fall back to being a standard text input. value a domstring representing a telephone number, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, and size idl attributes ...
...ditional attributes in addition to the attributes that operate on all <input> elements regardless of their type, telephone number inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum length, in utf-16 characters, to accept as a valid input minlength the minimum length that is considered valid for the field's contents pattern a regular expression the entered value must match to pass constraint validation placeholder an example value to display inside the field when it has no value readonly a boolean attribute which, if present, indicates that the field's contents should not be us...
...And 22 more matches
UI pseudo-classes - Learn web development
ar to you now. more recently, the css selector level 3 and css basic ui level 3 added more pseudo-classes related to html forms that provide several other useful targetting conditions that you can take advantage of. we'll discuss these in more detail in the sections below, but briefly, the main ones we'll be looking at are: :required and :optional: targets required or optional form controls. :valid and :invalid, and :in-range and :out-of-range: target form controls that are valid/invalid according to form validation constraints set on them, or in-range/out-of-range. :enabled and :disabled, and :read-only and :read-write: target enabled or disabled form controls (e.g. with the disabled html attribute set), and read-write or read-only form controls (e.g. with the readonly html attribute set)...
... the others are aimed at solving very specific niche problems, or simply not very well supported in browsers yet. the ones listed above all have pretty good browser support, but of course, you should test your form implementations carefully to make sure they work for your target audience. note: a number of the pseudo-classes discussed here are concerned with styling form controls based on their validation state (is their data valid, or not?) you'll learn much more about setting and controlling validation constraints in our next article — client-side form validation — but for now we'll keep things simple with regards to form validation, so it doesn't confuse things. styling inputs based on whether they are required or not one of the most basic concepts with regards to client-side form v...
...g the :required and :optional pseudo-classes. for example, if we apply the following css to the above html: input:required { border: 1px solid black; } input:optional { border: 1px solid silver; } the required controls would have a black border, and the optional control will have a silver border, like so: you can also try submitting the form without filling it in, to see the client-side validation error messages browsers give you by default. the above form isn't bad, but it isn't great either. for a start, we are signalling required versus optional status using color alone, which isn't great for colorblind people. second, the standard convention on the web for required status is an asterisk (*), or the word "required" being associated with the controls in question. in the next secti...
...And 21 more matches
sample2
30s - certificate issuer nickname\n\n", "-u <issuernickname>"); fprintf(stderr, "%-30s - certificate signing request \n\n", "-r <csr>"); fprintf(stderr, "%-30s - generate a self-signed cert [optional]\n\n", "-x"); fprintf(stderr, "%-30s - to enable ascii [optional]\n\n", "-a"); fprintf(stderr, "%-30s - to save certificate to header file as sig verification [optional]\n\n", "-v"); exit(-1); } /* * validate the options used for generate csr command */ static void validategeneratecsrcommand(const char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name: \"%s\"\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (!cer...
...me *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name: \"%s\"\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */ static void validateaddcerttodbcommand(const char *progname, const char *dbdir, const char *nicknamestr, const char *truststr, const char *certfilename, const char *certreqfilename...
...n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */ static void validateaddcerttodbcommand(const char *progname, const char *dbdir, const char *nicknamestr, const char *truststr, const char *certfilename, const char *certreqfilename, const char *issuernamestr, const char *serialnumberstr, prbool selfsign) { prbool validationfailed = pr_false; if (!nicknamestr) { pr_fprintf(pr_stderr, "%s -a -d %s -n : nick name is missing\n", progname, dbdir); validationfailed = pr_true; } if (!truststr) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t: trust flag is missing\n", progname, dbdir, nicknamestr); validationfailed = pr_true; } if (!certfilename) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t %s -c: certificate file name ...
...And 21 more matches
NSS Tools certutil
lize one by default. -d delete a certificate from the certificate database. -l list all the certificates, or display information about a named certificate, in a certificate database. use the -htokenname argument to specify the certificate database on a particular hardware or software token. -v check the validity of a certificate and its attributes. -m modify a certificate's trust attributes using the values of the -t argument. -h display a list of the options and arguments used by the certificate database tool. -w change the password to a key database. -u list all available modules o...
...he password to a key database. -u list all available modules or print a single named module. arguments -a use ascii format or allow the use of ascii format for input or output. this formatting follows rfc 1113. for certificate requests, ascii output defaults to standard output unless redirected. -b validity-time specify a time at which a certificate is required to be valid. use when checking certificate validity with the -v option. the format of thevalidity-time argument is "yymmddhhmmss[+hhmm|-hhmm|z]". specifying seconds (ss) is optional. when specifying an explicit time, use "yymmddhhmmssz". when specifying an offset time, use "yymmddhhmmss+hhmm" or "yymmddhhmmss-hhmm". if this opt...
... -c issuer identify the certificate of the ca from which a new certificate will derive its authenticity. use the exact nickname or alias of the ca certificate, or use the ca's email address. bracket theissuer string with quotation marks if it contains spaces. ...
...And 21 more matches
NSS tools : certutil
s to standard out unless you use -o output-file argument. use the -a argument to specify ascii output. -s create an individual certificate and add it to a certificate database. -t reset the key database or token. -u list all available modules or print a single named module. -v check the validity of a certificate and its attributes. -w change the password to a key database. --merge merge two databases into one. --upgrade-merge upgrade an old database and merge it into a new database. this is used to migrate legacy nss databases (cert8.db and key3.db) into the newer sqlite databases (cert9.db and key4.db...
...abases (cert9.db and key4.db). arguments arguments modify a command option and are usually lower case, numbers, or symbols. -a use ascii format or allow the use of ascii format for input or output. this formatting follows rfc 1113. for certificate requests, ascii output defaults to standard output unless redirected. -b validity-time specify a time at which a certificate is required to be valid. use when checking certificate validity with the -v option. the format of the validity-time argument is yymmddhhmmss[+hhmm|-hhmm|z], which allows offsets to be set relative to the validity end time. specifying seconds (ss) is optional. when specifying an explicit...
... -c issuer identify the certificate of the ca from which a new certificate will derive its authenticity. use the exact nickname or alias of the ca certificate, or use the ca's email address. ...
...And 18 more matches
IAccessibleText
eoffset([in] long offset, [in] enum ia2textboundarytype boundarytype, [out] long startoffset, [out] long endoffset, [out] bstr text ); methods addselection() adds a text() selection(). hresult addselection( [in] long startoffset, [in] long endoffset ); parameters startoffset starting offset ( 0 based). endoffset offset of first character after new selection() (0 based). return value e_invalidarg if bad [in] passed. s_ok. attributes() returns text() attributes. [propget] hresult attributes( [in] long offset, [out] long startoffset, [out] long endoffset, [out] bstr textattributes ); parameters offset text() offset (0 based) startoffset the starting offset of the character range over which all text() attributes match those of offset. (0 based) endoffset the offset of the first ...
...of the character range over which all text() attributes match those of offset. (0 based) endoffset the offset of the first character past the character range over which all text() attributes match those of offset. (0 based) textattributes a string of attributes describing the text(). the attributes are described in the; text attributes specification on the iaccessible2 web site. return value e_invalidarg if bad [in] passed, [out] values are 0s and null respectively. s_false if there is nothing to return, [out] values are 0s and null respectively. s_ok. caretoffset() returns the position of the caret. returns the 0-based offset of the caret within the text(). if the text() is implemented as a tree of text() objects with embed characters in higher levels representing substrings of child text() o...
...racters in the text() or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate. [propget] hresult characterextents( [in] long offset, [in] enum ia2coordinatetype coordtype, [out] long x, [out] long y, [out] long width, [out] long height ); parameters offset index of the character for which to return its bounding box. the valid range is 0..length. coordtype specifies if the coordinates are relative to the screen or to the parent window. x x coordinate of the top left corner of the bounding box of the referenced character. y y coordinate of the top left corner of the bounding box of the referenced character. width width of the bounding box of the referenced character. height height of the bounding box of the referenced c...
...And 18 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
the moment support is patchy, with only chrome/opera and edge on desktop and most modern versions of mobile browsers having usable implementations. in other browsers, these degrade gracefully to simple <input type="text"> controls. the control is intended to simply represent a local date and time, not necessarily the user's local date and time. in other words, an implementation should allow any valid combination of year, month, day, hour, and minute - even if such a combination is invalid in the user's local time zone (such as times within a daylight saving time spring-forward transition gap). some mobile browsers (particularly on ios) do not currently implement this correctly. because of the limited browser support for datetime-local, and the variations in how the inputs work, it may curren...
...ly. 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. another option is to use separate date and time inputs, each of which is more widely supported than datetime-local. some browsers may resort to a text-only input element that validates that the results are legitimate date/time values before letting them be delivered to the server, as well, but you shouldn't rely on this behavior since you can't easily predict it. for those of you not using a supporting browser, the chrome/opera datetime-local control looks like the below screenshot. clicking the down arrow on the right hand side brings up a date picker to allow you to choo...
... this value must specify a date string later than or equal to the one specified by the min attribute...
...And 18 more matches
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
plete, list, maxlength, minlength, pattern, placeholder, required, size. idl attributes value methods select(), setrangetext(), setselectionrange(). value the value attribute contains a domstring representing the value contained in the search field. you can retrieve this using the htmlinputelement.value property in javascript. searchterms = mysearch.value; if no validation constraints are in place for the input (see validation for more details), the value can be any text string or an empty string (""). additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, search field inputs support the following attributes: attribute description list the id of the <datalist> element th...
...s of their type, search field inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be sp...
...that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the search field. this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the search field has no maximum length. this value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the search field. this must be a...
...And 18 more matches
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
time, or empty. events change and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup(). value a domstring containing the value of the time entered into the input. ...
...tes in addition to the attributes common to all <input> elements, time inputs offer the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest time to accept, in the syntax described under time value format min the earliest time to accept as a valid input readonly a boolean attribute which, if present, indicates that the contents of the time input should not be user-editable step the stepping interval to use both for user interfaces purposes and during constraint validation unlike many data types, time values have a periodic domain, meaning that the values reach the highest possible value, then wrap back around...
...e user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. max a string indicating the latest time to accept, specified in the same time value format as described above. if the specified string isn't a valid time, no maximum value is set. min a string specifying the earliest time to accept, given in the time value format described previously. if the value specified isn't a valid time string, no minimum value is set. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinp...
...And 18 more matches
HTTP Index - HTTP
Web › HTTP › Index
shooting cross-origin resource sharing (cors) is a standard that allows a server to relax the same-origin policy. this is used to explicitly allow some cross-origin requests while rejecting others. 22 reason: cors disabled authentication, authentication article, cors, cross-origin, disabled, errors, http, https, messages, resource, same origin, same-origin, security, sharing, validation, secure, troubleshooting a request that needs to use cors was attempted, but cors is disabled in the user's browser. when this happens, the user needs to turn cors back on in their browser. 23 reason: cors header 'access-control-allow-origin' does not match 'xyz' cors, corsalloworiginnotmatchingorigin, cross-origin, error, http, https, messages, reasons, security, consol...
... ‘true’ in cors header ‘access-control-allow-credentials’ cors, corsmissingallowcredentials, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting the cors request requires that the server permit the use of credentials, but the server's access-control-allow-credentials header's value isn't set to true to enable their use. ...
...llowcredentials, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting the cors request requires that the server permit the use of credentials, but the server's access-control-allow-credentials header's value isn't set to true to enable their use. ...
...And 18 more matches
<input type="text"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › text
th, minlength, pattern, placeholder, readonly, required and size idl attributes list, value methods select(), setrangetext() and setselectionrange(). value the value attribute is a domstring that contains the current value of the text entered into the text field. you can retrieve this using the value property in javascript. let thetext = mytextinput.value; if no validation constraints are in place for the input (see validation for more details), the value may be an empty string (""). additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, text inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pr...
...egardless of their type, text inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be sp...
...t that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the text input. this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the text input has no maximum length. this value must also be greater than or equal to the value of minlength. 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. constraint validation is only applied when the value is changed by the user. minlength the minimum number of characters (as utf-...
...And 17 more matches
Error codes returned by Mozilla APIs
error_unexpected (0x8000ffff) an operation did not complete due to a condition which was not expected. this error occurred rather than continuing. ns_error_out_of_memory (0x8007000e) this error occurs when there is not enough memory available to carry out an operation, or an error occurred trying to allocate memory. ns_error_illegal_value (0x80070057) an argument supplied to a method was not valid, for instance a null value was supplied as an argument which does not allow null values, or a value was out of range. ns_error_no_aggregation (0x80040110) ns_error_not_available (0x80040111) an operation could not be completed because some other necessary component or resource was not available. ns_error_factory_not_registered (0x80040154) returned when a service could not be found. ns_e...
...ror_factory_not_registered (0x80040154) returned when a service could not be found. ns_error_factory_register_again (0x80040155) this error is returned when registering a component and the registration should try registering again later. ns_error_factory_not_loaded (0x800401f8) ns_error_factory_exists (0xc1f30100) ns_error_factory_no_signature_support (0xc1f30101) ns_error_proxy_invalid_in_parameter (0x80010010) ns_error_proxy_invalid_out_parameter (0x80010011) ns_error_cannot_convert_data (0x80460001) ns_error_object_is_immutable (0x80460002) ns_error_loss_of_significant_data (0x80460003) ns_error_illegal_during_shutdown (0x8046001e) many operations cannot be performed once the application is being shutdown. this error will occur in this situation. file e...
...ed once the application is being shutdown. this error will occur in this situation. file errors the following table lists the errors that could occur when using files. while these errors can occur when using the file apis, they can also occur with other components that use files. ns_error_file_unrecognized_path (0x80520001) this error occurs when an attempt is made to set a path that isn't valid for the platform. for example, if a character in the path is not valid for a filename. in addition, this error may occur when a relative path is supplied to a method that expects an absolute path and vice versa. ns_error_file_unresolvable_symlink (0x80520002) an attempt was made to access a symbolic link to a file or directory which does not exist. ns_error_file_execution_failed (0x80520003) ...
...And 16 more matches
certutil
ertificate. output defaults to standard out unless you use -o output-file argument. use the -a argument to specify ascii output. -s create an individual certificate and add it to a certificate database. -t reset the key database or token. -u list all available modules or print a single named module. -v check the validity of a certificate and its attributes. -w change the password to a key database. --merge merge a source database into the target database. this is used to merge legacy nss databases (cert8.db and key3.db) into the newer sqlite databases (cert9.db and key4.db). --upgrade-merge upgrade an old database and merge it into a new dat...
...nd key3.db) into the newer sqlite databases (cert9.db and key4.db). arguments option arguments modify an action and are lowercase. -a use ascii format or allow the use of ascii format for input or output. this formatting follows rfc 1113. for certificate requests, ascii output defaults to standard output unless redirected. -b validity-time specify a time at which a certificate is required to be valid. use when checking certificate validity with the -v option. the format of the validity-time argument is yymmddhhmmss[+hhmm|-hhmm|z], which allows offsets to be set relative to the validity end time. specifying seconds (ss) is optional. when specifying an explicit ...
... -c issuer identify the certificate of the ca from which a new certificate will derive its authenticity. use the exact nickname or alias of the ca certificate, or use the ca's email address. ...
...And 16 more matches
AddressErrors - Web APIs
the addresserrors dictionary is used by the payment request api to to report validation errors in a physical address (typically a billing address or a shipping address). any members which is present indicates that a validation error occurred for the member of the same name in an address described using paymentaddress. addresserrors is the type of the object returned by shippingaddresserrors in the paymentdetailsupdate passed into paymentrequestupdateevent.updatewith() by the shippingaddresschange event handler if a change to the address resulted in a validation error occurring. see the examples below to see how this works. properties addressline a domstring which, if present, indicates that the addressline property of the paymentaddress could not be validated. the contents of the string...
...updateevent.updatewith() by the shippingaddresschange event handler if a change to the address resulted in a validation error occurring. see the examples below to see how this works. properties addressline a domstring which, if present, indicates that the addressline property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. city a domstring which, if present, indicates that the city property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. country a domstring which, if present, indicates that the country property of t...
...estions to correct the problem. city a domstring which, if present, indicates that the city property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. country a domstring which, if present, indicates that the country property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. ...
...And 16 more matches
<input type="month"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › month
tive-examples and send us a pull request. the control's ui varies in general from browser to browser; at the moment support is patchy, with only chrome/opera and edge on desktop — and most modern mobile browser versions — having usable implementations. 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. for those of you using a browser that doesn't support month, the screenshot below shows what it looks like in chrome and opera. clicking the down arrow on the right hand side brings up a date picker that lets you select the month and year. the microsoft edge month control looks like this: value a domstring represent...
...complete, list, readonly, and step. idl attributes value methods select(), stepdown(), stepup(). value a domstring representing the value of the month and year entered into the input, in the form yyyy-mm (four or more digit year, then a hyphen ("-"), followed by the two-digit month). the format of the month string used by this input type is described in format of a valid local month string in date and time formats used in html. you can set a default value for the input control by including a month and year inside the value attribute, like so: <label for="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> one thing to note is that the displayed date format differs from the actual value; mo...
...the <...
...And 16 more matches
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
havior in various ways to meet the criteria the users want. 37 html attribute: accept accept, attribute, file, input, reference the accept attribute takes as its value a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow. ...
...constraint validation, html the capture attribute specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute. values include user and environment. 39 html attribute: crossorigin advanced, attribute, cors, html, needscontent, reference, security the crossorigin attribute, valid on the <audio>, <img>, <link>, <script>, and <video> elements, provides support for cors, defining how the element handles crossorigin requests, thereby enabling the configuration of the cors requests for the element's fetched data. depending on the element, the attribute can be a cors settings attribute. ...
...gin attribute, valid on the <audio>, <img>, <link>, <script>, and <video> elements, provides support for cors, defining how the element handles crossorigin requests, thereby enabling the configuration of the cors requests for the element's fetched data. depending on the element, the attribute can be a cors settings attribute. 40 html attribute: max attribute, attributes, constraint validation, html, reference the max attribute defines the maximum value that is acceptable and valid for the input containing the attribute. if the value of the element is greater than this, the element fails constraint validation. this value must be greater than or equal to the value of the min attribute. ...
...And 16 more matches
Introduction to SSL - Archive of obsolete content
e server, and allows both machines to establish an encrypted connection. these capabilities address fundamental concerns about communication over the internet and other tcp/ip networks: ssl server authentication allows a user to confirm a server's identity. ssl-enabled client software can use standard techniques of public-key cryptography to check that a server's certificate and public id are valid and have been issued by a certificate authority (ca) listed in the client's list of trusted cas. this confirmation might be important if the user, for example, is sending a credit card number over the network and wants to check the receiving server's identity. ssl client authentication allows a server to confirm a user's identity. using the same techniques as those used for server authentication...
...rusted cas. this confirmation might be important if the user, for example, is sending a credit card number over the network and wants to check the receiving server's identity. ssl client authentication allows a server to confirm a user's identity. using the same techniques as those used for server authentication, ssl-enabled server software can check that a client's certificate and public id are valid and have been issued by a certificate authority (ca) listed in the server's list of trusted cas. this confirmation might be important if the server, for example, is a bank sending confidential financial information to a customer and wants to check the recipient's identity. an encrypted ssl connection requires all information sent between a client and a server to be encrypted by the sending softw...
... message to the client informing it that future messages from the server will be encrypted with the session key. it then sends a separate (encrypted) message indicating that the server portion of the handshake is finished. the ssl handshake is now complete, and the ssl session has begun. the client and the server use the session keys to encrypt and decrypt the data they send to each other and to validate its integrity. before continuing with the session, red hat servers can be configured to check that the client's certificate is present in the user's entry in an ldap directory. this configuration option provides one way of ensuring that the client's certificate has not been revoked. it's important to note that both client and server authentication involve encrypting some piece of data with ...
...And 14 more matches
attr() - CSS: Cascading Style Sheets
Web › CSS › attr
rc url, ""); attr(data-width px, inherit); attr(data-something, "default"); syntax values attribute-name is the name of an attribute on the html element referenced in the css. <type-or-unit> is a keyword representing either the type of the attribute's value, or its unit, as in html some attributes have implicit units. if the use of <type-or-unit> as a value for the given attribute is invalid, the attr() expression will be invalid too. if omitted, it defaults to string. the list of valid values are: keyword associated type comment default value string <string> the attribute value is treated as a css <string>. it is not reparsed, and in particular the characters are used as-is instead of css escapes being turned into different characte...
...e comment default value string <string> the attribute value is treated as a css <string>. it is not reparsed, and in particular the characters are used as-is instead of css escapes being turned into different characters. an empty string. color <color> the attribute value is parsed as a hash (3- or 6-value hash) or a keyword. ...
...a keyword. it must be a valid css <string> value. leading and trailing spaces are stripped. currentcolor url <url> the attribute value is parsed as a string that is used inside a css url() function. relative url are resolved relatively to the original document, not relatively to the style sheet. leading and trailing spaces are stripped. the url about:invalid that points to a non-existent document with a generic error condition. integer <integer> the attribute value is parsed as a css <integer>. if it is not valid, that is not an integer or out of the range accepted by the css property, the default value is used. leading and trailing spaces are stripped. ...
...And 14 more matches
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
the resulting value includes the year, month, and day, but not the time. the time and datetime-local input types support time and date+time input. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the input ui generally varies from browser to browser; see browser compatibility for further details. ...
...yyy-mm-dd format, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes list, value, valueasdate, valueasnumber. methods select(), stepdown(), stepup() value a domstring representing the date entered in the input. the date is formatted according to iso8601, described in format of a valid date string in date and time formats used in html. you can set a default value for the input with a date inside the value attribute, like so: <input type="date" value="2017-06-01"> the displayed date format will differ from the actual value — the displayed date is formatted based on the locale of the user's browser, but the parsed value is always formatted yyyy-mm-dd. you can get and se...
.... it then reads that value back in string and number formats. additional attributes along with the attributes common to all <input> elements, date inputs have the following attributes: attribute description max the latest acceptable date min the earliest acceptable date step the stepping interval, when clicking up and down spinner buttons and validating the date max the latest date to accept. if the value entered into the element occurs afterward, the element fails constraint validation. if the value of the max attribute isn't a possible date string in the format yyyy-mm-dd, then the element has no maximum date value. if both the max and min attributes are set, this value must be a date string later than or equal to the one in the ...
...And 14 more matches
Examples - Archive of obsolete content
</p> <p> this document contains inline css rules contained in a <code>style</code> element and surrounded by a comment and javascript contained in a <code>script</code> element and surrounded by a comment. </p> <dl> <dt>mozilla 1.1+/opera 7</dt> <dd>do not apply css or execute the javascript.</dd> <dt>netscap...
... and javascript contained in a <code>script</code> element and surrounded by a comment. </p> <dl> <dt>mozilla 1.1+/opera 7</dt> <dd>do not apply css or execute the javascript.</dd> <dt>netscape 7.0x/mozilla 1.0.x</dt> <dd>do not apply css but does execute the javascript.</dd> <dt>internet explorer 5.5+</dt> <dd>can not display the document.</dd> </dl> <p> <a href="http://validator.w3.org/check/referer"><img src="https://udn.realityripple.com/samples/8a/9e64asf935.png" alt="valid xhtml 1.0!" height="31" width="88" /></a> </p> </body> </html> back to the article problem 3 <!-- this file should have a .xhtml extension and will generate an error when parsed. --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dt...
...mple 1 - xhtml 1.0 strict as text/html</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> <!-- body { padding-top: 8em; } html { color: #fff; background: #000 no-repeat fixed;} p {width: 30em; font-weight: bold;} --> </style> </head> <body> <h1>example 1 - xhtml 1.0 strict as text/html</h1> <p> this document is valid xhtml 1.0 strict served as <code>text/html</code>. </p> <p> this document contains inline css rules contained in a <code>style</code> element and surrounded by a sgml comment. </p> <p> note how the css rules for the background are applied in netscape 7.x, mozilla, opera 7 and internet explorer 5.5+. </p> <p> <a href="http://validator.w3.org/check/referer"><img ...
...And 13 more matches
TypeScript support in Svelte - Learn web development
is a superset of javascript that provides features such as optional static typing, classes, interfaces, and generics. the goal of typescript is to help catch mistakes early through its type system and make javascript development more efficient. one of the big benefits is enabling ides to provide a richer environment for spotting common errors as you type the code. best of all, javascript code is valid typescript code; typescript is a superset of javascript. you can rename most of your .js files to .ts files and they will just work. our typescript code will be able to run everywhere javascript can run. how is that possible? typescript "transpiles" our code to vainilla javascript. that means that it parses typescript code and produces the equivalent vanilla javascript code for browsers to run. ...
...e <script> tag. moreover, thanks to type inference, in many cases we won't even need to specify types to get code assistance. for example, if you start adding an ms property to the alert component call, typescript will infer from the default value that the ms property should be a number: and if you pass something that is not a number it will complain about it: the application template has a validate script configured that runs svelte-check against your code. this package allows you to detect errors and warnings normally displayed by a code editor from the command line, which makes it pretty useful for running it in a continuous integration (ci) pipeline. just run npm run validate to check for unused css, and return a11y hints and typescript compile errors. in this case, if you run npm ru...
...e script configured that runs svelte-check against your code. this package allows you to detect errors and warnings normally displayed by a code editor from the command line, which makes it pretty useful for running it in a continuous integration (ci) pipeline. just run npm run validate to check for unused css, and return a11y hints and typescript compile errors. in this case, if you run npm run validate (either in the vs code console or terminal) you will get the following error: even better, if you run it from the vs code integrated terminal (you can open it with the ctrl + ` keyboard shortcut), cmd/ctrl + clicking on the file name will take you to the line containing the error. you can also run the validate script in watch mode with npm run validate -- --watch. in this case, the script ...
...And 13 more matches
IAccessibleTable
s obtained by parsing the attribute string returned by iaccessible2.attributes(). the "table-cell-index" attribute can be used just like a child index of the typical case. ats should first test for the presence of the "table-cell-index" attribute and if it is not present then iaccessible2.indexinparent() can be used as in the typical case where cells are direct children of the table. the range of valid coordinates for this interface are implementation dependent. however, that range includes at least the intervals from the from the first row or column with the index 0 up to the last (but not including) used row or column as returned by nrows() and ncolumns(). method overview [propget] hresult accessibleat([in] long row, [in] long column, [out] iunknown accessible ); [propget] hresult captio...
... accessible object at the specified row and column in the table. this object could be an iaccessible or an iaccessible2. [propget] hresult accessibleat( [in] long row, [in] long column, [out] iunknown accessible ); parameters row the 0 based row index for which to retrieve the cell. column the 0 based column index for which to retrieve the cell. accessible if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently visible (on the screen). return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. caption() returns the caption for the table. the returned object could be an iaccessible or an iaccessible2. [propget] hresult caption( [out] iunknown accessible ); ...
...ldindex() translates the given row and column indexes into the corresponding cell index. [propget] hresult childindex( [in] long rowindex, [in] long columnindex, [out] long cellindex ); parameters rowindex 0 based row index for the cell. columnindex 0 based column index for the cell. cellindex returns the 0 based index of the cell at the specified row and column indexes. return value e_invalidarg if bad [in] passed, [out] value is 0. s_ok. columndescription() returns the description text of the specified column in the table. [propget] hresult columndescription( [in] long column, [out] bstr description ); parameters column the 0 based index of the column for which to retrieve the description. description returns the description text of the specified column in the table if such a d...
...And 13 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
se. to get a student id, you apply to a school or college, which performs different checks (such as whether you have paid your tuition) before issuing the id. to get a library card, you may need to provide only your name and a utility bill with your address on it. certificates work much the same way as any of these familiar forms of identification. ...
...me and a utility bill with your address on it. certificates work much the same way as any of these familiar forms of identification. certificate authorities (cas) are entities that validate identities and issue certificates. they can be either independent third parties or organizations running their own certificate-issuing server software (such as red hat certificate system). the methods used to validate an identity vary depending on the policies of a given ca-just as the methods to validate other forms of identification vary depending on who is issuing the id and the purpose for which it will be used. in general, before issuing a certificate, the ca must use its published verification procedures for that type of certificate to ensure that an entity requesting a certificate is in fact who it c...
...particular name is on the list, and if the user types the correct password, the server grants access. certificate-based authentication. client authentication based on certificates is part of the ssl protocol. the client digitally signs a randomly generated piece of data and sends both the certificate and the signed data across the network. the server uses techniques of public-key cryptography to validate the signature and confirm the validity of the certificate. password-based authentication figure 4 shows the basic steps involved in authenticating a client by means of a name and password. figure 4 assumes the following: the user has already decided to trust the server, either without authentication or on the basis of server authentication via ssl. the user has requested a resource cont...
...And 12 more matches
NSS_3.12_release_notes.html
note: firefox 3 uses nss 3.12, but not the new sqlite-based shareable certificate and key databases. we missed the deadline to enable that feature in firefox 3. distribution information the cvs tag for the nss 3.12 release is nss_3_12_rtm. nss 3.12 requ...
...tdb/cert.h) cert_encodeusernotice (see cert.h) cert_findcrlentryreasonexten (see cert.h) cert_findcrlnumberexten (see cert.h) cert_findnameconstraintsexten (see cert.h) cert_getclassicocspdisabledpolicy (see cert.h) cert_getclassicocspenabledhardfailurepolicy (see cert.h) cert_getclassicocspenabledsoftfailurepolicy (see cert.h) cert_getpkixverifynistrevocationpolicy (see cert.h) cert_getusepkixforvalidation (see cert.h) cert_getvaliddnspatternsfromcert (see cert.h) cert_newtempcertificate (see cert.h) cert_setocsptimeout (see certhigh/ocsp.h) cert_setusepkixforvalidation (see cert.h) cert_pkixverifycert (see cert.h) hash_gettype (see sechash.h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) p...
...224 ckm_sha224_hmac ckm_sha224_hmac_general ckm_sha224_key_derivation ckm_camellia_key_gen ckm_camellia_ecb ckm_camellia_cbc ckm_camellia_mac ckm_camellia_mac_general ckm_camellia_cbc_pad ckm_camellia_ecb_encrypt_data ckm_camellia_cbc_encrypt_data ckg: mfgs ckg_mgf1_sha224 new error codes (see secerr.h): sec_error_not_initialized sec_error_token_not_logged_in sec_error_ocsp_responder_cert_invalid sec_error_ocsp_bad_signature sec_error_out_of_search_limits sec_error_invalid_policy_mapping sec_error_policy_validation_failed sec_error_unknown_aia_location_type sec_error_bad_http_response sec_error_bad_ldap_response sec_error_failed_to_encode_data sec_error_bad_info_access_location sec_error_libpkix_internal new mechanism flags (see secmod.h) public_mech_aes_flag public_mech_sha256_flag pu...
...And 12 more matches
<input type="week"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › week
nge and input supported common attributes autocomplete, list, readonly, and step idl attributes value, valueasdate, valueasnumber, and list. methods select(), stepdown(), and stepup() value a domstring representing the value of the week/year entered into the input. the format of the date and time value used by this input type is described in format of a valid week string in date and time formats used in html. you can set a default value for the input by including a value inside the value attribute, like so: <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" value="2017-w01"> one thing to note is that the displayed format may differ from the actual value, which is always formatted yyyy-www. when t...
... set the value in javascript using the input element's value property, for example: var weekcontrol = document.queryselector('input[type="week"]'); weekcontrol.value = '2017-w45'; additional attributes in addition to the attributes common to <input> elements, week inputs offer the following attributes: attribute description max the latest year and week to accept as valid input min the earliest year and week to accept as valid input readonly a boolean which, if present, indicates that the user cannot edit the field's contents step the stepping interval (the distance between allowed values) to use for both user interface and constraint validation max the latest (time-wise) year and week number, in the string format discus...
... indicates that the user cannot edit the field's contents step the stepping interval (the distance between allowed values) to use for both user interface and constraint validation max the latest (time-wise) year and week number, in the string format discussed in the value section above, to accept. if the value entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a valid week string, then the element has no maximum value. this value must be greater than or equal to the year and week specified by the min attribute. ...
...And 12 more matches
A Web PKI x509 certificate primer
his document referred as x509) is an itu standard to describe certificates. this article provides an overview of what these are and how they work. three versions of the x509 standard have been defined for web-pki. in this document we will be referring to the current standard in use for web pki: x509 v3, which is described in detail in rfc 5280. ...
... current standard in use for web pki: x509 v3, which is described in detail in rfc 5280. in general, x509 certificates bind a signature to a validity period, a public key, a subject, an issuer, and a set of extensions. the extensions define extra properties of the certificate such as extra attributes of the certificate or constraints on the use of the certificate. in order for a certificate to be valid these three requirements must be met: there is a verification path from the site certificate to a trusted certificate of the user agent (ie if you follow the issuer path you will end on a self-signed certificate that is considered trusted by the browser). ...
...ints on the use of the certificate. in order for a certificate to be valid these three requirements must be met: there is a verification path from the site certificate to a trusted certificate of the user agent (ie if you follow the issuer path you will end on a self-signed certificate that is considered trusted by the browser). the attributes of the certificates in the verification path have valid parameters for that verification (for example the validity period of all the certificates are valid for the time the verification is being done) revocation checks are considered ok for that particular validation. one issue that is not commonly known is that the x509 trust graph is not a forest (a bunch of trees where each root is a trusted root) but a cyclic graph, where the same key/issuer ca...
...And 11 more matches
PaymentResponse.retry() - Web APIs
the paymentresponse interface's retry() method makes it possible to ask the user to retry a payment after an error occurs during processing. this lets your app gracefully deal with situations such as invalid shipping addresses or declined credit cards. syntax retrypromise = paymentrequest.retry(errorfields); parameters errorfields a paymentvalidationerrors object, with the following properties: error optional a general description of a payment error from which the user may attempt to recover by retrying the payment, possibly after correcting mistakes in the payment information. error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in spe...
...ment information. error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment form. payer optional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation. paymentmethod optional any payment method specific errors which may have occurred. this object's contents will vary depending on the payment used. for example, if the user chose to pay by credit card using the basic-card payment method, this is a basiccarderrors object. shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shippi...
...ptional any payment method specific errors which may have occurred. this object's contents will vary depending on the payment used. for example, if the user chose to pay by credit card using the basic-card payment method, this is a basiccarderrors object. shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shipping address that failed validation. return value a promise which is resolved when the payment is successfully completed. the promise is rejected with an appropriate exception value if the payment fails again. typically you will use this by calling show(), then entering a loop or recursive function that checks the paymentresponse for errors or other reasons to retry the payment request. if a retry is needed, the loop ca...
...And 11 more matches
SubtleCrypto.verify() - Web APIs
the verify() method of the subtlecrypto interface verifies a digital signature. it takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. it returns a promise which will be fulfilled with a boolean value indicating whether the signature is valid. syntax const result = crypto.subtle.verify(algorithm, key, signature, data); parameters algorithm is a domstring or object defining the algorithm to use, and for some algorithm choices, some extra parameters. the values given for the extra parameters must match those passed into the corresponding sign() call. to use rsassa-pkcs1-v1_5, pass the string "rsassa-pkcs1-v1_5" or an object of the form { "name": "rsassa-pkcs1-v1_5" }. to use rsa-pss, pass ...
...a cryptokey containing the key that will be used to verify the signature. it is the secret key for a symmetric algorithm and the public key for a public-key system. signature is a arraybuffer containing the signature to verify. data is a arraybuffer containing the data whose signature is to be verified. return value result is a promise that fulfills with a boolean: true if the signature is valid, false otherwise. exceptions the promise is rejected when the following exception is encountered: invalidaccesserror raised when the encryption key is not a key for the requested verifying algorithm or when trying to use an algorithm that is either unknown or isn't suitable for a verify operation. supported algorithms the verify() method supports the same algorithms as the sign() method...
...ents of the "message" textbox, and encode it in a form we can use for sign operation. */ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. ...
...And 11 more matches
HTTP conditional requests - HTTP
principles http conditional requests are requests that are executed differently, depending on the value of specific headers. ...
... principles http conditional requests are requests that are executed differently, depending on the value of specific headers. ...
...dition: for safe methods, like get, which usually tries to fetch a document, the conditional request can be used to send back the document, if relevant only. therefore, this spares bandwidth. for unsafe methods, like put, which usually uploads a document, the conditional request can be used to upload the document, only if the original it is based on is the same as that stored on the server. ...
...And 11 more matches
PaymentResponse.onpayerdetailchange - Web APIs
yment request form. syntax paymentresponse.onpayerdetailchange = eventhandlerfunction; value an event handler function which is called to handle the payerdetailchange event when the user makes changes to their personal information while editing a payment request form. examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the information entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected. const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, opti...
...: true, }; const request = new paymentrequest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed. ...
... response = request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed. ...
...And 10 more matches
PaymentResponse: payerdetailchange event - Web APIs
payerdetailchange events are delivered by the payment request api to a paymentresponse object when the user makes changes to their personal information while filling out a payment request form. the event handler for payerdetailchange should check each value in the form that has changed and ensure that the values are valid. if any are invalid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries. bubbles no cancelable no interface paymentrequestupdateevent event handler property onpayerdetailchange examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to va...
...: true, }; const request = new paymentrequest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed. ...
... response = request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed. ...
...And 10 more matches
Gecko Compatibility Handbook - Archive of obsolete content
site works correctly in netscape 6.x but not netscape 7.x or other browsers based upon gecko. the browser detection javascript detects netscape 6.x but does not detect other gecko-based browsers. upgrade the browser detection javascript to detect "gecko." (related article) content differs in gecko browsers and internet explorer use of proprietary or invalid markup (such as is generated by some microsoft office applications). use the w3 html and css validator tools to validate the web page. correct any errors and replace proprietary code wherever possible. upgrade web authoring tool to versions that support the w3 standards and gecko browsers content differs in gecko browsers and internet explorer the javascrip...
...case between the css defining the style for html id's and classes results in gecko browsers not applying the styles to id's or class names that differ in case. internet explorer incorrectly specifies height and width of inline elements such as span. internet explorer implements the box model (padding, margins, borders) incorrectly. do not use internet explorer's invalid implementation of css. use only the cross-browser, standards conformant features of css. use consistent case when writing html id and class name attributes and css styles for those ids and classes. do not specify heights or widths on inline elements such as spans. use only cross-browser box specifications for margins, padding and borders. (more about css) content differs in geck...
...nk areas in interent explorer but display blank areas between the images in gecko browsers. incorrect layout mode specified by doctype. standards mode layout has been specified by the doctype. change the doctype to request quirks mode layout instead. more info clicking a link results in a 404-page not found but works in internet explorer the link may use an invalid form of a relative url. change relative urls from http://directory/... to directory/.... or use absolute paths in urls such as http://example.com/directory/... verify that all hyperlinks use forward slashes (/) clicking on a link displays a "download" or displays html code instead of rendering the page correctly, but works as expected in internet explorer t...
...And 9 more matches
CSS and JavaScript accessibility best practices - Learn web development
e javascript is that it should be used wherever possible to enhance functionality, not build it in entirely — basic functions should ideally work without javascript, although it is appreciated that this is not always an option. but again, a large part of it is using built-in browser functionality where possible. good example uses of unobtrusive javascript include: providing client-side form validation, which alerts users to problems with their form entries quickly, without having to wait for the server to check the data. if it isn't available, the form will still work, but validation might be slower. providing custom controls for html5 <video>s that are accessible to keyboard-only users, along with a direct link to the video that can be used to access it if javascript is not available (t...
...e, the form will still work, but validation might be slower. providing custom controls for html5 <video>s that are accessible to keyboard-only users, along with a direct link to the video that can be used to access it if javascript is not available (the default <video> browser controls aren't keyboard accessible in most browsers). as an example, we've written a quick and dirty client-side form validation example — see form-validation.html (also see the demo live). here you'll see a simple form; when you try to submit the form with one or both fields left empty, the submit fails, and an error message box appears to tell you what is wrong. ...
... browser controls aren't keyboard accessible in most browsers). as an example, we've written a quick and dirty client-side form validation example — see form-validation.html (also see the demo live). here you'll see a simple form; when you try to submit the form with one or both fields left empty, the submit fails, and an error message box appears to tell you what is wrong. ...
...And 9 more matches
Drawing and Event Handling - Plugins
draw plug-ins and to handle events: plug-in methods, called by the browser: npp_handleevent: deliver a platform-specific event to the instance. npp_print: request a platform-specific print operation for the instance. npp_setwindow: set the window in which a plug-in draws. browser-side methods, called by the plug-in: npn_forceredraw: force a paint message to a windowless plug-in. npn_invalidaterect: invalidate an area in a windowless plug-in before repainting or refreshing. npn_invalidateregion: invalidate a region in a windowless plug-in before repainting or refreshing. printing the plug-in the browser calls the npp_print method to ask the plug-in instance to print itself. void npp_print(npp instance, npprint *printinfo); the instance parameter represents the current plug-in.
...indow in which the plug-in should print. on ms windows, note that the coordinates for the window rectangle are in twips format. for this reason, you need to convert the x - and y - coordinates using the windows api call dptolp when you output text. setting the window the browser calls the npp_setwindow function to set the window in which a plug-in draws or returns an error code. this window is valid for the life of the instance, or until npp_setwindow is called again with a different value. subsequent calls to npp_setwindow for a given instance usually mean that the window has been resized. if either window or window->window is null, the plug-in must not perform any additional graphics operations on the window and should free any associated resources. nperror npp_setwindow(npp instance, np...
... os the window->window field points to an np_port structure. getting information to receive information from the browser, the plug-in calls the npn_getvalue method. nperror npn_getvalue(npp instance, npnvariable variable, void *value); the instance parameter represents the current plug-in. unix and ms windows the queried information is returned in the variable parameter. this parameter is valid only for the unix and ms windows platforms. for unix, the values are either the current display (npnvxdisplay) or the application's context (npnvxtappcontext). for ms windows, the value is the native window on which the plug-in drawing occurs (npnvnetscapewindow). the value parameter contains the name of the plug-in. you can also use npn_getvalue to help create a menu or dialog box for a window...
...And 9 more matches
HTMLSelectElement - Web APIs
are selected. htmlselectelement.size a long reflecting the size html attribute, which contains the number of visible items in the control. the default is 1, unless multiple is true, in which case it is 4. htmlselectelement.typeread only a domstring represeting the form control's type. when multiple is true, it returns "select-multiple"; otherwise, it returns "select-one". ...
...ains the number of visible items in the control. the default is 1, unless multiple is true, in which case it is 4. htmlselectelement.typeread only a domstring represeting the form control's type. when multiple is true, it returns "select-multiple"; otherwise, it returns "select-one". htmlselectelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this attribute is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmlselectelement.validityread only a validitystate reflecting the validity state that this control is in. htmlselectelement.value a domstring reflecting the value of the form cont...
... methods this interface inherits the methods of htmlelement, and of element and node. htmlselectelement.add() adds an element to the collection of option elements for this select element. ...
...And 9 more matches
Using CSS transitions - CSS: Cascading Style Sheets
erty: width height background-color font-size left top transform -webkit-transformv color; transition-duration: 0.5s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 1s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position: absolute; -webkit-transition-property: width height background-color f...
...roperty: width height background-color font-size left top transform -webkit-transform color; transition-duration: 1s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 2s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position: absolute; -webkit-transition-property: width height background-color f...
...roperty: width height background-color font-size left top transform -webkit-transform color; transition-duration: 2s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 4s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position: absolute; -webkit-transition-property: width height background-color f...
...And 9 more matches
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
is semantic identifiers. for example, --main-text-color is easier to understand than #00ff00, especially if this same color is also used in other contexts. custom properties are subject to the cascade and inherit their value from their parent. basic usage declaring a custom property is done using a custom property name that begins with a double hyphen (--), and a property value that can be any valid css value. like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } note that the selector given to the ruleset defines the scope that the custom property can be used in. a common best practice is to define custom properties on the :root pseudo-class, so that it can be applied globally across your html document: :root { --main-bg-color: brown...
...ne"> <div class="two"> <div class="three"></div> <div class="four"></div> </div> </div> ... with the following css: .two { --test: 10px; } .three { --test: 2em; } in this case, the results of var(--test) are: for the class="two" element: 10px for the class="three" element: 2em for the class="four" element: 10px (inherited from its parent) for the class="one" element: invalid value, which is the default value of any custom property keep in mind that these are custom properties, not actual variables like you might find in other programming languages. the value is computed where it is needed, not stored for use in other rules. for instance, you cannot set a property for an element and expect to retrieve it in a sibling's descendant's rule. the property is only set for...
...iven variable is not yet defined; this can be useful when working with custom elements and shadow dom. fallback values aren't used to fix the browser compatibility. if the browser doesn't support css custom properties, the fallback value won't help. it's just a backup for the browser which supports css custom properties to choose a different value if the given variable isn't defined or has an invalid value. the first argument to the function is the name of the custom property to be substituted. the second argument to the function, if provided, is a fallback value, which is used as the substitution value when the referenced custom property is invalid. the function only accepts two parameters, assigning everything following the first comma as the second parameter. if that second parameter is ...
...And 9 more matches
Date and time formats used in HTML - HTML: Hypertext Markup Language
02 february 28 (29 in leap years) 03 march 31 04 april 30 05 may 31 06 june 30 07 july 31 o8 august 31 09 september 30 10 october 31 11 november 30 12 december 31 week strings a week string specifies a week within a particular year. a valid week string consists of a valid year number, followed by a hyphen character ("-", or u+002d), then the capital letter "w" (u+0057), followed by a two-digit week of the year value. the week of the year is a two-digit string between 01 and 53. each week begins on monday and ends on sunday. that means it's possible for the first few days of january to be considered part of the previous week-year, ...
... 1953 was on january 1, so that week—beginning on monday, december 29—is considered the first week of the year. therefore, december 30, 1952 occurs during the week 1953-w01. a year has 53 weeks if: the first day of the calendar year (january 1) is a thursday or the first day of the year (january 1) is a wednesday and the year is a leap year all other years have 52 weeks. ...
... (january 21-27, 42) note that both the year and week numbers are padded with leading zeroes, with the year padded to four digits and the week to two. month strings a month string represents a specific month in time, rather than a generic month of the year. ...
...And 9 more matches
<input type="password"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › password
select(), setrangetext(), and setselectionrange() value the value attribute contains a domstring whose value is the current contents of the text editing control being used to enter the password. if the user hasn't entered anything yet, this value is an empty string (""). if the required property is specified, then the password edit box must contain a value other than an empty string to be valid. if the pattern attribute is specified, the content of a password control is only considered valid if the value passes validation; see validation for more information. note: the line feed (u+000a) and carriage return (u+000d) characters are not permitted in a password value. when setting the value of a password control, line feed and carriage return characters are stripped out of the value. ...
... stripped out of the value. ...
...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 an example value to display in the field when the field is empty readonly a boolean attribute which, if present, indicates that the field's contents should not be editable size the number of characters wide the input field should be maxlength the maximum number of characters (as utf-16 code units) the user can enter into the password field. ...
...And 9 more matches
Index - Archive of obsolete content
nvironment and access arguments passed to it. 61 tabs add-on sdk open, manipulate, and access tabs, and receive tab events. 62 timers add-on sdk set one-off and periodic timers. 63 ui add-on sdk, add-ons, extensions, reference provides access to button, toolbar, and sidebar ui objects. 64 url add-on sdk construct, validate, and parse urls. 66 widget add-on sdk create a simple user interface for an add-on in firefox's add-on bar. 67 windows add-on sdk enumerate and examine open browser windows, open new windows, and listen for window events. 68 low-level apis no summary! 69 /loader create commonjs module loaders. 70 c...
...ch. it also adds a preference dialog that lets you switch to a stock other than one of the ones included in the popup menu. 313 an interview with douglas bowman of wired news web development, web standards one of the web's oldest news sites, wired news draws between 20 and 25 million page views every month. on october 11, 2002, wired launched a brand-new site design that uses validating xhtml for its structure and a small collection of css files for its layout. the new design clearly shows what some experts have been saying: that standards-based design can be visually compelling and preserve the interface conventions we've come to expect from web pages. 356 archived mozilla and build documentation these articles are archived, obsolete documents about m...
...l part of the second codepath. 600 plug-n-hack security, plugnhack plug-n-hack (pnh) is a proposed standard from the mozilla security team for defining how security tools can interact with browsers in a more useful and usable way. 601 plug-n-hack get involved security, plugnhack while this project has been started by the mozilla security team and has been validated with firefox and owasp zap, this is an open project and we welcome involvement from anyone, especially people working on other browsers and security tools. 602 plug-n-hack phase1 security, plugnhack plug-n-hack (pnh) phase 1 allows easier integration and defines how security tools can advertise their capabilities to browsers. 603 plug-n-hack phase2 security...
...And 8 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
now imagine being able to develop web apps using javascript server-side too. ...
... listing 6 - creating the user interface <link href="/jaxer_examples/js/ext-2.1/resources/css/ext-all.css" type="text/css" rel="stylesheet"/> <script src="/jaxer_examples/js/ext-2.1/adapter/ext/ext-base.js"/> <script src="/jaxer_examples/js/ext-2.1/ext-all.js"/> <link href="/jaxer_examples/css/main.css" type="text/css" rel="stylesheet"/> <script runat="both" src="/jaxer_examples/js/validatecomments.js"/> <script> var txt_name; var txt_email; var txt_message; var btn_comments; var form_comments; ext.onready( function() { // create the name text field txt_name = new ext.form.textfield({ name: "name", fieldlabel: "name", width: 200 }); // create the e-mail text field txt_email = new ext.form.textfield({ name: "email", fieldlabel: "e-mail", width: 200 }); // cr...
...h 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. ...
...And 8 more matches
sslfnc.html
file descriptor also acts as a model for the new file descriptor, and the new file descriptor inherits its values from the model. ssl_handshake_as_client and ssl_handshake_as_server cannot both be turned on simultaneously. if you use ssl_optionset to turn one of these on when the other one is already turned on for a particular socket, the function returns with the error code set to sec_error_invalid_args. likewise, using ssl_enabledefault to turn on the global default for one of these when the global default for the other one is already turned for a particular socket generates the same error. however, there is no good reason for these to be mutually exclusive. this restirction will be removed in future releases. if a socket that is already connected gets imported into ssl after it has been...
...meters: fd a pointer to the file descriptor for the ssl listen socket. cert a pointer to the server's certificate structure. key a pointer to the server's private key structure. keatype key exchange type for use with specified certificate and key. these values are currently valid: kt_rsa kt_dh kt_fortezza returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to obtain the error code. description before ssl can handshake as a server on a socket, it must be configured to do so with a call to ssl_configsecureserver (among other things). this functi...
... following parameters: arg a pointer supplied by the application (in the call to ssl_authcertificatehook) that can be used to pass state information. can be null. fd a pointer to the file descriptor for the ssl socket. checksig pr_true means signatures are to be checked and the certificate chain is to be validated. pr_false means they are not to be checked. (the value is normally pr_true.) isserver pr_true means the callback function should evaluate the certificate as a server does, treating the remote end as a client. pr_false means the callback function should evaluate the certificate as a client does, treating the remote end as a server. the callback fun...
...And 8 more matches
HTML attribute: min - HTML: Hypertext Markup Language
Web › HTML › Attributes › min
the min attribute defines the minimum value that is acceptable and valid for the input containing the attribute. if the value of the element is less than this, the element fails constraint validation. this value must be less than or equal to the value of the max 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. ...
...of the max 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. syntax if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified. for example, if we have <input type="number" min="10" step="2"> any even integer, 10 or great, is valid. ...
...red valid. syntax if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified. for example, if we have <input type="number" min="10" step="2"> any even integer, 10 or great, is valid. if omitted, <input type="number">, any integer is valid, but floats, like 4.2, are not valid, as step defaults to 1. ...
...And 8 more matches
<time> - HTML: Hypertext Markup Language
Web › HTML › Element › time
the html <time> element represents a specific period in time. it may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders. it may represent one of the following: a time on a 24-hour clock. a precise date in the gregorian calendar (with optional time and timezone information). a valid time duration. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. tag omission none, bot...
...n of the gregorian calendar (due to complications in calculating those dates). the datetime value (the machine-readable value of the datetime) is the value of the element’s datetime attribute, which must be in the proper format (see below). if the element does not have a datetime attribute, it must not have any element descendants, and the datetime value is the element’s child text content. ...
... (due to complications in calculating those dates). the datetime value (the machine-readable value of the datetime) is the value of the element’s datetime attribute, which must be in the proper format (see below). if the element does not have a datetime attribute, it must not have any element descendants, and the datetime value is the element’s child text content. ...
...And 8 more matches
HTTP Cache
he entry's output stream immediately, even before the output stream is closed. this is called concurrent read/write. concurrent read and write important difference in behavior from the old cache: the cache now supports reading a cache entry data while it is still being written by the first consumer - the writer. this can only be engaged for resumable responses that (bug 960902) don't need revalidation. reason is that when the writer is interrupted (by e.g. external canceling of the loading channel) concurrent readers would not be able to reach the remaning unread content. this could be improved by keeping the network load running and being stored to the cache entry even after the writing channel has been canceled. when the writer is interrupted, the first concurrent reader in line doe...
...t writer. lifetime of an existing entry with only a partial content such a cache entry is first examined in the nsicacheentryopencallback.oncacheentrycheck callback, where it has to be checked for completeness. in this case, the content-length (or different indicator) header doesn't equal to the data size reported by the cache entry. the consumer then indicates the cache entry needs to be revalidated by returning entry_needs_revalidation from oncacheentrycheck. this consumer, from the point of view the cache, takes a role of the writer. other parallel consumers, if any, are blocked until the writer calls setvalid on the cache entry. the consumer is then responsible to validate the partial content cache entry with the network server and attempt to load the rest of the data. when the se...
...consumers, if any, are blocked until the writer calls setvalid on the cache entry. the consumer is then responsible to validate the partial content cache entry with the network server and attempt to load the rest of the data. when the server responds positively (in case of an http server with a 206 response code) the writer (in this order) opens the output stream on the cache entry and calls setvalid to unblock other pending openers. concurrent read/write is engaged. lifetime of an existing entry that doesn't pass server revalidation such a cache entry is first examined in the nsicacheentryopencallback.oncacheentrycheck callback, where the consumer finds out it must be revalidated with the server before use. ...
...And 7 more matches
IAccessibleEditableText
text ); hresult setattributes([in] long startoffset, [in] long endoffset, [in] bstr attributes ); methods copytext() copies the text range into the clipboard. the specified text between the two given indices is copied into the system clipboard. hresult copytext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to moved into the clipboard. the valid range is 0..length. endoffset end index of the text to moved into the clipboard. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. cuttext() deletes a range of text and copies it to the clipboard. the text between the two given indices is deleted from the text represented by this object and copied to the clipboard. hresult cuttext( [in] long startoffset, [in] ...
...s_ok. deletetext() deletes a range of text. the text between and including the two given indices is deleted from the text represented by this object. ...
.... cuttext() deletes a range of text and copies it to the clipboard. the text between the two given indices is deleted from the text represented by this object and copied to the clipboard. hresult cuttext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to be deleted. the valid range is 0..length. endoffset end index of the text to be deleted. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. deletetext() deletes a range of text. the text between and including the two given indices is deleted from the text represented by this object. hresult deletetext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to be deleted. the valid range is 0..length. endoffset end inde...
...And 7 more matches
IAccessibleTable2
llat() returns the accessible object at the specified row and column in the table. this object could be an iaccessible or an iaccessible2. [propget] hresult cellat( [in] long row, [in] long column, [out] iunknown cell ); parameters row the 0 based row index for which to retrieve the cell. column the 0 based column index for which to retrieve the cell. cell if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently visible (on the screen). return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. columndescription() returns the description text of the specified column in the table. [propget] hresult columndescription( [in] long column, [out] bstr description...
... the description text of the specified column in the table. [propget] hresult columndescription( [in] long column, [out] bstr description ); parameters column the 0 based index of the column for which to retrieve the description. description returns the description text of the specified column in the table if such a description exists. otherwise a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. iscolumnselected() returns a boolean value indicating whether the specified column is completely selected. [propget] hresult iscolumnselected( [in] long column, [out] boolean isselected ); parameters column 0 based index of the column for which to determine whether it is selected. i...
.... iscolumnselected() returns a boolean value indicating whether the specified column is completely selected. [propget] hresult iscolumnselected( [in] long column, [out] boolean isselected ); parameters column 0 based index of the column for which to determine whether it is selected. isselected returns true if the specified column is selected completely and false otherwise. return value e_invalidarg if bad [in] passed, [out] value is false. s_ok. isrowselected() returns a boolean value indicating whether the specified row is completely selected. [propget] hresult isrowselected( [in] long row, [out] boolean isselected ); parameters row 0 based index of the row for which to determine whether it is selected. isselected returns true if the specified row is selected completely and false ...
...And 7 more matches
nsITreeBoxObject
void ensurecellisvisible(in long row, in nsitreecolumn col); void scrolltorow(in long index); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrolltocell(in long row, in nsitreecolumn col); void scrolltocolumn(in nsitreecolumn col); void scrolltohorizontalposition(in long horizontalposition); void invalidate(); void invalidatecolumn(in nsitreecolumn col); void invalidaterow(in long index); void invalidatecell(in long row, in nsitreecolumn col); void invalidaterange(in long startindex, in long endindex); void invalidatecolumnrange(in long startindex, in long endindex, in nsitreecolumn col); long getrowat(in long x, in long y); void getc...
...s horizontally so that the specified column is at the left of the view (if possible). void scrolltocolumn(in nsitreecolumn col); parameters col the nsitreecolumn to scroll to scrolltohorizontalposition() scroll to a specific horizontal pixel position. ...
...y so that the specified column is at the left of the view (if possible). void scrolltocolumn(in nsitreecolumn col); parameters col the nsitreecolumn to scroll to scrolltohorizontalposition() scroll to a specific horizontal pixel position. ...
...And 7 more matches
HTMLInputElement - Web APIs
sets the element's formenctype attribute, containing the type of content that is used to submit the form to the server. this overrides the enctype attribute of the parent form. formmethod string: returns / sets the element's formmethod attribute, containing the http method that the browser uses to submit the form. this overrides the method attribute of the parent form. formnovalidate boolean: returns / sets the element's formnovalidate attribute, indicating that the form is not to be validated when it is submitted. this overrides the novalidate attribute of the parent form. formtarget string: returns / sets the element's formtarget attribute, containing a name or keyword indicating where to display the response that is received after submitting the form. thi...
...you cannot automatically set focus to a hidden control). required boolean: returns / sets the element's required attribute, indicating that the user must fill in a value before submitting a form. value string: returns / sets the current value of the control. note: if the user enters a value different from the value expected, this may return an empty string. validity read only validitystate object: returns the element's current validity state. validationmessage read only string: returns a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. this va...
... object: returns the element's current validity state. validationmessage read only string: returns a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. this value can be set by the setcustomvalidity method. willvalidate read only boolean: returns whether the element is a candidate for constraint validation. it is false if any conditions bar it from constraint validation, including: its type is hidden, reset, or button; it has a <datalist> ancestor; its disabled property is true. properties that apply only to elements of type checkbox or radio checked boole...
...And 7 more matches
HTML attribute: pattern - HTML: Hypertext Markup Language
the pattern attribute specifies a regular expression the form control's value should match. if a non-null value doesn't conform to the constraints set by the pattern value, the validitystate object's read-only patternmismatch property will be true. 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. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii. n...
... tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also include other explanatory text nearby. ...
...display as a tooltip to explain what the requirements are to match the pattern. you should also include other explanatory text nearby. some of the input types supporting the pattern attribute, notably the email and url input types, have expected value syntaxes that must be matched. if the pattern attribute isn't present, and the value doesn't match the expected syntax for that value type, the validitystate object's read-only typemismatch property will be true. usability when including a pattern, provide a description of the pattern in visible text near the control. additionally, include a title attribute which gives a description of the pattern. user agents may use the title contents during constraint validation to tell the user that the pattern is not matched. some browsers show a toolti...
...And 7 more matches
Cache-Control - HTTP
the cache-control http header holds directives (instructions) for caching in both requests and responses. a given directive in a request does not mean the same directive should be in the response. header type general header forbidden header name no cors-safelisted response header yes syntax caching directives have the following rules to be valid: case-insensitive, but lowercase is recommended. multiple directives are comma-separated. some directives have an optional argument, which can be either a token or a quoted-string. (see spec for definitions) cache request directives standard cache-control directives that can be used by the client in an http request. cache-control: max-age=<seconds> cache-control: max-stale[=<seconds>] cache-control:...
...hat can be used by the client in an http request. cache-control: max-age=<seconds> cache-control: max-stale[=<seconds>] cache-control: min-fresh=<seconds> cache-control: no-cache cache-control: no-store cache-control: no-transform cache-control: only-if-cached cache response directives standard cache-control directives that can be used by the server in an http response. cache-control: must-revalidate cache-control: no-cache cache-control: no-store cache-control: no-transform cache-control: public cache-control: private cache-control: proxy-revalidate cache-control: max-age=<seconds> cache-control: s-maxage=<seconds> extension cache-control directives extension cache-control directives are not part of the core http caching standards document. check the compatibility table for their suppo...
...private cache-control: proxy-revalidate cache-control: max-age=<seconds> cache-control: s-maxage=<seconds> extension cache-control directives extension cache-control directives are not part of the core http caching standards document. check the compatibility table for their support; user-agents that don't recognize them should ignore them. ...
...And 7 more matches
NSS 3.12.4 release notes
by cvs co -r nspr_4_8_rtm nspr cvs co -r nss_3_12_4_rtm nss see the documentation section for the build instructions. nss 3.12.4 source is also available on ftp.mozilla.org for secure https download: source tarball: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_4_rtm/src/. major changes in nss 3.12.4 nss 3.12.4 is the version that we submitted to nist for fips 140-2 validation. currently nss 3.12.4 is in the "review pending" state in the fips 140-2 pre-validation list at http://csrc.nist.gov/groups/stm/cmvp/documents/140-1/140inprocess.pdf added crl distribution point support (see cert.h). cert_decodecrlissuingdistributionpoint cert_findcrlissuingdistpointexten the old documentation of the expression matching syntax rules was incorrect, and the new corrected ...
...tion list at http://csrc.nist.gov/groups/stm/cmvp/documents/140-1/140inprocess.pdf added crl distribution point support (see cert.h). ...
... matching syntax rules was incorrect, and the new corrected documentation is as follows for public nssutil functions (see portreq.h): port_regexpvalid port_regexpsearch port_regexpcasesearch these functions will match a string with a shell expression. the expressions accepted are based loosely on the expressions accepted by zsh. expected return values: non_sxp if exp is a standard string invalid_sxp if exp is a shell expression, but invalid valid_sxp if exp is a valid shell expression expression matching rules: * matches anything ? matches one character \ will escape a special character $ matches the end of the string bracketed expressions: [abc] matches one occurence of a, b, or c. [^abc] matches any character except a, b, or c. to be matched between [ and ], these characters must be...
...And 6 more matches
Payment processing concepts - Web APIs
ovider an organization that provides the technology needed to submit payments using a given payment method. for example, when using a credit card to pay, the credit card processing service is the payment method provider. payment handler the implementation of the code needed to interface with a particular payment method provider in order to process payments. some payment handlers use merchant validation, which is the process of validating the identity of a merchant in some way, usually using some form of cryptographic response such as a public key. validated merchants are allowed to interface with a payment handler. payment method identifiers payment handlers are identified by payment method identifiers, which are strings uniquely identifying the payment handler. these may be either one o...
...ional payment method providers, in browsers that support it. in either case, the payment handler is responsible for: making sure a payment can be made. the conditions that make payment possible vary depending on the payment method and the user's payment request; for example, if the user chooses to pay using a credit card that isn't accepted by the payee, the payment can't be made. ...
...er case, the payment handler is responsible for: making sure a payment can be made. the conditions that make payment possible vary depending on the payment method and the user's payment request; for example, if the user chooses to pay using a credit card that isn't accepted by the payee, the payment can't be made. if merchant validation is supported by the payment handler, respond to merchant validation requests from the user agent. ...
...And 6 more matches
Web Authentication API - Web APIs
romise that will resolve to a publickeycredential containing an authenticatorattestationresponse. note that it is absolutely critical that the challenge be a buffer of random information (at least 16 bytes) and it must be generated on the server in order to ensure the security of the registration process. browser calls authenticatormakecredential() on authenticator - internally, the browser will validate the parameters and fill in any defaults, which become the authenticatorresponse.clientdatajson. one of the most important parameters is the origin, which is recorded as part of the clientdata so that the origin can be verified by the server later. the parameters to the create() call are passed to the authenticator, along with a sha-256 hash of the clientdatajson (only a hash is sent because th...
... consenting to the registration. after the user verification, the authenticator will create a new asymmetric key pair and safely store the private key for future reference. the public key will become part of the attestation, which the authenticator will sign over with a private key that was burned into the authenticator during its manufacturing process and that has a certificate chain that can be validated back to a root of trust. authenticator returns data to browser - the new public key, a globally unique credential id, and other attestation data are returned to the browser where they become the attestationobject. browser creates final data, application sends response to server - the create() promise resolves to an publickeycredential, which has a publickeycredential.rawid that is the globa...
...d that is the globally unique credential id along with a response that is the authenticatorattestationresponse containing the authenticatorresponse.clientdatajson and authenticatorattestationresponse.attestationobject. the publickeycredential is sent back to the server using any desired formatting and protocol (note that the arraybuffer properties need to be be base64 encoded or similar). ...
...And 6 more matches
Alerts - Accessibility
the form first, please read about the aria-required technique if you have not done so, as this technique expands upon that. ...
... in order to simplify this example, we’ll check whether the e-mail address contains the “@” symbol, and if the name entry contains at least 1 character. if the above criteria is no...
...bsite"/> </fieldset> <label for="message">please enter your message (required):</label> <br /> <textarea name="message" 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. each field has a set of criteria which must be met in order to pass validation. in order to simplify this example, we’ll check whether the e-mail address contains the “@” symbol, and if the name entry contains at least 1 character. if the above criteria is not met, the field’s aria-invalid attr...
...And 6 more matches
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
refox 50 and later. however, even though it has relatively broad support, it is still not standard and should not be used unless you have no alternative. unique file type specifiers a unique file type specifier is a string that describes a type of file that may be selected by the user in an <input> element of type file. each unique file type specifier may take one of the following forms: a valid case-insensitive filename extension, starting with a period (".") character. for example: .jpg, .pdf, or .doc. a valid mime type string, with no extensions. the string audio/* meaning "any audio file". the string video/* meaning "any video file". the string image/* meaning "any image file". the accept attribute takes as its value a string containing one or more of these unique file type spe...
...t to the previous example: note: you can find this example on github too — see the source code, and also see it running live. it may look similar, but if you try selecting a file with this input, you'll see that the file picker only lets you select the file types specified in the accept value (the exact nature differs across browsers and operating systems). the accept attribute doesn't validate the types of the selected files; it simply provides hints for browsers to guide users towards selecting the correct file types. it is still possible (in most cases) for users to toggle an option in the file chooser that makes it possible to override this and select any file they wish, and then choose incorrect file types. because of this, you should make sure that the accept attribute is back...
...es; it simply provides hints for browsers to guide users towards selecting the correct file types. it is still possible (in most cases) for users to toggle an option in the file chooser that makes it possible to override this and select any file they wish, and then choose incorrect file types. because of this, you should make sure that the accept attribute is backed up by appropriate server-side validation. notes you cannot set the value of a file picker from a script — doing something like the following has no effect: const input = document.queryselector("input[type=file]"); input.value = "foo"; when a file is chosen using an <input type="file">, the real path to the source file is not shown in the input's value attribute for obvious security reasons. instead, the filename ...
...And 6 more matches
Index - HTTP
Web › HTTP › Headers › Index
ck-all-mixed-content csp, directive, http, mixed content, reference, security the http content-security-policy (csp) block-all-mixed-content directive prevents loading any assets using http when the page is loaded using https. 31 csp: child-src csp, directive, http, reference, security the deprecated http content-security-policy (csp) child-src directive defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>. for workers, non-compliant requests are treated as fatal network errors by the user agent. 32 csp: connect-src csp, directive, http, reference, security the http content-security-policy (csp) connect-src directive restricts the urls which can be loaded using script interfa...
...p content-security-policy (csp) default-src directive serves as a fallback for the other csp fetch directives. for each of the following directives that are absent, the user agent will look for the default-src directive and will use this value for it: 34 csp: font-src csp, directive, http, reference, security the http content-security-policy (csp) font-src directive specifies valid sources for fonts loaded using @font-face. 35 csp: form-action csp, directive, http, security the http content-security-policy (csp) form-action directive restricts the urls which can be used as the target of a form submissions from a given context. 36 csp: frame-ancestors csp, directive, http, security the http content-security-policy (csp) frame-ancesto...
...ed using @font-face. 35 csp: form-action csp, directive, http, security the http content-security-policy (csp) form-action directive restricts the urls which can be used as the target of a form submissions from a given context. 36 csp: frame-ancestors csp, directive, http, security the http content-security-policy (csp) frame-ancestors directive specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. 37 csp: frame-src csp, directive, http, reference, security the http content-security-policy (csp) frame-src directive specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>. 38 csp: img-src csp, directive, http, reference, se...
...And 6 more matches
Object.prototype.watch() - Archive of obsolete content
erty. ...
...l + ' to ' + newval); return newval; }); o.p = 2; o.p = 3; delete o.p; o.p = 4; o.unwatch('p'); o.p = 5; this script displays the following: o.p changed from 1 to 2 o.p changed from 2 to 3 o.p changed from undefined to 4 using watch() to validate an object's properties you can use watch to test any assignment to an object's properties. this example ensures that every person always has a valid name and an age between 0 and 200. ...
...s script displays the following: o.p changed from 1 to 2 o.p changed from 2 to 3 o.p changed from undefined to 4 using watch() to validate an object's properties you can use watch to test any assignment to an object's properties. this example ensures that every person always has a valid name and an age between 0 and 200. ...
...And 5 more matches
The HTML5 input types - Learn web development
ppearance may be quite different from a designer's specifications, web developers sometimes build their own custom form controls. we cover this in an advanced tutorial: how to build custom form widgets. e-mail address field this type of field is set using the value email for the type attribute: <input type="email" id="email" name="email"> when this type is used, the user is required to type a valid email address into the field. any other content causes the browser to display an error when the form is submitted. you can see this in action in the below screenshot. you can also use the multiple attribute in combination with the email input type to allow several email addresses to be entered in the same input (separated by commas): <input type="email" id="email" name="email" multiple> on s...
...ted that is more suitable for entering email addresses, including the @ key. see the firefox for android keyboard screenshot below for an example: note: you can find examples of the basic text input types at basic input examples (see the source code also). this is another good reason for using these newer input types — improving the user experience for users of these devices. client-side validation as you can see above, email, along with other newer input types, provides built-in client-side error validation — performed by the browser before the data gets sent to the server. it is a helpful aid to guide users to fill out a form accurately, and it can save time — it is useful to know that your data is not correct immediately, rather than having to wait for a round trip to the serve...
...o guide users to fill out a form accurately, and it can save time — it is useful to know that your data is not correct immediately, rather than having to wait for a round trip to the server. but it should not be considered an exhaustive security measure! your apps should always perform security checks on any form-submitted data on the server-side as well as the client-side, because client-side validation is too easy to turn off, so malicious users can still easily send bad data through to your server. read website security for an idea of what could happen; implementing server-side validation is somewhat beyond the scope of this module, but you should bear it in mind. note that a@b is a valid email address according to the default provided constraints. this is because the email input type al...
...And 5 more matches
Index
Mozilla › Tech › XPCOM › Index
s obtained by parsing the attribute string returned by iaccessible2.attributes(). the "table-cell-index" attribute can be used just like a child index of the typical case. ats should first test for the presence of the "table-cell-index" attribute and if it is not present then iaccessible2.indexinparent() can be used as in the typical case where cells are direct children of the table. the range of valid coordinates for this interface are implementation dependent. however, that range includes at least the intervals from the from the first row or column with the index 0 up to the last (but not including) used row or column as returned by nrows() and ncolumns(). 171 iaccessibletable2 interfaces, needshelp please also refer to the iaccessibletablecell interface. if you want to s...
...t object on its 'obj' param's scope chain as the ecma 'variables object'. private data for this object is an nsisupports object. attempting to alter this bit will result in an ns_error_illegal_value. opt_* values above, or'd together. last version set on this context. scripts typically select this with the "language" attribute. see the version_* consts on jsdidebuggerservice. unique tag among all valid jsdicontext objects, useful as a hash key. private data for this context, if it is an nsisupports, |null| otherwise. retrieve the underlying context wrapped by this jsdicontext. top of the scope chain for this context. |true| if this context should be allowed to run scripts, |false| otherwise. this attribute is only valid for contexts which implement nsiscriptcontext. setting or getting this attr...
...herwise. retrieve the underlying context wrapped by this jsdicontext. top of the scope chain for this context. |true| if this context should be allowed to run scripts, |false| otherwise. this attribute is only valid for contexts which implement nsiscriptcontext. setting or getting this attribute on any other context will throw a ns_error_no_interface exception. stack frame objects. these are only valid inside the jsdiexecutionhook which gave it to you. after you return from that handler the bottom frame, and any frame you found attached through it, are invalidated via the jsdiephemeral interface. once a jsdistackframe has been invalidated all method and property accesses will throw a ns_error_not_available exception. 193 moziasyncfavicons interfaces, interfaces:scriptable, places...
...And 5 more matches
nsIAnnotationService
aren't interested in many other annotations, the positions of things, or other stuff you create, so put that in the weeks policy. removed at 180 days. expire_never 4 for data that should never expire as long as the uri is in the database. expire_with_history 5 for annotations that only live as long as the uri is in history (for example, has > 0 visits). this is only valid for page annotations. expire_days 6 for short-lived temporary data that you still want to outlast a session. removed at 7 days. type_int32 1 int32 type constant. type_double 2 double type constant. type_string 3 string type constant. type_binary 4 binary type constant. type_int64 5 int64 type constant. ...
...mitted due to it's temporary use as expire_never in bug 319455. methods setpageannotation() this method sets an annotation for given uri, overwriting any previous annotation with the same url/name. it is your job to namespace your annotation names. use the form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored in the favicon service, but are special cased in the protocol handler so they look like annotations. do not set favicons using this service, it will not work. binary annotations should be set using setitemannot...
...ll ensure the annotation exists until the item is removed by the user. setitemannotation() this method sets an annotation for given item, overwriting any previous annotation with the same url/name. it is your job to namespace your annotation names. use the form "namespace/value", so your name would be like "bills_extension/page_state" or "history/thumbnail". do not use characters that are not valid in urls such as spaces, ":", commas, or most other symbols. you should stick to ascii letters and numbers plus "_", "-", and "/". the annotation "favicon" is special. favicons are stored in the favicon service, but are special cased in the protocol handler so they look like annotations. do not set favicons using this service, it will not work. binary annotations should be set using setitemannot...
...And 5 more matches
HTMLObjectElement - Web APIs
s the type html attribute, specifying the mime type of the resource. htmlobjectelement.typemustmatch is a boolean that reflects the typemustmatch html attribute, indicating if the resource specified by data must only be played if it matches the type attribute. htmlobjectelement.usemap is a domstring that reflects the usemap html attribute, specifying a <map> element to use. ...
... is a boolean that reflects the typemustmatch html attribute, indicating if the resource specified by data must only be played if it matches the type attribute. htmlobjectelement.usemap is a domstring that reflects the usemap html attribute, specifying a <map> element to use. htmlobjectelement.validationmessage read only returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmlobjectelement.validity read only returns a validitystate with the validity states that this element is in. htmlobjectelement.vspace is a long representing the horizontal space in pixel...
...its constraints. htmlobjectelement.validity read only returns a validitystate with the validity states that this element is in. htmlobjectelement.vspace is a long representing the horizontal space in pixels around the control. htmlobjectelement.width is a domstring that reflects the width html attribute, specifying the displayed width of the resource in css pixels. htmlobjectelement.willvalidate read only returns a boolean that indicates whether the element is a candidate for constraint validation. always false for htmlobjectelement objects. methods inherits methods from its parent, htmlelement. htmlobjectelement.checkvalidity() retuns a boolean that always is true, because object objects are never candidates for constraint validation. ...
...And 5 more matches
PaymentRequest.show() - Web APIs
user engaging with the payment process. processing the result and, if necessary, calling paymentresponse.retry() to retry a failed payment can all be done either asynchronously or synchronously, depending on your needs. for the best user experience, asynchronous solutions are typically the best way to go. most examples on mdn and elsewhere use async/await to wait asynchronously while results are validated and so forth. syntax paymentpromise = paymentrequest.show(detailspromise); parameters detailspromise optional an optional promise that you can provide if your architecture requires that the payment request's details need to be updated between instantiating the payment interface and the user beginning to interact with it. the promise should resolve with a paymentdetailsupdate object co...
...ent request (such as by clicking a "pay" button in the browser's payment sheet). exceptions aborterror the returned promise rejects with an aborterror if the user agent is already showing a payment panel. only one payment panel may be visible at a time across all documents loaded by the user agent. the promise is also rejected with aborterror if the user cancels the payment request. invalidstateerror the promise rejects with an invalidstateerror if the same payment has already been shown for this request (its state is interactive because it is being shown already). notsupportederror the promise rejects with a notsupportederror if the user agent does not support the payment methods specified when the paymentrequest constructor was called. securityerror the promise rejects with a...
...the code to handle payments particularly cleanly: async function processpayment() { try { const payrequest = new paymentrequest(methoddata, details, options); payrequest.onshippingaddresschange = ev => ev.updatewith(checkaddress(payrequest)); payrequest.onshippingoptionchange = ev => ev.updatewith(checkshipping(payrequest)); const repsonse = await payrequest.show(); await validateresponse(response); } catch(err) { /* handle the error; aborterror usually means a user cancellation */ } } in this code, the methods checkaddress() and checkshipping(), respectively, check the shipping address and the shipping option changes and supply in response either a paymentdetailsupdate object or a promise to return one; this object contains the fields in the paymentresponse w...
...And 5 more matches
HTTP caching - HTTP
Web › HTTP › Caching
ld is used to specify directives for caching mechanisms in both requests and responses. use this header to define your caching policies with the variety of directives it provides. no caching the cache should not store anything about the client request or server response. a request is sent to the server and a full response is downloaded each and every time. cache-control: no-store cache but revalidate a cache will send the request to the origin server for validation before releasing a cached copy. cache-control: no-cache private and public caches the "public" directive indicates that the response may be cached by any cache. this can be useful if pages with http authentication, or response status codes that aren't normally cacheable, should now be cached. on the other hand, "private" in...
...ount of time a resource will be considered fresh. contrary to expires, this directive is relative to the time of the request. for the files in the application that will not change, you can usually add aggressive caching. this includes static files such as images, css files and javascript files, for example. for more details, see also the freshness section below. ...
...sidered fresh. contrary to expires, this directive is relative to the time of the request. for the files in the application that will not change, you can usually add aggressive caching. this includes static files such as images, css files and javascript files, for example. for more details, see also the freshness section below. ...
...And 5 more matches
Content-Security-Policy - HTTP
csp). header type response header forbidden header name no syntax content-security-policy: <policy-directive>; <policy-directive> where <policy-directive> consists of: <directive> <value> with no internal punctuation. directives fetch directives fetch directives control the locations from which certain resource types may be loaded. child-src defines the valid sources for web workers and nested browsing contexts loaded using elements such as <frame> and <iframe>. instead of child-src, if you want to regulate nested browsing contexts and workers, you should use the frame-src and worker-src directives, respectively. connect-src restricts the urls which can be loaded using script interfaces default-src serves as a fallback for the other fetch ...
...ed browsing contexts loaded using elements such as <frame> and <iframe>. instead of child-src, if you want to regulate nested browsing contexts and workers, you should use the frame-src and worker-src directives, respectively. connect-src restricts the urls which can be loaded using script interfaces default-src serves as a fallback for the other fetch directives. font-src specifies valid sources for fonts loaded using @font-face. frame-src specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>. img-src specifies valid sources of images and favicons. manifest-src specifies valid sources of application manifest files. media-src specifies valid sources for loading media using the <audio> , <video> and <track> elements. objec...
... elements controlled by object-src are perhaps coincidentally considered legacy html elements and are not receiving new standardized features (such as the security attributes sandbox or allow for <iframe>). ...
...And 5 more matches
Implementation Status - Archive of obsolete content
ported 3.2.2 linking attributes supported 3.2.3 single-node binding attributes supported 3.2.4 node-set binding attributes supported 3.2.5 model item property attributes partial in some cases a loop error can occur on valid bindings 302168; 3.3.1 model supported 3.3.2 instance partial instance element with two child element does not trigger exception 337302; 3.3.3 submission partial no support for @indent and complex schema validation 278761; 278762; 3.3.4 bind ...
...k. 292333; 3.4 extension module unsupported 300760; 3.5 mustunderstand module unsupported 300757; 4. processing model (events) section title status notes bugs 4 processing model (events) partial the xforms-recalculate, xforms-revalidate, and xforms-refresh events are not as separated as they should be. 278448; 338146; 4.2 initialization events supported 4.2.1 xforms-model-construct supported 4.2.2 xforms-model-construct-done supported 4.2.3 xforms-ready supported...
...-model-construct-done supported 4.2.3 xforms-ready supported 4.2.4 xforms-model-destruct supported 4.3.1 xforms-rebuild supported 4.3.2 xforms-recalculate supported 4.3.3 xforms-revalidate supported 4.3.4 xforms-refresh supported 4.3.5 xforms-reset supported 4.3.6 xforms-next xforms-previous supported 4.3.7 xforms-focus supported 4.3.8 xforms-help xforms-hint ...
...And 4 more matches
WAI-ARIA basics - Learn web development
lementary" (<aside>), but there are also others that describe different pages structures, such as role="banner", role="search", role="tabgroup", role="tab", etc., which are commonly found in uis. properties — these define properties of elements, which can be used to give them extra meaning or semantics. 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">. as an example, you could use aria-labelledby to specify that a key description contained in a <div> is the label for multiple table cells, or you could use it as an alternative to i...
...see it running live). in this example we have a simple random quote box: <section> <h1>random quote</h1> <blockquote> <p></p> </blockquote> </section> our javascript loads a json file via xmlhttprequest containing a series of random quotes and their authors. once that is done, we start up a setinterval() loop that loads a new random quote into the quote box every 10 seconds: let intervalid = window.setinterval(showquote, 10000); this works ok, but it is not good for accessibility — the content update is not detected by screenreaders, so their users would not know what is going on. this is a fairly trivial example, but just imagine if you were creating a complex ui with lots of constantly updating content, like a chat room, or a strategy game ui, or a live updating shopping cart ...
...n a series of nested <div>s along with css/javascript is used to create a complex ui-feature, or a native control is greatly enhanced/changed via javascript, not only can keyboard accessibility suffer, but screenreader users will find it difficult to work out what the feature does if there are no semantics or other clues. in such situations, aria can help to provide those missing semantics. ...
...And 4 more matches
Creating reftest-based unit tests
iles that have been checked in to be tested. presumably, one was supposed to open the pages with a browser and look at them and see if they look right. it is hard to tell how many of these will be usable as reftests. if the file is associated with a bug, the bug should be examined. i have seen a case where the html file in the bug had a problem, but the checked-in version was "cleaned up" and not valid for testing. mozilla has used html generation tools in the past. the htmlgen tool is an example of this. tools like this may be more useful now that we have reftest to exercise the files. it would also be useful to generate files that combine html and css in interesting or unusual ways. reftests and preferences in order to use preferences that are not listed in the browser's built-in prefer...
...k correctly should be testing chrome only pieces of ui. you can accomplish this by either: rewrite them as mochitests. the helper functions snapshotwindow and comparesnapshots are available in testing/mochitest/tests/simpletest/windowsnapshot.js. register them in the chrome package in layout/tools/reftest/jar.mn, and reference the chrome uris in the manifest file (see an example). testing invalidation testing that a document displays correctly once it has loaded is only one part of testing rendering. another part is testing invalidation - testing that when a document is changed after it has finished loading and displaying, that the browser correctly "invalidates" the parts of the screen that should change so that the screen displays the correct output the next time it is repainted. inval...
... invalidation - testing that when a document is changed after it has finished loading and displaying, that the browser correctly "invalidates" the parts of the screen that should change so that the screen displays the correct output the next time it is repainted. invalidation tests check both that the internal state of the document has been updated correctly, and that the browser then correctly invalidates and repaints the appropriate parts of the screen. in order to test invalidation it is important that invalidation tests let the document completely finish loading and displaying before making the changes for which invalidation and repainting is to be tested. making the changes before the document has completely finished loading and painting would mean that the test may not actually test the ...
...And 4 more matches
PKCS #11 Module Specs
nss specific parameters in module specs here are the nss application specific parameters in use. this data is currently stored in secmod.db or pkcs11.txt. this isn't part of the generic spec (that is other applications need not parse it, nor pkcs #11 modules need supply them or use them). nss="nss_params" nss_params are themselves name/value pairs, parsed with the same rules described above. valid names inside nss_params are: flags - comma separated list of flag values, parsed case-insensitive. valid flag values are: internal - this library is actually the netscape internal library fips - this library is the netscape internal fips library. critical - if this library cannot be loaded, completely fail initialization. moduledb - this library includes nss specific functions to su...
...ed when looking for a token to do a generic operation (des/hashing, etc). ciphers - comma separated list of ciphers this token will enable that isn't already enabled by the library (currently only fortezza is defined) (case-insensitive). slotparams - space separated list of name/value pairs where the name is a slotid and the value is a space separated list of parameters related to that slotid. valid slotparams values are: slotflags - comma separated list of cipher groups which this slot is expected to be the default implementation for (case-insensitive). valid flags are: rsa - this token should be used for all rsa operations (other than private key operations where the key lives in another token). dsa - this token should be used for all dsa operations (other than private key o...
...ble without authenticating. setting this flags means nss will not try to authenticate to the token when searching for certificates. this removes spurious password prompts, but if incorrectly set it can also cause nss to miss certificates in a token until that token is explicitly logged in. rootflags - comma separated of flags describing any root certs that may be stored (case-insensitive). valid flags are: hasrootcerts - claims that this token has the default root certs and trust values. at init time nss, will try to look for a default root cert device if one has not already been loaded. hasroottrust - parsed but ignored. timeout - time in minutes before the current authentication should be rechecked. this value is only used if askpwd is set to 'timeout'. (default = 0). a...
...And 4 more matches
NSS functions
er ssl_getclientauthdatahook mxr 3.2 and later ssl_getmaxservercachelocks mxr 3.4 and later ssl_getsessionid mxr 3.2 and later ssl_getstatistics mxr 3.2 and later ssl_handshakecallback mxr 3.2 and later ssl_importfd mxr 3.2 and later ssl_inheritmpserversidcache mxr 3.2 and later ssl_invalidatesession mxr 3.2 and later ssl_localcertificate mxr 3.4 and later ssl_optionget mxr 3.2 and later ssl_optiongetdefault mxr 3.2 and later ssl_optionset mxr 3.2 and later ssl_optionsetdefault mxr 3.2 and later ssl_peercertificate mxr 3.2 and later ssl_preencryptedfiletostream mxr 3.2 and ...
... and later cert_addokdomainname mxr 3.4 and later cert_addrdn mxr 3.2.1 and later cert_asciitoname mxr 3.2 and later cert_cachecrl mxr 3.10 and later cert_clearocspcache mxr 3.11.7 and later cert_certchainfromcert mxr 3.2 and later cert_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr 3.3 and later cert_comparename mxr 3.2 and later cert_comparevaliditytimes mxr 3.11 and later cert_completecrldecodeentries mxr ...
...rt_createcertificate mxr 3.5 and later cert_createcertificaterequest mxr 3.2 and later cert_createname mxr 3.2.1 and later cert_createocspcertid mxr 3.6 and later cert_createocsprequest mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 and later cert_decodealtnameextension mxr 3.10 and later cert_decodeauthinfoaccessextension mxr 3.10 and later cert_decodeauthkeyid mxr 3.10 and later cert_decodeavavalue mxr 3.4 and later cert_decodebasicconstraintvalue mxr 3.2 and later ...
...And 4 more matches
IAccessibleHyperlink
removed in a later version of the idl and it is suggested that implementations should not rely on the inheritance. ...
...ersion of the idl and it is suggested that implementations should not rely on the inheritance. ...
...; [propget] hresult valid([out] boolean valid ); methods anchor() returns an object that represents the link anchor, as appropriate for the link at the specified index. [propget] hresult anchor( [in] long index, [out] variant anchor ); parameters index a 0 based index identifies the anchor when, as in the case of an image map, there is more than one link represented by this object. the valid maximal index is indicated by iaccessibleaction.nactions(). anchor this is an implementation dependent value. for example, for a text link this method could return the substring of the containing string where the substring is overridden with link behavior, and for an image link this method could return an iunknown variant for iaccessibleimage. see the section about. ...
...And 4 more matches
FileSystemEntrySync - Web APIs
the path leading to it. methods getmetadata() look up metadata about this entry. [ todo: specify what kind of metadata ] metadata getmetada () raises (fileexception); parameter none returns metadata exceptions this method can raise a fileexception with the following codes: exception description not_found_err the entry does not exist. invalid_state_err the filesystemsync is no longer valid for some reason besides being deleted. moveto() move an entry to a different location on the file system. moving a file over an existing file replaces that existing file. moving a directory over an existing empty directory replaces that directory. [todo: what if the directory is not empty? ] [todo: verify ] this is the same method for re...
...ectory to which to move the entry. newname the new name of the entry. if you do not specify a name, the browser preserves the entry's current name. returns filesystementrysync an object that represents an entry in the file system. ...
...n entry in the file system. exceptions this method can raise a fileexception with the following codes: exception description encoding_err the name supplied is invalid, because at least one of the characters is reserved or illegal. examples include a backslash (\), dot (.), and two dots (..). not_found_err the target directory does not exist. invalid_modification_err you tried one of the following disallowed operations: moving an entry into its parent without changing its name moving a parent directory into one of its child directories. [todo: verify ] no_modification_allowed_err one of the following is not writable: the source entry, its parent directory, and the target directory. copyto() ...
...And 4 more matches
HTMLButtonElement - Web APIs
that is used to submit the form to the server. if specified, this attribute overrides the enctype attribute of the <form> element that owns this element. htmlbuttonelement.formmethod is a domstring reflecting the http method that the browser uses to submit the form. if specified, this attribute overrides the method attribute of the <form> element that owns this element. htmlbuttonelement.formnovalidate is a boolean indicating that the form is not to be validated when it is submitted. if specified, this attribute overrides the novalidate attribute of the <form> element that owns this element. htmlbuttonelement.formtarget is a domstring reflecting a name or keyword indicating where to display the response that is received after submitting the form. if specified, this attribute overrides the...
...buttonelement.tabindex is a long that represents this element's position in the tabbing order. htmlbuttonelement.type is a domstring indicating the behavior of the button. this is an enumerated attribute with the following possible values: submit: the button submits the form. ...
... behavior of the button. this is an enumerated attribute with the following possible values: submit: the button submits the form. this is the default value if the attribute is not specified, html5 or if it is dynamically changed to an empty or invalid value. reset: the button resets the form. button: the button does nothing. menu: the button displays a menu. htmlbuttonelement.willvalidate read only is a boolean indicating whether the button is a candidate for constraint validation. ...
...And 4 more matches
HTMLTextAreaElement - Web APIs
as,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltextareaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties accesskey string: returns / sets the element's accesskey attribute. autocapitalize string: returns / sets the element's capitalization behavior for user input. valid values are: none, off, characters, words, sentences. 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. defaultvalue string: returns ...
...d with this as the first argument, and selectionend as the second argument. tabindex long: returns / sets the position of the element in the tabbing navigation order for the current document. textlength read only long: returns the codepoint length of the control's value. same as reading value.length type read only string: returns the string textarea. validationmessage read only string: returns a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. validity read only validitystate object: returns the validity states that this element is in. ...
...constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. validity read only validitystate object: returns the validity states that this element is in. value string: returns / sets the raw value contained in the control. willvalidate read only boolean: returns whether the element is a candidate for constraint validation. false if any conditions bar it from constraint validation, including its readonly or disabled property is true. wrap string: returns / sets the wrap html attribute, indicating how the control wraps text. htmltextareaelement.labelsread only nodelist: returns a list of ...
...And 4 more matches
WebGL best practices - Web APIs
and to a lesser degree, vao attachments (vertexattribpointer...
...g_vectors: 8 max_vertex_uniform_vectors: 128 max_fragment_uniform_vectors: 64 aliased_point_size_range: [1,100] your desktop may support 16k textures, or maybe 16 texture units in the vertex shader, but most other systems don't, and content that works for you will not work for them! avoid invalidating fbo attachment bindings almost any change to an fbo's attachment bindings will invalidate its framebuffer completeness. set up your hot framebuffers ahead of time. in firefox, setting the pref webgl.perf.max-warnings to -1 in about:config will enable performance warnings that include warnings about fb completeness invalidations. and to a lesser degree, vao attachments (vertexattribpointer, disable/enablevertexattribarray) drawing from static, unchanging vaos is faster than mutat...
...the overhead for this is relatively low, but re-using vaos means fewer vertexattribpointer calls too, so it's worth doing wherever it's easy. delete objects eagerly don't wait for the garbage collector/cycle collector to realize objects are orphaned and destroy them. ...
...And 4 more matches
<easing-function> - CSS: Cascading Style Sheets
range). p0 is (0, 0) and represents the initial time and the initial state, p3 is (1, 1) and represents the final time and the final state. not all cubic bézier curves are suitable as easing functions as not all are mathematical functions; i.e., curves that for a given abscissa have zero or one value. with p0 and p3 fixed as defined by css, a cubic bézier curve is a function, and is therefore valid, if and only if the abscissas of p1 and p2 are both in the [0, 1] range. cubic bézier curves with the p1 or p2 ordinate outside the [0, 1] range may generate bouncing effects. when you specify an invalid cubic-bezier curve, css ignores the whole property. syntax cubic-bezier(x1, y1, x2, y2) where: x1, y1, x2, y2 are <number> values representing the abscissas, and ordinates of the p1 an...
... keywords for common cubic-bezier easing functions ease the animation starts slowly, accelerates sharply, and then slows gradually towards the end. this keyword represents the easing function cubic-bezier(0.25, 0.1, 0.25, 1.0). ...
...*/ cubic-bezier(0, 1.1, 0.8...
...And 4 more matches
HTML attribute: max - HTML: Hypertext Markup Language
Web › HTML › Attributes › max
the max attribute defines the maximum value that is acceptable and valid for the input containing the attribute. if the value of the element is greater than this, the element fails constraint validation. this value must be greater than or equal to the value of the min attribute. if the max attribute is present by is not specified or is invalid, no max value is applied. if the max attribute is valid and a non-empty value is greater than the maximum allowed by the max attribute, constraint validation will prevent form submission. ...
...ement is greater than this, the element fails constraint validation. this value must be greater than or equal to the value of the min attribute. if the max attribute is present by is not specified or is invalid, no max value is applied. if the max attribute is valid and a non-empty value is greater than the maximum allowed by the max attribute, constraint validation will prevent form submission. 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. ...
...allowed by the max attribute, constraint validation will prevent form submission. 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. if the value exceeds the max value allowed, the validitystate.rangeoverflow will be true, and the the control will be matched by the :out-of-range and :invalid pseudo-classes. 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...
...And 4 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
Web › HTML › Attributes › rel
the type of relationships is given by the value of the rel attribute, which, if present, must have a value that is an unordered set of unique space-separated keywords, which are listed in the following table. every keyword within a space seperated value should be unique within that value. ...
...thers mobile browsers do, to select a webpage icon for web clip or a start-up placeholder. instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively. the shortcut link type is often seen before icon, but this link type is non-conforming, ignored and web authors must not use it anymore. alternate indicates an alternate representation of the current document. valid for link, a, and area, the meaning depends on the values of the other attributes. with the stylesheet keyword on a <link>, it creates an alternate stylesheet. <!-- a persistent style sheet --> <link rel="stylesheet" href="default.css"> <!-- alternate style sheets --> <link rel="alternate stylesheet" href="highcontrast.css" title="high contrast"> with an hreflang attribute that differs...
... author of the entire document. note: the obsolete rev="made" is treated as rel="alternate" bookmark relevant as the rel attribute value for the <a> and <area> elements, the bookmark provides a permalink for ancestor section, which is the nearest ancestor <article> or <section>, if there is at least one, otherwise, the nearest heading sibling or ancestor descendant, to the next.. canonical valid for <link>, it defines the preferred url for the current document, which is useful for search engines. dns-prefetch relevant for the <link> element both in the <body> and <head>, it tells the browser to preemptively perform dns resolution for the target resource's origin. useful for resources the user will likely need, it helps reduce latency and thereby improves performance when the user does ...
...And 4 more matches
HTML attribute: step - HTML: Hypertext Markup Language
Web › HTML › Attributes › step
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 value can must be a positive number - integer or float -- or the special value any, which means no stepping is implied, and any value is allowed (barring other constraints, such as min and max). ...
...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 value can must be a positive number - integer or float -- or the special value any, which means no stepping is implied, and any value is allowed (barring other constraints, such as min and max). ...
...ype="week" min="2019-w23" step="2"> time 60 (seconds) <input type="time" min="09:00" step="900"> datetime-local 1 (day) <input type="datetime-local" min="019-12-25t19:30" step="7"> number 1 <input type="number" min="0" step="0.1" max="10"> range 1 <input type="range" min="0" step="2" max="10"> if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified. for example, if we have <input type="number" min="10" step="2"> any even integer, 10 or great, is valid. if omitted, <input type="number">, any integer is valid, but floats, like 4.2, are not valid, as step def...
...And 4 more matches
<input type="range"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › range
nd treat it as a text input. value a domstring containing the string representation of the selected numeric value; use valueasnumber to get the value as a number. events change and input supported common attributes autocomplete, list, max, min, and step idl attributes list, value, and valueasnumber methods stepdown() and stepup() validation there is no pattern validation available; however, the following forms of automatic validation are performed: if the value is set to something which can't be converted into a valid floating-point number, validation fails because the input is suffering from a bad input. the value won't be less than min. the default is 0. the value won't be greater than max. the default is 100. the valu...
...the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from thi...
...ptions. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. see the range control with hash marks below for an example of how the options on a range are denoted in supported browsers max the greatest value in the range of permitted values. ...
...And 4 more matches
constructor - JavaScript
u don't provide your own constructor, then a default constructor will be supplied for you. ...
... supplied for you. ...
...empty: constructor() {} if your class is a derived class, the default constructor calls the parent constructor, passing along any arguments that were provided: constructor(...args) { super(...args); } that enables code like this to work: class validationerror extends error { printcustomermessage() { return `validation failed :-( (details: ${this.message})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // this is error instead of validationerror! console.log(error.printcustomermessage()); } else { console.log('unknown error', error); throw error; } } the validationerror class doesn't need an explicit constructor, because it doesn't need to do any cust...
...And 4 more matches
Jetpack Processes - Archive of obsolete content
hat even if a process throws it away, it will not be garbage collected unless the other process explicitly does something to indicate that it is no longer needed. if that other process does not do something explicit and simply removes all references to it, the handle remains rooted yet unreachable in both processes and a memory leak is created. ...
...oth processes and a memory leak is created. to prevent such memory leaks, a process can either invalidate a handle, immediately preventing it from being passed as a message argument, or it can unroot the handle, allowing it to be passed as a message argument until all references to it are removed, at which point it is garbage collected. handles have the following native methods and properties: invalidate() invalidates the handle. either process may invalidate a handle when it is no longer useful. createhandle() creates a child handle which becomes invalid when its parent does. ...
...the callback is only called from the process that the handle was not garbage collected in. read-write. ...
...And 3 more matches
Building Mozilla XForms - Archive of obsolete content
during cvs times, the mozilla repository contained both extensions. since the switch to mercurial, the extensions live in separate repositories. before you can start building the xforms extension, you should check your mozilla build environment by doing a regular firefox build. have a look at the build instructions for detailed information for your platform. ...
... for your platform. ...
...firefox 3.5 and up: get the source code if you want to build xforms for firefox ...
...And 3 more matches
Index - Learn web development
ive, urls that's it for links, for now anyway! you'll return to links later on in the course when you start to look at styling them. next up for html, we'll return to text semantics and look at some more advanced/unusual features that you'll find useful — advanced text formatting is your next stop. 233 debugging html beginner, codingscripting, debugging, error, guide, html, validation, validator so there we have it, an introduction to debugging html, which should give you some useful skills to count on when you start to debug css, javascript, and other types of code later on in your career. this also marks the end of the introduction to html module learning articles — now you can go on to testing yourself with our assessments: the first one is linked below. ...
...tool for interacting with users — most commonly they are used for collecting data from users, or allowing them to control a user interface. however, for historical and technical reasons it's not always obvious how to use them to their full potential. in the articles listed below, we'll cover all the essential aspects of web forms including marking up their html structure, styling form controls, validating form data, and submitting data to the server. 309 advanced form styling advanced, css, example, forms, guide, html, web while there are still difficulties using css with html forms, there are ways to get around many of the problems. there are no clean, universal solutions, but modern browsers offer new possibilities. for now, the best solution is to learn more about the ...
...ed, css, forms, guide, html, junk, needsupdate, web the following compatibility tables try to summarize the state of css support for html forms. due to the complexity of css and html forms, these tables can't be considered a perfect reference. however, they will give you good insight into what can and can't be done, which will help you learn how to do things. 312 client-side form validation beginner, example, forms, guide, html, javascript, learn, web, regex client-side form validation sometimes requires javascript if you want to customize styling and error messages, but it always requires you to think carefully about the user. always remember to help your users correct the data they provide. to that end, be sure to: 313 html forms in legacy browsers ex...
...And 3 more matches
Handling common HTML and CSS problems - Learn web development
ready using for a different purpose. to ensure this doesn't happen, you need to research the tools you are using first and design your code around them. it is also worth "namespacing" css, e.g. if you have a widget, make sure it has a distinct class, and then start the selectors that select elements inside the widget with this class, so conflicts are less likely. for example .audio-player ul a. ...
...erent purpose. to ensure this doesn't happen, you need to research the tools you are using first and design your code around them. it is also worth "namespacing" css, e.g. if you have a widget, make sure it has a distinct class, and then start the selectors that select elements inside the widget with this class, so conflicts are less likely. for example .audio-player ul a. ...
...you have a widget, make sure it has a distinct class, and then start the selectors that select elements inside the widget with this class, so conflicts are less likely. for example .audio-player ul a. validation for html, validation involves making sure all your tags are properly closed and nested, you are using a doctype, and you are using tags for their correct purpose. a good strategy is to validate your code regularly. one service that can do this is the w3c markup validation service, which allows you to point to your code, and returns a list of errors: css has a similar story — you need to check that your property names are spelled correctly, property values are spelled correctly and are valid for the properties they are used on, you are not missing any curly braces, and so on. the...
...And 3 more matches
NSPR Error Handling
and macros, see nspr naming conventions. error type prerrorcode error functions pr_seterror pr_seterrortext pr_geterror pr_getoserror pr_geterrortextlength pr_geterrortext error codes error codes defined in prerror.h: pr_out_of_memory_error insufficient memory to perform request. pr_bad_descriptor_error the file descriptor used as an argument in the preceding function is invalid. pr_would_block_error the operation would have blocked, which conflicts with the semantics that have been established. pr_access_fault_error one of the arguments of the preceding function specified an invalid memory address. pr_invalid_method_error the preceding function is invalid for the type of file descriptor used. pr_illegal_access_error one of the arguments of the preceding function...
...k_error the operation would have blocked, which conflicts with the semantics that have been established. pr_access_fault_error one of the arguments of the preceding function specified an invalid memory address. pr_invalid_method_error the preceding function is invalid for the type of file descriptor used. pr_illegal_access_error one of the arguments of the preceding function specified an invalid memory address. pr_unknown_error some unknown error has occurred. pr_pending_interrupt_error the operation terminated because another thread has interrupted it with pr_interrupt. pr_not_implemented_error the preceding function has not been implemented. pr_io_error the preceding i/o function encountered some sort of an error, perhaps an invalid device. pr_io_timeout_error the i/o operati...
... pr_address_not_available_error the network address (prnetaddr) is not available (probably in use). pr_address_not_supported_error the type of network address specified is not supported. ...
...And 3 more matches
Mozilla internal string guide
iting to a mutable string is also simple: /** * replace every tab character in `data` with a space. */ void replacetabs(nsastring& data) { char16_t* cur = data.beginwriting(); char16_t* end = data.endwriting(); for (; cur < end; ++cur) { if (char16_t('\t') == *cur) *cur = char16_t(' '); } } you may change the length of a string via setlength(). note that iterators become invalid after changing the length of a string: /** * replace every tab character in `data` with four spaces. */ void replacetabs2(nsastring& data) { int len = data.length(); char16_t *cur = data.beginwriting(); char16_t *end = data.endwriting(); // because `cur` may change during the loop, track the position // within the string. int pos = 0; while (cur < end) { if (char16_t('\t') ...
...ed to be preserved. it's up to you to skip past it so as to not overwrite it. if there's a need to request a different capacity before you are ready to call finish(), you can call restartbulkwrite() on the handle. it takes three arguments that match the first three arguments of bulkwrite(). it returns mozilla::result<mozilla::ok, nsresult> to indicate success or oom. calling restartbulkwrite() invalidates previously-obtained span, raw pointer or length. once you are done writing, call finish(). it takes two arguments: the new logical length of the string (which must not exceed the capacity retuned by the length() method of the handle) and a boolean indicating whether it's ok to attempt to reallocate a smaller buffer in case a smaller mozjemalloc bucket could accommodate the new logical length...
...sic formats: 8-bit code unit (byte/char) strings, or 16-bit code unit (char16_t) strings. any string class with a capital "c" in the classname contains 8-bit bytes. these classes include nscstring, nsdependentcstring, and so forth. any string class without the "c" contains 16-bit code units. a 8-bit string can be in one of many character encodings while a 16-bit string is always in potentially-invalid utf-16. (you can make a 16-bit string guaranteed-valid utf-16 by passing it to ensureutf16validity().) the most common encodings are: ascii - 7-bit encoding for basic english-only strings. each ascii value is stored in exactly one byte in the array with the most-significant 8th bit set to zero. ucs2 - 16-bit encoding for a subset of unicode, bmp. the unicode value of a character stored in ucs...
...And 3 more matches
IAccessibleAction
); hresult nactions([out,retval] long nactions ); [propget] hresult name([in] long actionindex, [out] bstr name ); methods description() returns a description of the specified action of the object. [propget] hresult description( [in] long actionindex, [out] bstr description ); parameters actionindex 0 based index specifying which action's description to return. if it lies outside the valid range an empty string is returned. description the returned value is a localized string of the specified action. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. doaction() performs the specified action on the object. hresult doaction( [in] long actionindex ); parameters actionindex 0 based index specifying t...
...s_ok. keybinding() returns an array of bstrs describing one or more key bindings, if there are any, associated with the specified action. ...
...s_ok. keybinding() returns an array of bstrs describing one or more key bindings, if there are any, associated with the specified action. the returned strings are the localized human readable key sequences to be used to activate each action, e.g. "ctrl+shift+d". ...
...And 3 more matches
nsILivemarkService
nd of the list. return value returns the id of the folder for the livemark. getfeeduri() this method retrieves the uri of the syndication feed associated with a livemark container. nsiuri getfeeduri( in long long container ); parameters container the folder id of a livemark container. return value a nsiuri representing the uri of the feed; if the livemark container doesn't have a valid feed uri, null will be returned or the nsiuri object returned will be the empty string. exceptions thrown ns_error_invalid_arg if the folder id isn't known or identifies a folder that isn't a livemark container. ns_error_malformed_uri if the site uri annotation has somehow been corrupted (and can't be turned into an nsiuri) getlivemarkidforfeeduri() determines whether the feed uri is a ...
...arameters afeeduri feed uri to look for. return value the id of the livemark. getsiteuri() this method retrieves the uri of the website associated with a livemark container. nsiuri getsiteuri( in long long container ); parameters container the folder id of a livemark container. return value a nsiuri representing the uri of the website; if the livemark container doesn't have a valid site uri, null will be returned. exceptions thrown ns_error_invalid_arg if the folder id isn't known or identifies a folder that isn't a livemark container. ns_error_malformed_uri if the site uri annotation has somehow been corrupted (and can't be turned into an nsiuri) islivemark() this method determines whether the folder with the given folder id identifies a livemark container. bool...
...i annotation has somehow been corrupted (and can't be turned into an nsiuri) islivemark() this method determines whether the folder with the given folder id identifies a livemark container. boolean islivemark( in long long folder ); parameters folder a folder id. return value true if the given folder is a livemark folder, otherwise it returns false. exceptions thrown ns_error_invalid_arg if the folder id isn't known. reloadalllivemarks() this method reloads all livemark subscriptions, whether or not they have expired. void reloadalllivemarks(); parameters none. reloadlivemarkfolder() this method reloads the livemark with this folder id, whether or not it's expired. void reloadlivemarkfolder( in long long folderid ); parameters folderid the id of the folder ...
...And 3 more matches
Constants - Plugins
« previous this section is a reference to the program definitions used by the plug-in api. all program definitions are found in npapi.h. error codes code value description nperr_no_error 0 no errors occurred. nperr_generic_error 1 error with no specific error code occurred. nperr_invalid_instance_error 2 invalid instance passed to the plug-in. nperr_invalid_functable_error 3 function table invalid. nperr_module_load_failed_error 4 loading of plug-in failed. nperr_out_of_memory_error 5 memory allocation failed. nperr_invalid_plugin_error 6 plug-in missing or invalid. nperr_invalid_plugin_dir_error 7 plug-in directory missing or invalid. ...
... nperr_no_data 12 stream contains no data. ...
... nperr_no_data 12 stream contains no data. nperr_stream_not_seekable 13 seekable stream expected. ...
...And 3 more matches
HTMLTimeElement.dateTime - Web APIs
the htmltimeelement.datetime property is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value. ...
... the htmltimeelement.datetime property is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value. ...
...time property is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value. ...
...And 3 more matches
Drag Operations - Web APIs
wed, just like with the 'all' value. so you don't need to adjust this property unless you want to exclude specific types. during a drag operation, a listener for the dragenter or dragover events can check the effectallowed property to see which operations are permitted. a related property, dropeffect, should be set within one of these events to specify which single operation should be performed. valid values for dropeffect are none, copy, move, or link. the combination values are not used for this property. with the dragenter and dragover event, the dropeffect property is initialized to the effect that the user is requesting. the user can modify the desired effect by pressing modifier keys. although the exact keys used vary by platform, typically the shift and control keys would be used to sw...
...s preferred not to cancel the event in this case. within the drop and dragend events, you can check the dropeffect property to determine which effect was ultimately chosen. if the chosen effect were "move", then the original data should be removed from the source of the drag within the dragend event. specifying drop targets a listener for the dragenter and dragover events are used to indicate valid drop targets, that is, places where dragged items may be dropped. most areas of a web page or application are not valid places to drop data. thus, the default handling of these events is not to allow a drop. if you want to allow a drop, you must prevent the default handling by cancelling both the dragenter and dragover events. you can do this either by returning false from attribute-defined even...
...e pointer feedback is sufficient in many cases. however, you can also update the user interface with an insertion point or highlight as needed. for simple highlighting, you can use the :-moz-drag-over css pseudoclass on a drop target. .droparea:-moz-drag-over { outline: 1px solid black; } in this example, the element with the class droparea will receive a 1 pixel black outline while it is a valid drop target, that is, if the preventdefault() method was called during the dragenter event. note: you must cancel the dragenter event for this pseudoclass to apply, as this state is not checked for the dragover event. for more complex visual effects, you can also perform other operations during the dragenter event. for example, by inserting an element at the location where the drop will occur...
...And 3 more matches
MediaConfiguration - Web APIs
the mediaconfiguration mediacapabilities dictionary of the media capabilities api describes how media and audio files must be configured, or defined, to be passed as a parameter of the mediacapabilities.encodinginfo() and mediacapabilities.encodinginfo() methods. properties a valid configuration includes a valid encoding configuration type or decoding configuration type and a valid audio configuration or video configuration. if you plan on querying encoding information, set the media type to record or transmission. ...
...ginfo() methods. properties a valid configuration includes a valid encoding configuration type or decoding configuration type and a valid audio configuration or video configuration. if you plan on querying encoding information, set the media type to record or transmission. for decoding, set the type to file or media-source. if the media is an audio file, the audio configuration must include a valid audio mime type as contenttype, the number of channels, the bitrate, and the sample rate. video configurations mush include a valid video mime type as contenttype, the bitrate, and framerate, along with the width and the height of the video file. all of these must be present, as in the examples below, or a typeerror will occur. ...
...dia is an audio file, the audio configuration must include a valid audio mime type as contenttype, the number of channels, the bitrate, and the sample rate. video configurations mush include a valid video mime type as contenttype, the bitrate, and framerate, along with the width and the height of the video file. all of these must be present, as in the examples below, or a typeerror will occur. a valid media decoding configuration, to be submitted as the parameter for mediacapabilities.decodinginfo() method, has it's `type` set as: file: for plain playback file. media-source: for media source files. a valid media encoding configuration, to be submitted as the parameter for mediacapabilities.encodinginfo() method, has it's `type` set as: record: for recording media. tra...
...And 3 more matches
RTCPeerConnection - Web APIs
ring the creation of an offer or an answer.onidpassertionerror the rtcpeerconnection.onidpassertionerror event handler is a property containing the code to execute whent the idpassertionerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection. ...
...nidpassertionerror the rtcpeerconnection.onidpassertionerror event handler is a property containing the code to execute whent the idpassertionerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection. ...
...y containing the code to execute whent the idpassertionerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection. such an event is sent when the associated identity provider (idp) encounters an error while generating an identity assertion.onidpvalidationerror the rtcpeerconnection.onidpvalidationerror event handler is a property containing the code to execute whent the idpvalidationerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection. ...
...And 3 more matches
WebGL2RenderingContext - Web APIs
er. webgl2renderingcontext.getbuffersubdata() reads data from a buffer and writes them to an arraybuffer or sharedarraybuffer. framebuffers webgl2renderingcontext.blitframebuffer() transfers a block of pixels from the read framebuffer to the draw framebuffer. webgl2renderingcontext.framebuffertexturelayer() attaches a single layer of a texture to a framebuffer. webgl2renderingcontext.invalidateframebuffer() invalidates the contents of attachments in a framebuffer. webgl2renderingcontext.invalidatesubframebuffer() invalidates portions of the contents of attachments in a framebuffer webgl2renderingcontext.readbuffer() selects a color buffer as the source for pixels. renderbuffers webgl2renderingcontext.getinternalformatparameter() returns information about implementation-dep...
...rs to be drawn into. webgl2renderingcontext.clearbuffer[fiuv]() clears buffers from the currently bound framebuffer. query objects methods for working with webglquery objects. webgl2renderingcontext.createquery() creates a new webglquery object. webgl2renderingcontext.deletequery() deletes a given webglquery object. webgl2renderingcontext.isquery() returns true if a given object is a valid webglquery object. webgl2renderingcontext.beginquery() begins an asynchronous query. webgl2renderingcontext.endquery() marks the end of an asynchronous query. webgl2renderingcontext.getquery() returns a webglquery object for a given target. webgl2renderingcontext.getqueryparameter() returns information about a query. sampler objects webgl2renderingcontext.createsampler() creates a n...
...ringcontext.getqueryparameter() returns information about a query. sampler objects webgl2renderingcontext.createsampler() creates a new webglsampler object. webgl2renderingcontext.deletesampler() deletes a given webglsampler object. webgl2renderingcontext.bindsampler() binds a given webglsampler to a texture unit. ...
...And 3 more matches
WebGLRenderingContext - Web APIs
. webglrenderingcontext.buffersubdata() updates buffer data starting at a passed offset. webglrenderingcontext.createbuffer() creates a webglbuffer object. webglrenderingcontext.deletebuffer() deletes a webglbuffer object. webglrenderingcontext.getbufferparameter() returns information about the buffer. webglrenderingcontext.isbuffer() returns a boolean indicating if the passed buffer is valid. framebuffers webglrenderingcontext.bindframebuffer() binds a webglframebuffer object to a given target. webglrenderingcontext.checkframebufferstatus() returns the status of the framebuffer. webglrenderingcontext.createframebuffer() creates a webglframebuffer object. webglrenderingcontext.deleteframebuffer() deletes a webglframebuffer object. webglrenderingcontext.framebufferrenderbu...
...enderbuffer() attaches a webglrenderingbuffer object to a webglframebuffer object. webglrenderingcontext.framebuffertexture2d() attaches a textures image to a webglframebuffer object. webglrenderingcontext.getframebufferattachmentparameter() returns information about the framebuffer. webglrenderingcontext.isframebuffer() returns a boolean indicating if the passed webglframebuffer object is valid. webglrenderingcontext.readpixels() reads a block of pixels from the webglframebuffer. renderbuffers webglrenderingcontext.bindrenderbuffer() binds a webglrenderbuffer object to a given target. webglrenderingcontext.createrenderbuffer() creates a webglrenderbuffer object. webglrenderingcontext.deleterenderbuffer() deletes a webglrenderbuffer object. webglrenderingcontext.getrenderbuf...
...erbuffer object to a given target. webglrenderingcontext.createrenderbuffer() creates a webglrenderbuffer object. webglrenderingcontext.deleterenderbuffer() deletes a webglrenderbuffer object. webglrenderingcontext.getrenderbufferparameter() returns information about the renderbuffer. webglrenderingcontext.isrenderbuffer() returns a boolean indicating if the passed webglrenderingbuffer is valid. webglrenderingcontext.renderbufferstorage() creates a renderbuffer data store. textures webglrenderingcontext.bindtexture() binds a webgltexture object to a given target. webglrenderingcontext.compressedteximage2d() specifies a 2d texture image in a compressed format. webglrenderingcontext.compressedtexsubimage2d() specifies a 2d texture sub-image in a compressed format. webglrender...
...And 3 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
the setinterval() method, offered on the window and worker interfaces, repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. it returns an interval id which uniquely identifies the interval, so you can remove it later by calling clearinterval(). this method is defined by the windoworworkerglobalscope mixin. syntax var intervalid = scope.setinterval(func, [delay, arg1, arg2, ...]); var intervalid = scope.setinterval(function[, delay]); var intervalid = scope.setinterval(code, [delay]); parameters func a function to be executed every delay milliseconds. the function is not passed any arguments, and no return value is expected. code an optional syntax allows you to include a string instead of a function, which is compiled and executed every d...
..., argn optional additional arguments which are passed through to the function specified by func once the timer expires. note: passing additional arguments to setinterval() in the first syntax does not work in internet explorer 9 and earlier. if you want to enable this functionality on that browser, you must use a polyfill (see the callback arguments section). return value the returned intervalid is a numeric, non-zero value which identifies the timer created by the call to setinterval(); this value can be passed to windoworworkerglobalscope.clearinterval() to cancel the timeout. it may be helpful to be aware that setinterval() and settimeout() share the same pool of ids, and that clearinterval() and cleartimeout() can technically be used interchangeably. for clarity, however, you should...
...nterchangeably. for clarity, however, you should try to always match them to avoid confusion when maintaining your code. note: the delay argument is converted to a signed 32-bit integer. this effectively limits delay to 2147483647 ms, since it's specified as a signed integer in the idl. examples example 1: basic syntax the following example demonstrates setinterval()'s basic syntax. var intervalid = window.setinterval(mycallback, 500, 'parameter 1', 'parameter 2'); function mycallback(a, b) { // your code here // parameters are purely optional. console.log(a); console.log(b); } example 2: alternating two colors the following example calls the flashtext() function once a second until the stop button is pressed. <!doctype html> <html> <head> <meta charset="utf-8" /> <title>setin...
...And 3 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
here is a an example javascript function that prints the security details of an xmlhttprequest sent over ssl. the function is passed the channel property of an xmlhttprequest to extract the following information: was the connection secure? was the used ssl certificate valid and what are its details (owner, expiration, certificate authority, etc.)? notes: this code requires elevated privileges to run; you can only call it from a browser extension or from a xulrunner application. the channel property becomes available only after the request is sent and the connection was established, that is, on readystate loaded, interactive or completed. by setting the mozbackgroundrequest property of the request object and modifying the example appropriately, you can create your own alert dialo...
...ertificateerror'; break; // per bsmith, we will be unable to tell these errors apart very soon, // so it makes sense to just folder them all together already. ...
...ueryinterface(ci.nsisslstatusprovider) .sslstatus.queryinterface(ci.nsisslstatus).servercert; dump("\tcommon name (cn) = " + cert.commonname + "\n"); dump("\tissuer = " + cert.issuerorganization + "\n"); dump("\torganisation = " + cert.organization + "\n"); dump("\tsha1 fingerprint = " + cert.sha1fingerprint + "\n"); var validity = cert.validity.queryinterface(ci.nsix509certvalidity); dump("\tvalid from " + validity.notbeforegmt + "\n"); dump("\tvalid until " + validity.notaftergmt + "\n"); } } catch(err) { alert(err); } } function test(url) { var req = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('get', url, true); req.addeventlistener("error", function(e)...
...And 3 more matches
system - CSS: Cascading Style Sheets
ends along with a @counter-style name. cyclic cycles through the list of symbols provided. once the end of the list of symbols is reached, it will loop back to the beginning and start over. this system is useful for simple bullet styles with just one symbol, or for styles having multiple symbols. at least one symbol must be specified in the symbols descriptor, or the counter style is not valid. fixed defines a finite set of symbols are specified. once the system has looped through all the specified symbols, it will fall back. this system is useful in cases where the counter values are finite. at least one symbol must be specified in the symbols descriptor or the counter style is not valid. also an optional <integer> can be specified after the the system, as the value of the first sym...
...of symbols. on each successive pass through the cycle, the symbols used for the counter representation are doubled, tripled, and so on. for example, if the original symbols provided were "◽" and "◾", on each successive pass, they will become "◽◽" and "◾◾", "◽◽◽" and "◾◾◾" and so on. at least one symbol must be specified in the symbols descriptor or the counter style is not valid. this counter system works for positive counter values only. alphabetic interprets the specified symbols as digits, to an alphabetic numbering system. if the characters "a" to "z" are specified as symbols in a counter style, with the alphabetic system, then the first 26 counter representations will be "a", "b" upto "z". until this point, the behavior is the same as that of the symbolic system, ...
...acters "a" to "z" are specified as symbols in a counter style, with the alphabetic system, then the first 26 counter representations will be "a", "b" upto "z". until this point, the behavior is the same as that of the symbolic system, described above. however, after "z", it will continue as "aa", "ab", "ac"… the symbols descriptor must contain at least two symbols or the counter style is not valid. the first counter symbol provided in the symbols descriptor is interpreted as 1, the next as 2, and so on. this system is also defined strictly over positive counter values. numeric interprets the counter symbols as digits in a place-value numbering system. the numeric system is similar to the alphabetic system, described above. the main difference is that in the alphabetic system, the first c...
...And 3 more matches
transition-duration - CSS: Cascading Style Sheets
you may specify multiple durations; each duration will be applied to the corresponding property as specified by the transition-property property, which acts as a master list. if there are fewer durations specified than in the master list, the user agent repeat the list of durations. if there are more durations, the list is simply truncated to the right size. in both case the css declaration stays valid. syntax /* <time> values */ transition-duration: 6s; transition-duration: 120ms; transition-duration: 1s, 15s; transition-duration: 10s, 30s, 230ms; /* global values */ transition-duration: inherit; transition-duration: initial; transition-duration: unset; values <time> is a <time> denoting the amount of time the transition from the old value of a property to the new value should take. a...
...ansition-duration: inherit; transition-duration: initial; transition-duration: unset; values <time> is a <time> denoting the amount of time the transition from the old value of a property to the new value should take. a time of 0s indicates that no transition will happen, that is the switch between the two states will be instantaneous. a negative value for the time renders the declaration invalid. formal definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples transition-duration: 0.5s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; ...
...operty: width height background-color font-size left top transform -webkit-transformv color; transition-duration:0.5s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 1s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size ...
...And 3 more matches
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
controlling whether a textarea is resizable in most browsers, <textarea>s are resizable — you'll notice the drag handle in the right hand corner, which can be used to alter the size of the element on the page. ...
... whether a textarea is resizable in most browsers, <textarea>s are resizable — you'll notice the drag handle in the right hand corner, which can be used to alter the size of the element on the page. ...
...tarea is resizable in most browsers, <textarea>s are resizable — you'll notice the drag handle in the right hand corner, which can be used to alter the size of the element on the page. ...
...And 3 more matches
Expressions and operators - JavaScript
of the above expressions is not evaluated, so any side effects of doing so do not take effect. note that for the second case, in modern code you can use the new nullish coalescing operator (??) that works like ||, but it only returns the second expression, when the first one is "nullish", i.e. null or undefined. it is thus the better alternative to provide defaults, when values like '' or 0 are valid values for the first expression, too. string operators in addition to the comparison operators, which can be used on string values, the concatenation operator (+) concatenates two string values together, returning another string that is the union of the two operand strings. for example, console.log('my ' + 'string'); // console logs the string "my string". the shorthand assignment operator +...
... bitwise-xor ^ bitwise-or | logical-and && logical-or || conditional ?: assignment = += -= *= /= %= <<= >>= >>>= &= ^= |= &&= ||= ??= comma , a more detailed version of this table, complete with links to additional details about each operator, may be found in javascript reference. expressions an expression is any valid unit of code that resolves to a value. every syntactically valid expression resolves to some value but conceptually, there are two types of expressions: with side effects (for example: those that assign value to a variable) and those that in some sense evaluate and therefore resolve to a value. the expression x = 7 is an example of the first type. this expression uses the = operator to assign t...
...t. left-hand-side expressions: left values are the destination of an assignment. primary expressions basic keywords and general expressions in javascript. this use the this keyword to refer to the current object. in general, this refers to the calling object in a method. ...
...And 3 more matches
JavaScript error reference - JavaScript
. list of errors in this list, each page is listed by name (the type of error) and message (a more detailed human-readable error message). together, these two properties provide a starting point toward understanding and resolving the error. ...
...t, each page is listed by name (the type of error) and message (a more detailed human-readable error message). together, these two properties provide a starting point toward understanding and resolving the error. ...
...the type of error) and message (a more detailed human-readable error message). together, these two properties provide a starting point toward understanding and resolving the error. ...
...And 3 more matches
begin - SVG: Scalable Vector Graphics
Web › SVG › Attribute › begin
value <begin-value-list> default value 0s animatable no the <begin-value-list> is a semicolon-separated list of values. each value can be one of the following: <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event). negative values are valid. ...
... <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event). negative values are valid. <syncbase-value> this value defines a syncbase and an optional offset from that syncbase. the element's animation start time is defined relative to the begin or active end of another animation. a valid syncbase-value consists of an id reference to another animation element followed by a dot and either begin or end to identify whether to synchronize with the beginning or active end of the referenced animation element. an optional offset value as defined in <offset-value> can be appended. <event-value> this value defines an event and an optional offset that determines the time at which the elem...
...y whether to synchronize with the beginning or active end of the referenced animation element. an optional offset value as defined in <offset-value> can be appended. <event-value> this value defines an event and an optional offset that determines the time at which the element's animation should begin. the animation start time is defined relative to the time that the specified event is fired. a valid event-value consists of an element id followed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, k...
...And 3 more matches
Space Manager Detailed Design - Archive of obsolete content
nsresult addrectregion(nsiframe* aframe, const nsrect& aunavailablespace); /** * resize the rectangular region associated with aframe by the specified * deltas. the height change always applies to the bottom edge or the existing * rect. you specify whether the width change applies to the left or right edge * * returns ns_ok if successful, ns_error_invalid_arg if there is no region * tagged with aframe */ enum affectededge {leftedge, rightedge}; nsresult resizerectregion(nsiframe* aframe, nscoord adeltawidth, nscoord adeltaheight, affectededge aedge = rightedge); /** * offset the region associated with aframe by the specified amount. ...
...ame */ enum affectededge {leftedge, rightedge}; nsresult resizerectregion(nsiframe* aframe, nscoord adeltawidth, nscoord adeltaheight, affectededge aedge = rightedge); /** * offset the region associated with aframe by the specified amount. ...
... affectededge aedge = rightedge); /** * offset the region associated with aframe by the specified amount. * * returns ns_ok if successful, ns_error_invalid_arg if there is no region * tagged with aframe */ nsresult offsetregion(nsiframe* aframe, nscoord dx, nscoord dy); /** * remove the region associated with afrane. * * returns ns_ok if successful and ns_error_invalid_arg if there is no region * tagged with aframe */ nsresult removeregion(nsiframe* aframe); /** * clears the list of regions representing the unavailable space. */ void clearregions(); /** * methods for dealing with the propagation of float damage during * reflow. */ prbool hasfloatdamage() { return !mfloatdamage.isempty(); } void includeindamage(nscoord...
...And 2 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
other code or by itself, or a variable that refers to the function. when a function is called, arguments are passed to the function as input, and the function can optionally return a value. a function in javascript is also an object. 162 fuzz testing firefox, fuzzing, mozilla, qa, security, testing fuzzing is a technique for testing software using automated tools to provide invalid or unexpected input to a program or function in a program, then checking the results to see if the program crashes or otherwise acts inappropriately. this is an important way to ensure that software is stable, reliable, and secure, and we use fuzzing a lot at mozilla. 163 gif composing, glossary gif (graphics interchange format) is an image format that uses lossless compressi...
...as non-normative or informative, which means those are provided there for the purpose of helping the reader understand the specifications better or to showcase an example or best practice, which need not be followed as a rule. 292 null codingscripting, glossary in computer science, a null value represents a reference that points, generally intentionally, to a nonexistent or invalid object or address. the meaning of a null reference varies among language implementations. 293 nullish value glossary, javascript, null, primitive, undefined in javascript, a nullish value is the value which is either null or undefined. nullish values are always falsy. 294 number codingscripting, glossary, javascript in javascript, number is a numeric data...
... when different content is to be shown. 392 sql codingscripting, database, glossary, sql sql (structured query language) is a descriptive computer language designed for updating, retrieving, and calculating data in table-based databases. 393 sql injection glossary, security, sql, sql injection, webapp sql injection takes advantage of web apps that fail to validate user input. hackers can maliciously pass sql commands through the web app for execution by a backend database. 394 sri csp, security subresource integrity (sri) is a security feature that enables browsers to verify that files they fetch (for example, from a cdn) are delivered without unexpected manipulation. it works by allowing you to provide a cryptographic hash that a f...
...And 2 more matches
Sending form data - Learn web development
prerequisites: basic computer literacy, an understanding of html, and basic knowledge of http and server-side programming. ...
... prerequisites: basic computer literacy, an understanding of html, and basic knowledge of http and server-side programming. ...
...ming first steps module. on the client side: defining how to send the data the <form> element defines how the data will be sent. all of its attributes are designed to let you configure the request to be sent when a user hits a submit button. the two most important attributes are action and method. the action attribute the action attribute defines where the data gets sent. its value must be a valid relative or absolute url. if this attribute isn't provided, the data will be sent to the url of the page containing the form — the current page. in this example, the data is sent to an absolute url — https://example.com: <form action="https://example.com"> here, we use a relative url — the data is sent to a different url on the same origin: <form action="/somewhere_else"> when specifie...
...And 2 more matches
Web forms — Working with user data - Learn web development
tool for interacting with users — most commonly they are used for collecting data from users, or allowing them to control a user interface. however, for historical and technical reasons it's not always obvious how to use them to their full potential. in the articles listed below, we'll cover all the essential aspects of web forms including marking up their html structure, styling form controls, validating form data, and submitting data to the server. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites before starting this module, you should at least work through our introduction to html. at this point you should find the introductory guides easy to understan...
...ould at least work through our introduction to html. at this point you should find the introductory guides easy to understand, and also be able to make use of our basic native form controls guide. mastering forms however requires more than just html knowledge — you also need to learn some specific techniques to style form controls, and some scripting knowledge is required to handle things like validation and creating custom form controls. therefore, before you look at the other sections listed below we'd recommend that you go away and learn some css and javascript first. the above text is a good indicator as to why we've put web forms into its own standalone module, rather than trying to mix bits of it into the html, css, and javascript topic areas — form elements are more complex than mo...
... with css, including all the basics you might need to know for basic styling tasks. advanced form styling here we look at some more advanced form styling techniques that need to be used when trying to deal with some of the more difficult-to-style form elements. ui pseudo-classes an introduction to the ui pseudo-classes enabling html form controls to be targeted based on their current state. ...
...And 2 more matches
Debugging HTML - Learn web development
he incorrect nesting has been fixed by the browser as shown here: <strong>strong <em>strong emphasised?</em> </strong> <em> what is this?</em> the link with the missing double quote has been deleted altogether. the last list item looks like this: <li> <strong>unclosed attributes: another common source of html problems. ...
...'s look at an example: </strong> </li> html validation so you can see from the above example that you really want to make sure your html is well-formed! ...
...ent? the best strategy is to start by running your html page through the markup validation service — created and maintained by the w3c, the organization that looks after the specifications that define html, css, and other web technologies. 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. active learning: validating an html document let's try this with our sample document. first, load the markup validation service in one browser tab, if it isn't already open. switch to the validate by direct input tab. copy all of the sample document's code (not just the body) and paste it into the lar...
...And 2 more matches
Working with JSON - Learn web development
note: we've made the json seen above available inside a variable in our jsontest.html example (see the source code). try loading this up and then accessing data inside the variable via your browser's javascript console. arrays as json above we mentioned that json text basically looks like a javascript object, and this is mostly right. ...
... even a single misplaced comma or colon can cause a json file to go wrong,...
...esistance", "superhuman reflexes" ] } ] the above is perfectly valid json. you'd just have to access array items (in its parsed version) by starting with an array index, for example [0]["powers"][0]. other notes json is purely a data format — it contains only properties, no methods. json requires double quotes to be used around strings and property names. single quotes are not valid. even a single misplaced comma or colon can cause a json file to go wrong, and not work. you should be careful to validate any data you are attempting to use (although computer-generated json is less likely to include errors, as long as the generator program is working correctly). you can validate json using an application like jsonlint. json can actually take the form of any data type that is ...
...And 2 more matches
Links and Resources
ulations on these guidelines. wai interest group - discussion list for standards in web accessibility. web accessibility checklist from ibm. ibm's java accessibility checklist - guidelines to making java accessibility. accessibility information resource center for developers at adobe - flash mx accessibility, pdf document accessibility and actionscript accessibility. online accessibility validators there are now a few available and excellent online accessibility validators which check single webpages according to checkpoints of wcag guidelines and then reports errors or warnings. webxact™ from watchfire® corporation webxact™ is a free and complete online accessibility validation service that can test single pages for quality, accessibility and privacy issues. the accessibil...
...quality, accessibility and privacy issues. the accessibility report will contain errors and warnings for "automatic checkpoints" and "manual checkpoints"; detailed and useful information (line numbers, instances/occurences, textual references to guidelines) will be included for web authors. cynthia says™ from hisoftware® company "cynthia says™" is a free online webpage accessibility validation service that identifies accessibility errors in webpage related to section 508 standards and/or the wcag guidelines. just like webxact, it can also perform a "complete webpage quality check" for accessibility, privacy, searchability, metadata and even alt text attribute quality. accessibility valet from webthing description and summary to be written. wave 3.0 (web accessibility...
...te webpage quality check" for accessibility, privacy, searchability, metadata and even alt text attribute quality. accessibility valet from webthing description and summary to be written. wave 3.0 (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 3.0 is another powerful, mature, free online webpage accessibility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines. html advanced validator (firefox extension) by marc gueury this advanced html validator (based on w3c tidy and on opensp for sgml validation - just like w3c html validator) is a free, powerful, versatile, extended html validator. ...
...And 2 more matches
What to do and what not to do in Bugzilla
the reporter should be directed to the product's support page for help diagnosing the issue. if there are only a few comments in the bug, it may be reopened only if the original reporter provides more info, or confirms someone else's steps to reproduce. if the bug is long, when enough info is provided a new bug should be filed and the original bug marked as a duplicate of it. ...
...e product's support page for help diagnosing the issue. if there are only a few comments in the bug, it may be reopened only if the original reporter provides more info, or confirms someone else's steps to reproduce. if the bug is long, when enough info is provided a new bug should be filed and the original bug marked as a duplicate of it. ...
... should be filed and the original bug marked as a duplicate of it. resolving bugs as invalid you should resolve a bug as invalid if the issue described in the bug is clearly not a mozilla bug or if the issue is intended behavior. the exceptions are bugs in other software which we have to work around and bugs that involve certain core gecko modules. bugs covered by this exception should not be invalidated by anyone other than the module owner or module peer; for bugs involving modules like layout or content, attach a test case to the bug and then cc one of the owners or peers. reports of problems with specific websites that result from bad coding practices already determined to be “tech evangelism” cases by the module owner or peer, or problems that result from the use of proprietary techn...
...And 2 more matches
An overview of NSS Internals
bi module and the user hasn't made any overriding trust decisions, or it can be found in a nss database file managed by the user or by the local environment). after having successfully verified the signatures in a (chain of) issuer certificate(s), we're still not done with verifying the certificate a. in a pki it's suggested/required to perform additional checks. ...
... nss has multiple apis to perform verification of certificates. there is a classic engine that is very stable and wor...
...sks the issuer(s) of the certificates whether there have been events that made it necessary to revoke the trust (revoke the validity of the cert). trust anchors contained in the ckbi module are usually self signed, which is defined as having identical subject name and issuer name fields. if a self-signed certificate is marked as explicitly trusted, nss will skip checking the self-signature for validity. nss has multiple apis to perform verification of certificates. there is a classic engine that is very stable and works fine in all simple scenarios, for example if all (b) candidate issuer certificates have the same subject and issuer names and differ by validity period; however, it works only in a limited amount of more advanced scenarios. unfortunately, the world of certificates has beco...
...And 2 more matches
Certificate functions
and later cert_addokdomainname mxr 3.4 and later cert_addrdn mxr 3.2.1 and later cert_asciitoname mxr 3.2 and later cert_cachecrl mxr 3.10 and later cert_clearocspcache mxr 3.11.7 and later cert_certchainfromcert mxr 3.2 and later cert_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr 3.3 and later cert_comparename mxr 3.2 and later cert_comparevaliditytimes mxr 3.11 and later cert_completecrldecodeentries mxr ...
...rt_createcertificate mxr 3.5 and later cert_createcertificaterequest mxr 3.2 and later cert_createname mxr 3.2.1 and later cert_createocspcertid mxr 3.6 and later cert_createocsprequest mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 and later cert_decodealtnameextension mxr 3.10 and later cert_decodeauthinfoaccessextension mxr 3.10 and later cert_decodeauthkeyid mxr 3.10 and later cert_decodeavavalue mxr 3.4 and later cert_decodebasicconstraintvalue mxr 3.2 and later ...
...ert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocspcertid mxr 3.6 and later cert_destroyocsprequest mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_dupcertificate mxr 3.2 and later cert_dupcertlist mxr 3.2 and later cert_enableocspchecking mxr 3.2 and later cert_encodealtnameextension mxr 3.7 and later cert_encodeandaddbitstrextension mxr 3.5 and later cert_encodeauthkeyid mxr 3.5 and later cert_encodebasicconstr...
...And 2 more matches
Python binding for NSS
sslchannelinfo.expiration_time_utc sslchannelinfo.compression_method sslchannelinfo.compression_method_name sslchannelinfo.session_id the following files were added: doc/examples/cert_trust.py doc/examples/ssl_version_range.py the following constants were added: nss.certdb_terminal_record nss.certdb_valid_peer nss.certdb_trusted nss.certdb_send_warn nss.certdb_valid_ca nss.certdb_trusted_ca nss.certdb_ns_trusted_ca nss.certdb_user nss.certdb_trusted_client_ca nss.certdb_govt_approved_ca ssl.srtp_aes128_cm_hmac_sha1_32 ssl.srtp_aes128_cm_hmac_sha1_80 ssl.srtp_null_hmac_sha1_32 ssl.srtp_null_hmac_sha1_80 ssl.s...
...eprecated getopt and optparse. some command line args were tweaked. release 0.14.0 release date 2013-05-10 scm tag pynss_release_0_14_0 source download https://ftp.mozilla.org/pub/mozilla.org/security/python-nss/releases/pynss_release_0_14_0/src/ change log the primary enhancements in this version is support of certifcate validation, ocsp support, and support for the certificate "authority information access" extension. enhanced certifcate validation including ca certs can be done via certificate.verify() or certificate.is_ca_cert(). when cert validation fails you can now obtain diagnostic information as to why the cert failed to validate. this is encapsulated in the certverifylog class which is a iterable collecti...
... ca certs can be done via certificate.verify() or certificate.is_ca_cert(). when cert validation fails you can now obtain diagnostic information as to why the cert failed to validate. this is encapsulated in the certverifylog class which is a iterable collection of certverifylognode objects. most people will probablby just print the string representation of the returned certverifylog object. cert validation logging is handled by the certificate.verify() method. support has also been added for the various key usage and cert type entities which feature prominently during cert validation. certificate() constructor signature changed from certificate(data=none, der_is_signed=true) to certificate(data, certdb=cert_get_default_certdb(), perm=false, nickname=none)...
...And 2 more matches
sslcrt.html
guide. if you are inclined to help with this migration, your help would be very much appreciated. upgraded documentation may be found in the current nss reference certificate functions chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator. validating certificates manipulating certificates getting certificate information comparing secitem objects validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_cmpcertchainwcanames cert_verifycertnow checks that the current date is within the certificate's validity period and that the ca signature on the certificate is valid. syntax #inclu...
...hat needs to be escaped in this is ], all others are not special. [a-z] matches any character between a and z [^az] matches any character except a or z ~ followed by another shell expression removes any pattern matching the shell expression from the match list (foo|bar) matches either the substring foo or the substring bar. these can be shell expressions as well. ...
...a-z] matches any character between a and z [^az] matches any character except a or z ~ followed by another shell expression removes any pattern matching the shell expression from the match list (foo|bar) matches either the substring foo or the substring bar. these can be shell expressions as well. cert_checkcertvalidtimes checks whether a specified time is within a certificate's validity period. syntax #include <cert.h> #include <certt.h> seccerttimevalidity cert_checkcertvalidtimes( certcertificate *cert, int64 t); parameters this function has the following parameters: cert a pointer to the certificate whose validity period you want to check against. t the tim...
...And 2 more matches
Creating the Component Code
xpcom api reference. the first parameter of the call to createinstance specifies the component the client code is looking for, which is the same value passed to registerfactorylocation. the next parameter is for aggregation, which the weblock component does not support. the third parameter is the interface used to talk to the component. the last parameter is the out variable which will contain a valid object if and only if the method succeeds[non-null-out]. the implementation of createinstance will ensure that the result will support the passed iid, kisupportsiid. the type of the variable sample should match the iid passed in as kisupportsiid. when createinstance is called, xpcom looks through all registered components to find a match for the given cid. xpcom then loads the component library ...
...by the concrete base class, for example, then when you go to add a new supported interface you add this iid comparison in both the factory and the queryinterface implementation in the concrete class. ...
...thodimp_(nsrefcnt) samplefactory::addref() { return ++mrefcnt; } ns_imethodimp_(nsrefcnt) samplefactory::release() { if (--mrefcnt == 0) { delete this; return 0; } return mrefcnt; } ns_imethodimp samplefactory::createinstance(nsisupports *aouter, const nsiid & iid, void * *result) { if (!result) return ns_error_invalid_arg; sample* sample = new sample(); if (!sample) return ns_error_out_of_memory; nsresult rv = sample->queryinterface(iid, result); if (ns_failed(rv)) { *result = nsnull; delete sample; } return rv; } ns_imethodimp samplefactory::lockfactory(prbool lock) { return ns_error_not_implemented; } // module implementation class samplemodule : public nsimodule { pub...
...And 2 more matches
IAccessible2
ositioningroup ); parameters grouplevel 1 based, 0 indicates that this value is not applicable. similaritemsingroup 1 based, 0 indicates that this value is not applicable. positioningroup 1 based, 0 indicates that this value is not applicable. this is an index into the objects in the current group, not an index into all the objects at the same group level. return value s_false if no values are valid. s_ok if at least one value is valid. indexinparent() returns the index of this object in its parent object. [propget] hresult indexinparent( [out] long indexinparent ); parameters indexinparent 0 based; -1 indicates there is no parent; the upper bound is the value returned by the parent's iaccessible::get_accchildcount. return value s_false if no parent, [out] value is -1. s_ok. locale() re...
...s_ok. nrelations() returns the number of accessible relations for this object. [propget] hresult nrelations( [out] long nrelations ); parameters nrelations return value s_ok. relation() returns one accessible relation for this object. [propget] hresult relation( [in] long relationindex, [out] iaccessiblerelation relation ); parameters relationindex 0 based. relation return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. relations() returns multiple accessible relations for this object. [propget] hresult relations( [in] long maxrelations, [out, size_is(maxrelations), length_is( nrelations)] iaccessiblerelation relations, [out] long nrelations ); parameters maxrelations maximum size of the array allocated by the client. relations the array of accessible rel...
... nrelations() is set to 0. s_ok. role() returns the role of an iaccessible2 object. hresult role( [out] long role ); parameters role the role of an iaccessible2 object. return value s_ok. scrollto() makes an object visible on the screen. hresult scrollto( [in] enum ia2scrolltype scrolltype ); parameters scrolltype defines where the object should be placed on the screen. ...
...And 2 more matches
nsICache
want to write into the cache, make me a new entry and doom the old one, if any. access granted - you must write to this descriptor because the cache entry was just created for you. access_read_write 3 access requested - i want to read, but i'm willing to update an existing entry if necessary, or create a new one if none exists. access granted - you can read the descriptor to determine if it's valid, you may write if it needs updating. store_anywhere 0 the storage policy of a cache entry determines the device(s) to which it belongs. see nsicachesession and nsicacheentrydescriptor for more details. allows the cache entry to be stored in any device. the cache service decides which cache device to use based on "some resource management calculation." store_in_memory 1 the storage policy of...
...tream based entry when calling nsicacheservice.createsession() method. stream_based 1 all entries for a cache session are stored as streams of data or as objects. this constant specify that cache session is a stream based entry when calling nsicacheservice.createsession() method. non_blocking 0 the synchronous opencacheentry() may be blocking or non-blocking. if a cache entry is waiting to be validated by another cache descriptor (so no new cache descriptors for that key can be created), opencacheentry() will return ns_error_cache_wait_for_validation in non-blocking mode. if the cache entry is validated, then a descriptor for that entry will be created and returned. if the cache entry was doomed, then a descriptor will be created for a new cache entry for the key. blocking 1 the synchrono...
...if the cache entry was doomed, then a descriptor will be created for a new cache entry for the key. note: if you think that you might need to modify cached data or meta data, then you must open a cache entry requesting write access. ...
...And 2 more matches
nsIEffectiveTLDService
in name parts. acstring getbasedomain( in nsiuri auri, [optional] in pruint32 aadditionalparts ); parameters auri the uri to be analyzed. aadditionalparts the number of domain name parts to be returned in addition to the public suffix. return value an acstring containing the base domain (public suffix plus the requested number of additional parts). exceptions thrown ns_error_invalid_arg this exception is thrown if the hostname in auri is empty. ns_error_insufficient_domain_levels this exception is thrown if there were insufficient subdomain levels in the hostname to satisfy the requested aadditionalparts value. ns_error_host_is_ip_address this exception is thrown if auri is a numeric ipv4 or ipv6 address. ns_error_unexpected or other error returned by nsiidnservice.no...
...sedomainfromhost( in autf8string ahost, in pruint32 aadditionalparts optional ); parameters ahost the host string to be analyzed. aadditionalparts optional the number of domain name parts to be returned in addition to the public suffix. return value an acstring containing the base domain (public suffix plus the requested number of additional parts). exceptions thrown ns_error_invalid_arg this exception is thrown if ahost is empty. ns_error_unexpected this exception originates in the normalize() method in nsiidnservice and is thrown when ahost contains characters disallowed in uris. ns_error_insufficient_domain_levels this exception is thrown if there were insufficient subdomain levels in the hostname to satisfy the requested aadditionalparts value. ns_error_host_is_ip_a...
...sufficient subdomain levels in the hostname to satisfy the requested aadditionalparts value. ns_error_host_is_ip_address this exception is thrown if ahost is a numeric ipv4 or ipv6 address. remarks note: prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), this method worked if you passed host strings starting with a period ("."). that is no longer the case, since these are not valid host names. you should strip leading periods off host names before passing them to this method. getpublicsuffix() returns the public suffix of a uri. a public suffix is the highest-level domain under which individual domains may be registered; it may therefore contain one or more dots. for example, the public suffix for www.bbc.co.uk is co.uk. likewise, the public suffix for developer.mozilla.
...And 2 more matches
nsIHttpServer
_null_pointer * if callback is null * @throws ns_error_unexpected * if this server is not running */ void stop(in nsihttpserverstoppedcallback callback); /** * associates the local file represented by the string file with all requests * which match request. * * @param path * the path which is to be mapped to the given file; must begin with "/" and * be a valid uri path (i.e., no query string, hash reference, etc.) * @param file * the file to serve for the given path, or null to remove any mapping that * might exist; this file must exist for the lifetime of the server */ void registerfile(in string path, in nsifile file); /** * registers a custom path handler. * * @param path * the path on the server (beginning with a ...
... * * @param prefix * the path on the server (beginning and ending with "/") which is to be * handled by handler; this path must not include a query string or hash * component. all requests that start wit...
...ponent. all requests that start with this prefix will be directed to * the given handler. * @param handler * an object which will handle any requests for the given path, or null to * remove any existing handler; if while the server is running the handler * throws an exception while responding to a request, an http 500 response * will be returned * @throws ns_error_invalid_arg * if path does not begin with a "/" or does not end with a "/" */ void registerprefixhandler(in string prefix, in nsihttprequesthandler handler); /** * registers a custom error page handler. * * @param code * the error code which is to be handled by handler * @param handler * an object which will handle any requests which generate the given status * cod...
...And 2 more matches
nsIScriptableIO
location, in astring afilename ); parameters alocation a location key identifying a known standard directory. the afilename parameter is treated as being local to this directory. afilename the relative path of the file to generate a reference for. return value returns an nsifile object referencing the specified file location. exceptions thrown ns_error_invalid_arg alocation was null. getfilewithpath() returns a file reference using an absolute file path to locate the file. note: you should avoid using this method, since file paths are platform-dependent and non-portable. instead, you should use getfile() and construct the path from the base location manually. nsifile getfilewithpath( in astring afilepath ); parameters afilepath ...
...able. instead, you should use getfile() and construct the path from the base location manually. nsifile getfilewithpath( in astring afilepath ); parameters afilepath the absolute pathname of the file to reference, or the value of a file's persistentdescriptor. return value returns an nsifile object referencing the specified file location. exceptions thrown ns_error_invalid_arg afilepath was null. newuri() creates a uri object that implements the nsiuri interface. nsiuri newuri( in nsivariant auri ); parameters auri the file for which to create a new nsiuri object. this parameter may be specified either as a url string or as an nsifile object. return value returns an nsiuri object corresponding to the specified string or file. exception...
...ll. newuri() creates a uri object that implements the nsiuri interface. nsiuri newuri( in nsivariant auri ); parameters auri the file for which to create a new nsiuri object. this parameter may be specified either as a url string or as an nsifile object. return value returns an nsiuri object corresponding to the specified string or file. exceptions thrown ns_error_invalid_arg auri was null. newinputstream() retrieves a stream from which data can be read. nsisupports newinputstream( in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize ); parameters abase the base object from which to read. this should be one of the following types: ...
...And 2 more matches
Debugger.Script - Firefox Developer Tools
play name: h/i f(function () {}); // display name: h/< } var s = f(function () {}); // display name: s< if the instance refers to webassembly code, throw a typeerror. url if the instance refers to a jsscript, the filename or url from which this script’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by information tracking how the code was introduced into the system; the entire string is not a valid url. for function.prototype’s script, this is null. if this debugger.script’s source property is non-null, then this is equal to source.url. if the instance refers to webassembly code, throw a typeerror. startline if the instance refers to a jsscript, the number of the ...
...objects for each function in this script. only direct children are included; nested children can be reached by walking the tree. if the instance refers to webassembly code, throw a typeerror. setbreakpoint(offset,handler) if the instance refers to a jsscript, set a breakpoint at the bytecode instruction atoffset in this script, reporting hits to the hit method ofhandler. ifoffset is not a valid offset in this script, throw an error. when execution reaches the given instruction, spidermonkey calls the hit method ofhandler, passing a debugger.frame instance representing the currently executing stack frame. the hit method’s return value should be a resumption value, determining how execution should continue. any number of breakpoints may be set at a single location; when control reac...
......
...And 2 more matches
Console messages - Firefox Developer Tools
by clicking the "css" button in the toolbar and selecting "reflows". each message is labeled "reflow" and shows the time taken to execute the reflow. if the reflow is a synchronous reflow triggered from javascript, it also shows a link to the line of code that triggered the reflow. click the link to open the file in the debugger. ...
... however, if some javascript code reads a style that has been modified, then the browser must perform a synchronous reflow in order to calculate the computed style to return. ...
... security the security messages shown in the web console help developers find potential or actual vulnerabilities in their sites. additionally, many of these messages help educate developers because they end with a “learn more” link that takes you to a page with background information and advice for mitigating the issue. the comp...
...And 2 more matches
Element.classList - Web APIs
Web › API › Element › classList
havior for ie 6-9. check it out: // 1. string.prototype.trim polyfill if (!"".trim) string.prototype.trim = function(){ return this.replace(/^[\s]+|[\s]+$/g, ''); }; (function(window){"use strict"; // prevent global namespace pollution if(!window.domexception) (domexception = function(reason){this.message = reason}).prototype = new error; var wsre = /[\11\12\14\15\40]/, wsindex = 0, checkifvalidclasslistentry = function(o, v) { if (v === "") throw new domexception( "failed to execute '" + o + "' on 'domtokenlist': the token provided must not be empty." ); if((wsindex=v.search(wsre))!==-1) throw new domexception("failed to execute '"+o+"' on 'domtokenlist': " + "the token provided ('"+v[wsindex]+"') contains html space characters, which are not valid in tokens."); } // 2. impl...
...stconstruction) throw typeerror("illegal constructor"); // internally let it through } domtokenlist.prototype.tostring = domtokenlist.prototype.tolocalestring = function(){return this.value}; domtokenlist.prototype.add = function(){ a: for(var v=0, arglen=arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v!==arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("add", val); for (var i=0, len=proto.length, resstr=val; i !== len; ++i) if (this[i] === val) continue a; else resstr += " " + this[i]; this[len] = val, proto.length += 1, proto.value = resstr; } skippropchange = 1, ele.classname = proto.value, skippropchange = 0; }; domtokenlist.prototype.remove = function(){ f...
...a; else resstr += " " + this[i]; this[len] = val, proto.length += 1, proto.value = resstr; } skippropchange = 1, ele.classname = proto.value, skippropchange = 0; }; domtokenlist.prototype.remove = function(){ for (var v=0, arglen=arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v !== arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("remove", val); for (var i=0, len=proto.length, resstr="", is=0; i !== len; ++i) if(is){ this[i-1]=this[i] }else{ if(this[i] !== val){ resstr+=this[i]+" "; }else{ is=1; } } if (!is) continue; delete this[len], proto.length -= 1, proto.value = resstr; } skippropchange = 1, ele.classname = proto.value, skippropchange ...
...And 2 more matches
HTMLInputElement.stepDown() - Web APIs
the htmlinputelement.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. the method, when invoked, decrements the value by (step * n), where n defaults to 1 if not specified, and step defaults to the default value for step if not specified. 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. mytime.step(), with no parameter, would have resulted in 16:45, as n defaults to 1...
... by the parameter, within the constraints set within the form control. the default value for the parameter, if not is passed, is 1. the method will not cause the value to go below the min value set or defy the constraints set by the step attribute. a negative value for n will increment the value, but will not increment beyond the max value. ...
...invalid, for example, if it doesn't match the constraints set by the step attribute, invoking the stepdown() method will return a value that does match the form controls constraints. if the form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the list of supported input types in the the table above), or if the step value is set to any, an invalidstateerror exception is thrown. htmlinputelement.stepdown() decrements the value by (step * n), where n defaults to 1 if not specified. throws an invalid_state_err exception: if the method is not applicable to for the current type value, if the element has no step value, if the value cannot be converted to a number, if the resulting value is above the max or below the min. ...
...And 2 more matches
HTMLKeygenElement - Web APIs
the keytype html attribute, containing the type of key used. labels read only unimplemented (see bug 556743) is a nodelist that represents a list of label elements associated with this keygen element. name is a domstring that reflects the name html attribute, containing the name for the control that is submitted with form data. type read only is a domstring that must be the value keygen. ...
...e bug 556743) is a nodelist that represents a list of label elements associated with this keygen element. name is a domstring that reflects the name html attribute, containing the name for the control that is submitted with form data. type read only is a domstring that must be the value keygen. validationmessage read only is a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). ...
...s the name html attribute, containing the name for the control that is submitted with form data. type read only is a domstring that must be the value keygen. validationmessage read only is a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. validity read only is a validitystate representing the validity states that this element is in. ...
...And 2 more matches
HTMLOutputElement - Web APIs
the same document that contribute to (or otherwise affect) the calculated value. htmloutputelement.labelsread only a nodelist of <label> elements associated with the element. htmloutputelement.name a domstring reflecting the name html attribute, containing the name for the control that is submitted with form data. htmloutputelement.typeread only the domstring "output". ...
...element.labelsread only a nodelist of <label> elements associated with the element. htmloutputelement.name a domstring reflecting the name html attribute, containing the name for the control that is submitted with form data. htmloutputelement.typeread only the domstring "output". htmloutputelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmloutputelement.validityread only a validitystate representing the validity states that this element is in. htmloutputelement.value a domstring representing the value of the contents of th...
... string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmloutputelement.validityread only a validitystate representing the validity states that this element is in. htmloutputelement.value a domstring representing the value of the contents of the elements. behaves like the node.textcontent property. htmloutputelement.willvalidateread only a boolean indicating whether the element is a candidate for constraint validation. methods this interface also inherits methods from its parent, htmlelement. htmloutputelement.checkvalidity() checks the validity of the element and returns a boolean holding the check result. ...
...And 2 more matches
PayerErrors.phone - Web APIs
Web › API › PayerErrors › phone
the phone property is found in a payererrors object if the payername returned in the response couldn't be validated as a valid phone number. the value of this property is a string explaining the problem. if the payer's phone number validated successfully, the phone property is omitted from the payererrors object. syntax payerphone = payererrors.phone; value if this property is present in the payererrors object, the payer's phone number couldn't be successfully validated, and the phone property's value is a domstring explaining the error. this string will be displayed to the user by the user agent's payment handling user interface as appropriate. ...
...ed from the payererrors object. syntax payerphone = payererrors.phone; value if this property is present in the payererrors object, the payer's phone number couldn't be successfully validated, and the phone property's value is a domstring explaining the error. this string will be displayed to the user by the user agent's payment handling user interface as appropriate. if the phone number is valid, this property is omitted from the payererrors object. ...
... if this property is present in the payererrors object, the payer's phone number couldn't be successfully validated, and the phone property's value is a domstring explaining the error. this string will be displayed to the user by the user agent's payment handling user interface as appropriate. if the phone number is valid, this property is omitted from the payererrors object. ...
...And 2 more matches
PaymentCurrencyAmount.value - Web APIs
the paymentcurrencyamount property value is a string containing the decimal numeric value of the payment, specified in the currency units indicated by the currency property. the contents of this string must be a valid decimal number; that is, some number of digits between 0 and 9 with up to one optional decimal point. an optional leading minus sign ("-") can be included to indicate a negative value, such as to represent a refund or discount. important note: the number given in this string is always specified using the period (".") as the decimal point, rather than the comma (","), even if the user's locale normally uses the comma. you must convert the entered text to this form or it will not be valid. syntax value = paymentcurrencyamount.value; value a domstring indicating the numeric...
...ount. important note: the number given in this string is always specified using the period (".") as the decimal point, rather than the comma (","), even if the user's locale normally uses the comma. you must convert the entered text to this form or it will not be valid. syntax value = paymentcurrencyamount.value; value a domstring indicating the numeric value of the payment. this must be a valid decimal number, with an optional leading minus sign ("-"), then one or more decimal digits 0 through 9, optionally with a decimal point (".") with at least one digit following it to represent fractional units. there must not be any leading or trailing whitespace in the string. for uniformity and consistency, the value is always given using the period (".") as the decimal character, regardless of...
...s. there must not be any leading or trailing whitespace in the string. for uniformity and consistency, the value is always given using the period (".") as the decimal character, regardless of the user's locale. you need to convert the value to this format before submitting the payment. see the example verifying a properly formatted price below for a simple regular expression that can be used to validate the value string prior to submission. examples representing prices this example represents the price of $42.95 in us dollars: let itemprice = { currency: "usd", value: "42.95" }; this example specifies a price of £7.77: let shippingcost = { currency: "gbp", value: "7.77" } this example specifies a price of 1000¥: let price = { currency: "jpy", value: "1000" } verifyin...
...And 2 more matches
Web applications and ARIA FAQ - Accessibility
ibutes acting as a layer on top to help support the at api. though on its own aria will not change any styles, as with any html attributes, css can take advantage of aria attributes as element selectors. this may provide a convenient mechanism to style aria-enabled widgets. .tab-panel[aria-hidden="true"] { display: none; } .tab-panel[aria-hidden="false"] { display: block; } what about validation? the new attributes introduced in aria, such as role and those prefixed with aria-, aren't officially part of the html 4 or xhtml 4 specifications. as a result, pages that include aria may not validate using tools such as the w3c's markup validator. the first potential solution to this problem is to avoid placing aria roles and states in your markup directly. instead, use javascript to dyn...
... how does html5 relate to aria? html5 introduces a number of useful new semantic tags to html. ...
... how does html5 relate to aria? html5 introduces a number of useful new semantic tags to html. a few of these tags overlap directly with roles available in aria, such as the new <progress> element. ...
...And 2 more matches
Accessibility documentation index - Accessibility
tive technologies. 8 forms aria, accessibility the following pages provide various techniques for improving the accessibility of web forms: 9 alerts aria, accessibility, forms, web you have a form — a contact form, for example — that you want to put some accessible error checking into. examples of common problems include e-mail addresses which are not valid, or a name field which does not contain at least a first name or a surname. 10 basic form hints aria, accessibility, forms when implementing forms using traditional html form-related elements, it is important to provide labels for controls, and explicitly associate a label with its control. 11 multipart labels: using aria for labels with embedded fields inside them...
...t the user might need. 19 using the aria-hidden attribute aria, accessibility, attribute, codingscripting, html, javascript, needscontent, role(2), agent, alert, user, useragent this technique demonstrates how to use the aria-hidden attribute. the aria-hidden attribute can either expose or hide non-interactive content from the accessibility api. ...
...e(2), agent, alert, user, useragent this technique demonstrates how to use the aria-hidden attribute. the aria-hidden attribute can either expose or hide non-interactive content from the accessibility api. 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. aria-invalid can also be used to indicate that a required field has not been filled in.the attribute should be programmatically set as a result of a validation process. 21 using the ari...
...And 2 more matches
Accessibility Information for Web Authors - Accessibility
ilgrim an excellent, easy-to-understand resource (available in english and in 9 other languages) on accessible website authoring, which goes into greater depth. in 30 days, you will know why your website should be accessible and how to make it more accessible. automated checking & repair cynthia says™ from hisoftware® company "cynthia says™" is a free online webpage accessibility validation service that is designed to identify errors in webpage related to section 508 standards and/or the wcag guidelines. it can perform a "complete webpage quality check" for accessibility, privacy, searchability, metadata and even alt text attribute quality. the web author chooses the guidelines (as a basis for errors and warnings) to be used by "cynthia says™": section 508, wcag priorities 1,...
...ning, failed for automated verification, warning for manual verification, not selected, not available, not related, etc. accessibility valet from webthing description and summary to be written. wave 4.0 beta (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 4.0 beta is another powerful, free online webpage accessibility validation service that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines. its purpose is to aid humans in the web accessibility evaluation process. rather than providing a complex technical report, wave 4.0 shows the original web page with embedded icons and indicators that reveal the accessibility information w...
...ort for errors, warnings. you can view the structure and order view of the document. you can see a text-only view and and outline view of the document. you can install a custom wave toolbar in firefox for a quick, easy and convenient evaluation of web pages directly within firefox. you can also add a wave bookmarklet in firefox or even wave direct links for checking a webpage. html advanced validator (firefox extension) by marc gueury this html validator (based on w3c tidy and on opensp for sgml validation) is a powerful, versatile, extended html validator. it's free. it works off-line and that is a major advantage over other accessibility checkers. no document upload needed and no additional application to launch; everything is accessible within the firefox browser. this html advanc...
...And 2 more matches
@charset - CSS: Cascading Style Sheets
Web › CSS › @charset
g> denoting the character encoding to be used. it must be the name of a web-safe character encoding defined in the iana-registry, and must be double-quoted, following exactly one space character (u+0020), and immediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. ...
...the character encoding to be used. it must be the name of a web-safe character encoding defined in the iana-registry, and must be double-quoted, following exactly one space character (u+0020), and immediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. ...
...ted, following exactly one space character (u+0020), and immediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. ...
...And 2 more matches
Pseudo-classes - CSS: Cascading Style Sheets
r as many pseudo-classes as you want in a selector. ...
... html living standard living standard defines when particular selectors match html elements. ...
... html living standard living standard defines when particular selectors match html elements. ...
...And 2 more matches
Syntax - CSS: Cascading Style Sheets
Web › CSS › Syntax
llow a browser engine to paint elements of the page with specific features, like colors, positioning, or decorations. the css syntax reflects this goal and its basic building blocks are: the property which is an identifier, that is a human-readable name, that defines which feature is considered. the value which describe how the feature must be handled by the engine. each property has a set of valid values, defined by a formal grammar, as well as a semantic meaning, implemented by the browser engine. css declarations setting css properties to specific values is the core function of the css language. a property and value pair is called a declaration, and any css engine calculates which declarations apply to every single element of a page in order to appropriately lay it out, and to style i...
...es are case-insensitive by default in css. the pair is separated by a colon, ':' (u+003a colon), and white spaces before, between, and after properties and values, but not necessarily inside, are ignored. there are more than 100 different properties in css and a nearly infinite number of different values. not all pairs of properties and values are allowed and each property defines what are the valid values. when a value is not valid for a given property, the declaration is deemed invalid and is wholly ignored by the css engine. css declaration blocks declarations are grouped in blocks, that is in a structure delimited by an opening brace, '{' (u+007b left curly bracket), and a closing one, '}' (u+007d right curly bracket). blocks sometimes can be nested, so opening and closing braces must ...
...emi-colon-separated declarations, without the initial and closing braces, can be put inside an html style attribute. css rulesets if style sheets could only apply a declaration to each element of a web page, they would be pretty useless. the real goal is to apply different declarations to different parts of the document. css allows this by associating conditions with declarations blocks. each (valid) declaration block is preceded by one or more comma-separated selectors, which are conditions selecting some elements of the page. a selector group and an associated declarations block, together, are called a ruleset, or often simply a rule. a css ruleset (or rule) is visualized in the diagram below. as an element of the page may be matched by several selectors, and therefore by several rules...
...And 2 more matches
<color> - CSS: Cascading Style Sheets
s determined by the timing function. accessibility considerations some people have difficulty distinguishing colors. the wcag 2.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result. see color and color contrast for more information. examples color value tester in this example we provide a <div> and a text input. ...
... advises against using color as the only means of conveying a specific message, action, or result. see color and color contrast for more information. 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. ...
... 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
display - CSS: Cascading Style Sheets
Web › CSS › display
e css display property is specified using keyword values. keyword values are grouped into six value categories: .container { display: [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy> ; } outside <display-outside> these keywords specify the element’s outer display type, which is essentially its role in flow layout. valid <display-outside> values: block the element generates a block element box, generating line breaks both before and after the element when in the normal flow. inline the element generates one or more inline element boxes that do not generate line breaks before or after themselves. in normal flow, the next element will be on the same line if there is space run-in the element generates a ru...
...result in expected behavior; for example if you specify an element to be block, you would expect that the children of that element would participate in block and inline normal flow layout. inside <display-inside> these keywords specify the element’s inner display type, which defines the type of formatting context that its contents are laid out in (assuming it is a non-replaced element). valid <display-inside> values: flow the element lays out its contents using flow layout (block-and-inline layout). if its outer display type is inline or run-in, and it is participating in a block or inline formatting context, then it generates an inline box. otherwise it generates a block container box. depending on the value of other properties (such as position, float, or overflow) and whet...
...flow. if no outer value is specified, the principal box will have an outer display type of block. internal <display-internal> some layout models such as table and ruby have a complex internal structure, with several different roles that their children and descendants can fill. this section defines those "internal" display values, which only have meaning within that particular layout mode. valid <display-internal> values: table-row-group these elements behave like <tbody> html elements. table-header-group these elements behave like <thead> html elements. table-footer-group these elements behave like <tfoot> html elements. table-row these elements behave like <tr> html elements. table-cell these elements behave like <td> html elements. table-column-group these elements behav...
...And 2 more matches
<frequency-percentage> - CSS: Cascading Style Sheets
used in any css properties. syntax the value of a <frequency-percentage> is either a <frequency> or a <percentage>; see their individual reference pages for details about their syntaxes. description use in calc() where a <frequency-percentage> is specified as an allowable type, this means that the percentage resolves to a frequency and therefore can be used in a calc() expression. ...
...their individual reference pages for details about their syntaxes. description use in calc() where a <frequency-percentage> is specified as an allowable type, this means that the percentage resolves to a frequency and therefore can be used in a calc() expression. ...
...t their syntaxes. description use in calc() where a <frequency-percentage> is specified as an allowable type, this means that the percentage resolves to a frequency and therefore can be used in a calc() expression. ...
...And 2 more matches
transition-delay - CSS: Cascading Style Sheets
will be applied to the corresponding property as specified by the transition-property property, which acts as a master list. if there are fewer delays specified than in the master list, the list of delay values will be repeated until there are enough. if there are more delays, the list of delay values will be truncated to match the number of properties. in both cases, the css declaration remains valid. syntax /* <time> values */ transition-delay: 3s; transition-delay: 2s, 4ms; /* global values */ transition-delay: inherit; transition-delay: initial; transition-delay: unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect. formal definition initial value0sapplies toall elements, ::before and ::after pseudo-e...
...sition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-delay: 1s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size le...
...ansition-property: width height background-color font-size left top color; transition-duration:2s; transition-delay:1s; transition-timing-function: linear; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-delay: 2s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size lef...
...And 2 more matches
Event reference
button of a pointing device is rotated in any direction. drag & drop events event name fired when drag an element or text selection is being dragged (fired continuously every 350ms). dragend a drag operation is being ended (by releasing a mouse button or hitting the escape key). dragenter a dragged element or text selection enters a valid drop target. dragstart the user starts dragging an element or text selection. dragleave a dragged element or text selection leaves a valid drop target. dragover an element or text selection is being dragged over a valid drop target (fired continuously every 350ms). drop an element is dropped on a valid drop target. media events ...
...ss has begun. progress in progress. timeout progression is terminated due to preset time expiring. 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. using abortcontroller.abort(). svg events svgabort svgerror svgload svgresize svgscroll svgunload svgzoom database events abort blocked complete error success upgradeneeded versionchange script events afterscript...
... dom l3 a change happened in the document (use mutation observers instead). drag dragevent html5 an element or text selection is being dragged (every 350ms). dragend dragevent html5 a drag operation is being ended (by releasing a mouse button or hitting the escape key). dragenter dragevent html5 a dragged element or text selection enters a valid drop target. dragleave dragevent html5 a dragged element or text selection leaves a valid drop target. dragover dragevent html5 an element or text selection is being dragged over a valid drop target (fires every 350ms). dragstart dragevent html5 the user starts dragging an element or text selection. drop dragevent html5 an el...
...And 2 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
ittle careful. see this example: console.log(3 / 2); // 1.5, not 1 console.log(math.floor(3 / 2)); // 1 so an apparent integer is in fact implicitly a float. also, watch out for stuff like: 0.1 + 0.2 == 0.30000000000000004; in practice, integer values are treated as 32-bit ints, and some implementations even store it that way until they are asked to perform an instruction that's valid on a number but not on a 32-bit integer. this can be important for bit-wise operations. the standard arithmetic operators are supported, including addition, subtraction, modulus (or remainder) arithmetic, and so forth. there's also a built-in object that we did not mention earlier called math that provides advanced mathematical functions and constants: math.sin(3.5); var circumference = 2 * mat...
...just try parsing the string "10.2abc" with each method by yourself in the console and you'll understand the differences better. strings strings in javascript are sequences of unicode characters. this sho...
...just try parsing the string "10.2abc" with each method by yourself in the console and you'll understand the differences better. ...
...And 2 more matches
Proxy - JavaScript
ive javascript object to which our proxy will forward all operations that are applied to it. const target = {}; const p = new proxy(target, {}); p.a = 37; // operation forwarded to the target console.log(target.a); // 37 // (the operation has been properly forwarded!) note that while this "no-op" works for javascript objects, it does not work for native browser objects like dom elements. ...
...will forward all operations that are applied to it. const target = {}; const p = new proxy(target, {}); p.a = 37; // operation forwarded to the target console.log(target.a); // 37 // (the operation has been properly forwarded!) note that while this "no-op" works for javascript objects, it does not work for native browser objects like dom elements. validation with a proxy, you can easily validate the passed value for an object. ...
... new proxy(target, {}); p.a = 37; // operation forwarded to the target console.log(target.a); // 37 // (the operation has been properly forwarded!) note that while this "no-op" works for javascript objects, it does not work for native browser objects like dom elements. validation with a proxy, you can easily validate the passed value for an object. this example uses the set handler. ...
...And 2 more matches
end - SVG: Scalable Vector Graphics
Web › SVG › Attribute › end
s default value none value <end-value-list> animatable no the <end-value-list> is a semicolon-separated list of values. each value can be one of the following: <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event). negative values are valid. ...
... <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event). negative values are valid. <syncbase-value> this value defines a syncbase and an optional offset from that syncbase. the element's animation end time is defined relative to the begin or active end of another animation. a valid syncbase-value consists of an id reference to another animation element followed by a dot and either begin or end to identify whether to synchronize with the beginning or active end of the referenced animation element. an optional offset value as defined in <offset-value> can be appended. <event-value> this value defines an event and an optional offset that determines the time at which the elem...
...ntify whether to synchronize with the beginning or active end of the referenced animation element. an optional offset value as defined in <offset-value> can be appended. <event-value> this value defines an event and an optional offset that determines the time at which the element's animation should end. the animation end time is defined relative to the time that the specified event is fired. a valid event-value consists of an element id followed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, ...
...And 2 more matches
Miscellaneous - Archive of obsolete content
ble js in the currently active tab from the context of browser.xul gbrowser.docshell.allowjavascript = false; if this isn't your browser, you should save the value and restore it when finished. if you wish to block selected scripts based on their uri, implement nsicontentpolicy. using string bundles from javascript assuming the extension has myext.properties with name/value pairs such as: invalid.url=the speficied url, %s, is invalid. that was attempt number %s. these properties can be accessed from javascript in the following manner: var common = { _bundle: components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"), getlocalizedmessage: fu...
... following manner: var common = { _bundle: components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"), getlocalizedmessage: function(msg) { return this._bundle.getstringfromname(msg); } }; alert(common.getlocalizedmessage("invalid.url")) another similar alternative (using both getstringfromname and formatstringfromname), is: var fcbundle = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"); function getstr(msg, args){ //get localised message if (args){ args = array.pro...
... var ci = components.interfaces; var cc = components.classes; //assume you can not get the main window object directly, if you can, just use it var wm = cc["@mozilla.org/a...
... var ci = components.interfaces; var cc = components.classes; //assume you can not get the main window object directly, if you can, just use it var wm = cc["@mozilla.org/appshell/window-mediator;1"].getservice(ci.nsiwindowmediator); var mainwindow = wm.ge...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
.server2.name", "jehan.procaccia@int-evry.fr"); lockpref("mail.server.server2.type", "imap"); lockpref("mail.server.server2.username", env_user); //smtp lockpref("mail.identity.id1.smtpserver", "smtp1"); lockpref("mail.identity.id1.stationery_folder", "imap://" + env_user + "@imap-int.int-evry.fr/templates"); lockpref("mail.identity.id1.tmpl_folder_picker_mode", "0"); lockpref("mail.identity.id1.valid", true); //smtp general lockpref("mail.smtp.defaultserver", "smtp1"); lockpref("mail.smtpserver.smtp1.auth_method", 0); lockpref("mail.smtpserver.smtp1.hostname", "smtp-int.int-evry.fr"); lockpref("mail.smtpserver.smtp1.port", 25); lockpref("mail.smtpserver.smtp1.try_ssl", 0); lockpref("mail.smtpserver.smtp1.username", ""); lockpref("mail.smtpservers", "smtp1"); lockpref("mail.startup.enabledmai...
...ail.identity.id1.drafts_folder_picker_mode", "0"); lockpref("mail.identity.id1.fcc_folder", "imap://" + env_user + "@imap-int.int-evry.fr/sent"); lockpref("mail.identity.id1.fcc_folder_picker_mode", "0"); lockpref("mail.identity.id1.stationery_folder", "imap://" + env_user + "@imap-int.int-evry.fr/templates"); lockpref("mail.identity.id1.tmpl_folder_picker_mode", "0"); lockpref("mail.identity.id1.valid", true); lockpref("mail.identity.id1.overrideglobal_pref", true); lockpref("mail.server.server1.download_on_biff", true); lockpref("mail.server.server1.login_at_startup", true); lockpref("mail.server.server1.username", env_user); lockpref("mail.server.server1.delete_model", 0); //smtp lockpref("mail.identity.id1.smtpserver", "smtp1"); defaultpref("mail.smtpserver.smtp1.auth_method", 0); lockpref...
...lob-prefs-win.cgi #!/usr/bin/perl -w print("content-type: application/javascript-config\n\n"); $page = <<"eop"; try { var env_user = getenv("username"); var env_home = getenv("homepath"); var env_mozdebug= getenv("mozilla_debug"); ... the rest of the file is identical to the linux version, only the environment variables (var env_*) are different! versions tested this configuration was validated on linux with mozilla 1.4, 1.6 and 1.7, and on windows with mozilla 1.4, 1.5, 1.7. debugging - bugzilla run time messages note: the presence of var env_mozdebug=getenv("mozilla_debug")allows user to print debugging messages if mozilla_debug is defined in either the shell for unix (export mozilla_debug=1) or in the command.com environment in windows (set mozilla_debug=1). blank space bug ...
...ail.identity.id1.drafts_folder_picker_mode", "0"); lockpref("mail.identity.id1.fcc_folder", "imap://" + env_user + "@imap-int.int-evry.fr/sent"); lockpref("mail.identity.id1.fcc_folder_picker_mode", "0"); lockpref("mail.identity.id1.stationery_folder", "imap://" + env_user + "@imap-int.int-evry.fr/templates"); lockpref("mail.identity.id1.tmpl_folder_picker_mode", "0"); lockpref("mail.identity.id1.valid", true); lockpref("mail.identity.id1.overrideglobal_pref", true); lockpref("mail.server.server1.download_on_biff", true); lockpref("mail.server.server1.login_at_startup", true); lockpref("mail.server.server1.username", env_user); lockpref("mail.server.server1.delete_model", 0); //smtp defaultpref("mail.identity.id1.smtpserver", "smtp1"); defaultpref("mail.smtpserver.smtp1.auth_method", 0); defau...
JavaScript crypto - Archive of obsolete content
, and checked against a pre-installed certificate copy in the local certificate database) the public keys, wrapped encryption private key, and text string from the script (possibly containing naming or enrollment info) are signed by the user signed blob is returned to the script script submits signed blob and any other necessary info to the ca/ra ca/ra verifies signature on signed blob ca/ra validates 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>...
... if (typeof(crypto.version) != "undefined") { crmfobject = crypto.generatecrmfrequest( "cn=" + form.name.value, form.password.value, authenticator, keytransportcert, "setcrmfrequest();", 1024, null, "rsa-dual-use"); } return false; } function setcrmfrequest() { form.cert_request.value = crmfobject.reque...
... (typeof(crypto.version) != "undefined") { crmfobject = crypto.generatecrmfrequest( "cn=" + form.name.value, form.password.value, authenticator, keytransportcert, "setcrmfrequest();", 1024, 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 cer...
... void logout(); logs the user out of all the crypt...
Return Codes - Archive of obsolete content
pt was not signed no_certificate -205 extracted file is not signed or the file (and, therefore, its certificate) could not be found. ...
...cause its permissions are set to read only. is_directory -216 the specified file cannot be deleted because it is a directory. network_file_is_in_use -217 the specified file cannot be deleted because it is in use. apple_single_err -218 an error occurred when unpacking a file in applesingle format. invalid_path_err -219 the path provided to getfolder was invalid. patch_bad_diff -220 an error occurred in gdiff. patch_bad_checksum_target -221 the checksum generated for the source file does not match the checksum in the xpi file. patch_bad_checksum_result -222 the checksum of the patched file failed. ...
... -238 chrome_registry_error -239 malformed_install -240 key_access_denied -241 access to the registry key has been denied key_does_not_exist -242 registry key does not exist value_does_not_exist -243 registry value does not exist invalid_signature -260 the signature used in the xpi is not valid invalid_hash -261 the hash used in the xpi is not valid invalid_hash_type -262 the has used in the xpi is not of a valid type out_of_memory -299 insufficient memory for operation gestalt_unknown_error -5550 ...
...260 the signature used in the xpi is not valid invalid_hash -261 the hash used in the xpi is not valid invalid_hash_type -262 the has used in the xpi is not of a valid type out_of_memory -299 insufficient memory for operation gestalt_unknown_error -5550 gestalt_invalid_argument -5551 ...
Adding Properties to XBL-defined Elements - Archive of obsolete content
on> <field name="number"/> </implementation> </binding> a number field has been defined in the binding, which stores the random number. the two extra buttons set and get the value of this field. the syntax is very similar to getting and setting the properties of html elements. in this example, no content has been placed inside either the xul box or its definition in xbl, which is perfectly valid. this example isn't quite correct because the field is not assigned a default value. to do this, add the default value as the content of the field tag. for example: <field name="number"> 25 </field> this will assign the value 25 as the default value of the number field. actually, you can instead place a script inside the field tag that evaluates to the default value. that might be necessary if...
...gn the value 25 as the default value of the number field. actually, you can instead place a script inside the field tag that evaluates to the default value. that might be necessary if the value needs to be computed. for example, the following field is given a default value equal to the current time: <field name="currenttime"> new date().gettime(); </field> properties sometimes you will want to validate the data that is assigned to a property. or, you may want the value to be calculated dynamically as it's asked for. for example, if you want a property that holds the current time, you would want to have its value generated as needed. in these cases, you need to use a property tag instead of a field tag. its syntax is similar but has additional features. onget attribute and onset attribute you...
...et to calculate the current time. whenever a script attempts to access the value of the property, the onget script will be called to retrieve the value. the script should return the value that should be treated as the value of that property. the onset handler is similar but is called whenever a script attempts to assign a new value to the property. this script should store the value somewhere, or validate the value. for example, some properties might only be able to store numbers. attempting to assign alphabetic text to such a property should fail. <property name="size" onget="return 77;" onset="alert('changed to:'+val);"/> this property will always return 77 when retrieved. when set, an alert will be displayed which displays the value to assign to the property. the special...
...tempting to assign alphabetic text to such a property should fail. <property name="size" onget="return 77;" onset="alert('changed to:'+val);"/> this property will always return 77 when retrieved. when set, an alert will be displayed which displays the value to assign to the property. the special variable val holds the value that the property should be assigned to. use this to validate it or store it. the following decribes what happens in a typical case: there are two elements, one called 'banana' and the other 'orange'. they each have a custom property called 'size'. when the following line of script is executed: banana.size = orange.size; the onget script is called for the size property of the orange. the script calculates the value and returns it. the onset handler o...
Using Visual Studio as your XUL IDE - Archive of obsolete content
compared to a simple text-editor, visual studio gives you some special features when writing xul: intellisense / autocompletion for elements and attributes validation syntax coloring (okay, more sophisticated editors like notepad++ provide this as well) before you can use all of this, you have to adjust visual studio a little. 1. setting the correct editor as xul files are nothing but xml, you can use the normal xml-editor for writing xul. go to tools > options... > text editor > file extension and add the extension "xul" with "xml editor". as you are already there, you can do the same for "xbl". 2. using xml schemas for validation and intellisense visual studio needs the xml schema for xul files. there is a very nice schema created by mihailo lalevic. you can download it at xu...
...ment uses the correct xul namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul. 3. xbl if you are writing your own elements in xbl, you can download a xbl schema from mozilla.doslash.org/xblschema. grab the xsd version and add it in the same way, you added the xul schema. to combine both, you can also add your own xbl elements to the xul schema to get autocompletion-support and validation for those in your xul files. mihailo posted some instructions in this codeplex discussion. 4. visual assist and file extensions since version 10.5, visual assist supports javascript and xml. as it does not work out of the box with unknown file extensions (like .xul, .xbl and .jsm), you have to do some registry tricks, so that va knows how to treat these file types. all va options can be fo...
...le tomato\visual assist x\ find the folder that represents your visual studio version ((vanet8, vanet9, etc.) and add your extensions to the corresponding registry entries extjs and extxml. make sure that visual studio is not running, when you do this. 5. problems that need to be solved there are still some problems for which i did not find a solution yet. 5.1 localization using dtd you will get validation errors in visual studio, if you are localizing your xul files. that has to do with the way mozilla implemented localization: < !doctype window system "chrome://loomo/locale/main.dtd"> visual studio doesn't recognize the chrome uri prefix, what will give you an error at the previous line ("the uri prefix is not recognized"). as vs doesn't know how the chrome protocol works it can't detect wh...
...refix, what will give you an error at the previous line ("the uri prefix is not recognized"). as vs doesn't know how the chrome protocol works it can't detect where the dtd file is really located and thus will give you errors wherever you use the entities that are declared in this file. 5.2 text preprocessor the mozilla build system includes a text preprocessor. as preprocessor directives are not valid xml, visual studio will mark them as errors in your xul files. 5.3 javascript related you will get validation errors for javascript code whenever using the keywords "const" and "let". these keywords are mozilla-specific at the moment. vs just supports ecmascript 3rd edition and thus doesn't know these keywords. ...
Standards-Compliant Authoring Tools - Archive of obsolete content
re using older versions of tools that rely on old browser bugs or generate browser-specific code, it may be time to upgrade: nvu is a standalone editor created from the remains of mozilla composer. currently the work done on nvu is being ported back to mozilla source code. html-kit is a full-featured, low priced editor designed to help html, xhtml and xml authors to edit, format, lookup help, validate, preview and publish web pages. validation is done with html tidy, so you can verify standards compliance. macromedia™ dreamweaver™ cs6 style master and layout master by western civilisation some caveats: it appears that tools currently available from namo generate ie-specific or netscape 4-specific code that may require extra debugging for compatibility with standards-based browsers. ...
...me caveats: it appears that tools currently available from namo generate ie-specific or netscape 4-specific code that may require extra debugging for compatibility with standards-based browsers. ...
...e-specific or netscape 4-specific code that may require extra debugging for compatibility with standards-based browsers. newer versions of microsoft frontpage™ have improved, however be sure not to rely on frontpage-specific extensions for critical website content or functionality. ...
...ed, however be sure not to rely on frontpage-specific extensions for critical website content or functionality. some versions of microsoft word create invalid html code that only works with internet explorer. always be sure to validate your web pages. ...
Pseudo-classes and pseudo-elements - Learn web development
lement in the article, and we will no longer need to edit the html (this may not always be possible anyway, maybe due to it being generated by a cms.) all pseudo-classes behave in this same kind of way. they target some bit of your document that is in a certain state, behaving as if you had added a class into your html. take a look at some other examples on mdn: :last-child :only-child :invalid note: it is valid to write pseudo-classes and elements without any element selector preceding them. in the example above, you could write :first-child and the rule would apply to any element that is the first child of an <article> element, not just a paragraph first child — :first-child is equivalent to *:first-child. however, usually you want more control than that, so you need to be more s...
...roperty and see it change in the output. you could also change the ::before pseudo-element to ::after and see the text inserted at the end of the element instead of the beginning. inserting strings of text from css isn't really something we do very often on the web however, as that text is inaccessible to some screen readers and might be hard for someone to find and edit in the future. a more valid use of these pseudo-elements is to insert an icon, for example the little arrow added in the example below, which is a visual indicator that we wouldn't want read out by a screenreader: these pseudo-elements are also frequently used to insert an empty string, which can then be styled just like any element on the page. in this next example, we have added an empty string using the ::before pseu...
...nt with focus plus an element with a descendent that has focus. :future matches the elements after the current element. :hover matches when the user hovers over an element. :indeterminate matches ui elements whose value is in an indeterminate state, usually checkboxes. :in-range matches an element with a range when its value is in-range. :invalid matches an element, such as an <input>, in an invalid state. :lang matches an element based on language (value of the html lang attribute). :last-child matches an element which is last among its siblings. :last-of-type matches an element of a certain type that is last among its siblings. :left in paged media, matches left-hand pages. :li...
... :read-only matches an element if it is not user-alterable. :read-write matches an element if it is user-alterable. :required matches form elements that are required. :right in paged media, matches right-hand pages. :root matches an element that is the root of the document. :scope matches any element that is a scope element. :valid matches an element such as an <input> element, in a valid state. :target matches an element if it is the target of the current url (i.e. if it has an id matching the current url fragment). :visited matches visited links. pseudo-elements selector description ::after matches a stylable element appearing after the originating element's a...
CSS values and units - Learn web development
in this lesson we will take a look at some of the most common values and units in use. ...
...ion to html), and an idea of how css works (study css first steps.) objective: to learn about the different types of values and units used in css properties. what is a css value? in css specifications and on the property pages here on mdn you will be able to spot values as they will be surrounded by angle brackets, such as <color> or <length>. when you see the value <color> as valid for a particular property, that means you can use any valid color as a value for that property, as listed on the <color> reference page. note: you'll also see css values referred to as data types. the terms are basically interchangeable — when you see something in css referred to as a data type, it is really just a fancy way of saying value. note: yes, css values tend to be denoted using a...
...as they both use angle brackets, but this is unlikely — they are used in very different contexts. in the following example we have set the color of our heading using a keyword, and the background using the rgb() function: h1 { color: black; background-color: rgb(197,93,161); } a value in css is a way to define a collection of allowable sub-values. this means that if you see <color> as valid you don't need to wonder which of the different types of color value can be used — keywords, hex values, rgb() functions, etc. you can use any available <color> values assuming they are supported by your browser. the page on mdn for each value will give you information about browser support. for example, if you look at the page for <color> you will see that the browser compatibility section lis...
...f these color values in your projects. it is likely that for most projects you will decide on a color palette and then use those colors — and your chosen method of specifying color — throughout the whole project. you can mix and match color models, however for consistency it is usually best if your entire project uses the same one! images the <image> data type is used wherever an image is a valid value. this can be an actual image file pointed to via a url() function, or a gradient. in the example below we have demonstrated an image and a gradient in use as a value for the css background-image property. note: there are some other possible values for <image>, however these are newer and currently have poor browser support. check out the page on mdn for the <image> data type if you wa...
CSS FAQ - Learn web development
Learn › CSS › Howto › CSS FAQ
using a correct and modern doctype declaration at the start of your html will improve browser standards compliance. ...
...lic "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> when at all possible, you should just use the html5 doctype. why doesn't my css, which is valid, render at all? here are some possible causes: you've got the path to css file wrong. to be applied, a css stylesheet must be served with a text/css mime type. if the web server doesn't serve it with this type, it won't be applied. what is the difference between id and class? html elements can have an id and/or class attribute. the id attribute assigns a name to the element it is applied ...
...all? here are some possible causes: you've got the path to css file wrong. to be applied, a css stylesheet must be served with a text/css mime type. if the web server doesn't serve it with this type, it won't be applied. what is the difference between id and class? html elements can have an id and/or class attribute. the id attribute assigns a name to the element it is applied to, and for valid markup, there can be only one element with that name. the class attribute assigns a class name to the element, and that name can be used on many elements within the page. css allows you to apply styles to particular id and/or class names. use a class-specific style when you want to apply the styling rules to many blocks and elements within the page, or when you currently only have element to s...
... note: see selectors for more information. how do i restore the default value of a property? initially css didn't provide a "default" keyword and the only way to restore the default value of a property is to explicitly re-declare that property. for example: /* heading default color is black */ h1 { color: red; } h1 { color: black; } this has changed with css 2; the keyword initial is now a valid value for a css property. it resets it to its default value, which is defined in the css specification of the given property. /* heading default color is black */ h1 { color: red; } h1 { color: initial; } how do i derive one style from another? css does not exactly allow one style to be defined in terms of another. (see eric meyer's note about the working group's stance). however, assigning mu...
Tips for authoring fast-loading HTML pages - Learn web development
tant factor in page-load performance. reducing page weight through the elimination of unnecessary whitespace and comments, commonly known as minimization, and by moving inline script and css into external files, can improve download performance with minimal need for other changes in the page structure. tools such as html tidy can automatically strip leading whitespace and extra blank lines from valid html source. other tools can "compress" javascript by reformatting the source or by obfuscating the source and replacing long identifiers with shorter versions. minimize the number of files reducing the number of files referenced in a web page lowers the number of http connections required to download a page, thereby reducing the time for these requests to be sent, and for their responses to be...
...t assume that an inline script could modify the page structure while parsing is in progress. reducing the use of inline scripts in general, and reducing the use of document.write() to output content in particular, can improve overall page loading. use modern ajax methods to manipulate page content for modern browsers, rather than the older approaches based on document.write(). use modern css and valid markup use of modern css reduces the amount of markup, can reduce the need for (spacer) images, in terms of layout, and can very often replace images of stylized text -- that "cost" much more than the equivalent text-and-css. using valid markup has other advantages. first, browsers will have no need to perform error-correction when parsing the html (this is aside from the philosophical issue of...
...for example, html tidy can remove whitespace and optional ending tags; however, it will refuse to run on a page with serious markup errors. chunk your content tables for layouts are a legacy method that should not be used anymore. ...
...use of other tools which can pre-process your web pages. for example, html tidy can remove whitespace and optional ending tags; however, it will refuse to run on a page with serious markup errors. chunk your content tables for layouts are a legacy method that should not be used anymore. layouts utilizing floats, positioning, flexbox, or grids should be used instead. tables are still considered valid markup but should be used for displaying tabular data. to help the browser render your page quicker, you should avoid nesting your tables. rather than deeply nesting tables as in: <table> <table> <table> ... </table> </table> </table> use non-nested tables or divs as in <table>...</table> <table>...</table> <table>...</table> see also: css flexible box layout and css g...
Mozilla accessibility architecture
r. we listen to dom mutation events for several resons: to broadcast document changes to the assistive technology client. however, on windows there are crash issues with the automatic windows-generated versions of event_create and event_destroy, so the msaa client cannot listen to them. we fire the safer event_reorder in their place.. ...
...these cases are not very likely, but we should try to think of real-world scenarios where it might happen. ...
...a. also, msaa clients need to access the event accessibles using the unique child id we give it. when we get the child id back, we can recreate the hash key needed to retrieve the accessible. finally, because the msaa client gets the same accessible for the event and for tree traversal each time, it can do comparisons with its own internal data model. for example, this allows the msaa client to invalidate parts of its own cache or data model based on dom mutation events. three levels of the accessibility cache there are three levels in the accessibility cache: global cache of doc accessibles (gglobaldocaccessiblecache), used to get the accessible for any document. per-document cache of accessibles a cache in each nsdocaccessible (maccessnodecache), containing all of the accessible nodes c...
...cause that would miss nsaccessnode's that are not nsaccessible's. at program shutdown, when the nsaccessibilityservice observes ns_xpcom_shutdown_observer_id, it iterates through the doc accessibles in gglobaldocaccessiblecache and destroys all of the doc accessibles them. challenges of the accessibility cache there are some tricky issues when dealing with the accessibility cache: remaining valid: changes in a given document, or the destruction of documents must update or shutdown parts of the cache. we use dom mutation events to listen for document changes, and invalidate the appropriate part of each cache. we must be careful: if the dom mutation events are incomplete, then our cache will not be a correct mirror of the dom. if we do not shut down nodes that go away, we cause more memory ...
Mozilla Web Developer FAQ
foo</p></td>. often the content of a cell in a table of tabular data does not constitute a paragraph. in that case, the easy solution is not to mark the contents of the cell as a paragraph. when the paragraph markup is called for but the default margins are unwanted, zero margins can be suggested using css. my style sheet doesn’t work! why? here’s the check list: does the html document validate? styling misnested markup may cause strange effects. the <link> and <style> elements should be inside the <head> element. does the css style sheet pass the syntax check? the css error handling rules require erroneous parts to be ignored rather than fixed by guessing. lengths other than zero should be followed by a proper unit without a space between the number and the unit (...
...back when the mathplayer plug-in for ie did not handle application/xhtml+xml. if your document mixes mathml or svg with xhtml, you should use application/xhtml+xml (until html5 parsing is supported). however, if you are using the usual html features (no mathml or svg) and are serving your content as text/html to other browsers, there is no need to serve application/xhtml+xml to mozilla. serving valid html as text/html ensures the widest browser and search engine support. there is a fad of serving text/html to ie but serving the same markup with no added value as application/xhtml+xml to gecko. this is usually done without a mechanism that would ensure the well-formedness of the served documents. mechanisms that ensure well-formed output include serializing from a document tree object model (...
...rse error) and serving the same soup labeled as text/html to ie (not leading to a parse error). how is the treatment of application/xhtml+xml documents different from the treatment of text/html documents? an xml parser (expat) is used instead of the tag soup parser. most well-formedness constraints are enforced. despite common allegations to the contrary, the document is not checked for validity. externally defined character entities other than the five pre-defined ones (&lt;, &gt;, &amp;, &quot; and &apos;) are only supported if the document references a public identifier for which there is a mapping in mozilla’s pseudo-dtd catalog and the document has not been declared standalone. in older versions of mozilla as well as in old mozilla-based products, there is no pseudo-dtd c...
...een declared standalone. in older versions of mozilla as well as in old mozilla-based products, there is no pseudo-dtd catalog and the use of externally defined character entities (other than the five pre-defined ones) leads to an xml parsing error. there are also other xhtml user agents that do not support externally defined character entities (other than the five pre-defined ones). since non-validating xml processors are not required to support externally defined character entities (other than the five pre-defined ones), the use of externally defined character entities (other than the five pre-defined ones) is inherently unsafe in xml documents intended for the web. the best practice is to use straight utf-8 instead of entities. (numeric character references are safe, too.) document.wri...
nss tech note3
all about certificate extensions nss technical note: 3 09 may 2002 nelson b. bolyard this week at least 5 different people came to me with variants of the same question: what certificate extensions do i have to put into my cert for nss to allow it to be used for purpose <x>?? this message attempts to answer that question, and to document nss's approach to validating certificates for certain purposes. when nss is asked to verify the validity of a certificate chain, it verifies the validity of that cert chain for a particular purpose, known as a seccertusage, as of a specific date and time. the list of known seccertusages is short: certusagesslclient ........... an ssl client authentication cert certusagesslserver ........... an ordinary ssl server cert certusagesslserverwithst...
....... used to verify s/mime email signatures certusageemailrecipient ...... used to encrypt s/mime emails. certusageobjectsigner ........ used to verify signatures on files of executable code, e.g. jar files. certusagestatusresponder ..... used by an ocsp responder certusageverifyca ............ a ca of any kind. ...
...sp responder certusageverifyca ............ a ca of any kind. each cert has a "type" and a "key usage", each of which may contain one or more valid values. each of the above seccertusages translates into a required set of cert type and key usage for the certificate itself, and into another set of required cert type and key usage for all the ca certs in the cert chain. to determine if a cert is valid for a given cert usage, it must have the the cert type and key usage required for that cert usage, and all the ca certs in the cert chain must have the cert type and key usage required for ca certs for that cert usage. there are 8 key usages: cert_sign crl_sign data_encipherment digital_signature govt_approved key_agreement key_encipherment non_repudiation there are 9 cert types: emai...
... 113730 1 1 } encoded in hex as 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01 in addition to netscape's own cert type extension, nss recognizes various x.509 extensions. the x.509 key usage extension has oid { 2 5 29 0f } encoded in hex as 0x55, 0x1d, 0x0f. if present, this extension directly determines the values of the 8 key usages defined above. if absent, the cert is assumed to be valid for all key usages. the x.509v3 extended key usage extension as oid { 2 5 29 37 } encoded in hex as 0x55, 0x1d, 0x25. that extension contains a sequence of oids, each of which signifies one or more cert types, depending on the presence or absence of of the true basic constraints extension; that is, the interpretation of the extended key usage extension is controlled by whether the cert is a ca ...
NSS tools : signtool
nts in keyword=value format. all options and arguments can be expressed through this file. for more information about the syntax used with this file, see "tips and techniques". -i scriptname specifies the name of an installer script for smartupdate. this script installs files from the jar archive in the local system after smartupdate has validated the digital signature. for more details, see the description of -m that follows. the -i option provides a straightforward way to provide this information if you don't need to specify any metadata other than an installer script. -j directory specifies a special javascript directory. this option causes the specified directory to be sig...
...ecify the required key size and the -t option to specify the token. for more information about the use of the -g option, see "generating test object-signing certificates""generating test object-signing certificates" on page 1241. -l lists signing certificates, including issuing cas. if any of your certificates are expired or invalid, the list will so specify. this option can be used with the -k option to list detailed information about a particular signing certificate. the -l option is available in netscape signing tool 1.0 and later versions only. -j signs a directory of html files containing javascript and creates as many archive files as are specified in the html...
...m lists the pkcs #11 modules available to signtool, including smart cards. the -m option is available in netscape signing tool 1.0 and later versions only. for information on using netscape signing tool with smart cards, see "using netscape signing tool with smart cards". for information on using the -m option to verify fips-140-1 validated mode, see "netscape signing tool and fips-140-1". --norecurse blocks recursion into subdirectories when signing a directory's contents or when parsing html. -o optimizes the archive for size. use this only if you are signing very large archives containing hundreds of files. this option makes the manifest files (requir...
...ents of an archive and verifies the cryptographic integrity of the digital signatures it contains and the files with which they are associated. this includes checking that the certificate for the issuer of the object-signing certificate is listed in the certificate database, that the ca's digital signature on the object-signing certificate is valid, that the relevant certificates have not expired, and so on. --verbosity value sets the quantity of information netscape signing tool generates in operation. a value of 0 (zero) is the default and gives full information. a value of -1 suppresses most messages, but not error messages. -w archive displays the names of signe...
Hacking Tips
db-error=0 ./js … this command will tell you how to start gdb as a remote. be aware that functions which are usually dumping some output will do it in the shell where valgrind is started and not in the shell where gdb is started. thus functions such as js::dumpbacktrace, when called from gdb, will print their output in the shell containing valgrind. adding spew for compilations & bailouts & invalidations (from gdb) if you are in rr, and forgot to record with the spew enabled with ionflags or because this is an optimized build, then you can add similar spew with extra breakpoints within gdb. gdb has the ability to set breakpoints with commands, but a simpler / friendlier version is to use dprintf, with a location, and followed by printf-like arguments. (gdb) dprintf js::jit::ionbuilder::i...
...a/contrib-push/js/src/jit/ionbuilder.cpp, line 159. (gdb) cond 1 inliningdepth == 0 (gdb) dprintf js::jit::bailoutiontobaseline, "bailout from %s:%d:%d-%d\n", iter.script()->scriptsource()->filename_.mtuple.mfirsta, iter.script()->lineno_, iter.script()->sourcestart_, iter.script()->sourceend_ dprintf 2 at 0x7fb4f6fe43dc: js::jit::bailoutiontobaseline. ...
... hacking tips benchmarking (shell) arewefastyet.com display the benchmark results of the javascript shell, and browser for b2g. ...
...mfirsta, co->script_->lineno_, co->script_->sourcestart_, co->script_->sourceend_ dprintf 3 at 0x7fb4f6a0b62a: file /home/nicolas/mozilla/contrib-push/js/src/jit/ion.cpp, line 3196. (gdb) continue compiling self-hosted:650:20470-21501 bailout from self-hosted:20:403-500 invalidate self-hosted:20:403-500 note: the line 3196, listed above, corresponds to the location of the jit spew inside jit::invalidate function. hacking tips benchmarking (shell) arewefastyet.com display the benchmark results of the javascript shell, and browser for b2g. these benchmarks are publicly recognized benchmarks suggested by other companies and are used as a metric to evaluate how fast javascript engines. this tool is maintained by the javascript team, to find regressions and to compare spidermonkey with other ...
Index
specified js id, id, is jsid_void. 120 jsid_is_zero jsapi reference, reference, référence(2), spidermonkey jsid_is_zero tests whether a specified js id, id, is zero (0 in its integer representation). 121 jsid_void jsapi reference, reference, référence(2), spidermonkey jsid_void does not occur in js scripts but may be used to indicate the absence of a valid jsid. a void jsid is not a valid id and only arises as an exceptional api return value, such as in js_nextproperty. embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid except when explicitly noted in the api contract. 122 jsidarray jsapi reference, spidermonkey jsidarray is used to hold ids ...
...ing thread is entering a region of code that may call into the jsapi but does not block. 192 js_bindcallable jsapi reference, reference, référence(2), spidermonkey js_bindcallable binds the given callable to use the given object as this. 193 js_bufferiscompilableunit jsapi reference, spidermonkey given a buffer, return false if the buffer might become a valid javascript statement with the addition of more lines. otherwise return true. the intent is to support interactive compilation - accumulate lines in a buffer until js_bufferiscompilableunit is true, then pass it to the compiler. 194 js_cstringsareutf8 jsapi reference, obsolete, spidermonkey by default, all c/c++ strings passed into the jsapi are treated as iso/iec 8859-1, also...
... the class has the jsclass_construct_prototype flag set, spidermonkey passes the constructor a non-standard this object. in such cases, the following example would provide the additional information of whether a special this was supplied. 370 js_isconstructor jsapi reference, reference, référence(2), spidermonkey js_isconstructor determines if a specified function, fun is a valid constructor object. if so, js_isconstructor returns true. otherwise it returns false. 371 js_isexceptionpending jsapi reference, spidermonkey js_isexceptionpending returns true if an exception has been thrown in the context cx and the exception has not yet been caught or cleared. otherwise, it returns false 372 js_isextensible jsapi reference, reference, réfé...
...lstring returns true if the string is an external string; otherwise it's false. 374 js_isglobalobject jsapi reference, reference, référence(2), spidermonkey js_isglobalobject returns true if obj is a global object, false otherwise. 375 js_isidentifier jsapi reference, reference, référence(2), spidermonkey js_isidentifier tests if the given string is a valid ecmascript identifier. on successful, js_isidentifier stores the test result to *isidentifier and returns true, otherwise returns false and the value of *isidentifier is undefined. 376 js_isnative jsapi reference, reference, référence(2), spidermonkey js_isnative returns true if the object is a native object. 377 js_isnativefunction jsapi reference, reference...
Property cache
shapes, the shape rules can no longer be satisfied. the property cache cannot operate without them, so it is disabled permanently. see bug 440834. property cache entries each entry in the property cache hash table is either populated or not; unpopulated entries have .kpc == null. if an entry is populated, the .kpc field points to the bytecode instruction at which it was populated. the entry is valid only for subsequent lookups that occur at the same instruction, for several reasons: the script, not the property cache entry, contains the id of the property being accessed. a property cache entry could be valid for a getprop but not a setprop, e.g. because the property has a setter and not a getter; or vice versa. lookups for jof_name instructions are quite different from ordinary property...
...the prototype chain. if pobj exists (that is, both the parent chain and the prototype chain are long enough) and it has the shape vshape, then it contains the desired property. furthermore, the .vword field describes the property in detail, as described in the next section. if a property with the same name is ever added to an object anywhere along the search path, then this cache entry becomes invalid: the property described by this property cache entry has been shadowed. the two shadowing guarantees ensure that if this happens, the shape of pobj changes, invalidating the entry. setting. for jof_set instructions, this makes two additional guarantees: first, vword.issprop(); second, the correct behavior is to set the property described by vword.tosprop(), rather than to shadow it with a new ow...
...escribes the property that should be added to obj. with regard to property attributes, getters, setters, and so forth, the property cache entry must take into account several rules documented at js_setproperty. sometimes the new property can be created simply by calling jsscope::extend, but there are many special cases and pitfalls to watch out for. when a prototype gains a property that could invalidate an entry of this type, rt->protohazardshape is bumped, effectively marking all such entries invalid at once. entry value words for the .vword member of a non-adding property cache entry, one of the following is true: vword.isshape() vword.toshape() points to the js::shape that describes the property in question. this is the default type of vword generated when neither of the two specia...
...a function. it helps the jit avoid extra loads and guards when calling methods. branded scopes exist to support this case. when a property cache entry of this type is created, the scope of the object that contains the property is branded. the "branded scope guarantee" documented above ensures that any changes to function-valued own properties of that object will bump its shape, conservatively invalidating all property cache entries of this type for that object (and jit code that might inline a call to the function). the jit uses a fourth kind of pcval, having pcval.isnull(), internally to indicate that a property lookup missed entirely. but property cache entries are never populated such that .vword.isnull(). to do treat cache invalidation systematically. does the global object alway...
TPS Bookmark Lists
s root folder ("menu", "toolbar", and "unfiled" are all children of this) sub-folders are preceded with forward slashes, so "menu/folder1" denotes that "folder1" is a sub-folder of "menu". tps does not support forward slashes as part of a folder name. folder contents the contents for a folder are given as an array of objects, representing various bookmark types, described below. bookmark objects valid properties are: uri: the bookmark uri. required. title: the bookmark title. optional. defaults to the bookmark uri. loadinsidebar: true or false. optional. toggles the "load in sidebar" property. description: the bookmark description. optional. tags: an array of tags for the bookmark. optional. keyword: the keyword for the bookmark. optional. after: the title of the bookmark item expected to be ...
...required. siteuri: the livemark's uri. optional. feeduri: the livemark's feed uri. required. after: the title of the bookmark item expected to be found after this livemark; used only in verify and modify actions. before: the title of the bookmark item expected to be found before this livemark; used only in verify and modify actions. changes: an object...
...required. description: the folder's description. optional. after: the title of the bookmark item expected to be found after this folder; used only in verify and modify actions. before: the title of the bookmark item expected to be found before this folder; used only in verify and modify actions. changes: an object containing new properties to be set for...
...changes: an object containing new properties to be set for this separator when this asset list is used in a modify action. the properties for this object are: location: the full path of the folder that this separato...
Animated PNG graphics
Mozilla › Tech › APNG
or first frame 2 second 'fdat' for first frame ... ... decoders must treat out-of-order apng chunks as an error. apng-aware png editors should restore them to correct order using the sequence numbers. 'actl': the animation control chunk the 'actl' chunk is an ancillary chunk as defined in the png specification. it must appear before the first 'idat' chunk within a valid png stream. the 'actl' chunk contains: byte offset field name field type description 0 num_frames unsigned int the number of frames in the apng. 4 num_plays unsigned int the number of times to loop this apng. 0 indicates infinite looping. num_frames indicates the total number of frames in the animation. this must equal the number of '...
...chunk contains: byte offset field name field type description 0 num_frames unsigned int the number of frames in the apng. 4 num_plays unsigned int the number of times to loop this apng. 0 indicates infinite looping. num_frames indicates the total number of frames in the animation. this must equal the number of 'fctl' chunks. 0 is not a valid value. 1 is a valid value for a single-frame apng. if this value does not equal the actual number of frames it should be treated as an error. num_plays indicates the number of times that this animation should play; if it is 0, the animation should play indefinitely. if nonzero, the animation should come to rest on the final frame at the end of the last play. 'fctl': the frame control chunk the...
... quickly as possible, though viewers may impose a reasonable lower bound. frame timings should be independent of the time required for decoding and display of each frame, so that animations will run at the same rate regardless of the performance of the decoder implementation. dispose_op specifies how the output buffer should be changed at the end of the delay (before rendering the next frame). valid values for dispose_op are: value constant description 0 apng_dispose_op_none no disposal is done on this frame before rendering the next; the contents of the output buffer are left as is. 1 apng_dispose_op_background the frame's region of the output buffer is to be cleared to fully transparent black before rendering the next frame. 2 apng_...
...put buffer is to be reverted to the previous contents before rendering the next frame. if the first 'fctl' chunk uses a dispose_op of apng_dispose_op_previous it should be treated as apng_dispose_op_background. blend_op<code> specifies whether the frame is to be alpha blended into the current output buffer content, or whether it should completely replace its region in the output buffer. valid values for <code>blend_op are: value constant description 0 apng_blend_op_source all color components of the frame, including alpha, overwrite the current contents of the frame's output buffer region. 1 apng_blend_op_over the frame should be composited onto the output buffer based on its alpha, using a simple over operation as described in the alpha c...
nsDependentString
class declaration nstdependentstring_chart stores a null-terminated, immutable sequence of characters. subclass of nststring that restricts string value to an immutable character sequence. this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use. ...
...endentstring_chart stores a null-terminated, immutable sequence of characters. subclass of nststring that restricts string value to an immutable character sequence. this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use. ...
...parameters prunichar* data void rebind(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void rebind(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end op...
...parameters prunichar* data void rebind(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void rebind(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end operator= nsstring&...
nsIAccessibleTreeCache
me. try to avoid using it. a private interface to operate with tree accessible. accessible/public/nsiaccessibletreecache.idlnot scriptable please add a summary to this article. last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview nsiaccessible getcachedtreeitemaccessible(in long arow, in nsitreecolumn acolumn); void invalidatecache(in long arow, in long acount); void treeviewchanged(); void treeviewinvalidated(in long astartrow, in long aendrow, in long astartcol, in long aendcol); methods getcachedtreeitemaccessible() returns the tree item from the cache for the cell in the specified row and column; the nsiaccessible is created if it doesn't already exist in the cache. nsiaccessible getcachedtreeitemacces...
...e specified row and column; the nsiaccessible is created if it doesn't already exist in the cache. nsiaccessible getcachedtreeitemaccessible( in long arow, in nsitreecolumn acolumn ); parameters arow the row index. acolumn the column object. if is is null then the primary column is used. it makes sense for atk only. return value the nsiaccessible corresponding to the specified tree cell. invalidatecache() invalidates the number of cached treeitem accessibles. void invalidatecache( in long arow, in long acount ); parameters arow row index the invalidation starts from. acount the number of treeitem accessibles to invalidate, the number sign specifies whether rows have been inserted (plus) or removed (minus) treeviewchanged() invalidates children created for the previous tree view. v...
...m accessibles. void invalidatecache( in long arow, in long acount ); parameters arow row index the invalidation starts from. acount the number of treeitem accessibles to invalidate, the number sign specifies whether rows have been inserted (plus) or removed (minus) treeviewchanged() invalidates children created for the previous tree view. void treeviewchanged(); parameters none. treeviewinvalidated() fires name change events for invalidated area of tree. void treeviewinvalidated( in long astartrow, in long aendrow, in long astartcol, in long aendcol ); parameters astartrow row index invalidation starts from. aendrow row index invalidation ends, -1 means the last row index. astartcol column index invalidation starts from. ...
... parameters none. treeviewinvalidated() fires name change events for invalidated area of tree. void treeviewinvalidated( in long astartrow, in long aendrow, in long astartcol, in long aendcol ); parameters astartrow row index invalidation starts from. aendrow row index invalidation ends, -1 means the last row index. astartcol column index invalidation starts from. aendcol column index invalidation ends, -1 means the last column index. ...
nsICacheSession
key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type description doomentriesifexpired prbool expired entries will be doomed or evicted if this attribute is set to true. if false, expired entries will be returned (useful for offline mode and clients, such as http, that can update the valid lifetime of cached content). this attribute defaults to true. methods asyncopencacheentry() this method gives an asynchronous cache access. does not block the calling thread. instead, the listener will be notified when the descriptor is available. void asyncopencacheentry( in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait ...
...er will be notified when the descriptor is available. void asyncopencacheentry( in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait ); parameters key the key for cache entry. accessrequested the requested access. listener the cache listener to be notified. nowait do not wait for the cache entry when it is in use and waits for validation. doomentry() asynchronously dooms an entry specified by the key. void doomentry( in acstring key, in nsicachelistener listener ); parameters key the key for cache entry. listener the cache listener to be notified (may be null). evictentries() this method evicts all entries for this session's clientid according to its storagepolicy. void evictentries(); parameters none. isstorageenabl...
... are currently enabled for instantiation or not, depending on their existence. opencacheentry() this method gives a synchronous cache access. it returns a unique descriptor each time it is called, even if the same key is specified. when called by multiple threads for write access, only one writable descriptor will be granted. if blockingmode is set to false, it will return ns_error_cache_wait_for_validation rather than block when another descriptor has been given write access but hasn't validated the entry yet. note: if at all possible, you should use asyncopencacheentry() instead of calling opencacheentry(), in order to avoid blocking on i/o on the calling thread. this will streamline overall application performance. a cache session can only give out one descriptor with write access to a given...
...nsicacheentrydescriptor opencacheentry( in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode ); parameters key the key for cache entry. accessrequested the requested access. ...
nsICachingChannel
olean specifies whether or not the data should be cached to a file. this may fail if the disk cache is not present. the value of this attribute is usually only settable during the processing of a channel's onstartrequest. the default value of this attribute depends on the particular implementation of nsicachingchannel. cachefile nsifile get the "file" where the cached data can be found. this is valid for as long as a reference to the cache token is held. this may return an error if cacheasfile is false. read only. cacheforofflineuse boolean specifies whether or not the data should be placed in the offline cache, in addition to normal memory/disk caching. this may fail if the offline cache is not present. the value of this attribute should be set before opening the channel. cachekey nsisu...
...icular instance of nsicachingchannel could be set on another instance of nsicachingchannel provided the underlying implementations are compatible and provided the new channel instance was created with the same uri. the implementation of nsicachingchannel would be expected to use the cache entry identified by the cache token. depending on the value of nsirequest.loadflags(), the cache entry may be validated, overwritten, or simply read. the cache key may be null indicating that the uri of the channel is sufficient to locate the same cache entry. setting a null cache key is likewise valid. cachetoken nsisupports uniquely identifies the data in the cache. holding a reference to this token prevents the cached data from being removed. a cache token retrieved from a particular instance of nsicachi...
.... holding a reference to this token prevents the cached data from being removed. a cache token retrieved from a particular instance of nsicachingchannel could be set on another instance of nsicachingchannel provided the underlying implementations are compatible. the implementation of nsicachingchannel would be expected to only read from the cache entry identified by the cache token and not try to validate it. the cache token can be queryinterface'd to a nsicacheentryinfo if more detail about the cache entry is needed. for example, expiration time. offlinecacheclientid acstring the session into which to cache offline data. if not specified, data will be placed in "http-offline". offlinecachetoken nsisupports the same as cachetoken but accessing the offline app cache token if there is any. ...
...rown ns_error_not_available when there is not offline cache token. constants constant value description load_no_network_io 1 << 26 this load flag inhibits fetching from the net. an error of ns_error_document_not_cached will be sent to the listener's onstoprequest if network io is necessary to complete the request. this flag can be used to find out whether fetching this url would cause validation of the cache entry via the network. combining this flag with load_bypass_local_cache will cause all loads to fail. this flag differs from load_only_from_cache in that this flag fails the load if validation is required while load_only_from_cache skips validation where possible. load_check_offline_cache 1 << 27 this load flag causes the offline cache to be checked when fetching a request. ...
nsICrashReporter
m to which minidumps will be written when a crash happens. exceptions thrown ns_error_not_initialized if crash reporting is not initialized. serverurl nsiurl get or set the url to which crash reports will be submitted. only https and http urls are allowed, as the submission is handled by os-native networking libraries. exceptions thrown ns_error_failure on get if no url is set. ns_error_invalid_arg on set if a non-http(s) url is assigned. ns_error_not_initialized if crash reporting is not initialized. submitreports boolean user preference for submitting crash reports. methods annotatecrashreport() add some extra data to be submitted with a crash report. void annotatecrashreport( in acstring key, in acstring data ); parameters key name of the data to be added. data data to ...
...ned. ns_error_not_initialized if crash reporting is not initialized. submitreports boolean user preference for submitting crash reports. methods annotatecrashreport() add some extra data to be submitted with a crash report. void annotatecrashreport( in acstring key, in acstring data ); parameters key name of the data to be added. data data to be added. exceptions thrown ns_error_invalid_arg if key or data contain invalid characters. invalid characters for key are '=' and '\n'. invalid character for data is '\0'. ns_error_not_initialized if crash reporting not initialized. appendappnotestocrashreport() append some data to the "notes" field, to be submitted with a crash report. unlike annotatecrashreport(), this method will append to existing data. void appendappnotestocrashrepor...
...ns_error_not_initialized if crash reporting not initialized. native code only!appendobjcexceptioninfotoappnotes append note containing an obj-c exception's info. void appendobjcexceptioninfotoappnotes( in voidptr aexception ); parameters aexception nsexception object to append note for. ...
...s '\0'. ns_error_not_initialized if crash reporting not initialized. appendappnotestocrashreport() append some data to the "notes" field, to be submitted with a crash report. unlike annotatecrashreport(), this method will append to existing data. void appendappnotestocrashreport( in acstring data ); parameters data data to be added. exceptions thrown ns_error_invalid_arg if data contains invalid characters. the only invalid character is '\0'. ns_error_not_initialized if crash reporting not initialized. native code only!appendobjcexceptioninfotoappnotes append note containing an obj-c exception's info. void appendobjcexceptioninfotoappnotes( in voidptr aexception ); parameters aexception nsexception object to append note for. native code only!writeminidumpforexception write a minid...
nsILocalFile
in acstring relativefilepath ); parameters relativefilepath a native relative path. for security reasons, this cannot contain '..' or cannot start with a directory separator '/'. must be in the native file system character set. exceptions thrown ns_error_file_unrecognized_path indicates that relativefilepath incorrectly begins with a path separator character or otherwise contains invalid characters. appendrelativepath() appends a relative native path to the current path of the nsilocalfile object. void appendrelativepath( in astring relativefilepath ); parameters relativefilepath a native relative path. for security reasons, this cannot contain '..' or cannot start with a directory separator '/' . exceptions thrown ns_error_file_unrecognized_path indicates that ...
...he nsilocalfile object. void appendrelativepath( in astring relativefilepath ); parameters relativefilepath a native relative path. for security reasons, this cannot contain '..' or cannot start with a directory separator '/' . exceptions thrown ns_error_file_unrecognized_path indicates that relativefilepath incorrectly begins with a path separator character or otherwise contains invalid characters. getrelativedescriptor() returns a relative file path in an opaque, cross platform format. it is therefore not a native path. acstring getrelativedescriptor( in nsilocalfile fromfile ); parameters fromfile the file from which the descriptor is relative. there is no defined result if this parameter is null. return value an opaque string value with undefined character enco...
...ences. all current settings will be reset. void initwithnativepath( in acstring filepath ); parameters filepath a string that specifies a platform-specific, full path to a file or directory. must be in the native file system character set. exceptions thrown ns_error_file_unrecognized_path indicates that filepath is not an absolute file path or that it contains characters that are invalid for the filesystem. initwithpath() used to set the full path that this nsilocalfile references. all current settings will be reset. void initwithpath( in astring filepath ); parameters filepath a string that specifies a platform-specific, full path to a file or directory. exceptions thrown ns_error_file_unrecognized_path indicates that filepath is not an absolute file path or th...
... used to set the full path that this nsilocalfile references. all current settings will be reset. void initwithpath( in astring filepath ); parameters filepath a string that specifies a platform-specific, full path to a file or directory. exceptions thrown ns_error_file_unrecognized_path indicates that filepath is not an absolute file path or that it contains characters that are invalid for the filesystem. launch() requests that the operating system attempt to open this file. void launch(); parameters none. native code only! load returns the result of pr_loadlibrary() on the file. the caller is responsible for calling pr_unloadlibrary() on the result. prlibrarystar load(); parameters none. return value a pointer to a prlibrary. example #include "prlink.h" ...
nsIRequest
when the cache contains data that could perhaps satisfy this request. they are listed in descending order of precedence. constant value description load_bypass_cache 1 << 9 force an end-to-end download of content data from the origin server. this flag is used for a shift-reload. ...
... origin server. this flag is used for a shift-reload. load_from_cache 1 << 10 load from the cache, bypassing protocol specific validation logic. this flag is used when browsing via history. it is not recommended for normal browsing as it may likely violate reasonable assumptions made by the server and confuse users. the following flags control the frequency of cached content validation when neither load_bypass_cache or load_from_cache are set. by default, cached content is automatically validated if necessary before reuse. note: these flags are intended for normal browsing, and they should therefore not apply to content that must be validated before each use. consider, for example, a http response with a "cache-control: no-cache" header. according to rfc2616, this respons...
... neither load_bypass_cache or load_from_cache are set. by default, cached content is automatically validated if necessary before reuse. note: these flags are intended for normal browsing, and they should therefore not apply to content that must be validated before each use. consider, for example, a http response with a "cache-control: no-cache" header. according to rfc2616, this response must be validated before it can be taken from a cache. breaking this requirement could result in incorrect and potentially undesirable side-effects. constant value description validate_always 1 << 11 forces validation of any cached content independent of its expiration time. ...
...sponse with a "cache-control: no-cache" header. according to rfc2616, this response must be validated before it can be taken from a cache. breaking this requirement could result in incorrect and potentially undesirable side-effects. constant value description validate_always 1 << 11 forces validation of any cached content independent of its expiration time. validate_never 1 << 12 disables validation of expired content. validate_once_per_session 1 << 13 disables validation of expired content, provided it has already been validated (at least once) since the start of this session. constant value description load_anonymous 1 << 14 when set, this flag indicates that no user-specific data should be ...
nsIWebBrowser
t. the chrome object may optionally implement nsiwebprogresslistener instead of explicitly calling addwebbrowserlistener() and removewebbrowserlistener() to register a progress listener object. if the implementation does this, it must also implement nsiweakreference. note: the implementation should not refcount the supplied chrome object; it should assume that a non nsnull value is always valid. the embedder must explicitly set this value back to nsnull if the chrome object is destroyed before the browser object. note: nsiinterfacerequestor and nsiweakreference might also need to be implemented by the chrome object. contentdomwindow nsidomwindow the top-level dom window. the embedder may walk the entire dom starting from this value. read only. isactive boolean...
...may set this property to their own implementation if they intend to override or prevent how certain kinds of content are loaded. note: if this attribute is set to an object that implements nsisupportsweakreference, the implementation should get the nsiweakreference and hold that. otherwise, the implementation should not refcount this interface; it should assume that a non null value is always valid. in that case, the embedder should explicitly set this value back to null if the parent content listener is destroyed before the browser object. methods addwebbrowserlistener() registers a listener of the type specified by the iid to receive callbacks. the browser stores a weak reference to the listener to avoid any circular dependencies. typically this method will be called to register an ...
...ner or nsishistorylistener notifications in which case the the iid is that of the interface. void addwebbrowserlistener( in nsiweakreference alistener, in nsiidref aiid ); parameters alistener the listener to be added. aiid the iid of the interface that will be called on the listener as appropriate. return value ns_ok listener was successfully added. ns_error_invalid_arg one of the arguments was invalid or the object did not implement the interface specified by the iid. removewebbrowserlistener() removes a previously registered listener. void removewebbrowserlistener( in nsiweakreference alistener, in nsiidref aiid ); parameters alistener the listener to be removed. aiid the iid of the interface on the listener that will no longer b...
... specified by the iid. removewebbrowserlistener() removes a previously registered listener. void removewebbrowserlistener( in nsiweakreference alistener, in nsiidref aiid ); parameters alistener the listener to be removed. aiid the iid of the interface on the listener that will no longer be called. return value ns_ok listener was successfully added. ns_error_invalid_arg one of the arguments was invalid or the object did not implement the interface specified by the iid. see also nsibasewindow nsicontextmenulistener nsidomwindow nsiembeddingsitewindow nsiinterfacerequestor nsishistorylistener nsitooltiplistener nsiuricontentlistener nsiweakreference nsiwebbrowserchrome nsiwebbrowserchromefocus nsiwebprogresslistener ...
Applying styles and colors - Web APIs
rn object. we'll look at gradient and pattern objects later. by default, the stroke and fill color are set to black (css color value #000000). note: when you set the strokestyle and/or fillstyle property, the new value becomes the default for all shapes being drawn from then on. for every shape you want in a different color, you will need to reassign the fillstyle or strokestyle property. the valid strings you can enter should, according to the specification, be css <color> values. each of the following examples describe the same color. // these all set the fillstyle to 'orange' ctx.fillstyle = 'orange'; ctx.fillstyle = '#ffa500'; ctx.fillstyle = 'rgb(255, 165, 0)'; ctx.fillstyle = 'rgba(255, 165, 0, 1)'; a fillstyle example in this example, we once again use two for loops to draw a gr...
...ss rgba color values, we can use the following notation to assign a transparent color to them. // assigning transparent colors to stroke and fill style ctx.strokestyle = 'rgba(255, 0, 0, 0.5)'; ctx.fillstyle = 'rgba(255, 0, 0, 0.5)'; the rgba() function is similar to the rgb() function but it has one extra parameter. the last parameter sets the transparency value of this particular color. the valid range is again between 0.0 (fully transparent) and 1.0 (fully opaque). a globalalpha example in this example, we'll draw a background of four different colored squares. on top of these, we'll draw a set of semi-transparent circles. the globalalpha property is set at 0.2 which will be used for all shapes from that point on. every step in the for loop draws a set of circles with an increasing rad...
...no miter join will be rendered, but only a bevel join: miterlimit = max miterlength / linewidth = 1 / sin ( min θ / 2 ) the default miter limit of 10.0 will strip all miters for sharp angles below about 11 degrees. a miter limit equal to √2 ≈ 1.4142136 (rounded up) will strip miters for all acute angles, keeping miter joins only for obtuse or right angles. a miter limit equal to 1.0 is valid but will disable all miters. values below 1.0 are invalid for the miter limit. here's a little demo in which you can set miterlimit dynamically and see how this effects the shapes on the canvas. the blue lines show where the start and endpoints for each of the lines in the zig-zag pattern are. if you specify a miterlimit value below 4.2 in this demo, none of the visible corners will join with...
...below is a very simple linear gradient from white to black. var lineargradient = ctx.createlineargradient(0, 0, 150, 150); lineargradient.addcolorstop(0, 'white'); lineargradient.addcolorstop(1, 'black'); a createlineargradient example in this example, we'll create two different gradients. as you can see here, both the strokestyle and fillstyle properties can accept a canvasgradient object as valid input. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); // create gradients var lingrad = ctx.createlineargradient(0, 0, 0, 150); lingrad.addcolorstop(0, '#00abeb'); lingrad.addcolorstop(0.5, '#fff'); lingrad.addcolorstop(0.5, '#26c000'); lingrad.addcolorstop(1, '#fff'); var lingrad2 = ctx.createlineargradient(0, 50, 0, 95); lingrad2.addcolorsto...
DOMException - Web APIs
the allowed range. for example, this can be thrown by the range object. (legacy code value: 1 and legacy constant name: index_size_err) hierarchyrequesterror the node tree hierarchy is not correct. (legacy code value: 3 and legacy constant name: hierarchy_request_err) wrongdocumenterror the object is in the wrong document. (legacy code value: 4 and legacy constant name: wrong_document_err) invalidcharactererror the string contains invalid characters. (legacy code value: 5 and legacy constant name: invalid_character_err) nomodificationallowederror the object cannot be modified. (legacy code value: 7 and legacy constant name: no_modification_allowed_err) notfounderror the object cannot be found here. (legacy code value: 8 and legacy constant name: not_found_err) notsupportederror the ...
...name: invalid_character_err) nomodificationallowederror the object cannot be modified. (legacy code value: 7 and legacy constant name: no_modification_allowed_err) notfounderror the object cannot be found here. (legacy code value: 8 and legacy constant name: not_found_err) notsupportederror the operation is not supported. (legacy code value: 9 and legacy constant name: not_supported_err) invalidstateerror the object is in an invalid state. (legacy code value: 11 and legacy constant name: invalid_state_err) syntaxerror the string did not match the expected pattern. (legacy code value: 12 and legacy constant name: syntax_err) invalidmodificationerror the object cannot be modified in this way. ...
...constant name: not_supported_err) invalidstateerror the object is in an invalid state. (legacy code value: 11 and legacy constant name: invalid_state_err) syntaxerror the string did not match the expected pattern. (legacy code value: 12 and legacy constant name: syntax_err) invalidmodificationerror the object cannot be modified in this way. (legacy code value: 13 and legacy constant name: invalid_modification_err) namespaceerror the operation is not allowed by namespaces in xml. (legacy code value: 14 and legacy constant name: namespace_err) invalidaccesserror the object does not support the operation or argument. (legacy code value: 15 and legacy constant name: invalid_access_err) typemismatcherror the type of the object does not match the expected type. (legacy code value: 17 an...
...ue: 20 and legacy constant name: abort_err) urlmismatcherror the given url does not match another url. (legacy code value: 21 and legacy constant name: url_mismatch_err) quotaexceedederror the quota has been exceeded. (legacy code value: 22 and legacy constant name: quota_exceeded_err) timeouterror the operation timed out. (legacy code value: 23 and legacy constant name: timeout_err) invalidnodetypeerror the node is incorrect or has an incorrect ancestor for this operation. (legacy code value: 24 and legacy constant name: invalid_node_type_err) datacloneerror the object can not be cloned. (legacy code value: 25 and legacy constant name: data_clone_err) encodingerror the encoding or decoding operation failed (no legacy code value and constant name). notreadableerror the...
GlobalEventHandlers.onsubmit - Web APIs
the onsubmit property of the globaleventhandlers mixin is an eventhandler that processes submit events. the submit event fires when the user submits a form. syntax target.onsubmit = functionref; value functionref is a function name or a function expression. the function receives a focusevent object as its sole argument. example this example demonstrates oninvalid and onsubmit event handlers on a form. html <form id="form"> <p id="error" hidden>please fill out all fields.</p> <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. thanks!</p> javascript const form = document.getelementbyid('form'); const error = document.getelementbyid('error'); const city = docum...
... <label for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. ...
...for="city">city</label> <input type="text" id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. ...
..." id="city" required> <button type="submit">submit</button> </form> <p id="thanks" hidden>your data has been received. thanks!</p> javascript const form = document.getelementbyid('form'); const error = document.getelementbyid('error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = invalid; form.onsubmit = submit; function invalid(event) { error.removeattribute('hidden'); } function submit(event) { form.setattribute('hidden', ''); thanks.removeattribute('hidden'); // for this example, don't actually submit the form event.preventdefault(); } result specifications specification status comment html living standardthe definition of 'onsubmit' in that specification. living standard ...
HTMLFieldSetElement - Web APIs
orm element in the same document it is related to, or the null value if none matches. htmlfieldsetelement.name a domstring reflecting the name html attribute, containing the name of the field set. this can be used when accessing the field set in javascript. it is not part of the data which is sent to the server. htmlfieldsetelement.typeread only the domstring "fieldset". htmlfieldsetelement.validationmessage a domstring representing a localized message that describes the validation constraints that the element does not satisfy (if any). this is the empty string if the element is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmlfieldsetelement.validity a validitystate representing the validity states that this element is in. htmlfi...
...mstring representing a localized message that describes the validation constraints that the element does not satisfy (if any). this is the empty string if the element is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmlfieldsetelement.validity a validitystate representing the validity states that this element is in. htmlfieldsetelement.willvalidate a boolean false, because <fieldset> objects are never candidates for constraint validation. methods inherits methods from its parent, htmlelement. htmlfieldsetelement.checkvalidity() always returns true because <fieldset> objects are never candidates for constraint validation. ...
...senting the validity states that this element is in. htmlfieldsetelement.willvalidate a boolean false, because <fieldset> objects are never candidates for constraint validation. methods inherits methods from its parent, htmlelement. htmlfieldsetelement.checkvalidity() always returns true because <fieldset> objects are never candidates for constraint validation. htmlfieldsetelement.reportvalidity() always returns true because <fieldset> objects are never candidates for constraint validation. htmlfieldsetelement.setcustomvalidity() sets a custom validity message for the field set. if this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate. specifications specification status comment html ...
... html living standardthe definition of 'htmlfieldsetelement' in that specification. living standard html 5.1the definition of 'htmlfieldsetelement' in that specification. recommendation html5the definition of 'htmlfieldsetelement' in that specification. recommendation the following properties have been added: disabled, elements, name, type, valdiationmessage, validity, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(). document object model (dom) level 2 html specificationthe definition of 'htmlfieldsetelement' in that specification. obsolete no change document object model (dom) level 1 specificationthe definition of 'htmlfieldsetelement' in that specification. obsolete initial d...
HTMLFormElement - Web APIs
lformelement.acceptcharset a domstring reflecting the value of the form's accept-charset html attribute, representing the character encoding that the server accepts. htmlformelement.autocomplete a domstring reflecting the value of the form's autocomplete html attribute, indicating whether the controls in this form can have their values automatically populated by the browser. htmlformelement.novalidate a boolean reflecting the value of the form's novalidate html attribute, indicating whether the form should not be validated. 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). me...
...ating whether the form should not be validated. 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). methods this interface also inherits methods from its parent, htmlelement. checkvalidity() returns true if the element's child controls are subject to constraint validation and satisfy those contraints; returns false if some controls do not satisfy their constraints. fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled. it is up to the programmer to decide how to respond to false. rep...
...() returns true if the element's child controls are subject to constraint validation and satisfy those contraints; returns false if some controls do not satisfy their constraints. fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled. it is up to the programmer to decide how to respond to false. reportvalidity() returns true if the element's child controls satisfy their validation constraints. when false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user. requestsubmit() requests that the form be submitted using the specified submit button and its corresponding configuration. reset() resets the form to its initial state. sub...
...inition of 'htmlformelement' in that specification. living standard the following method has been added: requestautocomplete(). html5the definition of 'htmlformelement' in that specification. recommendation the elements properties returns an htmlformcontrolscollection instead of a raw htmlcollection. this is mainly a technical change. the following method has been added: checkvalidity(). the following properties have been added: autocomplete, novalidate, and encoding. ...
HTMLInputElement.stepUp() - Web APIs
n 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. the default value for the parameter, if no value is passed, is 1. the method will not cause the value to exceed the set max value, or defy the constraints set by the step attribute. ...
... syntax element.stepup( [ stepincrement ] ); parameters stepincrement the optional stepincrement paremeter is a numeric value. if no parameter is passed, stepincrement defaults to 1. ...
... = document.getelementbyid('thebutton') button.addeventlistener('click', function() { steponup() }) function steponup() { let input = document.getelementbyid('thenumber') let val = document.getelementbyid('incrementer').value if (val) { /* increment with a parameter */ input.stepup(val) } else { /* or without a parameter. try it with 0 */ input.stepup() } } css input:invalid { border: red solid 3px; } result note if you don't pass a parameter to the stepup method, it defaults to 1. any other value is a multiplier of the step attribute value, which in this case is 5. if you pass 4 as the stepincrement, the input will stepup by 4 * 5, or 20. if the parameter is 0, the number will not be incremented. the stepup will not allow the input to out of range, in this cas...
...as the stepincrement, the input will stepup by 4 * 5, or 20. if the parameter is 0, the number will not be incremented. the stepup will not allow the input to out of range, in this case stopping when it reaches 400, and rounding down any floats that are passed as a parameter. try setting the step increment to 1.2. what happens when you invoke the method? try setting the value to 4, which is not valid. what happens when you invoke the method? specifications specification status comment html living standardthe definition of 'stepup()' in that specification. living standard html 5.1the definition of 'stepup()' in that specification. recommendation html5the definition of 'stepup()' in that specification. recommendation initial de...
Using IndexedDB - Web APIs
db.transaction(["customers"], idbtransaction.read_write); the transaction() function takes two arguments (though one is optional) and returns a transaction object. the first argument is a list of object stores that the transaction will span. you can pass an empty array if you want the transaction to span all object stores, but don't do it because the spec says an empty array should generate an invalidaccesserror. if you don't specify anything for the second argument, you get a read-only transaction. since you want to write to it here you need to pass the "readwrite" flag. now that you have a transaction you need to understand its lifetime. transactions are tied very closely to the event loop. if you make a transaction and return to the event loop without using it then the transaction will bec...
...(or prevunique if you're going backwards) as the direction parameter. when nextunique or prevunique is used, the entry with the lowest key is always the one returned. index.openkeycursor(null, "nextunique").onsuccess = function(event) { var cursor = event.target.result; if (cursor) { // do something with the entries. cursor.continue(); } }; please see "idbcursor constants" for the valid direction arguments. version changes while a web app is open in another tab when your web app changes in such a way that a version change is required for your database, you need to consider what happens if the user has the old version of your app open in one tab and then loads the new version of your app in another. when you call open() with a greater version than the actual version of the data...
... var title = $('#pub-title').val(); var biblioid = $('#pub-biblioid').val(); if (!title || !biblioid) { displayactionfailure("required field(s) missing"); return; } var year = $('#pub-year').val(); if (year != '') { // better use number.isinteger if the engine has ecmascript 6 if (isnan(year)) { displayactionfailure("invalid year"); return; } year = number(year); } else { year = null; } var file_input = $('#pub-file'); var selected_file = file_input.get(0).files[0]; console.log("selected_file:", selected_file); // keeping a reference on how to reset the file input in the ui once we // have its value, but instead of doing that we rather use a...
...ick(function(evt) { console.log("delete ..."); var biblioid = $('#pub-biblioid-to-delete').val(); var key = $('#key-to-delete').val(); if (biblioid != '') { deletepublicationfrombib(biblioid); } else if (key != '') { // better use number.isinteger if the engine has ecmascript 6 if (key == '' || isnan(key)) { displayactionfailure("invalid key"); return; } key = number(key); deletepublication(key); } }); $('#clear-store-button').click(function(evt) { clearobjectstore(); }); var search_button = $('#search-list-button'); search_button.click(function(evt) { displaypublist(); }); } opendb(); addeventlisteners(); })(); // immediately-invoked function ...
PayerErrors.email - Web APIs
Web › API › PayerErrors › email
the email property is included in a payererrors object if the paymentresponse.payeremail property failed validation; in this case, the property should contain a string describing how to correct the problem. if the payer's email address passed validation, this property is not included in the payererrors object. syntax payeremail = payererrors.email; value if validation of the payer's email address (paymentresponse.payeremail) found problems, this property should be set to a domstring that explains the validation problem and how to correct it. if the email address is valid, this property should be omitted from the payererrors object. ...
...erty is not included in the payererrors object. syntax payeremail = payererrors.email; value if validation of the payer's email address (paymentresponse.payeremail) found problems, this property should be set to a domstring that explains the validation problem and how to correct it. if the email address is valid, this property should be omitted from the payererrors object. ...
...s (paymentresponse.payeremail) found problems, this property should be set to a domstring that explains the validation problem and how to correct it. if the email address is valid, this property should be omitted from the payererrors object. ...
... that explains the validation problem and how to correct it. if the email address is valid, this property should be omitted from the payererrors object. example function validatepayment(response) { const correctionpromises let paymenterrors = {}; let payererrors = {}; // check payer details if (!validemail(response.payeremail)) { payererrors.email = "please make sure you enter a valid email address." } if (!validname(response.payername)) { payererrors.email = "please enter a valid name, using only <appropriate characters>." } if (!validphone(response.payerphone)) { payererrors.phone = "please enter a valid phone number in the form ###-###-####." } // check everything else too... // } specifications specification status comment ...
PayerErrors.name - Web APIs
Web › API › PayerErrors › name
the name property is included in a payererrors object if the payername returned in the response couldn't be validated. the value is a string explaining the problem. if the payer's name validated successfully, the name property is omitted from the payererrors object. syntax payername = payererrors.name; value if this property is present in the payererrors object, the payer's name couldn't be successfully validated, and the name property's value is a domstring explaining the error. this string will be displayed to the user by the user agent's payment handling user interface. if the payer's name is valid, this property is left out of the payererrors object. ...
...payererrors.name; value if this property is present in the payererrors object, the payer's name couldn't be successfully validated, and the name property's value is a domstring explaining the error. this string will be displayed to the user by the user agent's payment handling user interface. if the payer's name is valid, this property is left out of the payererrors object. ...
...the name property's value is a domstring explaining the error. this string will be displayed to the user by the user agent's payment handling user interface. if the payer's name is valid, this property is left out of the payererrors object. ...
...yed to the user by the user agent's payment handling user interface. if the payer's name is valid, this property is left out of the payererrors object. example function validatepayment(response) { const correctionpromises let paymenterrors = {}; let payererrors = {}; // check payer details if (!validemail(response.payeremail)) { payererrors.email = "please make sure you enter a valid email address." } if (!validname(response.payername)) { payererrors.email = "please enter a valid name, using only <appropriate characters>." } if (!validphone(response.payerphone)) { payererrors.phone = "please enter a valid phone number in the form ###-###-####." } // check everything else too... // } specifications specification status comment ...
Payment Request API - Web APIs
rast of the payment sheet, making it more comfortable for the user to make a payment. credentials management: users can manage their credit cards and shipping addresses directly in the browser. a browser can also sync these "credentials" across devices, making it easy for users to jump from desktop to mobile and back again when buying things. consistent error handling: the browser can check the validity of card numbers, and can tell the user if a card has expired (or is about to expire). the browser can automatically suggest which card to use based on past usage patterns or restrictions from the merchant (e.g, "we only accept visa or mastercard"), or allow the user to say which is their default/favorite card. to request a payment, a web page creates a paymentrequest object in response to a ...
...when a paymentrequest is made. paymentrequestupdateevent enables the web page to update the details of the payment request in response to a user action. paymentmethodchangeevent represents the user changing payment instrument (e.g., switching from a credit card to debit card). paymentresponse an object returned after the user selects a payment method and approves a payment request. merchantvalidationevent represents the browser requiring the merchant (website) to validate themselves as allowed to use a particular payment handler (e.g., registered as allowed to use apple pay). dictionaries addresserrors a dictionary containing strings providing descriptive explanations of any errors in any paymentaddress entries which have errors. payererrors a dictionary containing strings pr...
...related dictionaries for the basic card specification basiccardchangedetails an object providing redacted address information that is provided as the methoddetails on the paymentmethodchange event sent to the paymentrequest when the user changes payment information. basiccarderrors an object providing any error messages associated with the fields in the basiccardresponse object that are not valid. this is used as the value of the paymentmethod property on the paymentvalidationerrors object sent to the paymentrequest when an error occurs. basiccardrequest defines an object structure for containing payment request details such as card type. basiccardresponse defines an object structure for payment response details such as the number/expiry date of the card used to make the payment, and ...
... ...
WebGL constants - Web APIs
be used with getparameter to query the scissor test. stencil_test 0x0b90 passed to enable/disable to turn on/off the stencil test. can also be used with getparameter to query the stencil test. errors constants returned from webglrenderingcontext.geterror(). constant name value description no_error 0 returned from geterror. invalid_enum 0x0500 returned from geterror. invalid_value 0x0501 returned from geterror. invalid_operation 0x0502 returned from geterror. out_of_memory 0x0505 returned from geterror. context_lost_webgl 0x9242 returned from geterror. front face directions constants passed to webglrenderingcontext.frontface(). constant name...
...act error delete_status 0x8b80 passed to getshaderparamter to determine if a shader was deleted via deleteshader. returns true if it was, false otherwise. link_status 0x8b82 passed to getprogramparameter after calling linkprogram to determine if a program was linked correctly. returns false if there were errors. use getprograminfolog to find the exact error. validate_status 0x8b83 passed to getprogramparameter after calling validateprogram to determine if it is valid. returns false if errors were found. attached_shaders 0x8b85 passed to getprogramparameter after calling attachshader to determine if the shader was attached correctly. returns false if errors occurred. active_attributes 0x8b89 passed to getprogramparameter ...
... constant name value description unpack_flip_y_webgl 0x9240 unpack_premultiply_alpha_webgl 0x9241 unpack_colorspace_conversion_webgl 0x9243 additional constants defined webgl 2 these constants are de...
... webgl_debug_renderer_info co...
Basic form hints - Accessibility
element. the aria-describedby attribute on the <button> references the id of the <div>. <button aria-describedby="descriptionrevert">revert</button> <div id="descriptionrevert">reverting will undo any changes that have been made since the last save.</div> note: the aria-describedby attribute is used for other purposes, in addition to form controls. required and invalid fields note: now that required is available to more than 97% of users globally, it is no longer recommended that you use both required and aria-required. web developers typically use presentational strategies to indicate required or invalid fields. assistive technologies (ats) cannot necessarily infer this information from the presentation. aria provides attributes for indicating that form co...
...required is available to more than 97% of users globally, it is no longer recommended that you use both required and aria-required. web developers typically use presentational strategies to indicate required or invalid fields. assistive technologies (ats) cannot necessarily infer this information from the presentation. aria provides attributes for indicating that form controls are required or invalid: the aria-required property can be applied to a form element, to indicate to an at that it is required to complete the form. the aria-invalid state can be programmatically applied, to indicate to an at which data fields have incorrect data, so that the user knows they have entered invalid data. the example below shows a simple form with three fields. on lines 4 and 12, the aria-required att...
...o indicate to an at which data fields have incorrect data, so that the user knows they have entered invalid data. the example below shows a simple form with three fields. on lines 4 and 12, the aria-required attributes are set to true (in addition to the asterisks next to the labels), indicating that the name and email fields are required. the second part of the example, a snippet of javascript validates the email format, and sets the aria-invalid attribute of the email field (line 12 of the html) according to the result (in addition to changing the presentation of the element). <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...
...v> <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 this: var validate = function () { var emailelement = document.getelementbyid(emailfieldid); var valid = emailvalid(formdata.email); // returns true if valid, false otherwise emailelement.setattribute("aria-invalid", !valid); setelementbordercolour(emailelement, valid); // sets the border to red if second arg is false }; providing helpful e...
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
Web › CSS › :is
main or footer element that is being hovered */ :is(header, main, footer) p:hover { color: red; cursor: pointer; } /* the above is equivalent to the following */ header p:hover, main p:hover, footer p:hover { color: red; cursor: pointer; } /* backwards-compatible version with :-*-any() and :matches() (it is not possible to group selectors into single rule, because presence of invalid selector would invalidate whole rule.) */ :-webkit-any(header, main, footer) p:hover { color: red; cursor: pointer; } :-moz-any(header, main, footer) p:hover { color: red; cursor: pointer; } :matches(header, main, footer) p:hover { color: red; cursor: pointer; } syntax :is( <complex-selector-list> )where <complex-selector-list> = <complex-selector>#where <complex-selector> = <compo...
...} will be ignored in browsers which don't support :unsupported even if they sup...
... difference between :is() and :where() the diffference bet...
... aside, nav) :is(section, article, aside, nav) h1 { font-size: 20px; } /* level 3 */ :is(section, article, aside, nav) :is(section, article, aside, nav) :is(section, article, aside, nav) h1 { font-size: 15px; } avoiding selector list invalidation unlike selector lists, the :is() pseudo-class doesn't get invalidated when one of the selectors passed to it isn't supported by the browser. :is(:valid, :unsupported) { ... } will still parse correctly and match :valid even in browsers which don't support :unsupported, whereas: :valid, :unsupported { ... } will be ignored in browsers which don't support :unsupported even if they support :valid. difference between :is() and :where() the diffference between the two is that :is() counts towards the specificity of the overall selector (it t...
Variable fonts guide - CSS: Cascading Style Sheets
has existed the ability to specify this via the font-weight property, which takes numeric values ranging from 100 to 900 in increments of 100, and keywords like normal or bold, which are simply aliases for their corresponding numeric values (400 and 700 in this case). these are still applied when dealing with non-variable or variable fonts, but with variable ones, any number from 1 to 1000 is now valid. it should be noted that at this point there is no way in the @font-face declaration to 'map' a specific point on the variation axis of a variable font to the keyword bold (or any other keyword). this can generally be resolved fairly easily, but does require an extra step in writing your css: font-weight: 375; font-variation-settings: 'wght' 375; the following live example's css can be edited...
... can be edited to allow you to play with font weight values. width width (represented by the wdth tag) defines the design axis of how narrow or wide (condensed or extended, in typographic terms) the letterforms can be. this is typically set in css using the font-stretch property, with values expressed as a percentage above or below ‘normal’ (100%), any number greater than 0 is technically valid—though it is far more likely that the range would fall closer to the 100% mark, such as 75%-125%. if a number value supplied is outside the range encoded in the font, the browser should render the font at the closest value allowed. note: the % symbol is not used when utilizing font-variation-settings. font-stretch: 115%; font-variation-settings: 'wdth' 115; the following live example's c...
... the letterforms but doesn’t perform any kind of character substitution. it is also variable, in that it is expressed as a numeric range. this allows the font to be varied anywhere along that axis. the allowed range is generally 0 (upright) to 20 degrees — any number value along that range can be supplied, so the font can be slanted just a tiny bit. however, any value from -90–90 degrees is valid. note: the deg keyword is not used when utilizing font-variation-settings. font-style: oblique 14deg; font-variation-settings: 'slnt' 14; the following live example's css can be edited to allow you to play with font slant/oblique values. optical size this is something new to digital fonts and css, but is actually a centuries-old technique in designing and creating metal type. optical si...
...ather than format-variations (i.e. woff2 instead of woff2-variations), but it’s best to use the proper syntax if possible. note: supplying value ranges for font-weight, font-stretch, and font-style will keep the browser from attempting to render an axis outside that range if you are using the appropriate attribute (i.e. font-weight or font-stretch), but will not block you from supplying an invalid value via font-variation-settings, so use with care. working with older browsers variable font support can be checked with css feature queries (see @supports), so it's possible to use variable fonts in production and scope the css calling the variable fonts inside a feature query block. h1 { font-family: some-non-variable-font-family; } @supports (font-variation-settings: 'wdth' 115) { h1 ...
<time-percentage> - CSS: Cascading Style Sheets
ntage> css data type represents a value that can be either a <time> or a <percentage>. syntax refer to the documentation for <time> and <percentage> for details of the individual syntaxes allowed by this type. examples use in calc() where a <time-percentage> is specified as an allowable type, this means that the percentage resolves to a time and therefore can be used in a calc() expression. ...
... refer to the documentation for <time> and <percentage> for details of the individual syntaxes allowed by this type. examples use in calc() where a <time-percentage> is specified as an allowable type, this means that the percentage resolves to a time and therefore can be used in a calc() expression. valid percentages 50% +50% optional plus sign -50% negative percentages are not valid for all properties that accept percentages invalid percentages 50 % space not allowed between the space and the percentage sign valid times 12s positive integer -456ms negative integer 4.3ms non-integer 14ms the unit is case-insensitive, although capital letters are not recommended. +0s zero with a leading + and a unit -0ms zero with a leading -...
...12.0 this is a <number>, not a <time>, because it's missing a unit. 7 ms no space is allowed between the number and the unit. ...
...12.0 this is a <number>, not a <time>, because it's missing a unit. 7 ms no space is allowed between the number and the unit. specifications specification status comment css values and units module level 4the definition of '<time-percentage>' in that specification. ...
Rich-Text Editing in Mozilla - Developer guides
dow').contentwindow.focus() } example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.compform.switchmode.checked) { setdocmode(true); } } function formatdoc(scmd, svalue) { if (validatemode()) { document.execcommand(scmd, false, svalue); odoc.focus(); } } function validatemode() { if (!document.compform.switchmode.checked) { return true ; } alert("uncheck \"show html\"."); odoc.focus(); return false; } function setdocmode(btosource) { var ocontent; if (btosource) { ocontent = document.createtextnode(odoc.innerhtml); odoc.innerhtml = ""; var opre = do...
....contenteditable = true; opre.appendchild(ocontent); odoc.appendchild(opre); } else { if (document.all) { odoc.innerhtml = odoc.innertext; } else { ocontent = document.createrange(); ocontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odoc.innerhtml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <style type="text/css"> ...
...r: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 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 &lt;h1&gt;</option> <option value="h2">title 2 &lt;h2&gt;</option> <option value="h3">title 3 &lt;h3&gt;</o...
.../option> <option value="black">black</option> </select> <select onchange="formatdoc('backcolor',this[this.selectedindex].value);this.selectedindex=0;"> <option class="heading" selected>- background -</option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc...
Making content editable - Developer guides
clipboard.paste", "allaccess"); example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.compform.switchmode.checked) { setdocmode(true); } } function formatdoc(scmd, svalue) { if (validatemode()) { document.execcommand(scmd, false, svalue); odoc.focus(); } } function validatemode() { if (!document.compform.switchmode.checked) { return true ; } alert("uncheck \"show html\"."); odoc.focus(); return false; } function setdocmode(btosource) { var ocontent; if (btosource) { ocontent = document.createtextnode(odoc.innerhtml); odoc.innerhtml = ""; var opre = do...
...endchild(opre); document.execcommand("defaultparagraphseparator", false, "div"); } else { if (document.all) { odoc.innerhtml = odoc.innertext; } else { ocontent = document.createrange(); ocontent.selectnodecontents(odoc.firstchild); odoc.innerhtml = ocontent.tostring(); } odoc.contenteditable = true; } odoc.focus(); } function printdoc() { if (!validatemode()) { return; } var oprntwin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oprntwin.document.open(); oprntwin.document.write("<!doctype html><html><head><title>print<\/title><\/head><body onload=\"print();\">" + odoc.innerhtml + "<\/body><\/html>"); oprntwin.document.close(); } </script> <style type="text/css"> ...
...r: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 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 &lt;h1&gt;</option> <option value="h2">title 2 &lt;h2&gt;</option> <option value="h3">title 3 &lt;h3&gt;</o...
.../option> <option value="black">black</option> </select> <select onchange="formatdoc('backcolor',this[this.selectedindex].value);this.selectedindex=0;"> <option class="heading" selected>- background -</option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc...
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>. this must be an integer value 0 or higher. if no minlength is specified, or an invalid value is specified, the input has no minimum length. this value must be less than or equal to the value of maxlength, otherwise the value will never be valid, as it is impossible to meet both criteria. 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. constraint validation is only applied when the value is changed by the user. once submission fails, some browsers will display an error message indicating the minimum length required and the ...
...is less than minlength utf-16 code units long, with validitystate.tooshort returning true. constraint validation is only applied when the value is changed by the user. once submission fails, some browsers will display an error message indicating the minimum length required and the current length. examples by adding minlength="5", the value must either be empty or five characters or longer to be valid. <label for="fruit">enter a fruit name that is at least 5 letters long</label> <input type="text" minlength="5" id="fruit"> we can use pseudoclasses to style the element based on whether the value is valid. the value will be valid as long as it is either null (empty) or five or more characters long. lime is invalid, lemon is valid. ...
... living standard html 5.1the definition of 'minlength attribute' in that specification. ...
...t name that is at least 5 letters long</label> <input type="text" minlength="5" id="fruit"> we can use pseudoclasses to style the element based on whether the value is valid. the value will be valid as long as it is either null (empty) or five or more characters long. lime is invalid, lemon is valid. input { border: 2px solid currentcolor; } input:invalid { border: 2px dashed red; } input:invalid:focus { background-image: linear-gradient(pink, lightgreen); } specifications specification status html living standardthe definition of 'minlength attribute' in that specification. living standard html 5.1the definition of 'minlength attribute' in that specification. recommendation ...
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
ludes the global attributes. alt defines an alternative text description of the image. note: browsers do not always display images. there are a number of situations in which a browser might not display images, such as: non-visual browsers (such as those used by people with visual impairments) the user chooses not to display images (saving bandwidth, privacy reasons) the image is invalid or an unsupported type in these cases, the browser may replace the image with the text in the element's alt attribute. for these reasons and others, provide a useful value for alt whenever possible. omitting alt altogether indicates that the image is a key part of the content and no textual equivalent is available. setting this attribute to an empty string (alt="") indicates that this ima...
... the cors request is sent with any credentials included (that is, cookies, x.509 certificates, and the authorization request header). if the server does not opt into sharing credentials with the origin site (by sending back the access-control-allow-credentials: true response header), then the browser marks the image as tainted and restricts access to its image data. if the attribute has an invalid value, browsers handle it as if the anonymous value was used. see cors settings attributes for additional information. decoding provides an image decoding hint to the browser. allowed values: sync decode the image synchronously, for atomic presentation with other content. async decode the image asynchronously, to reduce delay in presenting other content. auto default: no p...
...ese dimensions and naturalwidth/naturalheight on images would return the values specified in this attribute. explainer, examples ismap this boolean attribute indicates that the image is part of a server-side map. if so, the coordinates where the user clicked on the image are sent to the server. note: this attribute is allowed only if the <img> element is a descendant of an <a> element with a valid href attribute. this gives users without pointing devices a fallback destination. loading indicates how the browser should load the image: eager: loads the image immediately, regardless of whether or not the image is currently within the visible viewport (this is the default value). lazy: defers loading the image until it reaches a calculated distance from the viewport, as defined by ...
... a pixel density descriptor (a positive floating point number directly followed by x). if no descriptor is specified, the source is assigned the default descriptor of 1x. it is incorrect to mix width descriptors and pixel density descriptors in the same srcset attribute. duplicate descriptors (for instance, two sources in the same srcset which are both described with 2x) are also invalid. the user agent selects any of the available sources at its discretion. this provides them with significant leeway to tailor their selection based on things like user preferences or bandwidth conditions. see our responsive images tutorial for an example. width the intrinsic width of the image in pixels. must be an integer without a unit. usemap the partial url (starting with #) of an imag...
<input type="color"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › color
by entering the color into a text field in #rrggbb hexadecimal format. only simple colors (without alpha channel) are allowed though css colors has more formats, e.g. color names, functional notations and a hexadecimal format with an alpha channel. 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. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. while you can input the color in either upper- or lower-case, it will be stored in lower-case form. the value is never in any other form, and is never empty. note: setting the value to anything that isn't a valid, fully-opaque, rgb color in hexadecimal notation will result in the value being set to #000000. in particular, you can't use css's standardized color names, or any css function syntax, to set the value. this makes sense when you keep in mind that html and css are separate languages and specifications. in addition, colors with an alpha channel are not supported; specifying a color in 9-character h...
...) method to select the text currently in the edit field. if the browser instead uses a color well, select() does nothing. you should be aware of this behavior so your code can respond appropriately in either case. ...
...inputs will be a text box that validates the contents automatically to ensure that the value is in the correct format. for example, in safari 10.1, you would see something that looks looks like this: the same content looks like this in firefox 55: in this case, clicking on the color well presents the platform's color picker for you to choose a color from (in this case, the macos picker): validation a color input's value is considered to be invalid if the user agent is unable to convert the user's input into seven-character lower-case hexadecimal notation. if and when this is the case, the :invalid pseudo-class is applied to the element. example let's create an example which does a little more with the color input by tracking the change and input events to take the new color and appl...
<input type="image"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › image
e example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value none — the value attribute should not be specified. events none. supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none. methods none. value <input type="image"> elements do not accept value attributes. the path to the image to be displayed is specified in the src attribute. additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attributes: attribute description ...
...ments, 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, in css pixels, at which to draw the image src the url from which to load the image width the width, in css pixels, at which to d...
... is sent to the url given by the formaction or action attribute using an http post request. this method supports complex data and file attachments. dialog this method is used to indicate that the button simply closes the dialog with which the input is associated, and does not transmit the form data at all. this attribute is also available on <input type="submit"> and <button> elements. formnovalidate a boolean attribute which, if present, specifies that the form should not be validated before submission to the server. this overrides the value of the novalidate attribute on the element's owning form. this attribute is also available on <input type="submit"> and <button> elements. formtarget a string which specifies a name or keyword that indicates where to display the response received ...
...he form is included in the body of the form and is sent to the server. get: the data from the form is appended to the form attribute uri, with a '?' as a separator, and the resulting uri is sent to the server. use this method when the form has no side-effects and contains only ascii characters. if specified, this attribute overrides the method attribute of the element's form owner. formnovalidate html5 a boolean attribute specifying that the form is not to be validated when it is submitted. if this attribute is specified, it overrides the novalidate attribute of the element's form owner. formtarget html5 a name or keyword indicating where to display the response that is received after submitting the form. this is a name of, or keyword for, a browsing context (for example, tab, windo...
MIME types (IANA media types) - HTTP
s is the default for textual files. even if it really means "unknown textual file," browsers assume they can display it. note that text/plain does not mean "any kind of textual data." if they expect a specific kind of textual data, they will likely not consider it a match. specifically if they download a text/plain file from a <link> element declaring a css file, they will not recognize it as a valid css file if presented with text/plain. the css mime type text/css must be used. text/css css files used to style a web page must be sent with text/css. if a server doesn't recognize the .css suffix for css files, it may send them with text/plain or application/octet-stream mime types. if so, they won't be recognized as css by most browsers and will be ignored. text/html all html content shou...
...r xhtml (like application/xhtml+xml) are mostly useless nowadays. note: use application/xml or application/xhtml+xml if you want xml’s strict parsing rules, <![cdata[…]]> sections, or elements that aren't from html/svg/mathml namespaces. text/javascript per the html specification, javascript files should always be served using the mime type text/javascript. ...
...t/javascript per the html specification, javascript files should always be served using the mime type text/javascript. no other values are considered valid, and using any of those may result in scripts that do not load or run. ...
... text/x-ecmascript text/x-javascript note: even though any given user agent may support any or all of these, you should only use text/javascript. it's the only mime type guaranteed to work now and into the future. some content you find may have a charset parameter at the end of the text/javascript media type, to specify the character set used to represent the code's content. this is not valid, and in most cases will result in a script not being loaded. image types files whose mime type is image contain image data. the subtype specifies which specific image file format the data represents. only a few image types are used commonly enough to be considered safe for use on web pages: abbreviation file format mime type file extension(s) browser compatibility ...
SyntaxError: illegal character - JavaScript
use an editor that supports syntax highlighting and carefully check your code against mismatches like a minus sign ( - ) versus a dash ( – ) or simple quotes ( " ) vs non-standard quotation marks ( “ ). ...
...use an editor that supports syntax highlighting and carefully check your code against mismatches like a minus sign ( - ) versus a dash ( – ) or simple quotes ( " ) vs non-standard quotation marks ( “ ). ...
...use an editor that supports syntax highlighting and carefully check your code against mismatches like a minus sign ( - ) versus a dash ( – ) or simple quotes ( " ) vs non-standard quotation marks ( “ ). ...
...ind the source of the problem, it's often best to just delete the problematic line and retype it. forgotten characters it's easy to forget a character here or there. var colors = ['#000', #333', '#666']; // syntaxerror: illegal character add the missing quote for '#333'. var colors = ['#000', '#333', '#666']; hidden characters when copy pasting code from external sources, there might be invalid characters. watch out! var foo = 'bar';​ // syntaxerror: illegal character when inspecting this code in an editor like vim, you can see that there is actually a zero-width space (zwsp) (u+200b) character. var foo = 'bar';​<200b> ...
Date.parse() - JavaScript
g) parameters datestring a string representing a simplification of the iso 8601 calendar date extended format. (other formats may be used, but results are implementation-dependent.) return value a number representing the milliseconds elapsed since january 1, 1970, 00:00:00 utc and the date obtained by parsing the given string representation of a date. if the argument doesn't represent a valid date, nan is returned. description the parse() method takes a date string (such as "2011-10-10t14:48:00") and returns the number of milliseconds since january 1, 1970, 00:00:00 utc. this function is useful for setting date values based on string values, for example in conjunction with the settime() method and the date object. date time string format the standard string representation of a da...
... can be inconsistent across implementations. the ecmascript specification states: if the string does not conform to the standard format the function may fall back to any implementation–specific heuristics or implementation–specific parsing algorithm. unrecognizable strings or dates containing illegal element values in iso formatted strings shall cause date.parse() to return nan. however, invalid values in date strings not recognized as simplified iso format as defined by ecma-262 may or may not result in nan, depending on the browser and values provided, e.g.: // non-iso string with invalid date values new date('23/25/2014'); will be treated as a local date of 25 november, 2015 in firefox 30 and an invalid date in safari 7. however, if the string is recognized as an iso format string...
...ings not recognized as simplified iso format as defined by ecma-262 may or may not result in nan, depending on the browser and values provided, e.g.: // non-iso string with invalid date values new date('23/25/2014'); will be treated as a local date of 25 november, 2015 in firefox 30 and an invalid date in safari 7. however, if the string is recognized as an iso format string and it contains invalid values, it will return nan in all browsers compliant with es5 and later: // iso string with invalid values new date('2014-25-23').toisostring(); // throws "rangeerror: invalid date" in all es5-compliant browsers spidermonkey's implementation-specific heuristic can be found in jsdate.cpp. the string "10 06 2014" is an example of a non-conforming iso format and thus falls back to a custom routin...
...s implementation-specific heuristic can be found in jsdate.cpp. the string "10 06 2014" is an example of a non-conforming iso format and thus falls back to a custom routine. see also this rough outline on how the parsing works. new date('10 06 2014'); will be treated as a local date of 6 october, 2014, and not 10 june, 2014. other examples: new date('foo-bar 2014').tostring(); // returns: "invalid date" date.parse('foo-bar 2014'); // returns: nan differences in assumed time zone this section contains implementation-specific behavior that can be inconsistent across implementations. given a non-standard date string of "march 7, 2014", parse() assumes a local time zone, but given a simplification of the iso 8601 calendar date extended format such as "2014-03-07", it will assume a time ...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
article and its associated example shows how to use inline svg to provide a background picture for a form. it shows how javascript and css can be used to manipulate the picture in the same way you would script regular html. ...
...ovide a background picture for a form. it shows how javascript and css can be used to manipulate the picture in the same way you would script regular html. ...
...ript regular html. ...
...scussion the page is mainly regular html, css and javascript. the only interesting part is the <svg> element it contains. this element and its children are declared to be in the svg namespace. the element contains a gradient and two shapes filled with the gradient. the gradient color stops have their colors set by css. when the user enters something incorrect into the form, the script sets the invalid attribute on the <body>, and a style rule changes the gradient end-stop color to red. (another style rule makes an error message appear.) this approach has the following points in its favor: we have taken a regular html form that could have been part of an existing web site, and added an attractive, interactive background the approach is backwards compatible to browsers that do not support s...
url - Archive of obsolete content
experimental construct, validate, and parse urls. globals constructors url(source, base) the url constructor creates an object that represents a url, verifying that the provided string is a valid url in the process. any api in the sdk which has a url parameter will accept url objects, not raw strings, unless otherwise noted. parameters source : string a string to be converted into a url. if source is not a valid uri, this constructor will throw an exception. base : string an optional string used to resolve relative source urls into absolute ones. dataurl(uri) the dataurl constructor creates an object that represents a data: url, verifying that the provided string is a valid data: url in the process. ...
... functions tofilename(url) attempts to convert the given url to a native file path. this function will automatically attempt to resolve non-file protocols, such as the resource: protocol, to their place on the file system. ...
...verted; otherwise, the native file path is returned as a string. parameters url : string the url, as a string, to be converted. returns string : the converted native file path as a string. fromfilename(path) converts the given native file path to a file: url. parameters path : string the native file path, as a string, to be converted. returns string : the converted url as a string. isvaliduri(uri) checks the validity of a uri. isvaliduri("http://mozilla.org") would return true, whereas isvaliduri("mozilla.org") would return false. parameters uri : string the uri, as a string, to be tested. returns boolean : a boolean indicating whether or not the uri is valid. gettld(url) returns the top-level domain for the given url: that is, the highest-level domain under which individua...
content/mod - Archive of obsolete content
tyle, window); parameters modification : object the modification we want to remove from the target window : nsidomwindow the window to be modified. if window is not provided modification is removed from all targets it's being attached to. gettargetwindow(target) function takes target, value representing content (page) and returns nsidomwindow for that content. if target does not represents valid content null is returned. for example target can be a content window itself in which case it's will be returned back. parameters target : object the object for which we want to obtain the window represented or contained. if a nsidomwindow is given, it works as an identify function, returns target itself. returns nsidomwindow|null : the window represented or contained by the target, if any. r...
...rns nsidomwindow|null : the window represented or contained by the target, if any. returns null otherwise. attach(modification, target) function applies given modification to a given target representing a content to be modified. parameters modification : object the modification we want to apply to the target target : object target is a value that representing content to be modified. it is valid only when gettargetwindow(target) returns nsidomwindow of content it represents. detach(modification, target) function removes attached modification. if target is specified modification is removed from that target only, otherwise modification is removed from all the targets it's being attached to. parameters modification : object the modification we want to remove from the target target : o...
...resents. detach(modification, target) function removes attached modification. if target is specified modification is removed from that target only, otherwise modification is removed from all the targets it's being attached to. parameters modification : object the modification we want to remove from the target target : object target is a value that representing content to be modified. it is valid only when gettargetwindow(target) returns nsidomwindow of content it represents. if target is not provided modification is removed from all targets it's being attached to. ...
Extension Versioning, Update and Compatibility - Archive of obsolete content
nor update to version 2 of the application. the application will usually suggest to extension authors which version part it is sensible to do this with. do not mistakenly think that * in a version represents any version. the * actually represents an infinitely high number and so is really only sensibly used in the maxversion. using it in a minversion usually doesn't produce the effect you want. valid application versions automatic add-on update checking applications will periodically check for updates to installed add-ons by retrieving the updateurl. the information returned can be used to notify the user of an updated version to the add-on as well as inform the application of new application versions that the add-on is compatible with. note: starting in gecko 2.0, the automatic add-on ...
...o this you must add an updateinfourl entry to the update manifest (see the example above). the page at this url will be retrieved and displayed to the user. since it is being displayed outside of a normal webpage context it is heavily sanitized, which means there are few formatting options available and scripting and images aren't allowed. the information page retrieved must currently be totally valid xhtml, including being delivered with the mime type application/xhtml+xml (important: see problems section) you may include %app_locale% in your updateinfourl if you want to have locale information included in the url -- this allows you to customize the text based on the user's locale. you may also use the other substitution strings supported by updateurl, although those may be less useful. for...
...t be specified in one of the following ways: the updatelink to the xpi file must use https the updatelink can use http and you must include an updatehash for the xpi file using sha1, sha256, sha384 or sha512 hash algorithms. any entries in the update manifest that do not meet one of those two requirements will be ignored when checking for new versions. note that https links to sites with invalid certificates or that redirect to http sites will fail for both the update.rdf and updatelink cases. updatelink using an https site with a non-builtin token ca signed certificate will fail regardless of whether or not updatehash is used. update hashes in order to verify the integrity of the downloaded xpi you may provide an updatehash entry alongside the updatelink. this should be a hash genera...
Signing an XPI - Archive of obsolete content
the certificate more closely. press the ok button and you'll see your new certificate in the list of authorities. 2. attempt to install the signed extension either drag and drop or browse to and download the signed xpi. when the mozilla firefox software installation dialog appears the organisation name of the certificate will appear where firefox usually displays unsigned. image obtaining a valid software developer code-signing certificate warning: currently firefox expects xpi files to be signed with certificates that conform to the older object signing convention, rather than the newer code signing convention. this means that firefox will refuse to install code signed via an intermediate certificate authority such as certum level i unless the user installs that intermediate ca certif...
...e older object signing convention, rather than the newer code signing convention. this means that firefox will refuse to install code signed via an intermediate certificate authority such as certum level i unless the user installs that intermediate ca certificate into firefox first. installing the intermediate ca certificate causes firefox to mark the intermediate code signing ca certificate as a valid object signing ca certificate, which makes it all work. bug 321156 has been filed to request a way to obviate the installation of intermediate code signing ca certs into firefox. now you know it all works, you need to add a real software developer's certificate to the nss certificate database, and use that to sign the xpi. there are several issuers of software developer certificates, with the th...
...certificates, with the three key differentials: availability, cost and identity verification. many issuers will not provide a software developer certificate to individuals (how ridiculous) so you may have to search hard to find one that will, and who also has a ca root authority installed in mozilla firefox. without the certificate-issuers ca root certificate mozilla firefox will not confirm the validity of your certificate to users who want to install your extension. ideally you want a certificate that has a root ca installed in all major platforms (microsoft windows, sun java, mozilla/netscape firefox/navigator, opera) so you only use one certificate for signing all your software, no matter which platform it is for. the cheapest universally supported (mozilla, java, microsoft) certificate s...
cert_override.txt - Archive of obsolete content
sed by firefox, thunderbird, and other xul-based applications. since there is no way to add easily an exception in a xulrunner 1.9 project, you can open the page in firefox, accept the certificate, then copy the cert_override.txt to the xulrunner application profile. the syntax is described on this web site. example here is an example for a sha1-256 hash algorithm. the key and the website are not valid: # psm certificate override settings file # this is a generated file! do not edit. some.website.com:443 oid.2.16.840.1.101.3.4.2.1 00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:ff:ee:dd:cc:bb:aa:99:88:77:66:55:44:33:22:11:00 u aaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaa...
...t). ...
...ssl) hash algorithm oid sha1-256: oid.2.16.840.1.101.3.4.2.1 (most used) sha-384: oid.2.16.840.1.101.3.4.2.2 sha-512: oid.2.16.840.1.101.3.4.2.3 certificate fingerprint using previous hash algorithm one or more characters for override type: m : allow mismatches in the hostname u : allow untrusted certs (whether it's self signed cert or a missing or invalid issuer cert) t : allow errors in the validity time, for example, for expired or not yet valid certs certificate's serial number and the issuer name as a base64 encoded string ...
Microsummary XML grammar reference - Archive of obsolete content
should be in the xslt namespace: http://www.w3.org/1999/xsl/transform the <generator> element the <generator> element is the root tag for all microsummary generators, and should contain the remainder of the xml code describing the generator. attributes: name (required) a descriptive, human-readable name for the microsummary created by the generator. uri (optional) a valid uri uniquely identifying the generator. only relevant for generators dynamically created by firefox code and extensions. generators installed from the web via nssidebar::addmicrosummarygenerator are identified by the remote url from which they were downloaded, and firefox ignores the value of this attribute for them. child elements: <template> (required) defines how to transform p...
...tributes: none. child elements: <include> (optional) a regular expression matching the urls of pages that the generator is able to summarize. <exclude> (optional) a regular expression matching the urls of pages that the generator is not able to summarize. the <pages> element can contain zero or more <include> and <exclude> child elements, each of which must contain a valid javascript-compatible regular expression. it must not contain any other elements, and it does not have any attributes. when a generator is examined to determine whether or not it is able to summarize a page, the regular expressions provided by the child elements are evaluated against the url of the page. a generator is considered to be able to summarize a page if at least one of the <include> exp...
...hey intend to match. for example, the regular expression http://www\.example\.com/ matches both the url http://www.example.com/ and the url http://www.evil.com/http://www.example.com/, but the regular expression ^http://www\.example\.com/ matches only the first of those two urls. see the reference core_javascript_1.5_reference:global_objects:regexp for the details of the regular expression syntax valid for generators and the tutorial creating regular expressions for a microsummary generator for step by step instructions to writing regular expressions that match urls. the <include> element the <include> element identifies a set of pages that the generator is able to summarize. it must be a child of the <pages> element, and it must contain a javascript-compatible regular expression. for more info...
XML in Mozilla - Archive of obsolete content
mozilla has a relatively good support for xml. several world wide web consortium (w3c) recommendations and drafts from the xml family of specifications are supported, as well as other related technologies. this page is outdated. please help updating it with current information. supported core xml w3c recommendations the core xml support includes parsing xml without validation (we use the expat parser), displaying xml with css, manipulating xml documents with scripts via dom, associating stylesheets with xml documents, and namespaces in xml. the core support is very good with few bugs. dtds and other external entities mozilla does not load external entities from the web. mozilla can load external entities whose system identifier uses the chrome protocol. this feature is used mainly t...
... text/html html htm html the entire document need not be xhtml. you can use xhtml elements inside an arbitrary xml document by using the xhtml namespace. see the testing and qa section for samples. the correct xhtml namespace is http://www.w3.org/1999/xhtml please note that the xhtml entities, like &auml;, work only in conforming xhtml documents that have a valid xhtml formal public identifier (or in other words, a doctype section with a public identifier). xhtml entities will not work in arbitrary xml documents, not even if the xhtml namespace is used. the public identifiers that are recognized are: -//w3c//dtd xhtml 1.0 transitional//en -//w3c//dtd xhtml 1.1//en -//w3c//dtd xhtml 1.0 strict//en -//w3c//dtd xhtml 1.0 frameset//en -//w3c//dtd xhtml basic ...
...to fully implement xlink, we need something called a link manager. see some initial design documents. testing and qa we have a lot of testcases linked to from the browser standards compliance qa page. most of the core xml test documents on the mercurial repository are located in content/xml/tests. we also have a couple online: the books demo and the irs t...
Positioning - Archive of obsolete content
ment positions, or as 2 words specifying exactly which part of the popup and associated element should be aligned. explicit alignment values if specified as 2 words there must be exactly 1 space between the 2 words and indicates which corner or edge of the anchor is aligned with which corner of the popup. the first word specifies the anchor corner/edge and the second species the popup corner. valid values for the anchor alignment (ie, the first word) are shown below anchor alignment values topleft the popup will be aligned with the upper-left corner of the anchor. topright the popup will be aligned with the upper-right corner of the anchor. bottomleft the popup will be aligned with the lower-left corner of the anchor. bottomright ...
... the popup will be aligned with the center of the left-hand edge of the anchor. rightcenter the popup will be aligned with the center of the right-hand edge of the anchor. topcenter the popup will be aligned with the center of the top edge the anchor. bottomcenter the popup will be aligned with the center of the bottom edge the anchor. valid values for the popup alignment (ie, the second word) are shown below popup alignment values topleft the top-left corner of the popup will be aligned with the specified corner or edge of the anchor element. topright the top-right corner of the popup will be aligned with the specified corner or edge of the anchor element. bottomleft t...
...gned with the specified corner or edge of the anchor element for example, a position value of bottomleft topleft means that the popup will be positioned such that the bottom-left corner of the anchor is aligned with the upper-left corner of the popup. simple alignment values positions specified as a single word string are shortcuts for the values above. the following table shows the valid values, corresponding explicit (ie, 2 word) alignment values and an example of the alignment. single word alignment values example before_start the left side of the popup is aligned with the left side of the anchor, and the bottom of the popup is aligned along the top of the anchor. equivalent to topleft bottomleft before_end the right side of...
Template Logging - Archive of obsolete content
rors the second type of template error is a syntax error is the template rules, for example, a missing attribute or a tag out of place. these types of errors are also logged to the console, however, these types of errors are logged whether the logging flag is set or not. the following lists the errors that can occur and an explanation of what the problem is. ...
...no member variable found. action body should have an element with uri attribute the member variable could not be determined. you should specify an element inside the first <action> body with a uri attribute. ...
... never be computed properly. an example is given below this list of errors. neither subject or object variables of <triple> has a value similar to the previous error but for the <triple> element. either the subject or object variables could never be set to a value for a result. xpath expression in query could not be parsed for xml datasources, a query attribute has an xpath expression that is not valid. xpath expression in <assign> could not be parsed </assign> for xml datasources, an <assign> element has an xpath expression that is not valid. xpath expression in <binding> could not be parsed for xml datasources, a <binding> element has an xpath expression that is not valid. the two errors where neither variable of either a <member> or <triple> have a value deserve some examples. <content uri=...
Adding HTML Elements - Archive of obsolete content
you probably should not use tables for layout in xul. (there are xul elements for doing layout). notice that the prefix html: was added to the front of each tag. this is so that mozilla knows that this is an html tag and not a xul one. 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. in xul, you can add labels with the description or label element. you should use these elements when you can. you can also add labels to controls either by using the html label element, or you can simply put the text inside another html block element (such as p or div) as in the example below. example 1 : source view <html:p> search for: <html:input id="find-text"/> <button id="ok...
...text inside the div tag was displayed but the other text (expense report 1 and what i did last summer) was not. this is because there is no html or xul element capable of displaying text enclosing it. to have this text appear, you would need to put it inside the div tag, or enclose the text in a description tag. note: due to bug 554290, this text actually does render in gecko 1.9.2 and later. invalid html elements <html:po>case 1</html:po> <div>case 2</div> <html:description value="case 3"/> all three of the cases above will not display, each for a different reason. case 1 po is not a valid html tag and mozilla has no idea what to do with it. case 2 div is valid but only in html. to get it to work, you will need to add the html: qualifier. case 3 a description elemen...
...ents <html:po>case 1</html:po> <div>case 2</div> <html:description value="case 3"/> all three of the cases above will not display, each for a different reason. case 1 po is not a valid html tag and mozilla has no idea what to do with it. case 2 div is valid but only in html. to get it to work, you will need to add the html: qualifier. case 3 a description element is only valid in xul and not in html. it should not have the html: qualifier. next, we will learn how to adding spacing between elements. « previousnext » ...
More Wizards - Archive of obsolete content
needed. wizard functions the wizard works much like a tabbed panel, except that the tabs are not displayed and the user navigates between pages by using the buttons along the bottom. because all of the pages are part of the same file, all of the values of the fields on all pages will be remembered. thus, you do not have to load and save information between pages. however, you may want to do some validation of each field on each page. for this, use the handlers described in the previous section. if a field is invalid, you might display an alert. in some cases, it would be more convenient to disable the next button until valid input has been entered. the wizard has a property canadvance, which can be set to true to indicate that the next button should be enabled. if set to false, the next button...
...in the following example, the user must enter a secret code into a textbox on the first page of the wizard. the function checkcode() is called whenever the first page is shown as indicated by the onpageshow attribute. ...
...in the following example, the user must enter a secret code into a textbox on the first page of the wizard. the function checkcode() is called whenever the first page is shown as indicated by the onpageshow attribute. ...
Tree View Details - Archive of obsolete content
if not, the function just returns since non-containers cannot be opened or closed. since the third element in the item array (with an index of 2) holds whether the row is open or not, we use two code paths, the first to close a row and the second to open a row. let's examine each block of code, but let's look at the second blo...
... which should not be removed. finally, we use the splice function to remove the rows from the visibledata array and call the rowcountchanged function to redraw the tree. when deleting rows, you will need to supply a negative count of the number of rows to delete. whether opening or closing a row, we need to tell the tree to repaint the twisty in the new state. the easiest way to do this is to invalidate the row. complete example there are several other view functions we can implement but they don't need to do anything in this example, so we can create functions that do nothing for those. they are added near the end of the complete example, shown here: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window onload="init();" xmlns="http://www.mo...
...treebox.rowcountchanged(idx + 1, -deletecount); } } else { item[2] = true; var label = this.visibledata[idx][0]; var toinsert = this.childdata[label]; for (var i = 0; i < toinsert.length; i++) { this.visibledata.splice(idx + i + 1, 0, [toinsert[i], false]); } this.treebox.rowcountchanged(idx + 1, toinsert.length); } this.treebox.invalidaterow(idx); }, getimagesrc: function(idx, column) {}, getprogressmode : function(idx,column) {}, getcellvalue: function(idx, column) {}, cycleheader: function(col, elem) {}, selectionchanged: function() {}, cyclecell: function(idx, column) {}, performaction: function(action) {}, performactiononcell: function(action, index, column) {}, getrowproperties: function(idx, prop) {},...
XML - Archive of obsolete content
must be very careful about your syntax, and in particular about these four cardinal rules of xul: all events and attributes must be written in lowercase. unlike html, xul is very sensitive to case. all of the events and attributes -- even the javascript event listeners normally formatted in the javascript world with uppercase verbs (e.g., onclick, onload) -- must be lowercase or they are invalid. all strings must be double quoted. all of the values for all of the attributes declared in xul are strings. when an attribute is assigned a value (e.g., flex="1" or "onload='dointerestingstartupthing()'") that value must be double-quoted. every xul widget must use close tags to be well-formed. html allows some elements, such as <br> and <hr>, to be neither closed nor matched with a clo...
...declared in xul are strings. when an attribute is assigned a value (e.g., flex="1" or "onload='dointerestingstartupthing()'") that value must be double-quoted. every xul widget must use close tags to be well-formed. html allows some elements, such as <br> and <hr>, to be neither closed nor matched with a closing element. in xul, elements must either be of the form <tag></tag> or <tag/> to be valid. for example, <html:img src="box.gif" /> is valid, but <html:img src="box.gif"> is not. all attributes must have a value. xul is made out of xml you don't need to know all about xml in order to use xul, but you may want to read through this article to get a sense of xul's pedigree as a specialized markup language. xul is based upon xml, so it inherits a lot of the rules and syntax described...
... <memo> <from>ian oeschger</from> <to>steve rudman</to> <body>i think the first draft of the guide is done!</body> </memo> note how the memo element -- the root element in our brief definition, ordeclaration, above -- surrounds the other three elements. in the memoml definition, the memo element is defined as containing the from, to, and body elements in that order. so the example here is valid memo according to our dtd; it's a memo that's been writtten in memoml. bam! you're a markup language programmer! you can author an infinite number of memos using our new markup language, and all will be structured in a consistent, foreseeable way. this consistency makes it possible for both humans and machines to read memoml memos, to "understand" the english marked up with memoml and to do what ...
menuitem - Archive of obsolete content
erence home [ examples | attributes | properties | methods | related ] a single choice in a menupopup element. it acts much like a button but it is rendered on a menu. more information is available in the xul tutorial. ...
... the menuitem is checked. the checked attribute determines whether the menuitem is checked or not. radio the menuitem becomes part of a radio group. other menuitems that have the same value for their name attributes are part of the same radio group. only one menuitem in the same radio group can be checked at once. more information on adding checkmarks to menus in the xul tutorial validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the i...
...s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
application/http-index-format specification - Archive of obsolete content
d be presented to the user when they are viewing data drawn from the file. 102 a human readable information line in html format. this data is intended for the end user of the file format data if there is one. this data should be presented to the user when they are viewing data drawn from the file. this data should be parsed as html. 200 defines the field names for the 201 file index code. ...
...tokens may be quoted or unquoted. unquoted tokens may not contain white space. quoted tokens are terminated by the next quote but may not contain carrage returns or new lines. ...
...ted or unquoted. unquoted tokens may not contain white space. quoted tokens are terminated by the next quote but may not contain carrage returns or new lines. any illegal characters must be escaped via the url escaping syntax defined by rfc 1738. note that a 201 line encountered before a 200 line should be ignored. 300 a url pointing to the directory represented by the index if there is one. a valid path token must be url escaped. valid 200 tokens note that all tokens are case insensitive. filename the name of file that can be used to retrieve the file when combined with the full path provided by the 300 line. white space and 8 bit characters must be url encoded. content-length base 10 digits representing the size of the file in bytes. only digits are legal. last-modified rfc 112...
NPClass - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an npclass (i.e. an npobject). syntax struct npclass { uint32_t structversion; npallocatefunctionptr allocate; npdeallocatefunctionptr deallocate; npinvalidatefunctionptr invalidate; nphasmethodfunctionptr hasmethod; npinvokefunctionptr invoke; npinvokedefaultfunctionptr invokedefault; nphaspropertyfunctionptr hasproperty; npgetpropertyfunctionptr getproperty; npsetpropertyfunctionptr setproperty; npremovepropertyfunctionptr removeproperty; npenumerationfunctionptr enumerate; npconstructfunctionptr construct; }; warning: don't call these routines directly. you should instead use the appro...
...ox 3.0b1. allocate returns a pointer to a newly allocated npobject. called by npn_createobject() if non-null, otherwise the browser calls malloc(). this function is expected to allocate and return enough storage to hold the npobject that is being created. deallocate called by npn_releaseobject() when an object's reference count reaches zero. if this field is null, free() is called isntead. invalidate called on live objects that belong to a plugin instance that is being destroyed. this call is always followed by a call to the deallocate function, or free(). any attempt to use an invalidated object will result in undefined behavior. hasmethod called by npn_hasmethod() to determine whether or not a specified method exists on a given npobject. returns true if the method exists, otherwise re...
... this field is available only if structversion is np_class_struct_version_enum (2) or greater. construct called by npn_construct. this field is available only if structversion is np_class_struct_version_ctor (3) or greater. ...
NPN_ForceRedraw - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary asks the plugin host to immediately (synchronously) repaint invalid areas. note: as of firefox 4, this function no longer has any effect when running with separate plugin processes. syntax #include <npapi.h> void npn_forceredraw(npp instance); parameters the function has the following parameters: instance plug-in instance for which the function forces redrawing. description once a region of a windowless plugin has been invalidated with npn_invalidaterect() or npn_invalidateregion(), a plug-in can call npn_forceredraw() to force a paint message. ...
...ance plug-in instance for which the function forces redrawing. description once a region of a windowless plugin has been invalidated with npn_invalidaterect() or npn_invalidateregion(), a plug-in can call npn_forceredraw() to force a paint message. this causes a synchronous update event or paint message for the plug-in. browsers may ignore this request. ...
... for which the function forces redrawing. description once a region of a windowless plugin has been invalidated with npn_invalidaterect() or npn_invalidateregion(), a plug-in can call npn_forceredraw() to force a paint message. this causes a synchronous update event or paint message for the plug-in. browsers may ignore this request. ...
NPRegion - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary represents a platform-defined region of a page. ...
...gion; mac os x: typedef rgnhandle npregion; note: this may need to be updated for the cocoa event model. ...
...ef rgnhandle npregion; note: this may need to be updated for the cocoa event model. xwindows: typedef region npregion; description npregion defines the region of the plug-in window to be updated, painted, invalidated, or clipped to. ...
XForms Alert Element - Archive of obsolete content
the message of the alert element can exist in instance data, in a remote document, or as inline text. if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src - url of a document whose contents will be retrieved by the alert element and used to provide the alert message for the containing form control. ...
...ntaining form control element in the xforms document's layout. this representation is used if the alert element has an inline display style. ...
... <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> ...
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
ike rules that can be used to correct both problems. the following rule is derived from mozilla's html.css file: *|*:-moz-list-bullet, *|*:-moz-list-number {font-size: 1em;} this rule tells gecko-based browsers to use the computed value of font-size for the marker's parent, which is the list item itself. thus the font sizes of the marker and the content will be the same. since this rule is not valid css, it will prevent the validation of any stylesheet that contains it. one solution is to move the rule into its own stylesheet, and accept that the stylesheet in question will never validate. this might also be a place to put any explorer-specific css-like rules (such as scrollbar styling rules), which also will not validate. authors who are not concerned with making sure the rule applies acro...
... related links bug 110360 bug 97351 original document information author(s): eric a. ...
...e rule applies across all namespaces can use a slightly more simplified rule: *:-moz-list-bullet, *:-moz-list-number {font-size: 1em;} recommendations if it is important to make list item markers match the font size of the content, use one of the suggested rules. in situations where validation is a priority, segregate the rule into a separate stylesheet so that the rule will not confuse css validators run against the main stylesheet. related links bug 110360 bug 97351 original document information author(s): eric a. meyer, netscape communications last updated date: published 04 oct 2002; revised 07 mar 2003 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
The Business Benefits of Web Standards - Archive of obsolete content
. they have adopted web standards long ago and now work where these new skills are appreciated. familiarity with dreamweaver or any other legacy software is not a good basis for hiring creative development personnel. eliminate unwelcome future costs a very significant portion of electronically-stored information is produced for the web and written in html format. ...
...evelopment personnel. eliminate unwelcome future costs a very significant portion of electronically-stored information is produced for the web and written in html format. most of this information uses invalid html which happens to be displayed correctly in permissive older browsers. as the web evolves, web browsers may eventually become either less permissive, or behave differently when given invalid markup (e.g. parse invalid data and render it slightly differently). using valid, standards-compliant markup ensures that data will still be re-usable for a long time, as specifications on how to parse the standard formats are well documented and here to stay. contrary to popular belief, coding to standards does not mean producing less compelling content. as a matter of fact, almost anything tak...
... forum hunting and bug fixing. by using standards to start with we have a known benchmark to measure the known deviations of legacy user agents. nearly all of those deviations are now well documented and the fixes are well published and well known. conversely fixing tag soup is a black hole of time and money. well-formed code significantly reduces rendering differences in various browsers. using validation tools such as the w3c validator helps by spotting coding errors and making sure html code is well-formed, which eliminates ambiguity in parsing by browsers. standards embrace new browsers more and more browsers, other than internet explorer for windows, are used to surf the web: windows: msie, browsers using mozilla's gecko rendering engine, opera mac: ms-tasman (ie/mac's rendering eng...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
le from javascript ns_imethodimp nsscriptablepeer::nativemethod() { return ns_ok; } example 3. ...
...for the purpose of this example to keep things simple // we just assign it to instance->pdata after we create it. ...
...ranganathan last updated date: october 26, 2001 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
and their result cannot be cached. the status code of the response is known by the application caching, and it is considered cacheable. the following status code are cacheable: 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, and 501. there are specific headers in the response, like cache-control, that prevents caching. ...
...on caching, and it is considered cacheable. the following status code are cacheable: 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, and 501. there are specific headers in the response, like cache-control, that prevents caching. note that some non-cacheable requests/responses to a specific uri may invalidate previously cached responses on the same uri. for example, a put to pagex.html will invalidate all cached get or head requests to the same uri. ...
... to a specific uri may invalidate previously cached responses on the same uri. for example, a put to pagex.html will invalidate all cached get or head requests to the same uri. when both, the method of the request and the status of the response, are cacheable, the response to the request can be cached: get /pagex.html http/1.1 (…) 200 ok (…) a put request cannot be cached. ...
Debugging CSS - Learn web development
o it, at which point you can start typing the new property and devtools will show you an autocomplete list of matching properties. after selecting font-size, enter the value you want to try. you can also click the + button to add an additional rule with the same selector, and add your new rules there. note: there are other useful features in the rules view too, for example declarations with invalid values are crossed out. you can find out more at examine and edit css. understanding the box model in previous lessons we have discussed the box model, and the fact that we have an alternate box model that changes how the size of elements are calculated based on the size you give them, plus the padding and borders. devtools can really help you to understand how the size of an element is being ...
...age to search for online to help with finding a solution. if you are becoming frustrated, take a step away from the issue for a while — go for a walk, grab a drink, chat to a co-worker, or work on some other thing for a while. sometimes the solution magically appears when you stop thinking about the problem, and even if not, working on it when feeling refreshed will be much easier. do you have valid html and css? browsers expect your css and html to be correctly written, however browsers are also very forgiving and will try their best to display your webpages even if you have errors in the markup or stylesheet. if you have mistakes in your code the browser needs to make a guess at what you meant, and it might make a different decision to what you had in mind. in addition, two different brow...
...ll try their best to display your webpages even if you have errors in the markup or stylesheet. if you have mistakes in your code the browser needs to make a guess at what you meant, and it might make a different decision to what you had in mind. in addition, two different browsers might cope with the problem in two different ways. a good first step therefore is to run your html and css through a validator, to pick up and fix any errors. css validator html validator is the property and value supported by the browser you are testing in? browsers simply ignore css they don't understand. if the property or value you are using is not supported by the browser you are testing in then nothing will break, but that css won't be applied. devtools will generally highlight unsupported properties and...
How CSS is structured - Learn web development
pply styles to content. we have already discovered a variety of selectors in the getting started with css tutorial. if css is not applying to content as-expected, your selector may not match the way you think it should match. each css rule starts with a selector—or a list of selectors—in order to tell the browser which element or elements the rules should apply to. all the examples below are valid selectors, or lists of selectors. h1 a:link .manythings #onething * .box p .box p:first-child h1, h2, .intro try creating some css rules that use the selectors above. add html to be styled by the selectors. if any of the syntax above is not familiar, try searching mdn. note: you will learn more about selectors in the next module: css selectors. specificity you may encounter scenarios where...
...s apply to every single element of a page. important: css properties and values are case-sensitive. the property and value in each pair is separated by a colon. (:) look up different values of properties listed below. write css rules that apply styling to different html elements: font-size width background-color color border important: if a property is unknown, or if a value is not valid for a given property, the declaration is processed as invalid. it is completely ignored by the browser's css engine. important: in css (and other web standards), it has been agreed that us spelling is the standard where there is language variation or uncertainty. for example, color should be spelled color, as colour will not work. functions while most values are relatively simple keywords o...
... red; border-radius: 3px;} div p {margin: 0; padding: 1em;} div p + p {padding-top: 0;} for your own projects, you will format your code according to personal preference. for team projects, you may find that a team or project has its own style guide. important: though white space separates values in css declarations, property names never have white space. for example, these declarations are valid css: margin: 0 auto; padding-left: 10px; but these declarations are invalid: margin: 0auto; padding- left: 10px; do you see the spacing errors? first, 0auto is not recognized as a valid value for the margin property. the entry 0auto is meant to be two separate values: 0 and auto. second, the browser does not recognize padding- as a valid property. the correct property name (padding-left) is s...
What is a Domain Name? - Learn web development
lds is maintained by icann. label (or component) the labels are what follow the tld. a label is a case-insensitive character sequence anywhere from one to sixty-three characters in length, containing only the letters a through z, digits 0 through 9, and the - character (which may not be the first or last character in the label). a, 97, and hello-strange-person-16-how-are-you are all examples of valid labels. the label located right before the tld is also called a secondary level domain (sld). a domain name can have many labels (or components). it is not mandatory nor necessary to have 3 labels to form a domain name. for instance, www.inf.ed.ac.uk is a valid domain name. for any domain you control (e.g. mozilla.org), you can create "subdomains" with different content located at each, like de...
... name. once it's paid for, it's too late! the registrar will let you know when the domain name is properly registered. within a few hours, all dns servers will have received your dns information. note: in this process the registrar asks you for your real-world address. make sure you fill it properly, since in some countries registrars may be forced to close the domain if they cannot provide a valid address. dns refreshing dns databases are stored on every dns server worldwide, and all these servers refer to a few special servers called “authoritative name servers” or “top-level dns servers.” — these are like the boss servers that manage the system. whenever your registrar creates or updates any information for a given domain, the information must be refreshed in every dns data...
... special servers called “authoritative name servers” or “top-level dns servers.” — these are like the boss servers that manage the system. whenever your registrar creates or updates any information for a given domain, the information must be refreshed in every dns database. each dns server that knows about a given domain stores the information for some time before it is automatically invalidated and then refreshed (the dns server queries an authoritative server and fetches the updated information from it). thus, it takes some time for dns servers that know about this domain name to get the up-to-date information. how does a dns request work? as we already saw, when you want to display a webpage in your browser it's easier to type a domain name than an ip address. let's take a look ...
Basic native form controls - Learn web development
type text with line breaks, the browser removes those line breaks before sending the data to the server. the following screenshot shows default, focused and disabled text input types in firefox 71 and safari on macos and in chrome 79 and edge 18 on windows 10. note: html5 enhanced the basic original single line text field by adding special values for the type attribute that enforce specific validation constraints and other features, for example specific to entering urls or numbers. we'll cover those in the next article, the html5 input types. password field one of the original input types was the password text field type: <input type="password" id="pwd" name="pwd"> the password value doesn't add any special constraints to the entered text, but it does obscure the value entered into t...
...bled unchecked and checked radio buttons — on firefox 71 and safari 13 on macos and chrome 79 and edge 18 on windows 10. actual buttons the radio button isn't actually a button, despite its name; let's move on and look at actual buttons! there are three input types that produce buttons: submit sends the form data to the server. for <button> elements, omitting the type attribute (or an invalid value of type) results in a submit button. reset resets all form widgets to their default values. button buttons that have no automatic effect but can be customized using javascript code. then we also have the <button> element itself. this can take a type attribute of value submit, reset, or button to mimic the behevior of the three <input> types mentioned above. the main difference between...
...hat is well supported in all browsers. in the next section, we'll take a look at the newer values of the type attribute that were added in html5. ...
Your first form - Learn web development
ents to help structure the overall form — they are often referred to as html forms. 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. form controls can also be programmed to enforce specific formats or values to be entered (form validation), and paired with text labels that describe their purpose to both sighted and blind users. designing your form before starting to code, it's always better to step back and take the time to think about your form. designing a quick mockup will help you to define the right set of data you want to ask your user to enter. from a user experience (ux) point of view, it's important to remember tha...
...se the value <input/text> for the first input — the default value for this attribute. it represents a basic single-line text field that accepts any kind of text input. for the second input, we use the value <input/email>, which defines a single-line text field that only accepts a well-formed e-mail address. this turns a basic text field into a kind of "intelligent" field that will perform some validation checks on the data typed by the user. it also causes a more appropriate keyboard layout for entering email addresses (e.g. with an @ symbol by default) to appear on devices with dynamic keyboards, like smartphones. you'll find out more about form validation in the client-side form validation article later on. last but not least, note the syntax of <input> vs. <textarea></textarea>. this is...
...ow it's time to take a deeper look. forms have way more power than what we saw here and the other articles in this module will help you to master the rest. ...
Server-side web frameworks - Learn web development
ase layer that abstracts database read, write, query, and delete operations. this abstraction layer is referred to as an object-relational mapper (orm). using an orm has two benefits: you can replace the underlying database without necessarily needing to change the code that uses it. this allows developers to optimize for the characteristics of different databases based on their usage. basic validation of data can be implemented within the framework. this makes it easier and safer to check that data is stored in the correct type of database field, has the correct format (e.g. an email address), and isn't malicious in any way (crackers can use certain patterns of code to do bad things such as deleting database records). for example, the django web framework provides an orm, and refers to ...
... field, has the correct format (e.g. an email address), and isn't malicious in any way (crackers can use certain patterns of code to do bad things such as deleting database records). for example, the django web framework provides an orm, and refers to the object used to define the structure of a record as the model. the model specifies the field types to be stored, which may provide field-level validation on what information can be stored (e.g. an email field would only allow valid email addresses). the field definitions may also specify their maximum size, default values, selection list options, help text for documentation, label text for forms etc. the model doesn't state any information about the underlying database as that is a configuration setting that may be changed separately of our c...
...owing much about the language and powerful enough to keep you going. mojolicious implements this idea using bleeding edge technologies. some of the features provided by mojolicious are: a real-time web framework, to easily grow single-file prototypes into well-structured mvc web applications. restful routes, plugins, commands, perl-ish templates, content negotiation, session management, form validation, testing framework, static file server, cgi/psgi detection, and first-class unicode support. a full-stack http and websocket client/server implementation with ipv6, tls, sni, idna, http/socks5 proxy, unix domain socket, comet (long polling), keep-alive, connection pooling, timeout, cookie, multipart, and gzip compression support. json and html/xml parsers and generators with css selector s...
Accessibility API cross-reference
e alternative richtext content may be nested inside, but the canvas itself is presentational) a dialog for picking a color n/a color_chooser color_chooser n/a <input type=color> a dialog for picking a file n/a file_chooser file_chooser n/a invoked with <input type=file> no explanation given n/a n/a invalid n/a contains accessible info, but its role is not known n/a n/a unknown accessible states and properties description & notes msaa state (state_system_*) java accessibility state gnome accessibility state (atk_state_*) mac os x accessibility state aria state or property html attribute tagged pdf relev...
... n/a accessible_active_descendant_property aria-activedescendant critical info to convey immediately alert_...
... n/a accessible_active_descendant_property aria-activedescendant critical info to convey immediately alert_high n/a n/a ...
Gecko info for Windows accessibility vendors
odeinfo(), which returns a uniqueid for any iaccessible that can be cached in the internal model. when an event is received, the negative childid should match one of these cached uniqueid's, if the entire document has been stored and kept current. keeping an internal cache current means getting new subtrees of iaccessibles whenever an event_reorder is received, indicating important changes have invalidated part of the model. msaa features we do not support no one has yet asked for the following features (if you need something, please contact the mozilla accessibility community ): iaccessible methods that we don't currently support: get_acchelp get_acchelptopic put_accname put_accvalue we do not currently support the visual basic (idispatch) bindings for iaccessib...
...indicates that the absence of state_checked should be spoken as // "unchecked", and that event_state_change will be fired in the event that the // checkbox is toggled. const unsigned long state_r...
...ed; // useful on menuitem, listitem // and treeitem. indicates that the absence of state_checked should be spoken as // "unchecked", and that event_state_change will be fired in the event that the // checkbox is toggled. const unsigned long state_required = state_alert_low; // used on form controls // to indicate that this field must be filled out to submit the form const unsigned long state_invalid = state_alert_high; // used on form controls to // indicate the the field does not currently have a legal value const unsigned long state_??? = state_alert_medium; // reserved for future use. document structure exposed in msaa tree bstr roles are used for important roles that have not been defined by microsoft. when the role is retrieved in a variant returned from get_accrole, chec...
NetUtil.jsm
o 2) as an nsifile. aorigincharset the optional character set for the uri. defaults to utf-8 if not provided. abaseuri the base uri for the spec, specified as an nsiuri. return value returns the nsiuri object representing the specified target. exceptions thrown this method throws an exception with the message "must have a non-null string spec or nsifile object" and result code ns_error_invalid_arg if aspec is null. readinputstreamtostring() reads a given number of bytes from an input stream, returning a string containing those bytes. this works even if some of those bytes are zeros, instead of terminating the string at the first zero byte. string readinputstreamtostring( ainputstream, acount, aoptions ); parameters ainputstream the input stream from which to read the dat...
...options. options the aoptions parameter is a javascript object which can have any or all of the following fields: field name description charset the character encoding to use when interpreting the input stream. if you don't provide this, the input won't be decoded at all and the raw bytes will be returned. replacement a character with which to replace any invalid byte sequences in the input stream. if you don't specify a replacement character, any invalid sequences will result in ns_error_illegal_input being thrown. this option only has effect if charset is as well. return value a string containing the bytes read from the input stream. exceptions thrown ns_error_invalid_arg the specified stream is not an nsiinputstream. ns_base_stream_would_...
...he bytes read from the input stream. exceptions thrown ns_error_invalid_arg the specified stream is not an nsiinputstream. ns_base_stream_would_block reading from the specified stream would block the calling thread, and the stream is in non-blocking mode. ns_error_failure there aren't at least acount bytes available to read from the stream. ns_error_illegal_input the input stream has invalid byte sequences, and no replacement character was specified using aoptions.replacement. ...
NSS_3.12.2_release_notes.html
are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. new in nss 3.12.2 new functions in the nss shared library: sec_pkcs12addcertorchainandkey (see p12.h) new pkcs11 errors (see secerr.h) sec_error_pkcs11_general_error sec_error_pkcs11_function_failed sec_error_pkcs11_device_error bugs fixed the following bugs have been fixed in nss 3.12.2. ...
... bug 432260: [[@ pkix_pl_httpdefaultclient_hdrcheckcomplete - pkix_pl_memcpy] cra...
...cc warning when compiling with -wstrict-prototypes bug 449334: pk12util has duplicate options letters bug 449725: signver is still using static libraries. bug 450427: add comodo ecc certification authority certificate to nss bug 450536: remove obsolete xp_mac code bug 451024: certutil.exe crashes with segmentation fault inside pr_cleanup bug 451927: security/coreconf/winnt6.0.mk has invalid defines bug 452751: slot leak in pk11_findslotsbynames bug 452865: remove obsolete linker flags needed when libnss3 was linked with libsoftokn3 bug 454961: fix the implementation and use of pr_fgets in signtool bug 455348: change hyphens to underscores in debug_$(shell whoami). bug 455424: nssilckt.h defines the enumeration constant 'lock' bug 456036: stubs for deprecated functions in...
NSS 3.14.2 release notes
or other platforms, such as windows, will follow in a future nss release. (https://bugzilla.mozilla.org/show_bug.cgi?id=540986) sqlite has been updated to 3.7.15. note: please apply the patch in https://bugzilla.mozilla.org/show_bug.cgi?id=837799 if you build nss with the system sqlite library and your system sqlite library is older than 3.7.15. bug 816853 - when using libpkix for certificate validation, applications may now supply additional application-defined trust anchors to be used in addition to those from loaded security tokens, rather than as an alternative to. (https://bugzilla.mozilla.org/show_bug.cgi?id=816853) bug 772144 - basic support for running nss test suites on android devices.this is currently limited to running tests from a linux host machine using an ssh connection. o...
...ty tokens, rather than as an alternative to. (https://bugzilla.mozilla.org/show_bug.cgi?id=816853) bug 772144 - basic support for running nss test suites on android devices.this is currently limited to running tests from a linux host machine using an ssh connection. only the sshdroid app has been tested. bug 373108 - fixed a bug where, under certain circumstances, when applications supplied invalid/out-of-bounds parameters for aes encryption, a double free may occur. bug 813857 - modification of certificate trust flags from multiple threads is now a thread-safe operation. bug 618418 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padding when present. bug 807890 - added support for microsoft trust list signing eku. bug 822433 - fixed a crash in dtls_freehandshakemessag...
...r aes encryption, a double free may occur. bug 813857 - modification of certificate trust flags from multiple threads is now a thread-safe operation. bug 618418 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padding when present. bug 807890 - added support for microsoft trust list signing eku. bug 822433 - fixed a crash in dtls_freehandshakemessages. bug 823336 - reject invalid ldap aia uris sooner. bugs fixed in nss 3.14.2 https://bugzilla.mozilla.org/buglist.cgi?list_id=5502456;resolution=fixed;classification=components;query_format=advanced;target_milestone=3.14.2;product=nss compatibility nss 3.14.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.2 sha...
Enc Dec MAC Output Public Key as CSR
ailed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } switch (cmd) { case gen_csr: /* validate command for generate csr */ if (!certreqfilename || !subject) { usage(progname); } /* * generate the cert request and save it * in a file so public key can be retrieved later to wrap the symmetric key */ rv = createcertificaterequest(slot, dbdir, &pwdata, subject, certreqfilename, ascii); if (rv != secsuccess) { ...
...rt request and save it * in a file so public key can be retrieved later to wrap the symmetric key */ rv = createcertificaterequest(slot, dbdir, &pwdata, subject, certreqfilename, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "create certificate request: failed\n"); goto cleanup; } break; case encrypt: /* validate command for encrypt */ if (!certreqfilename && !infilename) { usage(progname); } /* * read cert request from a file and extract public key * generates an aes encryption key, session object * generates a mac key, session object * wraps each of those keys with rsa public key * write wrapped keys and public key into...
...sion keys * close files */ rv = encryptfile(slot, infilename, certreqfilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* validate command for decrypt */ if (!infilename && !outfilename) { usage(progname); } /* * reads intermediate header including public key and wrapped keys * finds rsa private key corresponding to the public key * unwraps two keys, creating session key objects * decryption and mac checking loop to write to output file * des...
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
c_getsessioninfo to get the login/logout state. nss never attempts to cache this information, because login state can change instantly without nss knowing about it (for example, when the user removes the card). you must update all sessions correctly when the state changes. not doing so is a common source of problems. i have noticed that nss sometimes use a session handle value of 0. is this an invalid session handle? a session handle of 0 is indeed invalid. in the past, nss uses the invalid session handle to mark problems with acquiring or using a session. there have been cases where nss would then use this handle to try to do some operation. pkcs #11 modules should fail with ckr_invalid_session. we are working to remove these cases as we find them. what are "generic crypto svcs" (the first ...
...t that contains the server's private key. does nss support the use of pkcs #11 callbacks specified in the pnotify and papplication parameters for c_opensession? nss does not currently use any of the callbacks. nss applications detect card insertion and deletion by means of polling to determine whether the card is still in the slot and whether the open session associated with that card is still valid, or by waiting on the c_waitforslotevent call. what must an x.509 certificate include to allow it to be recognized as an email certificate for use with s/mime? an email address must be included in the attribute of the subject dn or the mail attribute of the subject dn. if the subject dn does not include an email address, the certificate extension subjectaltname must include an email address. th...
...citly depends on this semantic without the use of c_copyobject. if your module does not support this semantic, it will not work with nss. questions about pins will a password change ever be done on the token? yes, nss attempts to change the password in user mode only. (it goes to sso mode only if your token identifies itself as ckf_login_required, but not ckf_user_initialized). it's perfectly valid to reject the password change request with a return value such as ckr_function_not_supported. if you do this, nss applications display an appropriate error message for the user. if i have my smart card which has initial pin set at '9999', i insert it into my reader and download with my certificate (keygen completed), can i issue 'change password' from the firefox to set a new pin to the smart ca...
NSS reference
ce. data types based on "selected ssl types and structures" in the ssl reference. nss initialization and shutdown nss_init nss_initreadwrite nss_nodb_init nss_initialize nss_shutdown utility functions based on "utility functions" in nss public functions. certificate functions based on certificate functions in the ssl reference and "certificate functions" in nss public functions. ...
...hutdown nss_init nss_initreadwrite nss_nodb_init nss_initialize nss_shutdown utility functions based on "utility functions" in nss public functions. certificate functions based on certificate functions in the ssl reference and "certificate functions" in nss public functions. ...
...vate keys and certificates between two parties. sec_pkcs12createexportcontext sec_pkcs12createpasswordprivsafe sec_pkcs12createunencryptedsafe sec_pkcs12addcertandkey sec_pkcs12addpasswordintegrity sec_pkcs12enablecipher sec_pkcs12encode sec_pkcs12destroyexportcontext sec_pkcs12decoderstart sec_pkcs12decoderimportbags sec_pkcs12decoderupdate sec_pkcs12decoderfinish sec_pkcs12decodervalidatebags sec_pkcs12decoderverify sec_pkcs12decodergetcerts sec_pkcs12decodersettargettokencas sec_pkcs12decoderiterateinit sec_pkcs12decoderiteratenext sec_pkcs12isencryptionallowed sec_pkcs12setpreferredcipher nspr functions a small number of nspr functions are required for using the certificate verification and ssl functions in nss. these functions are listed in this section. error co...
OLD SSL Reference
ation ssl_authcertificatehook ssl_authcertificate ssl_badcerthook ssl_getclientauthdatahook nss_getclientauthdata ssl_handshakecallback ssl communication functions ssl_invalidatesession ssl_datapending ssl_securitystatus ssl_getsessionid ssl_setsockpeerid ssl functions used by callbacks ssl_peercertificate ssl_revealurl ssl_revealpinarg ssl handshake functions ...
...ions ssl_enabledefault ssl_enable ssl_enablecipher ssl_setpolicy ssl_redohandshake chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator. ...
...licy ssl_redohandshake chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator. ...
NSS_3.12.3_release_notes.html
ws because it calls undeclared isatty bug 471539: stop honoring digital signatures in certificates and crls based on weak hashes bug 471665: nss reports incorrect sizes for (aes) symmetric keys bug 471715: add cert to nssckbi to override rogue md5-collision ca cert bug 472291: crash in libpkix object leak tests due to null pointer dereferencing in pkix_build.c:3218. bug 472319: vfychain validates chain even if revoked certificate. bug 472749: softoken permits aes keys of any length to be created bug 473147: pk11mode tests fails on aix when using shareable dbs. bug 473357: ssltap incorrectly parses handshake messages that span record boundaries bug 473365: incompatible argument in pkix_validate.c. bug 473505: softoken's c_initialize and c_finalize should succeed after a fork ...
...lfserv crashed in client/server tests. bug 478171: consolidate the coreconf/xxx.mk files for windows bug 478563: add _msc_ver (the cl version) to coreconf. bug 478724: nss build fails on windows since 20090213.1 nightly build. ...
...ject by cert_asciitoname bug 480142: use sizeof on the correct type of ckc_x509 in lib/ckfw bug 480257: ocsp fails when response > 1k byte bug 480280: the cka_ec_point pkcs#11 attribute is encoded in the wrong way: missing encapsulating octet string bug 480442: remove (empty) watcomfx.h from nss bug 481216: fix specific spelling errors in nss bug 482702: ocsp test with revoked ca cert validated as good. bug 483113: add environment variable to disable/enable hash algorithms in cert/crl signatures bug 483168: nss callback api for looking up a default ocsp responder url bug 483963: assertion failure in ocsp tests. bug 484425: need accessor function to retrieve symkey handle bug 484466: sec_error_invalid_args with nss_enable_pkix_verify=1 bug 485127: bltest crashes when atte...
NSS Tools crlutil
to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 -n nickname specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. bracket the nickname string with quotation marks if it contains spaces. -o output-file specify the output file name for new crl. bracket the output-file string with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -t crl-type ...
... 0 since this is non-critical extension code: the following codes are available: unspecified (0), keycompromise (1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6), removefromcrl (8), privilegewithdrawn (9), aacompromise (10) add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-critical date where: crlnumber: identifies the name of an extension non-critical: should be set to 0 since this is n...
...date should be represented in generalizedtime format (yyyymmddhhmmssz). usage the certificate revocation list management tool's capabilities are grouped as follows, using these combinations of options and arguments. options and arguments in square brackets are optional, those without square brackets are required. ...
NSS tools : crlutil
Mozilla › Projects › NSS › tools › crlutil
plain-text file containing one password. be sure to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 -n nickname specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. bracket the nickname string with quotation marks if it contains spaces. -o output-file specify the output file name for new crl. bracket the output-file string with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -t crl-type specify type of crl. p...
...where: reasoncode: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension code: the following codes are available: unspecified (0), keycompromise (1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6), removefromcrl (8), privilegewithdrawn (9), aacompromise (10) * add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-critical date where: crlnumber: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extens...
... date should be represented in generalizedtime format (yyyymmddhhmmssz). usage the certificate revocation list management tool's capabilities are grouped as follows, using these combinations of options and arguments. options and arguments in square brackets are optional, those without square brackets are required. ...
JSID_VOID
embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid except when explicitly noted in the api contract. jsid_voidhandle is the handle to the jsid which value is jsid_void. ...
...embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid except when explicitly noted in the api contract. jsid_voidhandle is the handle to the jsid which value is jsid_void. ...
...embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid except when explicitly noted in the api contract. jsid_voidhandle is the handle to the jsid which value is jsid_void. ...
Shell global objects
scompilationavailable returns whether asm.js compilation is currently available or whether it is disabled (e.g., by the debugger). issimdavailable returns true if simd extensions are supported on this platform. getcompileroptions() return an object describing some of the jit compiler options. isasmjsmodule(fn) returns whether the given value is a function containing "use asm" that has been validated according to the asm.js spec. isasmjsmoduleloadedfromcache(fn) return whether the given asm.js module function has been loaded directly from the cache. this function throws an error if fn is not a validated asm.js module. isasmjsfunction(fn) returns whether the given value is a nested function in an asm.js module that has been both compile- and link-time validated. wasmissupported() ret...
...ograms. serialize(data, [transferables, [policy]]) serialize data using js_writestructuredclone. returns a structured clone buffer object. policy must be an object. the following keys' string values will be used to determine whether the corresponding types may be serialized (value allow, the default) or not (value deny). if denied types are encountered a typeerror will be thrown during cloning. valid keys: sharedarraybuffer. deserialize(clonebuffer) deserialize data generated by serialize. detacharraybuffer(buffer) detach the given arraybuffer object from its memory, i.e. as if it had been transferred to a webworker. helperthreadcount() returns the number of helper threads available for off-main-thread tasks. reportoutofmemory() report oom, then clear the exception and return undefine...
...g) verify stack rooting 7: (generationalgc) collect the nursery every n nursery allocations 8: (incrementalrootsthenfinish) incremental gc in two slices: 1) mark roots 2) finish collection 9: (incrementalmarkallthenfinish) incremental gc in two slices: 1) mark all 2) new marking and finish 10: (incrementalmultipleslices) incremental gc in multiple slices 11: (incrementalmarkingvalidator) verify incremental marking 12: (elementsbarrier) always use the individual element post-write barrier, regardless of elements size 13: (checkhashtablesonminorgc) check internal hashtables on minor gc 14: (compact) perform a shrinking collection every n allocations 15: (checkheapaftergc) walk the heap to check its integrity after every gc 16: (checknursery) check nursery...
Secure Development Guidelines
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 type ...
... bbv: stack overflow example: void foo(char *bar) { char c[12]; strcpy(c, bar); } int main(int argc, char **argv) { foo(argv[1]); } bbv: stack overflow before the stack overflow bbv: st...
...lass nsastring common read-only methods length() isempty() equals() common methods for modifying the string assign() append() insert() truncate() checking return values often causes problems return value not handled certain cases not handled or interpreted incorrectly double meaning malloc() can return a pointer or null, but null by itself is a valid address checking return values int main() { int fds[2]; pipe(fds); write(fds[0], "data", 4); } the pipe() return value is not checked if pipe() fails, fds is not initialized write to un-initialized file descriptor checking return values check all return values—no matter how unlikely the api failure for example: close() can fail and leak file descriptor ...
Signing Mozilla apps for Mac OS X
nd certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.ou] = "43aq936h96"))' \ application.app depending on your keychain preferences, the codesign command may display a popup asking for the password for the specified keychain. ...
...te leaf[subject.ou] = "43aq936h96"))' \ application.app depending on your keychain preferences, the codesign command may display a popup asking for the password for the specified keychain. once the application has been signed, the signature of an application bundle can be validated by calling: codesign -vvvv application.app where application.app is the application bundle you wish to validate. the folder will fail to validate if any of these cases occur (there may be other cases not listed here): if any files that were included in the signature have been removed or modified if any files have been added to a folder that should have all files signed the coderesources file this file is located in your application's bundle at contents/_codesignature/coderesources. if you don't p...
...rces. if you don't provide one, codesign will automatically generate it. however, to modify apple's automatic signing process (for example, to exclude a file or folder), you'll need to provide this file.. once the application bundle is signed, this file will contain the hashes/checksums of all files that are included in the signature. if any file is subsequently changed, the folder will no longer validate. the coderesources file used to sign official firefox and thunderbird builds is available in mozilla-central. for more details on using the coderesources file, refer to the code resources section on erick dransch's blog post about code signing. ...
XForms Accessibility
eady to be tested. you will find trunk builds of firefox at ftp.mozilla.org, trunk builds of xforms extension (windows) at ftp.mozilla.org or trunk builds of xforms extension (linux) ftp.mozilla.org. build it yourself if you would like to build firefox/seamonkey yourself then please ensure your .mozconfig file has the following option: ac_add_options --enable-extensions=default,xforms,schema-validation how to test there are two approaches to test xforms accessibility. the first is to use and assistive technology such as a screen reader, or an accessibility testing tool, to make sure xforms elements have proper accessible objects. or you may be guided by toolkit checklist to check keyboard navigation for xforms controls. you can try the following link to test xforms accessibility: vi...
... properties are formed for forms control elements. name it is formed from value of child xforms label element if the element doesn't have labelledby attribute. description it is formed from value of child xforms hint element if the element doesn't have describedby attribute. state it is formed as well from model item properties (mips) of instance node that xforms element is bound to as from valid/invalid or in-range/out-of-range states of instance node. instance node states are mapped to accessibility state constants declared in nsiaccessiblestates interface like it shown below: relevant - state_unavailable readonly - state_readonly required - state_required invalid - state_invalid out of range - state_invalid attributes redefines datatype aria attribute. its value is xml schema...
...sible object. help specifies contextual help for the containing form control (see the spec, the docs). the help element has role_alert role. hint similar to a tooltip (see the spec, the docs). the value of hint element is used as description of accessible object. alert this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec, the docs). the alert element has role_alert role for both usual and inline alert elements. message used in combination with event listeners to display a message to the user when the specified event occurs (see the spec, the docs). the message element has role_alert role. resources below you will find a list of xforms/accessibli...
nsDependentCString
class declaration nstdependentstring_chart stores a null-terminated, immutable sequence of characters. subclass of nststring that restricts string value to an immutable character sequence. this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use. ...
...endentstring_chart stores a null-terminated, immutable sequence of characters. subclass of nststring that restricts string value to an immutable character sequence. this class does not own its data, so the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use. ...
...xisting string at which the dependent string should start. this is similar to using substring(str, startpos), except that the resulting string is flat. void nsdependentcstring() - source constructs an nsdependentstring to be rebound later. nsdependentcstring(const nsacstring_internal&) - source obsolete in gecko 9. this constructor should not be used. parameters nsacstring_internal& str assertvalid void assertvalid() - source verify restrictions rebind void rebind(const char*) - source allow this class to be bound to a different string... parameters char* data void rebind(const char*, pruint32) - source parameters char* data pruint32 length void rebind(const char*, const char*) - source parameters char* start char* end operator= nscstring& operator=(const nsc...
nsIAccessibilityService
the container content ...
...int, out boolean aishidden); nsiaccessible addnativerootaccessible(in voidptr aatkaccessible); void removenativerootaccessible(in nsiaccessible arootaccessible); void invalidatesubtreefor(in nsipresshell apresshell, in nsicontent achangedcontent, in pruint32 aevent); methods removenativerootaccessible() void removenativerootaccessible( in nsiaccessible arootaccessible ); invalidatesubtreefor() invalidate the accessibility cache associated with apresshell, for accessibles that were generated for acontainercontent and it's subtree. ...
... <tt>achangedcontent</tt> the affected dom content. ...
nsIAccessibleHyperLink
perlink.idlscriptable a cross-platform interface that supports hyperlink-specific properties and methods. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessible getanchor(in long index); note: renamed from getobject in gecko 1.9 nsiuri geturi(in long index); boolean isselected(); obsolete since gecko 1.9 boolean isvalid(); obsolete since gecko 1.9 attributes attribute type description anchorcount long the number of anchors within this hyperlink. is normally 1 for anchors. this anchor is, for example, the visible output of the html:a tag. with an image map, reflects the actual areas within the map. read only. note: renamed from anchors in gecko 1.9 exceptions thrown...
...the accessible tree. startindex long the offset of the hyperlink accessible within the parent accessible. the returned value is related to the nsiaccessiblehyperlink interface of the object that owns this hyperlink. read only. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. valid boolean determines whether the hyperlink is valid, for example points to a valid url. read only. note: currently only used with aria links, and the author has to specify that the link is invalid via the aria-invalid='true' attribute. in all other cases, true is returned. exceptions thrown ns_error_failure indicates that the accessible is unattached from the ac...
...g index ); parameters index the 0-based index of the uri to be returned. return value the nsiuri object containing the specifications for the uri. isselected() obsolete since gecko 1.9 (firefox 3) note: has been replaced by the selected attribute. boolean isselected(); parameters none. return value true if the element currently has the focus. isvalid() obsolete since gecko 1.9 (firefox 3) note: has been replaced by the valid attribute. boolean isvalid(); parameters none. return value true if the hyperlink is valid. remarks anchors, image maps, xul:labels with class="text-link" implement this interface. see also nsiaccessible nsiuri ...
nsIAccessibleText
the maximal height of all the characters in the text or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate. void getcharacterextents( in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype ); parameters offset index of the character for which to return its bounding box. the valid range is 0..length. x x coordinate of the bounding box of the referenced character. y y coordinate of the bounding box of the referenced character. width width of the bounding box of the referenced character. height height of the bounding box of the referenced character. coordtype specifies if the coordinates are relative to the screen or to the parent window (see constants declared in nsiaccessi...
...the index of the character that is rendered on to the display at that point. y the position's y value for which to look up the index of the character that is rendered on to the display at that point. coordtype screen coordinates or window coordinates (see constants declared in nsiaccessiblecoordinatetype). return value offset - index of the character under the given point or -1 if the point is invalid or there is no character under the point. getrangeextents() the virtual character after the last character of the represented text, that is the one at position length is a special case. it represents the current input position and will therefore typically be queried by at more often than other positions. because it does not represent an existing character its bounding box is defined in relation t...
...he characters in the text or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate. void getrangeextents( in long startoffset, in long endoffset, out long x, out long y, out long width, out long height, in unsigned long coordtype ); parameters startoffset index of the character for which to return its bounding box. the valid range is 0..length. endoffset index of the character for which to return its bounding box. the valid range is 0..length. x x coordinate of the bounding box of the referenced character. y y coordinate of the bounding box of the referenced character. width width of the bounding box of the referenced character. height height of the bounding box of the referenced character. coordtype specifies if the...
nsIArray
ray should not be modified. documentation within a specific interface should describe variations from this convention. it is also convention that if an interface provides access to an nsiarray, that the array should not be queryinterfaced to an nsimutablearray for modification. if the interface in question had intended the array to be modified, it would have returned an nsimutablearray! null is a valid entry in the array, and as such any nsisupports parameters may be null, except where noted. method overview nsisimpleenumerator enumerate(); unsigned long indexof(in unsigned long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type description length unsigned long...
...merate() enumerate the array. nsisimpleenumerator enumerate(); parameters none. return value a new enumerator positioned at the start of the array. exceptions thrown ns_error_failure if the array is empty (to make it easy to detect errors). ns_error_out_of_memory if there is not enough memory to complete the operation. indexof() get the position of a specific element. note that since null is a valid input, exceptions are used to indicate that an element is not found. unsigned long indexof( in unsigned long startindex, in nsisupports element ); parameters startindex the initial element to search in the array. to start at the beginning, use 0 as the startindex. element the element you are looking for. return value a number >= startindex which is the position of the element in the array.
...t to search in the array. to start at the beginning, use 0 as the startindex. element the element you are looking for. return value a number >= startindex which is the position of the element in the array. exceptions thrown ns_error_failure if the element was not in the array. queryelementat() retrieve a specific element of the array, and queryinterface it to the specified interface. null is a valid result for this method, but exceptions are thrown in other circumstances. void queryelementat( in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result ); parameters index position of element. uuid the iid of the requested interface. result the object, queryinterface'd to the requested interface. exceptions thrown ns_error_illegal_value when index > length-...
nsICacheEntryDescriptor
netwerk/cache/nsicacheentrydescriptor.idlscriptable this interface provides a cache entry descriptor. ...
...atus. getmetadataelement() this method retrieves the meta data. meta data is a table of key/value string pairs. the strings do not have to conform to any particular charset, but they must be null terminated. string getmetadataelement( in string key ); parameters key the key for retrieving the meta data. return value returns the string value containing the meta data for the provided key. markvalid() this method means that a writer must validate this cache object before any readers are given a descriptor to the object. void markvalid(); parameters none. openinputstream() this method opens blocking input stream to cache data. this will fail if the cache entry is not stream based. use the stream transport service to asynchronously read this stream on a background thread. the returned stream ...
...e end of the stream has undefined consequences. return value returns blocking, unbuffered output stream. setdatasize() this method sets the cache entry data size. this will fail if the cache entry is stream based. void setdatasize( in unsigned long size ); parameters size the cache entry data size. setexpirationtime() this method sets the time at which the cache entry should be considered invalid (in seconds since the epoch). void setexpirationtime( in pruint32 expirationtime ); parameters expirationtime the time for cache entry expiration (in seconds). setmetadataelement() this method sets the meta data. meta data is a table of key/value string pairs. the strings do not have to conform to any particular charset, but they must be null terminated. void setmetadataelement( in string ...
nsIDOMMozNetworkStatsManager
providing filtering options. return value an nsidomdomrequest object. if successful, the request result is an nsidommoznetworkstats object describing the network statistics. if network stats are not available for some dates, then rxbytes and txbytes are undefined for those dates. if the filtering start date is greater than the end date, an exception is thrown. exceptions thrown ns_error_invalid_arg the filtering start date is greater than the end date. ns_error_not_implmented both appmanifesturl and servicetype are specified at the same time in the networkstatsgetoptions dictionary. invalidnetwork the network must be in the return of getavailablenetworks. addalarm() install an alarm on a network. when total data usage reaches threshold bytes, a "networkstats-alarm" system messag...
...able, the moznetworkstatsmanager.getavailablenetworks method returns an array of interfaces. threshold the total data usage threshold in bytes. options optional filtering options. networkstatsalarmoptions is a dictionary object providing filtering options. return value an nsidomdomrequest object. if successful, the result field of the domrequest keeps the alarm id. exceptions thrown invalidnetwork the network must be in the return of getavailablenetworks. getallalarms() obtain all alarms for those networks returned by getavailablenetworks. if a network is provided, only retrieves the alarms for that network. nsidomdomrequest getallalarms([optional] in nsisupports network); parameters network optional the origin of the data. it can specify wifi, mobile, or null. if null, da...
...igin of the data. it can specify wifi, mobile, or null. if null, data measurement from both origins are merged. to know in advance which kind of origin is available, the moznetworkstatsmanager.getavailablenetworks method returns an array of interfaces. return value an alarm object with the same fields as that in the system message; alarmid, network, threshold, and data. exceptions thrown invalidnetwork the network must be in the return of getavailablenetworks. removealarms() remove all network alarms. if an alarmid is provided, then only that alarm is removed. nsidomdomrequest removealarms([optional] in long alarmid); parameters alarmid id of an alarm, like the one returned by addalarm. return value an nsidomdomrequest object. clearstats() remove all stats related with th...
nsIFocusManager
edsfocus); native code only! attributes attribute type description activewindow nsidomwindow the most active (frontmost) window, or null if no window that is part of the application is active. setting the activewindow raises it, and focuses the current child window's current element, if any. setting this to null or to a non-top-level window throws an ns_error_invalid_arg exception. focusedelement nsidomelement the element that is currently focused. this will always be an element within the document loaded in focusedwindow or null if no element in that document is focused. read only. focusedwindow nsidomwindow the child window within the activewindow that is focused. this will always be activewindow, a child window of activewindow...
...sition of the caret. this is a special value used to focus links as the caret moves over them in caret browsing mode. methods clearfocus() clears the focused element within awindow. if the current focusedwindow is a descendant of awindow, sets the current focusedwindow to awindow. void clearfocus( in nsidomwindow awindow ); parameters awindow exceptions thrown ns_error_invalid_arg if awindow is null. native code only!contentremoved obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. called when content has been removed. void contentremoved( in nsidocument adocument, in nsicontent aelemen...
...a child descendant window that is focused. if false, then the return value will be the frame element if the focus is in a child frame. afocusedwindow will be set to the currently focused descendant window of awindow, or to awindow if adeep is false. this will be set even if no element is focused. return value the currently focused element within awindow. exceptions thrown ns_error_invalid_arg if awindow is null. getlastfocusmethod() pruint32 getlastfocusmethod( in nsidomwindow window ); parameters window if null, then the current focusedwindow will be used by default. this has the result of retrieving the method that was used to focus the currently focused element. return value the method that was used to focus the element in window. this will either be 0, flag_b...
nsINavHistoryResultViewer
e is discouraged since it could be removed at any time. try to avoid using it. note: most methods in this interface were renamed in gecko 1.9.2, and others have slightly different parameter lists. ...
... void containerclosed( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node whose state changed. containeropened() called when a container node's state changes from closed to opened. void containeropened( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container node whose state changed. invalidatecontainer() called when something has happened that requires that the contents of a container be rebuilt. void invalidatecontainer( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container that should be rebuilt. nodeannotationchanged() called right after the annotation on a node has changed. this is called when the annotation is changed, set, o...
...) called when the sorting order is changed to a particular mode. for trees, this would update the column headers to reflect the altered sorting. void sortingchanged( in unsigned short sortingmode ); parameters sortingmode one of the nsinavhistoryqueryoptions.sort_by_* constants, indicating the softing mode. remarks this method is only called to update the sorting user interface. invalidateall() is called as well if the sorting changes, in order to cause the contents to update properly. see also nsinavhistoryresult, nsitreeview, displaying places information using views ...
nsIThreadObserver
nsigned long recursiondepth); void ondispatchedevent(in nsithreadinternal thread); void onprocessnextevent(in nsithreadinternal thread, in boolean maywait, in unsigned long recursiondepth); methods afterprocessnextevent() called by the nsithread method nsithread.processnextevent() after an event is processed. this method is only called on the target thread. note: it is valid to change the thread's observer during a call to this method. void afterprocessnextevent( in nsithreadinternal thread, in unsigned long recursiondepth ); parameters thread the nsithread on which the event was processed. recursiondepth the number of calls to nsithread.processnextevent() on the call stack in addition to the current call. ondispatchedevent() called after an event has...
...nt( in nsithreadinternal thread, in unsigned long recursiondepth ); parameters thread the nsithread on which the event was processed. recursiondepth the number of calls to nsithread.processnextevent() on the call stack in addition to the current call. ondispatchedevent() called after an event has been dispatched to the thread. this method may be called from any thread. ...
... void onprocessnextevent( in nsithreadinternal thread, in boolean maywait, in unsigned long recursiondepth ); parameters thread the nsithread on which the event is going to be processed. maywait true if the method is allowed to block the calling thread. ...
nsITreeColumn
the nsitreecolumn interface represents a tree column. layout/xul/base/src/tree/public/nsitreecolumns.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void getidconst([shared] out wstring idconst); native code only! nsitreecolumn getnext(); nsitreecolumn getprevious(); void invalidate(); attributes attribute type description atom nsiatom the atom attribute of nsitreecolumn which returns an nsiatom for the column, making it fast to do comparisons. read only. native code only! columns nsitreecolumns the nsitreecolumns containing this column. read only. cycler boolean if true, then the column is a cycler column. if the cycler attribute is not set, the column cells are regular text cell...
...see also nsitreecolumns ...
...see also nsitreecolumns ...
nsIWindowsRegKey
d keys. read only. key hkey this attribute exposes the native hkey and is available to provide c++ consumers with the flexibility of making other windows registry api calls that are not exposed via this interface. it is possible to initialize this object by setting an hkey on it. in that case, it is the responsibility of the consumer setting the hkey to ensure that it is a valid hkey. warning: setting the key does not close() the old key. native code only! valuecount unsigned long this attribute returns the number of values under this key. read only. constants root key constants the values for these keys correspond to the values from winreg.h in the ms platform sdk. the root_key_ prefix corresponds to the hkey_ prefix in the ms platform sdk. this...
... reg_none type_string 1 reg_sz type_binary 3 reg_binary type_int 4 reg_dword type_int64 11 reg_qword methods close() this method closes the key. if the key is already closed, then this method does nothing. void close(); parameters none. create() this method opens an existing key or creates a new key. note: on 32-bit windows, it is valid to pass any hkey as the rootkey parameter of this function. however, for compatibility with 64-bit windows, that usage should probably be avoided in favor of createchild(). void create( in unsigned long rootkey, in astring relpath, in unsigned long mode ); parameters rootkey a root key defined above or any valid hkey on 32-bit windows. relpath a relative path from the give...
.... return value true if the key has a value by the given name. iswatching() this method returns true if the key is being watched for changes (that is, if startwatching() was called). boolean iswatching(); parameters none. return value true if the key is being watched for changes. open() this method opens an existing key. this method fails if the key does not exist. note: on 32-bit windows, it is valid to pass any hkey as the rootkey parameter of this function. however, for compatibility with 64-bit windows, that usage should probably be avoided in favor of openchild(). void open( in unsigned long rootkey, in astring relpath, in unsigned long mode ); parameters rootkey a root key defined above or any valid hkey on 32-bit windows. relpath a relative path from the given ro...
nsIXULTemplateQueryProcessor
added should be applied to each result when the result's rulematched method is called, since the bindings are different for each rule. the reference aref may be used to determine the reference when calculating the value for the binding, for example when a value should depend on the value of another variable. the syntax of the expression aexpr is defined by the query processor. if the syntax is invalid, the binding should be ignored. only fatal errors should be thrown, or ns_error_unexpected if generateresults() has already been called. as an example, if the reference aref is the variable ?count which holds the value 5, and the expression aexpr is the string '+2', the value of the variable avar would be 7, assuming the query processor considers the syntax '+2' to mean add two to the reference. ...
...ef. nsisimpleenumerator generateresults( in nsisupports adatasource, in nsixultemplateresult aref, in nsisupports aquery ); parameters adatasource datasource for the data. aref context reference value used as a starting point. aquery the compiled query returned from query compilation. return value an enumerator of nsixultemplateresult objects as the results. exceptions thrown ns_error_invalid_arg if aquery is invalid. getdatasource() retrieve the datasource to use for the query processor. the list of datasources in a template is specified using the datasources attribute as a space separated list of uris. this list is processed by the builder and supplied to the query processor in the adatasources array as a list of nsiuri objects or nsidomnode objects. this method may return an objec...
...ilt. this method must be called once before any of the other query processor methods except for translateref(). void initializeforbuilding( in nsisupports adatasource, in nsixultemplatebuilder abuilder, in nsidomnode arootnode ); parameters adatasource datasource for the data. abuilder the template builder. arootnode the root node the builder is attached to. exceptions thrown ns_error_invalid_arg if the datasource is not supported. ns_error_unexpected if generateresults() has already been called. translateref() translate a ref attribute string into a result. this is used as the reference point by the template builder when generating the first level of content. for recursive generation, the result from the parent generation phase will be used directly as the reference so a translation...
XPIDL
en an in type. special in typelib. nsid this type gets const when an in type. special in typelib. ptr the type is really (native str)* ref the type is really (native str)& utf8string this is an nsacstring declaration whose text is utf-8. as far as i can tell, these properties also apply to typedefs. need to verify. webidl interfaces are also valid xpidl types. to declare a webidl interface in xpidl, write webidl interfacename;. webidl types will be passed as mozilla::dom::interfacename* when used as in-parameters, as mozilla::dom::interfacename** when used as out or inout-parameters, and as refptr<mozilla::dom::interfacename> when used as an array element. other webidl types (e.g. dictionaries, enums, and unions), are not currently suppo...
...ary compatibility. when a change to an interface made by an xpidl developer requires that third-party binary addons change their source code, we say that it affects source compatibility. in table 5, the columns on the far right indicate whether changes to a specific attribute affect source compatibility, binary compatibility, or both. ...
...en a change to an interface made by an xpidl developer requires that third-party binary addons change their source code, we say that it affects source compatibility. in table 5, the columns on the far right indicate whether changes to a specific attribute affect source compatibility, binary compatibility, or both. ...
Building a Thunderbird extension 3: install manifest
your extension. it is not the thunderbird version number (which is stored in the minversion and maxversion fields). <em:creator>jenzed</em:creator>: this optional value is used to store the extension author's name. <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>: this element contains the version id of the application that this add on is developed for. it is defined by mozilla. ...
...cation that this add on is developed for. it is defined by mozilla. a list of valid application ids can be found here. normally the id does not change and is always the same even for different versions of thunderbird. <em:minversion>1.5</em:minversion>: this element indicates the earliest version of thunderbird for which the extension is intended to work. do not use a wildcard (such as "*"). see valid application versions for a list of the supported version numbers and formats. <em:maxversion>5.0.*</em:maxversion>: this element indicates the most recent version of thunderbird for which the extension is intended to work. this cannot be higher than the currently available version. ...
... there are more optional elements that can be specified in install.rdf. these are described on the install manifests page. note that elements can be specified in any order, as long as they are children of the <description> node. ...
WebIDL bindings
arg3); }; will correspond to these c++ function declarations: void getmyattr(nsstring& retval); void setmyattr(const nsastring& value); void mymethod(const sequence<nsstring>& arg1, const nsastring& arg2, const optional<nsastring>& arg3, nsstring& retval, errorresult& rv); usvstring usvstring is reflected just like domstring. utf8string utf8string is a string with guaranteed-valid utf-8 contents. it is not an standard in the webidl spec, but its observables are the same as those of usvstring. it is a good fit for when the specification allows a usvstring, but you want to process the string as utf-8 rather than utf-16. it is reflected in three different ways, depending on use: arguments become const nsacstring&. return values become an nsacstring& out param appended t...
...recated="tag"] when deprecating an interface or method, the [deprecated] annotation causes the webidl compiler to insert code that generates deprecation warnings. this annotation can be added to interface methods or interfaces. adding this to an interface causes a warning to be issued the first time the object is constructed, or any static method on the object is invoked. the complete list of valid deprecation tags is maintained in nsdeprecatedoperationlist.h. each new tag requires that a localized string be defined, containing the deprecation message to display. [crossoriginreadable] used to flag an attribute that, when read, will not have the same-origin constraint tested: it can be read from a context with a different origin. [crossoriginwrite] used to flag an attribute that, when w...
.... this will avoid exposing chrome uris and other implementation details to the content code. when throwing because a specification requires an exception, you need to create the exception from the window your webidl object is associated with (the one that was passed to your init method). the binding code will then rethrow that exception to the web page. an example of how this could work: if (!isvalid(passedinobject)) { throw new this.contentwindow.typeerror("object is invalid"); } or if (!isvalid(passedinobject)) { throw new this.contentwindow.domexception("object is invalid", "invalidstateerror"); } depending on which exact exception the specification calls for throwing in this situation. in some cases you may need to perform operations whose exception message you just want to prop...
ArrayType
array length optional it denotes the number of entries present in an array or the number of elements that an array should contain. if you don't specify this parameter, the array's length is unspecified. return value a ctype represents the newly declared array type. exceptions thrown typeerror type is not a ctype, or type.size is undefined.if the length is specifed but if it is not a valid one,then it is also thrown rangeerror the size of the resulting array can't be represented as both a size_t and as a javascript number. properties property type description elementtype ctype the data type of the elements in an array type. read only. length number the number of elements in the array, or undefined if the array type doesn't have a s...
...e these properties are available on all ctype objects. property type description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for other function, pointer, and array types, this should be a valid c type expression. ptr ctype returns a ctype representing the data type "pointer to this type". this is the result of calling ctypes.pointertype(the_type). read only. size number the size of the type, in bytes. this is the same value as the c sizeof. read only. note: ctypes.void_t.size is undefined. method overview methods inherited from cty...
...ource() string tostring() arraytype cdata methods addressofelement() returns a new cdata object of the appropriate pointer type, whose value points to the specified array element on which the method was called. cdata addressofelement( idx ); parameters idx a numeric value indicating the offset into the array of the element just to return a pointer. if this value isn't a valid javascript number that's also a valid index into the array, a typeerror exception is thrown. return value a new cdata object pointing to the specified element. the type of the returned object will be determined by ctypes.pointertype(thearraytype.constructor.elementtype)). see also ctype cdata type conversion ...
Debugger.Environment - Firefox Developer Tools
d as methods of other kinds of objects. names() return an array of strings giving the names of the identifiers bound by this environment. the result does not include the names of identifiers bound by enclosing environments. getvariable(name) return the value of the variable bound toname in this environment, or undefined if this environment does not bindname.name must be a string that is a valid ecmascript identifier name. the result is a debuggee value. javascript engines often omit variables from environments, to save space and reduce execution time. if the given variable should be in scope, but getvariable is unable to produce its value, it returns an ordinary javascript object (not a debugger.object instance) whose optimizedout property is true. this is not an invocation function...
...s is not an invocation function; if this call would cause debuggee code to run (say, because the environment is a "with" environment, andname refers to an accessor property of the with statement’s operand), this call throws a debugger.debuggeewouldrun exception. setvariable(name,value) storevalue as the value of the variable bound toname in this environment.name must be a string that is a valid ecmascript identifier name;value must be a debuggee value. if this environment binds no variable namedname, throw a referenceerror. this is not an invocation function; if this call would cause debuggee code to run, this call throws a debugger.debuggeewouldrun exception. find(name) return a reference to the innermost environment, starting with this environment, that bindsname. ifname is no...
...inds no variable namedname, throw a referenceerror. this is not an invocation function; if this call would cause debuggee code to run, this call throws a debugger.debuggeewouldrun exception. find(name) return a reference to the innermost environment, starting with this environment, that bindsname. ifname is not in scope in this environment, return null.name must be a string whose value is a valid ecmascript identifier name. source metadata generated from file: js/src/doc/debugger/debugger.environment.md watermark: sha256:3d6f67939e351803d5d7fe201ed38c4aaf766caf032f255e168df1f1c6fe73cb changeset: 7ae377917236 ...
Animation.finish() - Web APIs
Web › API › Animation › finish
e to the end of the animation corresponding to the current playback direction. that is, if the animation is playing forward, it sets the playback time to the length of the animation sequence, and if the animation is playing in reverse (having had its reverse() method called), it sets the playback time to 0. syntax animation.finish(); parameters none. return value none. ...
...everse (having had its reverse() method called), it sets the playback time to 0. syntax animation.finish(); parameters none. return value none. exceptions invalidstate the player's playback rate is 0 or the animation's playback rate is greater than 0 and the end time of the animation is infinity. examples the following example shows how to use the finish() method and catch an invalidstate error. ...
... value none. exceptions invalidstate the player's playback rate is 0 or the animation's playback rate is greater than 0 and the end time of the animation is infinity. examples the following example shows how to use the finish() method and catch an invalidstate error. interfaceelement.addeventlistener("mousedown", function() { try { player.finish(); } catch(e if e instanceof invalidstate) { console.log("finish() called on paused or finished animation."); } catch(e); logmyerrors(e); //pass exception object to error handler } }); the following example finishes all the animations on a single element, regardless of their direction of playback. elem.getanimations().foreach( function(animation){ return animation.finish(); } ); specifications spec...
CloseEvent - Web APIs
ies from its parent, event. closeevent.code read only returns an unsigned short containing the close code sent by the server. the following values are permitted status codes. the following definitions are sourced from the iana website [ref]. note that the 1xxx codes are only websocket-internal and not for the same meaning by the transported data (like when the application-layer protocol is invalid). the only permitted codes to be specified in firefox are 1000 and 3000 to 4999 [source, bug]. status code name description 0–999 reserved and not used. 1000 normal closure normal closure; the connection successfully completed whatever purpose for which it was created. 1001 going away the endpoint is going away, e...
...1004 reserved. a meaning might be defined in the future. 1005 no status received reserved. indicates that no status code was provided even though one was expected. 1006 abnormal closure reserved. used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected. 1007 invalid frame payload data the endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-utf-8 data within a text message). 1008 policy violation the endpoint is terminating the connection because it received a message that violates its policy. this is a generic status code, used when codes 1003 and 1009 are not suitable. ...
...quest. 1012 service restart the server is terminating the connection because it is restarting. [ref] 1013 try again later the server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients. [ref] 1014 bad gateway the server was acting as a gateway or proxy and received an invalid response from the upstream server. this is similar to 502 http status code. 1015 tls handshake reserved. indicates that the connection was closed due to a failure to perform a tls handshake (e.g., the server certificate can't be verified). 1016–1999 reserved for future use by the websocket standard. 2000–2999 reserved for use by we...
DOMError - Web APIs
Web › API › DOMError
returns a domstring representing a message or description associated with the given error type name. error types type description indexsizeerror the index is not in the allowed range (e.g. thrown in a range object). hierarchyrequesterror the node tree hierarchy is not correct. wrongdocumenterror the object is in the wrong document. invalidcharactererror the string contains invalid characters. nomodificationallowederror the object can not be modified. notfounderror the object can not be found here. notsupportederror the operation is not supported invalidstateerror the object is in an invalid state. syntaxerror the string did not match the expected pattern. inval...
... typemismatcherror the type of the object does not match the expected type. securityerror the operation is insecure. networkerror a network error occurred. ...
... type of the object does not match the expected type. securityerror the operation is insecure. networkerror a network error occurred. aborterror the operation was aborted. urlmismatcherror the given url does not match another url. quotaexceedederror the quota has been exceeded. timeouterror the operation timed out. invalidnodetypeerror the node is incorrect or has an incorrect ancestor for this operation. datacloneerror the object can not be cloned. ...
DirectoryEntrySync - Web APIs
usive is ignored) path doesn't exist an error is thrown. create: false (exclusive is ignored) path exists, but is a directory an error is thrown. returns fileentrysync represents a file in a file system. exceptions this method can raise a fileexception with the following codes: exception description encoding_err the path supplied is invalid. not_found_err the path was structurally correct, but refers to a resource that does not exist. no_modification_allowed_err this is a permission issue. the target directory or file is not writable. path_exists_err the file already exists. you cannot create another one with the same path. quota_exceeded_error the operation would cause the applica...
...gnored) path doesn't exist an error is thrown. create: false (exclusive is ignored) path exists, but is a directory an error is thrown. returns directoryentrysync represents a directory in a file system. exceptions this method can raise a fileexception with the following codes: exception description encoding_err the path supplied is invalid. not_found_err the path was structurally correct, but refers to a resource that does not exist. no_modification_allowed_err this is a permission issue. the target directory or file is not writable. path_exists_err the file already exists. you cannot create another one with the same path. quota_exceeded_error the operation would cause the applica...
...on is in progress, some of the contents might not be deleted. catch these cases with error callbacks and retry the deletion. void removerecursively ( ) raises (fileexception); parameter none returns void exceptions this method can raise a fileexception with the following codes: exception description not_found_err the target directory does not exist. invalid_state_err this directory is not longer valid for some reason other than being deleted. [todo: explain more ] no_modification_allowed_err one of the following is not writable: the directory, its parent directory, and some of the content in the directory. security_err the application does not have permission to access the target directory, its parent, or some of it...
Document.querySelector() - Web APIs
l is returned. note: the matching is done using depth-first pre-order traversal of the document's nodes starting with the first element in the document's markup and iterating through sequential nodes by order of the number of child nodes. syntax element = document.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match. this string must be a valid css selector string; if it isn't, a syntax_err exception is thrown. see locating dom elements using selectors for more about selectors and how to manage them. note: characters that are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, be especially careful when writing string literals using these characters. see escaping...
...cial characters for more information. return value an htmlelement object representing the first element in the document that matches the specified set of css selectors, or null is returned if there are no matches. if you need a list of all elements matching the specified selectors, you should use queryselectorall() instead. exceptions syntax_err the syntax of the specified selectors is invalid. usage notes if the specified selector matches an id that is incorrectly used more than once in the document, the first element with that id is returned. css pseudo-elements will never return any elements, as specified in the selectors api. escaping special characters to match against an id or selectors that do not follow standard css syntax (by using a colon or space inappropriately, for e...
...r selectors can also be really powerful, as demonstrated in the following example. 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[name='login']"); this will select an input with a parent div with the user-panel class but not the main class. specifications specification status comment domthe definition of 'document.queryselector()' in that specification. living standard ...
Document - Web APIs
Web › API › Document
nthandler for processing formdata events, fired after the entry list representing the form's data is constructed. globaleventhandlers.ongotpointercapture is an eventhandler representing the code to be called when the gotpointercapture event type is raised. globaleventhandlers.oninput is an eventhandler representing the code to be called when the input event is raised. globaleventhandlers.oninvalid is an eventhandler representing the code to be called when the invalid event is raised. globaleventhandlers.onkeydown is an eventhandler representing the code to be called when the keydown event is raised. globaleventhandlers.onkeypress is an eventhandler representing the code to be called when the keypress event is raised. globaleventhandlers.onkeyup is an eventhandler representing the co...
...operty. drag & drop events drag fired every few hundred milliseconds as an element or text selection is being dragged by the user. also available via the ondrag property. dragend fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key). also available via the ondragend property. dragenter fired when a dragged element or text selection enters a valid drop target. also available via the ondragenter property. dragexit fired when an element is no longer the drag operation's immediate selection target. also available via the ondragexit property. dragleave fired when a dragged element or text selection leaves a valid drop target. also available via the ondragleave property. dragover fired when an element or text selection is being dragged...
...rget. also available via the ondragenter property. dragexit fired when an element is no longer the drag operation's immediate selection target. also available via the ondragexit property. dragleave fired when a dragged element or text selection leaves a valid drop target. also available via the ondragleave property. dragover fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds). also available via the ondragover property. dragstart fired when the user starts dragging an element or text selection. also available via the ondragstart property. drop fired when an element or text selection is dropped on a valid drop target. also available via the ondrop property. fullscreen events fullscreenchange fired when the docum...
DragEvent - Web APIs
Web › API › DragEvent
by the browser during drag-and-drops. dragevent() creates a synthetic and untrusted dragevent. event types drag this event is fired when an element or text selection is being dragged. dragend this event is fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key). ...
...vent is fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key). dragenter this event is fired when a dragged element or text selection enters a valid drop target. dragexit this event is fired when an element is no longer the drag operation's immediate selection target. dragleave this event is fired when a dragged element or text selection leaves a valid drop target. dragover this event is fired continuously when an element or text selection is being dragged and the mouse pointer is over a valid drop target (every 50 ms when mouse is not moving else much faster between 5 ms (slow movement) and 1ms (fast movement) approximately. this firing pattern is different than mouseover ). dragstart this event is fired when the user starts dragging an el...
... globaleventhandlers globaleventhandlers.ondrag a global event handler for the drag event. globaleventhandlers.ondragend a global event handler for the dragend event. globaleventhandlers.ondragenter a global event handler for the dragenter event. globaleventhandlers.ondragexit a global event handler for the dragexit event. ...
Event.preventDefault() - Web APIs
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...
... 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(). nowadays, you should usually use native html form validation instead. ...
...stopped from reaching the input field with preventdefault(). nowadays, you should usually use native html form validation instead. 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. first, listen for keypress events: var mytextbox = document.getelementbyid('my-textbox'); mytextbox.addeventlistener('keypress', checkname, false); the checkname() function, whi...
IDBCursor.continuePrimaryKey() - Web APIs
atches the key parameter as well as whose primary key matches the primary key parameter. a typical use case, is to resume the iteration where a previous cursor has been closed, without having to compare the keys one by one. calling this method more than once before new cursor data has been loaded - for example, calling continueprimarykey() twice from the same onsuccess handler - results in an invalidstateerror being thrown on the second call because the cursor’s got value flag has been unset. this method is only valid for cursors coming from an index. using it for cursors coming from an object store will throw an error. note: this feature is available in web workers. syntax cursor.continueprimarykey(key, primarykey); parameters key the key to position the cursor at. primarykey th...
...y to position the cursor at. primarykey the primary key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. ...
...'s transaction is inactive. dataerror the key parameter may have any of the following conditions: the key is not a valid key. the key is less than or equal to this cursor's position and the cursor's direction is next or nextunique. the key is greater than or equal to this cursor's position and this cursor's direction is prev or prevunique. invalidstateerror the cursor is currently being iterated or has iterated past its end. invalidaccesserror the cursor's direction is not prev or next. example here’s how you can resume an iteration of all articles tagged with "javascript" since your last visit: let request = articlestore.index("tag").opencursor(); let count = 0; let unreadlist = []; request.onsuccess = (event) =>...
IDBObjectStore.createIndex() - Web APIs
l javascript sorting will be used — not locale-aware. return value an idbindex object: the newly created index. exceptions this method may raise a domexception of one of the following types: exception description constrainterror occurs if an index with the same name already exists in the database. index names are case-sensitive. invalidaccesserror occurs if the provided key path is a sequence, and multientry is set to true in the objectparameters object. invalidstateerror occurs if either: the method was not called from a versionchange transaction mode callback, i.e. from inside a idbopendbrequest.onupgradeneeded handler. the object store has been deleted. syntaxerror occu...
...d key path is a sequence, and multientry is set to true in the objectparameters object. invalidstateerror occurs if either: the method was not called from a versionchange transaction mode callback, i.e. from inside a idbopendbrequest.onupgradeneeded handler. the object store has been deleted. syntaxerror occurs if the provided keypath is not a valid key path. transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g. ...
...ransaction mode callback, i.e. from inside a idbopendbrequest.onupgradeneeded handler. the object store has been deleted. syntaxerror occurs if the provided keypath is not a valid key path. transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. createindex() is used to create new indexes on the object store. for a full working example, s...
Checking when a deadline is due - Web APIs
) { note.innerhtml += '<li>data not submitted — form incomplete.</li>'; return; } in this segment, we check to see if the form fields have all been filled in. if not, we drop a message into our developer notifications pane (see the bottom left of the app ui) to tell the user what is going on, and exit out of the function. ...
...te.</li>'; return; } in this segment, we check to see if the form fields have all been filled in. if not, we drop a message into our developer notifications pane (see the bottom left of the app ui) to tell the user what is going on, and exit out of the function. ...
...e").objectstore('todolist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { next we create another indexeddb objectstore, and use the opencursor() method to open a cursor, which is basically a way in indexeddb to iterate through all the items in the store. we then loop through all the items in the cursor for as long as there is a valid item left in the cursor. switch(cursor.value.month) { case "january": var monthnumber = 0; break; case "february": var monthnumber = 1; break; // other lines removed from listing for brevity case "december": var monthnumber = 11; break; default: alert('incorrect month entered in ...
Timing element visibility with the Intersection Observer API - Web APIs
r: 1px solid black; background-color: rgba(255, 255, 255, 0.5); } there's nothing magic in here. it's fairly basic css. tying it together with javascript that brings us to the javascript code which makes everything work. let's start with the global variables: let contentbox; let nextarticleid = 1; let visibleads = new set(); let previouslyvisibleads = null; let adobserver; let refreshintervalid = 0; these are used as follows: contentbox a reference to the <main> element's htmlelement object in the dom. this is where we'll insert the articles and ads. nextarticleid each article is given a unique id number; this variable tracks the next id to use, starting with 1. visibleads a set which we'll use to track the ads currently visible on the screen. previouslyvisibleads used to tem...
...ing with 1. visibleads a set which we'll use to track the ads currently visible on the screen. previouslyvisibleads used to temporarily store the list of visible ads while the document is not visible (for example, if the user has tabbed to another page). adobserver will hold our intersectionobserver used to track the intersection between the ads and the <main> element's bounds. refreshintervalid used to store the interval id returned by setinterval(). this interval will be used to trigger our periodic refreshes of the ads' content. setting up to set things up, we run the startup() function below when the page loads: window.addeventlistener("load", startup, false); function startup() { contentbox = document.queryselector("main"); document.addeventlistener("visibilitychange", ha...
...then we set up an event listener for the visibilitychange event. this event is sent when the document becomes hidden or visible, such as when the user switches tabs in their browser. the intersection observer api doesn't take this into ...
MediaCapabilities.decodingInfo() - Web APIs
e media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe whether decoding the media described would be supported, smooth, and powerefficient. syntax mediacapabilities.decodinginfo(mediadecodingconfiguration) parameters mediadecodingconfiguration a valid mediadecodingconfiguration dictionary containing a valid media decoding type of file or media-source and a valid media configuration: either an audioconfiguration or a videoconfiguration. return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration...
...taining a valid media decoding type of file or media-source and a valid media configuration: either an audioconfiguration or a videoconfiguration. return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the decodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, the media decoding configuration is not a valid value for the media decoding type, or any other error in the media configuration passed to the method, including omitting values required in the media decoding configuration. example //create media configuration to be tested const mediaconfig...
...the media decoding configuration is not a valid value for the media decoding type, or any other error in the media configuration passed to the method, including omitting values required in the media decoding configuration. example //create media configuration to be tested const mediaconfig = { type : 'file', // or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. }, }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.sup...
MediaCapabilities.encodingInfo() - Web APIs
ediacapabilities interface of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe how compatible the device is with the type of media. syntax mediacapabilities.encodinginfo(mediaencodingconfiguration) parameters mediaencodingconfiguration a valid mediaencodingconfiguration dictionary containing a valid media encoding type of record or transmission and a valid media configuration: either an audioconfiguration or videoconfiguration dictionary. return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaco...
...alid media encoding type of record or transmission and a valid media configuration: either an audioconfiguration or videoconfiguration dictionary. return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the encodinginfo() method is invalid, either because the type is not video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements. example //create media configuration to be tested const mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "vi...
...s not video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements. example //create media configuration to be tested const mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8.0", // valid content type width : 1920, // width of the video height : 1080, // height of the video bitrate : 120000, // number of bits used to encode 1s of video framerate : 48 // number of frames making up that 1s. } }; // check support and performance navigator.mediacapabilities.encodinginfo(mediaconfig).then(result => { console.log('this configuration is ...
MediaRecorder.onerror - Web APIs
e error that occurred. syntax mediarecorder.onerror = errorhandlerfunction; value a function to be called whenever an error occurs during the recorder's lifetime. in addition to other general errors that might occur, the following errors are specifically possible when using the mediastream recording api; to determine which occurred, check the value of mediarecordererrorevent.error.name. invalidstateerror an attempt was made to stop or pause or an inactive recorder, start or resume an active recorder, or otherwise manipulate the mediarecorder while in the wrong state. this exception can also occur when a request is made on a source that has been deleted or removed. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtain...
...ssion to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream. notsupportederror an attempt was made to instantiate a mediarecorder using a mime type that isn't supported on the user's device; one or more of the requested container, codecs, or profiles as well as other information may be invalid. unknownerror an non-security related error occurred that cannot otherwise be categorized. recording stops, the mediarecorder's state becomes inactive, one last dataavailable event is sent to the mediarecorder with the remaining received data, and finally a stop event is sent. these errors may occur either directly because of a call to a mediarecorder method, or indirectly due to a problem ar...
...try again later."); break; case securityerror: shownotification("recording the specified source " + "is not allowed due to security " + "restrictions."); break; default: shownotification("a problem oc...
Using the Media Capabilities API - Web APIs
nfiguration defined by the mediadecodingconfiguration dictionary. in our example, we are testing the decoding capabilities of a video configuration. the configuration requires the type of media being tested — e.g. a plain file or mediasource — and a videoconfiguration including values for the contenttype, width, height, bitrate, and framerate: the contenttype must be a string specifying a valid video mime type. the width and height are the horizontal and vertical dimensions of the video; these are also used to determine the aspect ratio. the bitrate is the number of bits used to encode one second of video. the framerate is the number of frames which are played per second of time when playing the video. const videoconfiguration = { type: "file", video: { contenttype: "vi...
... + (result.supported ? '' : 'not ') + 'supported, ' + (result.smooth ? '' : 'not ') + 'smooth, and ' + (result.powerefficient ? '' : 'not ') + 'power efficient.') }); the response provided is defined by the mediacapabilitiesinfo interface. handling errors in our video decoding example, a typeerror would be raised if the media configuration passed to the decodinginfo() method was invalid. there are a few reasons why an error might occur, including: the specified type isn't one of the two permtited values: file or media-source the contenttype given is the error can be due to the type not being one of the two possible values, the contenttype not being a valid codec mime type, or invalid or omitted definitions required in the videoconfiguration. navigator.mediacapabilities.de...
...and whether decoding will be smooth and power efficient:</p> <ul> <li> <label for="codec">select a codec</label> <select id="codec"> <option>video/webm; codecs=vp8</option> <option>video/webm; codecs=vp9</option> <option>video/mp4; codecs=avc1</option> <option>video/mp4; codecs=avc1.420034</option> <option>video/ogg; codecs=theora</option> <option>invalid</option> </select> </li> <li> <label for="size">select a size</label> <select id="size"> <option>7680x4320</option> <option>3840x2160</option> <option>2560x1440</option> <option>1920x1080</option> <option>1280x720</option> <option selected>800x600</option> <option>640x480</option> <option>320x240</option> <option value=" x ">no...
PublicKeyCredential.response - Web APIs
. the information contained in this response will be used by the relying party's server to verify the demand is legitimate. an authenticatorresponse is either: an authenticatorattestationresponse (when the publickeycredential is created via credentialscontainer.create()) an authenticatorassertionresponse (when the publickeycredential is obtained via credentialscontainer.get()). in order to validate the creation of credentials, a relying party's server needs both: this response the extensions of the client (given by publickeycredential.getclientextensionresults()) to validate the demand. note: when validating the fetching of existing credentials, the whole publickeycredential object and the client extensions are necessary for the relying party's server. note: this property may o...
... the client extensions are necessary for the relying party's server. note: this property may only be used in top-level contexts and will not be available in an <iframe> for example. syntax response = publickeycredential.response value an authenticatorresponse object containing the data a relying party's script will receive and which should be sent to the relying party's server in order to validate the demand for creation or fetching. this object contains data from the client (authenticatorresponse/clientdatajson) and from the authenticator. examples var options = { challenge: new uint8array(16) /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16) /* from the server */, name: "jdoe@example.com", displ...
... recommendation initial definition. ...
RTCOutboundRtpStreamStats - Web APIs
averagertcpinterval a floating-point value indicating the average rtcp interval between two consecutive compound rtcp packets. fircount an integer value which indicates the total number of full intra request (fir) packets which this rtcrtpsender has sent to the remote rtcrtpreceiver. this is an indicator of how often the stream has lagged, requiring frames to be skipped in order to catch up. valid only for video streams. framesencoded the number of frames that have been successfully encoded so far for sending on this rtp stream. only valid for video streams. lastpacketsenttimestamp a domhighrestimestamp indicating the time at which the last packet was sent for this ssrc. the timestamp property, on the other hand, indicates the time at which the rtcoutboundrtpstreamstats object was gene...
...tiated services code point (dscp). plicount an integer specifying the number of times the remote receiver has notified this rtcrtpsender that some amount of encoded video data for one or more frames has been lost, using picture loss indication (pli) packets. only available for video streams. qpsum a 64-bit value containing the sum of the qp values for every frame encoded by this rtcrtpsender. valid only for video streams. qualitylimitationdurations a record mapping each of the quality limitation reasons in the rtcremoteinboundrtpstreamstats enumeration to a floating-point value indicating the number of seconds the stream has spent with its quality limited for that reason. qualitylimitationreason a value from the rtcqualitylimitationreason enumerated type explaining why the resolution an...
...a record mapping each of the quality limitation reasons in the rtcremoteinboundrtpstreamstats enumeration to a floating-point value indicating the number of seconds the stream has spent with its quality limited for that reason. qualitylimitationreason a value from the rtcqualitylimitationreason enumerated type explaining why the resolution and/or frame rate is being limited for this rtp stream. valid only for video streams. remoteid a string which identifies the rtcremoteinboundrtpstreamstats object that provides statistics for the remote peer for this same ssrc. this id is stable across multiple calls to getstats(). retransmittedbytessent the total number of bytes that have been retransmitted for this source as of the time the statistics were sampled. these retransmitted bytes comprise t...
RTCPeerConnection.setConfiguration() - Web APIs
ice servers, then initiate an ice restart. you cannot change the identity information for a connection once it's already been set. syntax rtcpeerconnection.setconfiguration(configuration); parameters configuration an rtcconfiguration object which provides the options to be set. the changes are not additive; instead, the new values completely replace the existing ones. ...
... to be set. the changes are not additive; instead, the new values completely replace the existing ones. exceptions invalidaccesserror one or more of the urls specified in configuration.iceservers is a turn server, but complete login information is not provided (that is, either the rtciceserver.username or rtciceserver.credentials is missing). this prevents successful login to the server. invalidmodificationerror the configuration includes changed identity information, but the connection already has identity information specified. this happens if configuration.peeridentity or configuration.certificates is set and their values differ from the current configuration. invalidstateerror the rtcpeerconnection is closed. syntaxerror one or more of the urls provided in the configuration.ices...
... the configuration includes changed identity information, but the connection already has identity information specified. this happens if configuration.peeridentity or configuration.certificates is set and their values differ from the current configuration. invalidstateerror the rtcpeerconnection is closed. syntaxerror one or more of the urls provided in the configuration.iceservers list is invalid. example in this example, it has already been determined that ice restart is needed, and that negotiation needs to be done using a different ice server. var restartconfig = { iceservers: [{ urls: "turn:asia.myturnserver.net", username: "allie@oopcode.com", credential: "topsecretpassword" }] }; ...
RTCPeerConnection.setRemoteDescription() - Web APIs
ly involves intermediary steps handled by the webrtc layer to ensure that an active connection can be changed without losing the connection if the change does not succeed. see pending and current descriptions in webrtc connectivity for more details on this process. exceptions the following exceptions are reported to the rejection handler for the promise returned by setremotedescription(): invalidaccesserror the content of the description is invalid. invalidstateerror the rtcpeerconnection is closed, or it's in a state which isn't compatible with the specified description's type. for example, if the type is rollback and the signaling state is one of stable, have-local-pranswer, or have-remote-pranswer, this exception is thrown, because you can't roll back a connection that's either full...
...e, if the type is rollback and the signaling state is one of stable, have-local-pranswer, or have-remote-pranswer, this exception is thrown, because you can't roll back a connection that's either fully established or is in the final stage of becoming connected. operationerror any errors that occur which don't match the others specifeid here are reported as operationerror. this includes identity validation errors. rtcerror an rtcerror with the errordetail set to sdp-syntax-error is reported if the sdp specified by rtcsessiondescription.sdp. the error object's sdplinenumber property indicates the line number within the sdp on which the syntax error was detected. typeerror the specified rtcsessiondescriptioninit or rtcsessiondescription object is missing the type property, or no description ...
...ption object explaining why the request failed. this deprecated form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called. exceptions when using the deprecated callback-based version of setremotedescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indicating that the connection is not currently open, so negotiation cannot take place. invalidsessiondescriptionerror the rtcsessiondescription specified by the sessiondescription parameter is invalid. example here we see a function which handles an offer received from the remote peer. this code is derived from the example and tuto...
SVGLength - Web APIs
Web › API › SVGLength
value: 37.7952766418457, valueinspecifiedunits: 6: 1, valueasstring: 1cm value: 26.66666603088379, valueinspecifiedunits 9: 20, valueasstring: 20pt value: 26.66666603088379, valueinspecifiedunits 8: 0.277777761220932, valueasstring: 0.277778in constants name value description svg_lengthtype_unknown 0 the unit type is not one of predefined unit types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_lengthtype_number 1 no unit type was provided (i.e., a unitless value was specified), which indicates a value in user units. svg_lengthtype_percentage 2 a percentage value was specified. svg_lengthtype_ems 3 a value was specified using the em units...
...bject itself is read only. valueasstring domstring the value as a string value, in the units expressed by unittype. setting this attribute will cause value, valueinspecifiedunits, and unittype to be updated automatically to reflect this setting. exceptions on setting: a domexception with code syntax_err is raised if the assigned string cannot be parsed as a valid <length>. a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. methods name & arguments return description newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void reset the value as a number with an asso...
...guments return description newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object. exceptions: a domexception with code not_supported_err is raised if unittype is svg_lengthtype_unknown or not a valid unit type constant (one of the other svg_lengthtype_* constants defined on this interface). a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. converttospecifiedunits(in unsigned short unittype) void preserve the same underlying stored value, but reset the stored u...
URL() - Web APIs
Web › API › URL › URL
note: this feature is available in web workers. syntax const url = new url(url [, base]) parameters url a usvstring representing an absolute or relative url. if url is a relative url, base is required, and will be used as the base url. if url is an absolute url, a given base will be ignored. base optional a usvstring representing the base url to use in case url is a relative url. if not specified, it defaults to ''. ...
...al a usvstring representing the base url to use in case url is a relative url. if not specified, it defaults to ''. note: you can still use an existing url object for the base, which stringifies itself to the object's href property. exceptions exception explanation typeerror url (in the case of absolute urls) or base + url (in the case of relative urls) is not a valid url. examples // base urls let m = 'https://developer.mozilla.org'; let a = new url("/", m); // => 'https://developer.mozilla.org/' let b = new url(m); // => 'https://developer.mozilla.org/' new url('docs', b); // => 'https://developer.mozilla.org/docs' let d = new url('/docs', b); ...
...s', a); // => 'https://developer.mozilla.org/docs' new url('/docs', "https://developer.mozilla.org/fr-fr/toto"); // => 'https://developer.mozilla.org/docs' new url('/docs', ''); // raises a typeerror exception as '' is not a valid url new url('/docs'); // raises a typeerror exception as '/docs' is not a valid url new url('http://www.example.com', ); // => 'http://www.example.com/' new url('http://www.example.com', b); // => 'http://www.example.com/' new url("//foo.com", "https://example.com") // => 'https://foo.com' (see relative urls) specific...
WebGLRenderingContext.getError() - Web APIs
the webglrenderingcontext.geterror() method of the webgl api returns error information. syntax glenum gl.geterror(); parameters none. return value constant description gl.no_error no error has been recorded. the value of this constant is 0. gl.invalid_enum an unacceptable value has been specified for an enumerated argument. the command is ignored and the error flag is set. gl.invalid_value a numeric argument is out of range. ...
... constant description gl.no_error no error has been recorded. the value of this constant is 0. gl.invalid_enum an unacceptable value has been specified for an enumerated argument. the command is ignored and the error flag is set. gl.invalid_value a numeric argument is out of range. the command is ignored and the error flag is set. gl.invalid_operation the specified command is not allowed for the current state. the command is ignored and the error flag is set. gl.invalid_framebuffer_operation the currently bound framebuffer is not framebuffer complete when trying to render to or to read from it. gl.out_of_memory not enough memory is left to execute the command. gl.context_lost_webgl if the webgl ...
...render to or to read from it. gl.out_of_memory not enough memory is left to execute the command. gl.context_lost_webgl if the webgl context is lost, this error is returned on the first call to geterror. afterwards and until the context has been restored, it returns gl.no_error. examples gl.geterror(); // gl.no_error (0) gl.enable(gl.foobar); gl.geterror(); // gl.invalid_enum; specifications specification status comment webgl 1.0the definition of 'geterror' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgeterror' in that specification. standard man page of the opengl api. ...
Web APIs
Web › API
ediasession mediasessionactiondetails mediasettingsrange mediasource mediastream mediastreamaudiodestinationnode mediastreamaudiosourcenode mediastreamaudiosourceoptions mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackaudiosourcenode mediastreamtrackaudiosourceoptions mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints merchantvalidationevent messagechannel messageevent messageport metadata mimetype mimetypearray mouseevent mousescrollevent mousewheelevent mutationevent mutationobserver mutationobserverinit mutationrecord n ndefmessage ndefreader ndefreadingevent ndefrecord ndefwriter namelist namednodemap navigationpreloadmanager navigator navigatorconcurrenthardware navigatorid navigatorlanguage navigatoronlin...
...event offlineaudiocontext offscreencanvas orientationsensor oscillatornode overconstrainederror p pagetransitionevent paintworklet pannernode parentnode passwordcredential path2d payererrors paymentaddress paymentcurrencyamount paymentdetailsbase paymentdetailsupdate paymentitem paymentmethodchangeevent paymentrequest paymentrequestevent paymentrequestupdateevent paymentresponse paymentvalidationerrors pbkdf2params performance performanceentry performanceeventtiming performanceframetiming performancelongtasktiming performancemark performancemeasure performancenavigation performancenavigationtiming performanceobserver performanceobserverentrylist performancepainttiming performanceresourcetiming performanceservertiming performancetiming periodicwave permissionstatus permissions ...
...peinfo u uievent ulongrange url urlsearchparams urlutilsreadonly usb usbalternateinterface usbconfiguration usbdevice usbendpoint usbintransferresult usbinterface usbisochronousintransferpacket usbisochronousintransferresult usbisochronousouttransferpacket usbisochronousouttransferresult usbouttransferresult usvstring userdatahandler userproximityevent v vttcue vttregion validitystate videoconfiguration videoplaybackquality videotrack videotracklist visualviewport w webgl_color_buffer_float webgl_compressed_texture_astc webgl_compressed_texture_atc webgl_compressed_texture_etc webgl_compressed_texture_etc1 webgl_compressed_texture_pvrtc webgl_compressed_texture_s3tc webgl_compressed_texture_s3tc_srgb webgl_debug_renderer_info webgl_debug_shaders webgl_depth_text...
Using the alert role - Accessibility
ssistive technology. the alert role is used to communicate an important and usually time-sensitive message to the user. when this role is added to an element, the browser will send out an accessible alert event to assistive technology products which can then notify the user about it. the alert role is most useful for information that requires the user's immediate attention, for example: an invalid value was entered into a form field the user's login session is about to expire the connection to the server was lost, local changes will not be saved because of its intrusive nature, the alert role must be used sparingly and only in situations where the user's immediate attention is required. dynamic changes that are less urgent should use a less aggressive method, such as aria-live="polite...
...ppet below shows how the alert role is added directly into the html source code. the moment the element finishes loading the screen reader should be notified of the alert. if the element was already in the original source code when the page loaded, the screen reader will announce the error immediately after announcing the page title. <h2 role="alert">your form could not be submitted because of 3 validation errors.</h2> example 2: dynamically adding an element with the alert role this snippet dynamically creates an element with an alert role and adds it to the document structure. let myalert = document.createelement("p"); myalert.setattribute("role", "alert"); let myalerttext = document.createtextnode("you must agree with our terms of service to create an account."); myalert.appendchild(myal...
... automatically announce the alert regardless of where keyboard focus is currently located. ...
Forms - Accessibility
...
... ...
... ...
Understandable - Accessibility
uccess criteria how to conform to the criteria practical resource 3.3.1 error identification (a) when a user is filling out a form or choosing between options, any error that is detected should be clearly reported to the user, along with the form control that the error relates to. ...
...ide error detection and handling, via html5 form validation features, and/or javascript, whatever is best for your situation. when an error is detected, an intuitive error message should be shown next to the form input that is at fault to help the user correct their inputs. for screenreader users, you can use aria live regions to alert the user to a change on the page. note: server-side validation should *always* be used alongside client-side validation. client-side validation is too easy to turn off or otherwise get around, so it can't be relied on alone. see form data validation for comprehensive validation information, and wai-aria: dynamic content updates for information on live regions. 3.3.2 labels or instructions (a) clear instructions should be pro...
...the user is given an opportunity to correct them. a mechanism is available for confirming and correcting information before final submission. reversible — for any view where data can be entered, provide an equivalent view that allows you to edit or even delete an entry, as appropriate. checking data — as covered in 3.3.1, a combination of client-side and server-side validation should be used to detect errors and display helpful messages to the user to allow them to correct their inputs. confirm and correct — where appropriate, after filling in a series of form fields to perform a task (such as buying a product), the user should be shown a confirmation screen where they can review their inputs and correct anything that doesn't look right. this pattern is com...
@font-feature-values - CSS: Cascading Style Sheets
his can help simplify your css when using multiple fonts. the @font-feature-values at-rule may be used either at the top level of your css or inside any css conditional-group at-rule. syntax feature value blocks @swash specifies a feature name that will work with the swash() functional notation of font-variant-alternates. a swash feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @annotation specifies a feature name that will work with the annotation() functional notation of font-variant-alternates. an annotation feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @ornaments specifies a feature name that will work with the ornaments() functional notation of font-variant-alternates. an ornaments feature val...
... feature name that will work with the annotation() functional notation of font-variant-alternates. an annotation feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @ornaments specifies a feature name that will work with the ornaments() functional notation of font-variant-alternates. an ornaments feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @stylistic specifies a feature name that will work with the stylistic() functional notation of font-variant-alternates. a stylistic feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @styleset specifies a feature name that will work with the styleset() functional notation of font-variant-alternates. a stylset feature value defini...
...listic feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @styleset specifies a feature name that will work with the styleset() functional notation of font-variant-alternates. a stylset feature value definition allows an unlimited number of values: ident1: 2 4 12 1 maps to the opentype values ss02, ss04, ss12, and ss01. note that values higher than 99 are valid, but don't map to any opentype values and are ignored. @character-variant specifies a feature name that will work with the character-variant() functional notation of font-variant-alternates. a character-variant feature value definition allows either one or two values: ident1: 3 maps to cv03=1, and ident2: 2 4 maps to cv02=4, but ident2: 2 4 5 is invalid. formal syntax @font-feature-values <f...
@supports - CSS: Cascading Style Sheets
Web › CSS › @supports
nctions (and), disjunctions (or), and/or negations (not). precedence of operators can be defined with parentheses. declaration syntax the most basic supports condition is a simple declaration (a property name followed by a value, separated by a colon). the declaration must be surrounded by parentheses. the following example returns true if the browser's transform-origin property considers 5% 5% valid: @supports (transform-origin: 5% 5%) {} function syntax the second basic supports condition is a supports function, the syntax for these is supported by all browsers, but the functions themselves are still being standardized. selector() tests if the browser supports the tested selector syntax. the following example returns true if the browser supports the child combinator: @supports selec...
...ser supports the tested selector syntax. the following example returns true if the browser supports the child combinator: @supports selector(a > b) {} the not operator the not operator can precede any expression to create a new expression, resulting in the negation of the original one. the following example returns true if the browser's transform-origin property doesn't consider 10em 10em 10em valid: @supports not (transform-origin: 10em 10em 10em) {} as with any operator, the not operator can be applied to a declaration of any complexity. the following examples are both valid: @supports not (not (transform-origin: 2px)) {} @supports (display: grid) and (not (display: inline-grid)) {} note: there is no need to enclose the not operator between two parentheses at the top level. to combine...
... (-o-transform-style: preserve) or (-webkit-transform-style: preserve) {} @supports (transform-style: preserve-3d) or ((-moz-transform-style: preserve-3d) or ((-o-transform-style: preserve-3d) or (-webkit-transform-style: preserve-3d))) {} note: when using both and and or operators, the parentheses must be used to define the order in which they apply. otherwise, the condition is invalid and the whole rule is ignored. formal syntax @supports <supports-condition> { <group-rule-body> }where <supports-condition> = not <supports-in-parens> | <supports-in-parens> [ and <supports-in-parens> ]* | <supports-in-parens> [ or <supports-in-parens> ]*where <supports-in-parens> = ( <supports-condition> ) | <supports-feature> | <general-enclosed>where <supports-feature> = <supports-decl> |...
Color picker tool - CSS: Cascading Style Sheets
bj.a; this.hue = obj.hue; this.saturation = obj.saturation; this.value = obj.value; this.format = '' + obj.format; this.lightness = obj.lightness; }; color.prototype.setformat = function setformat(format) { if (format === 'hsv') this.format = 'hsv'; if (format === 'hsl') this.format = 'hsl'; }; /*========== methods to set color properties ==========*/ color.prototype.isvalidrgbvalue = function isvalidrgbvalue(value) { return (typeof(value) === 'number' && isnan(value) === false && value >= 0 && value <= 255); }; color.prototype.setrgba = function setrgba(red, green, blue, alpha) { if (this.isvalidrgbvalue(red) === false || this.isvalidrgbvalue(green) === false || this.isvalidrgbvalue(blue) === false) return; this.r = red | 0; this.g = green ...
...) { return (typeof(value) === 'number' && isnan(value) === false && value >= 0 && value <= 255); }; color.prototype.setrgba = function setrgba(red, green, blue, alpha) { if (this.isvalidrgbvalue(red) === false || this.isvalidrgbvalue(green) === false || this.isvalidrgbvalue(blue) === false) return; this.r = red | 0; this.g = green | 0; this.b = blue | 0; if (this.isvalidrgbvalue(alpha) === true) this.a = alpha | 0; }; color.prototype.setbyname = function setbyname(name, value) { if (name === 'r' || name === 'g' || name === 'b') { if(this.isvalidrgbvalue(value) === false) return; this[name] = value; this.updatehsx(); } }; color.prototype.sethsv = function sethsv(hue, saturation, value) { this.hue = hue; this.saturation = saturation; ...
...!== 'number' || isnan(value) === true || value < 0 || value > 100) return; this.value = value; this.hsvtorgb(); }; color.prototype.setlightness = function setlightness(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 100) return; this.lightness = value; this.hsltorgb(); }; color.prototype.sethexa = function sethexa(value) { var valid = /(^#{0,1}[0-9a-f]{6}$)|(^#{0,1}[0-9a-f]{3}$)/i.test(value); if (valid !== true) return; if (value[0] === '#') value = value.slice(1, value.length); if (value.length === 3) value = value.replace(/([0-9a-f])([0-9a-f])([0-9a-f])/i,'$1$1$2$2$3$3'); this.r = parseint(value.substr(0, 2), 16); this.g = parseint(value.substr(2, 2), 16); this.b = parseint(value.substr(4, 2), 16...
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
boxes/ http://msdn.microsoft.com/en-us/library/ie/hh772069(v=vs.85).aspx http://css-tricks.com/using-flexbox/ a complete guide to flexbox | css-tricks visual guide to css3 flexbox: flexbox playground | note: mixins are not currently supported natively in browsers. instead, you will need to use a css pre-processor to make the most of the following. however, css pre-processors simply generate valid css, so the techniques used below can be written in pure css instead, if preferred. flexbox containers using the display property's flex value causes an element to generate a block-level flex container box. the inline-flex value causes an element to generate an inline-level flex container box. values: flex | inline-flex spec: https://drafts.csswg.org/css-flexbox/#flex-containers @mixin fl...
...ainer, by assigning them to ordinal groups. value: any integer (0 is the default) spec: https://drafts.csswg.org/css-flexbox/#order-property @mixin order($int: 0) { -webkit-box-ordinal-group: $int + 1; -moz-box-ordinal-group: $int + 1; -webkit-order: $int; -ms-flex-order: $int; order: $int; } flexbox grow the flex-grow property sets the flex grow factor. negative numbers are invalid. value: any integer (0 is the default) spec: https://drafts.csswg.org/css-flexbox/#flex-grow-property @mixin flex-grow($int: 1) { -webkit-box-flex: $int; -moz-box-flex: $int; -webkit-flex-grow: $int; -ms-flex: $int; flex-grow: $int; } flexbox shrink the flex-shrink property sets the flex shrink factor. negative numbers are invalid. value: any integer (0 is the default) spe...
...lex-shrink property sets the flex shrink factor. negative numbers are invalid. value: any integer (0 is the default) spec: https://drafts.csswg.org/css-flexbox/#flex-shrink-property @mixin flex-shrink($int: 0) { -webkit-flex-shrink: $int; -moz-flex-shrink: $int; -ms-flex: $int; flex-shrink: $int; } flexbox basis the flex-basis property sets the flex basis. negative lengths are invalid. values: see the flex-basis reference (the default is auto) spec: https://drafts.csswg.org/css-flexbox/#flex-basis-property @mixin flex-basis($value: auto) { -webkit-flex-basis: $value; flex-basis: $value; } flexbox "flex" (shorthand) the flex property specifies the components of a flexible length; flex-grow factor, flex-shrink factor, and the flex-basis. when an element is a flex i...
CSS reference - CSS: Cascading Style Sheets
Web › CSS › Reference
selectors, pseudo-classes, and pseudo-elements below. the syntax for each specified value depends on the data type defined for each specified property. style rule examples strong { color: red; } div.menu-bar li:hover > ul { display: block; } for a beginner-level introduction to the syntax of selectors, see our guide on css selectors. be aware that any syntax error in a rule definition invalidates the entire rule. invalid rules are ignored by the browser. note that css rule definitions are entirely (ascii) text-based, whereas dom-css / cssom (the rule management system) is object-based. at-rule syntax as the structure of at-rules varies widely, please see at-rule to find the syntax of the specific one you want. keyword index note: the property names in this index do not include th...
...templategrid-template-areasgrid-template-columnsgrid-template-rowshhzhanging-punctuationheightheight (@viewport)@historical-forms:hoverhsl()hsla()hue-rotate()hyphensi<ident><image>image()image-orientationimage-renderingimage-set()@importin:in-range:indeterminateinheritinitialinline-sizeinsetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-inline-endinset-inline-start<integer>:invalidinvert()isolationjjustify-contentjustify-itemsjustify-selfkkhz@keyframesl:lang:last-child:last-of-typeleader():leftleft@left-bottom<length><length-percentage>letter-spacingline-breakline-heightlinear-gradient():linklist-stylelist-style-imagelist-style-positionlist-style-typelocal()mmarginmargin-blockmargin-block-endmargin-block-startmargin-bottommargin-inlinemargin-inline-endmargin-inline-startmar...
... basic selectors basic selectors are funda...
Linear-gradient Generator - CSS: Cascading Style Sheets
bj.a; this.hue = obj.hue; this.saturation = obj.saturation; this.value = obj.value; this.format = '' + obj.format; this.lightness = obj.lightness; }; color.prototype.setformat = function setformat(format) { if (format === 'hsv') this.format = 'hsv'; if (format === 'hsl') this.format = 'hsl'; }; /*========== methods to set color properties ==========*/ color.prototype.isvalidrgbvalue = function isvalidrgbvalue(value) { return (typeof(value) === 'number' && isnan(value) === false && value >= 0 && value <= 255); }; color.prototype.setrgba = function setrgba(red, green, blue, alpha) { if (this.isvalidrgbvalue(red) === false || this.isvalidrgbvalue(green) === false || this.isvalidrgbvalue(blue) === false) return; this.r = red | 0; this.g = green ...
...) { return (typeof(value) === 'number' && isnan(value) === false && value >= 0 && value <= 255); }; color.prototype.setrgba = function setrgba(red, green, blue, alpha) { if (this.isvalidrgbvalue(red) === false || this.isvalidrgbvalue(green) === false || this.isvalidrgbvalue(blue) === false) return; this.r = red | 0; this.g = green | 0; this.b = blue | 0; if (this.isvalidrgbvalue(alpha) === true) this.a = alpha | 0; }; color.prototype.setbyname = function setbyname(name, value) { if (name === 'r' || name === 'g' || name === 'b') { if(this.isvalidrgbvalue(value) === false) return; this[name] = value; this.updatehsx(); } }; color.prototype.sethsv = function sethsv(hue, saturation, value) { this.hue = hue; this.saturation = saturation; ...
...of(value) !== 'number' || isnan(value) === true || value < 0 || value > 100) return; this.lightness = value; this.hsltorgb(); }; color.prototype.setalpha = function setalpha(value) { if (typeof(value) !== 'number' || isnan(value) === true || value < 0 || value > 1) return; this.a = parsefloat(value.tofixed(2)); }; color.prototype.sethexa = function sethexa(value) { var valid = /(^#{0,1}[0-9a-f]{6}$)|(^#{0,1}[0-9a-f]{3}$)/i.test(value); if (valid !== true) return; if (value[0] === '#') value = value.slice(1, value.length); if (value.length === 3) value = value.replace(/([0-9a-f])([0-9a-f])([0-9a-f])/i,'$1$1$2$2$3$3'); this.r = parseint(value.substr(0, 2), 16); this.g = parseint(value.substr(2, 2), 16); this.b = parseint(value.substr(4, 2), 16...
WebKit CSS extensions - CSS: Cascading Style Sheets
ut not in a generally released browser. pseudo-classes :-webkit-animating-full-screen-transition :-webkit-any() :-webkit-any-link* :-webkit-autofill :-webkit-autofill-strong-password :-webkit-drag :-webkit-full-page-media :-webkit-full-screen* :-webkit-full-screen-ancestor :-webkit-full-screen-document :-webkit-full-screen-controls-hidden * now standard. note: if there is an invalid pseudo-class within in a chain or group of selectors, the whole selector list is invalid. pseudo-elements for web-compatibility reasons, blink, webkit, and gecko browsers treat all pseudo-elements starting with ::-webkit- as valid. ::-webkit-file-upload-button ::-webkit-inner-spin-button ::-webkit-input-placeholder ::-webkit-media-controls ::-webkit-media-controls-current-time-display ...
... media features -webkit-animation -webkit-device-pixel-ratio -webkit-transform-2d -webkit-transform-3d -webki...
...ext-track-container ::-webkit-outer-spin-button ::-webkit-progress-bar ::-webkit-progress-inner-element ::-webkit-progress-value ::-webkit-search-cancel-button ::-webkit-search-results-button ::-webkit-slider-runnable-track ::-webkit-slider-thumb note: generally, if there is an invalid pseudo-element or pseudo-class within in a chain or group of selectors, the whole selector list is invalid. if a pseudo-element (but not pseudo-class) has a -webkit- prefix, as of firefox 63, blink, webkit and gecko browsers assume it is valid, not invalidating the selector list. media features -webkit-animation -webkit-device-pixel-ratio -webkit-transform-2d -webkit-transform-3d -webkit-transition ...
env() - CSS: Cascading Style Sheets
Web › CSS › env
note: user agent properties are not reset by the all property. specifications ...
... note: user agent properties are not reset by the all property. specifications specification status comment css environment variables module level 1the defini...
...ing: env(safe-area-inset-bottom, 50px); /* zero for all rectangular user agents */ padding: env(safe-area-inset-bottom, 50px); /* 50px because ua properties are case sensitive */ padding: env(x, 50px 20px); /* as if padding: '50px 20px' were set because x is not a valid environment variable */ padding: env(x, 50px, 20px); /* ignored because '50px, 20px' is not a valid padding value and x is not a valid environment variable */ the syntax of the fallback, like that of custom properties, allows commas. but, if the property value doesn't support commas, the value is not valid. note: user agent properties are not reset by the all property. specifications specification status comment css environment variables module level 1the definition of 'env()' in that specificati...
font-family - CSS: Cascading Style Sheets
specifically designed to render emoji. this is some example emoji text: ✝♾. fangsong a particular style of chinese characters that are between serif-style song and cursive-style kai forms. this style is often used for government documents. this is some example fangsong text with the chinese characters for "fangsong" in traditional and simple forms, respectively: 仿宋體 仿宋体. ...
...haracters for "fangsong" in traditional and simple forms, respectively: 仿宋體 仿宋体. valid family names font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. this means that punctuation characters and digits at the start of each token must be escaped in unquoted font family names. ...
...ust either be given quoted as strings, or unquoted as a sequence of one or more identifiers. this means that punctuation characters and digits at the start of each token must be escaped in unquoted font family names. for example, the following declarations are valid: font-family: gill sans extrabold, sans-serif; font-family: "goudy bookletter 1911", sans-serif; the following declarations are invalid: font-family: goudy bookletter 1911, sans-serif; font-family: red/black, sans-serif; font-family: "lucida" grande, sans-serif; font-family: ahem!, sans-serif; font-family: test@foo, sans-serif; font-family: #pound, sans-serif; font-family: hawaii 5-0, sans-serif; formal definition initial valuedepends on user agentapplies toall elements. it also applies to ::first-letter and ::first-line.inher...
transition-timing-function - CSS: Cascading Style Sheets
roperty property, which acts as a transition-property list. if there are fewer timing functions specified than in the transition-property list, the user agent must calculate which value is used by repeating the list of values until there is one for each transition property. if there are more timing functions, the list is simply truncated to the right size. in both cases, the css declaration stays valid. syntax /* keyword values */ transition-timing-function: ease; transition-timing-function: ease-in; transition-timing-function: ease-out; transition-timing-function: ease-in-out; transition-timing-function: linear; transition-timing-function: step-start; transition-timing-function: step-end; /* function values */ transition-timing-function: steps(4, jump-end); transition-timing-function: cubic...
...s; } .parent > div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration: 2s; } function updatetransition() { var els = document.queryselectorall(".parent > div[class]"); for(var c = els.length, i = 0; i < c; i++) { els[i].classlist.toggle("box1"); } } var intervalid = window.setinterval(updatetransition, 10000); .ease { transition-timing-function: ease; } .easein { transition-timing-function: ease-in; } .easeout { transition-timing-function: ease-out; } .easeinout { transition-timing-function: ease-in-out; } .linear { transition-timing-function: linear; } .cb { transition-timing-function: cubic-bezier(0.2,-2,0.8,2); } step examples ...
...7s; } .parent > div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration:2s; } function updatetransition() { var els = document.queryselectorall(".parent > div[class]"); for(var c = els.length, i = 0; i < c; i++) { els[i].classlist.toggle("box1"); } } var intervalid = window.setinterval(updatetransition, 10000); .jump-start { transition-timing-function: steps(5, jump-start); } .jump-end { transition-timing-function: steps(5, jump-end); } .jump-none { transition-timing-function: steps(5, jump-none); } .jump-both { transition-timing-function: steps(5, jump-both); } .step-start { transition-timing-function: step-start; } .step-end { transit...
HTML attribute: accept - HTML: Hypertext Markup Language
it is still possible (in most cases) for users to toggle an option in the file chooser that makes it possible to override this and select any file they wish, and then choose incorrect file types. because of this, you should make sure that expected requirement is vali...
...alidate the types of the selected files; it simply provides hints for browsers to guide users towards selecting the correct file types. it is still possible (in most cases) for users to toggle an option in the file chooser that makes it possible to override this and select any file they wish, and then choose incorrect file types. because of this, you should make sure that expected requirement is validated server-side. 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. most operating systems lighten the files that don't match the criteria and aren't selectable. <p> <label for="soundfile">select an audio file:</label> <input type="file" id="soundfile" accept="audio/*"> </p> <p> <label for="videofile">...
...magefile" accept="image/*" multiple> </p> note the last example allows you to select multiple iamges. see the multiple attribute for more information. unique file type specifiers a unique file type specifier is a string that describes a type of file that may be selected by the user in an <input> element of type file. each unique file type specifier may take one of the following forms: a valid case-insensitive filename extension, starting with a period (".") character. for example: .jpg, .pdf, or .doc. a valid mime type string, with no extensions. the string audio/* meaning "any audio file". the string video/* meaning "any video file". the string image/* meaning "any image file". the accept attribute takes as its value a string containing one or more of these unique file type spe...
HTML attribute: multiple - HTML: Hypertext Markup Language
the boolean multiple attribute, if set, means the form control accepts one or more values. 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. depending on the type, the form control may have a different appearance if the multiple attribute is set. 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. ...
...ging 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. most browsers displaying a scrolling list box for a <select> control with the multiple attribute set versus a single line dropdown when the attribute is ommitted. the email input displays the same, but will match the :invalid pseudo-class if more than one comma-separated email address is included if the attribute is not present. when multiple is set on the email input type, the user can inlclude zero (if not also required), one or more comma-separated email addresses. <input type="email" multiple name="emails" id="emails"> if and only if the multiple attribute is specified, the value can be a list of properly-forme...
...any trailing and leading whitespace is removed from each address in the list. if the required attribute is present, at least one email address is required. some browsers support the appearance of the list of options from the associated <datal...
HTML attribute reference - HTML: Hypertext Markup Language
ion. if this attribute is specified, it overrides the enctype attribute of the button's form owner. formmethod <button>, <input> if the button/input is a submit button (type="submit"), this attribute sets the submission method to use during form submission (get, post, etc.). if this attribute is specified, it overrides the method attribute of the button's form owner. formnovalidate <button>, <input> if the button/input is a submit button (type="submit"), this boolean attribute specifies that the form is not to be validated when it is submitted. if this attribute is specified, it overrides the novalidate attribute of the button's form owner. formtarget <button>, <input> if the button/input is a submit button (type="submit"), this attribute specifies t...
...ntered in an input of the type email or file. muted <audio>, <video> indicates whether the audio will be initially silenced on page load. name <button>, <form>, <fieldset>, <iframe>, <input>, <keygen>, <object>, <output>, <select>, <textarea>, <map>, <meta>, <param> name of the element. for example used by the server to identify the fields in form submits. novalidate <form> this attribute indicates that the form shouldn't be validated when submitted. open <details> indicates whether the details will be shown on page load. optimum <meter> indicates the optimal numeric value. pattern <input> defines a regular expression which the element's value will be validated against. ping <a>, <area> the ...
...d if it’s absent, its value is false. html5 defines restrictions on the allowed values of boolean attributes: if the attribute is present, its value must either be the empty string (equivalently, the attribute may have an unassigned value), or a value that is an ascii case-insensitive match for the attribute’s canonical name, with no leading or trailing whitespace. the following examples are valid ways to mark up a boolean attribute: <div itemscope> this is valid html but invalid xml. </div> <div itemscope=itemscope> this is also valid html but invalid xml. </div> <div itemscope=""> this is valid html and also valid xml. </div> <div itemscope="itemscope"> this is also valid html and xml, but perhaps a bit verbose. </div> to be clear, the values "true" and "false" are not allowed on boole...
<area> - HTML: Hypertext Markup Language
Web › HTML › Element › area
dius. poly or polygon: the value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on. the values are numbers of css pixels. download this attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. see <a> for a full description of the download attribute. href the hyperlink target for the area. its value is a valid url. this attribute may be omitted; if so, the <area> element does not represent a hyperlink. hreflang indicates the language of the linked resource. allowed values are determined by bcp47. use this attribute only if the href attribute is present. ping contains a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser...
... attribute is present. shape the shape of the associated hot spot. the specifications for html defines the values rect, which defines a rectangular region; circle, which defines a circular region; poly, which defines a polygon; and default, which indicates the entire region beyond any defined shapes. many browsers, notably internet explorer 4 and higher, support circ, polygon, and rectangle as valid values for shape, but these values are non-standard. target a keyword or author-defined name of the browsing context to display the linked resource. the following keywords have special meanings: _self (default): show the resource in the current browsing context. _blank: show the resource in a new, unnamed browsing context. _parent: show the resource in the parent browsing context of th...
...pted by older browsers. nohref indicates that no hyperlink exists for the associated area. note: since html5, omitting the href attribute is sufficient. tabindex a numeric value specifying the position of the defined area in the browser tabbing order. this attribute is global in html5. type no effect. browsers ignore it. ...
<input type="submit"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › submit
nts, submit button inputs support the following attributes: attribute description formaction the url to which to submit the form's data; overrides the form's action attribute, if any formenctype a string specifying the encoding type to use for the form data formmethod the http method (get or post) to use when submitting the form. formnovalidate a boolean which, if present, means the form's fields will not be subjected to constraint validation before submitting the data to the server formtarget the browsing context into which to load the response returned by the server after submitting the form formaction a string indicating the url to which to submit the data. this takes precedence over the action attribute on ...
...at is sent to the url given by the formaction or action attribute using an http post method. this method supports complex data and file attachments. dialog this method is used to indicate that the button simply closes the dialog with which the input is associated, and does not transmit the form data at all. this attribute is also available on <input type="image"> and <button> elements. formnovalidate a boolean attribute which, if present, specifies that the form should not be validated before submission to the server. this overrides the value of the novalidate attribute on the element's owning form. this attribute is also available on <input type="image"> and <button> elements. formtarget a string which specifies a name or keyword that indicates where to display the response received a...
...to disable a submit button, simply specify the disabled global attribute on it, like so: <input type="submit" value="disabled" disabled> you can enable and disable buttons at run time by simply setting disabled to true or false; in javascript this looks like btn.disabled = true or btn.disabled = false. see the <input type="button"> page for more ideas about enabling and disabling buttons. validation submit buttons don't participate in constraint validation; they have no real value to be constrained. examples we've included simple examples above. there isn't really anything more to say about submit buttons. there's a reason this kind of control is sometimes called a "simple button." specifications specification status comments html living standardthe defi...
<script>: The Script element - HTML: Hypertext Markup Language
Web › HTML › Element › script
browser compatibility for notes on browser support. see also async scripts for asm.js. crossorigin normal script elements pass minimal information to the window.onerror for scripts which do not pass the standard cors checks. to allow error logging for sites which use a separate domain for static media, use this attribute. see cors settings attributes for a more descriptive explanation of its valid arguments. defer this boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing domcontentloaded. scripts with the defer attribute will prevent the domcontentloaded event from firing until the script has loaded and finished evaluating. this attribute must not be used if the src attribute is absent (i.e...
... module. the processing of the script contents is not affected by the charset and defer attributes. for information on using module, see our javascript modules guide. unlike classic scripts, module scripts require the use of the cors protocol for cross-origin fetching. any other value: the embedded content is treated as a data block which won't be processed by the browser. developers must use a valid mime type that is not a javascript mime type to denote data blocks. the src attribute will be ignored. deprecated attributes charset if present, its value must be an ascii case-insensitive match for "utf-8". it’s unnecessary to specify the charset attribute, because documents must use utf-8, and the script element inherits its character encoding from the document. language like ...
...pe attribute ignore any script with a nomodule attribute. that enables you to use module scripts while also providing nomodule-marked fallback scripts for non-supporting browsers. <script type="module" src="main.js"></script> <script nomodule src="fallback.js"></script> embedding data in html you can also use the <script> element to embed data in html with server-side rendering by specifying a valid non-javascript mime type in the type attribute. <!-- generated by the server --> <script id="data" type="application/json">{"userid":1234,"username":"john doe","membersince":"2000-01-01t00:00:00.000z"}</script> <!-- static --> <script> const userinfo = json.parse(document.getelementbyid("data").text); console.log("user information: %o", userinfo); </script> specifications specif...
itemtype - HTML: Hypertext Markup Language
artdate and location properties specifying the concert's key details. in this case, musicevent would be the url used by itemtype, with startdate and location as itemprop's which musicevent defines. note: more about itemtype attributes can be found at http://schema.org/thing the itemtype attribute must have a value that is an unordered set of unique tokens which are case-sensitive, each is a valid and absolute url, and all defined to use the same vocabulary. the attribute's value must have at least one token. the item types must all be types defined in applicable specifications (such as schema.org), and must all be defined to use the same vocabulary. the itemtype attribute can only be specified on elements which have an itemscope attribute specified. the itemid attribute can only be spe...
...ggregaterating"> rating: <span itemprop="ratingvalue">4.4</span> stars, based on <span itemprop="reviewcount">89 </span> reviews </span><p> <span itemprop="offers" itemscope itemtype="http://schema.org/offer"> regular price: $179.99<br> <meta itemprop="pricecurrency" content="usd" /> <span itemprop="price">sale price: $119.99<br></span> (sale ends <time itemprop="pricevaliduntil" datetime="2020-11-05"> 5 november!</time>)<br> available from: <span itemprop="seller" itemscope itemtype="http://schema.org/organization"> <span itemprop="name">executive objects<br></span> </span> condition: <link itemprop="itemcondition" href="http://schema.org/usedcondition"/>previously owned, in excellent condition<br> <...
... itemprop brand [thing] itemprop name acme itemscope itemprop[itemtype] aggregaterating[aggregaterating] itemprop ratingvalue 4.4 itemprop reviewcount 89 itemprop offers [offer] http://schema.org/offer itemprop pricecurrency usd itemprop price 119.99 itemprop pricevaliduntil 2020-11-05 itemprop itemcondition http://schema.org/usedcondition itemprop availability http://schema.org/instock itemscope itemprop[itemtype] seller [organization] http://schema.org/organization itemprop name executive objects note: a handy tool for extracting microdata structures from html is google's structured data...
Global attributes - HTML: Hypertext Markup Language
ffect on some elements. global attributes may be specified on all html elements, even those not specified in the standard. that means that any non-standard elements must still permit these attributes, even though using those elements means that the document is no longer html5-compliant. for example, html5-compliant browsers hide content marked as <foo hidden>...</foo>, even though <foo> is not a valid html element. in addition to the basic html global attributes, the following global attributes also exist: xml:lang and xml:base — these are inherited from the xhtml specifications and deprecated, but kept for compatibility purposes. the multiple aria-* attributes, used for improving accessibility. the event handler attributes: onabort, onautocomplete, onautocompleteerror, onblur, oncance...
...-* attributes, used for improving accessibility. ...
...mscope attribute can be associated with the item using an itemref. it provides a list of element ids (not itemids) with additional properties elsewhere in the document. itemscope itemscope (usually) works along with itemtype to specify that the html contained in a block is about a particular item. itemscope creates the item and defines the scope of the itemtype associated with it. itemtype is a valid url of a vocabulary (such as schema.org) that describes the item and its properties context. itemtype specifies the url of the vocabulary that will be used to define itemprops (item properties) in the data structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. lang helps define the language of an element: the language that n...
Warning - HTTP
Web › HTTP › Headers › Warning
the warning general http header contains information about possible problems with the status of the message. more than one warning header may appear in a response. warning header fields can in general be applied to any message, however some warn-codes are specific to caches and can only be applied to response messages. ...
...er some warn-codes are specific to caches and can only be applied to response messages. header type general header forbidden header name no syntax warning: <warn-code> <warn-agent> <warn-text> [<warn-date>] directives <warn-code> a three-digit warning number. the first digit indicates whether the warning is required to be deleted from a stored response after validation. 1xx warn-codes describe the freshness or validation status of the response and will be deleted by a cache after deletion. 2xx warn-codes describe some aspect of the representation that is not rectified by a validation and won't be deleted by a cache after validation unless a full response is sent. <warn-agent> the name or pseudonym of the server or software adding the w...
... the error. <warn-date> optional. if more than one warning header is sent, include a date that matches the date header. warning codes the http warn codes registry at iana.org defines the namespace for warn codes. code text description 110 response is stale a response provided by a cache is stale (the expiration time set for it has passed). 111 revalidation failed an attempt to validate the response failed, due to an inability to reach the server. 112 disconnected operation the cache is disconnected from the rest of the network. 113 heuristic expiration sent if a cache heuristically chose a freshness lifetime greater than 24 hours and the response's age is greater than 24 hours. 199 miscellaneous war...
Network Error Logging - HTTP
ion, the report data will be downgraded to only include information about this problem and the type set to dns.address_changed. ...
...e downgraded to only include information about this problem and the type set to dns.address_changed. ...
...tion was aborted tcp.address_invalid the ip address is invalid tcp.address_unreachable the ip address is unreachable tcp.failed the tcp connection failed due to reasons not covered by previous errors http.error the user agent successfully received a response, but it had a 4xx or 5xx status code http.protocol.error the connection was aborted due to an http protocol error http.response.invalid response is empty, has a content-length mismatch, has improper encoding, and/or other conditions that prevent user agent from processing the response http.response.redirect_loop the request was aborted due to a detected redirect loop http.failed the connection failed due to errors in http protocol not covered by previous errors specifications specification network error ...
HTTP Public Key Pinning (HPKP) - HTTP
header which public keys belong to it, the client stores this information for a given period of time. when the client visits the server again, it expects at least one certificate in the certificate chain to contain a public key whose fingerprint is already known via hpkp. if the server delivers an unknown public key, the client should present a warning to the user. firefox and chrome disable pin validation for pinned hosts whose validated certificate chain terminates at a user-defined trust anchor (rather than a built-in trust anchor). this means that for users who imported custom root certificates all pinning violations are ignored. enabling hpkp to enable this feature for your site, you need to return the public-key-pins http header when your site is accessed over https: public-key-pins: ...
... on how to extract this information out of a certificate or key file. max-age the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri optional if this optional parameter is specified, pin validation failures are reported to the given url. note: the current specification requires including a second pin for a backup key which isn't yet used in production. this allows for changing the server's public key without breaking accessibility for clients that have already noted the pins. this is important for example when the former key gets compromised. extracting the base64 encoded public k...
...rt" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production. the second pin declaration pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe=" also pins the backup key. max-age=5184000 tells the client to store this information for two months, which is a reasonable time limit according to the ietf rfc. this key pinning is also valid for all subdomains, which is told by the includesubdomains declaration. finally, report-uri="https://www.example.net/hpkp-report" explains where to report pin validation failures. report-only header instead of using a public-key-pins header you can also use a public-key-pins-report-only header. this header only sends reports to the report-uri specified in the header and does still allow browser...
HTTP response status codes - HTTP
Web › HTTP › Status
t another uri, specified by the location: http response header. this has the same semantics as the 301 moved permanently http response code, with the exception that the user agent must not change the http method used: if a post was used in the first request, a post must be used in the second request. client error responses 400 bad request the server could not understand the request due to invalid syntax. 401 unauthorized although the http standard specifies "unauthorized", semantically this response means "unauthenticated". that is, the client must authenticate itself to get the requested response. 402 payment required this response code is reserved for future use. the initial aim for creating this code was using it for digital payment systems, however this status code is used very ...
...ention exists. 403 forbidden the client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. unlike 401, the client's identity is known to the server. 404 not found the server can not find the requested resource. in the browser, this means the url is not recognized. in an api, this can also mean that the endpoint is valid but the resource itself does not exist. servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. this response code is probably the most famous one due to its frequent occurrence on the web. 405 method not allowed the request method is known by the server but has been disabled and cannot be used. for example, an api may forbid delete-in...
...situation it doesn't know how to handle. 501 not implemented the request method is not supported by the server and cannot be handled. the only methods that servers are required to support (and therefore that must not return this code) are get and head. 502 bad gateway this error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response. 503 service unavailable the server is not ready to handle the request. common causes are a server that is down for maintenance or that is overloaded. note that together with this response, a user-friendly page explaining the problem should be sent. this responses should be used for temporary conditions and the retry-after: http header should, if possible, contain the estimated time be...
Control flow and error handling - JavaScript
to false example in the following example, the function checkdata returns true if the number of characters in a text object is three. otherwise, it displays an alert and returns false. function checkdata() { if (document.form1.threechar.value.length == 3) { return true; } else { alert( 'enter exactly three characters. ' + `${document.form1.threechar.value} is not valid.`); return false; } } switch statement a switch statement allows a program to evaluate an expression and attempt to match the expression's value to a case label. if a match is found, the program executes the associated statement. a switch statement looks like this: switch (expression) { case label_1: statements_1 [break;] case label_2: statements_2 [break;] … ...
.... the finally block executes after the try and catch blocks execute but before the statements following the try...catch statement. the following example uses a try...catch statement. the example calls a function that retrieves a month name from an array based on the value passed to the function. ...
...your own function) } the catch block you can use a catch block to handle all exceptions that may be generated in the try block. ...
RangeError: radix must be an integer - JavaScript
the javascript exception "radix must be an integer at least 2 and no greater than 36" occurs when the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was specified and is not between 2 and 36. message rangeerror: invalid argument (edge) rangeerror: radix must be an integer at least 2 and no greater than 36 (firefox) rangeerror: tostring() radix argument must be between 2 and 36 (chrome) error type rangeerror what went wrong? the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was specified. its value must be an integer (a number) between 2 and 36, specifying the base of the number system to be used for representing numeric values. for example, the decimal (base 10) number 169 is r...
...a9. why is this parameter's value limited to 36? a radix that is larger than 10 uses alphabetical characters as digits; therefore, the radix can't be larger than 36, since the latin alphabet (used by english and many other languages) only has 26 characters. ...
...atin alphabet (used by english and many other languages) only has 26 characters. the most common radixes: 2 for binary numbers, 8 for octal numbers, 10 for decimal numbers, 16 for hexadecimal numbers. ...
TypeError: "x" is not a non-null object - JavaScript
null is not an object and won't work. you must provide a proper object in the given situation. ...
...null is not an object and won't work. you must provide a proper object in the given situation. ...
... methods like object.create() or object.defineproperty() and object.defineproperties() are used, the optional descriptor parameter expects a property descriptor object. providing no object (like just a number), will throw an error: object.defineproperty({}, 'key', 1); // typeerror: 1 is not a non-null object object.defineproperty({}, 'key', null); // typeerror: null is not a non-null object a valid property descriptor object might look like this: object.defineproperty({}, 'key', { value: 'foo', writable: false }); weakmap and weakset objects require object keys weakmap and weakset objects store object keys. you can't use other types as keys. var ws = new weakset(); ws.add('foo'); // typeerror: "foo" is not a non-null object use objects instead: ws.add({foo: 'bar'}); ws.add(window); ...
RangeError: repeat count must be less than infinity - JavaScript
the javascript exception "repeat count must be less than infinity" occurs when the string.prototype.repeat() method is used with a count argument that is infinity. message rangeerror: argument out of range (edge) rangeerror: repeat count must be less than infinity and not overflow maximum string size (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong? the string.prototype.repeat() method has been used. it has a count parameter indicating the number of times to repeat the string. it must be between 0 and less than positive infinity and cannot be a negative number. the range of allowed values can be described like this: [0, +∞). the resulting string can also not be larger than the maximum string size, which can differ in javascript engines. in fire...
...ing the number of times to repeat the string. it must be between 0 and less than positive infinity and cannot be a negative number. the range of allowed values can be described like this: [0, +∞). ...
...nfinity and cannot be a negative number. the range of allowed values can be described like this: [0, +∞). the resulting string can also not be larger than the maximum string size, which can differ in javascript engines. ...
Warning: unreachable code after return statement - JavaScript
g an expression directly after. message warning: unreachable code after return statement (firefox) error type warning what went wrong? unreachable code after a return statement might occur in these situations: when using an expression after a return statement, or when using a semicolon-less return statement but including an expression directly after. when an expression exists after a valid return statement, a warning is given to indicate that the code after the return statement is unreachable, meaning it can never be run. why should i have semicolons after return statements? in the case of semicolon-less return statements, it can be unclear whether the developer intended to return the statement on the following line, or to stop execution and return. the warning indicates that ther...
... in the case of semicolon-less return statements, it can be unclear whether the developer intended to return the statement on the following line, or to stop execution and return. the warning indicates that there is ambiguity in the way the return statement is written. ...
...less returns if these statements follow it: throw break var function examples invalid cases function f() { var x = 3; x += 4; return x; // return exits the function immediately x -= 3; // so this line will never run; it is unreachable } function f() { return // this is treated like `return;` 3 + 4; // so the function returns, and this line is never reached } valid cases function f() { var x = 3; x += 4; x -= 3; return x; // ok: return after all other statements } function f() { return 3 + 4 // ok: semicolon-less return with expression on the same line } ...
Array - JavaScript
array is changed) console.log(removeditems) // ["turnip", "radish"] copy an array let shallowcopy = fruits.slice() // this is how to make a copy // ["strawberry", "mango"] accessing array elements javascript arrays are zero-indexed. the first element of an array is at index 0, and the last element is at the index value equal to the value of the array's length property minus 1. using an invalid index number returns undefined. let arr = ['this is the first element', 'this is the second element', 'this is the last element'] console.log(arr[0]) // logs 'this is the first element' console.log(arr[1]) // logs 'this is the second element' console.log(arr[arr.length - 1]) // logs 'this is the last element' array elements are object properties in the same way that t...
...lement' console.log(arr[1]) // logs 'this is the second element' console.log(arr[arr.length - 1]) // logs 'this is the last element' array elements are object properties in the same way that tostring is a property (to be specific, however, tostring() is a method). nevertheless, trying to access an element of an array as follows throws a syntax error because the property name is not valid: console.log(arr.0) // a syntax error there is nothing special about javascript arrays and the properties that cause this. javascript properties that begin with a digit cannot be referenced with dot notation and must be accessed using bracket notation. for example, if you had an object with a property named 3d, it can only be referenced using bracket notation. let years = [1950, 1960, 1970, ...
...in array methods (e.g., join(), slice(), indexof(), etc.) take into account the value of an array's length property when they're called. other methods (e.g., push(), splice(), etc.) also result in updates to an array's length property. const fruits = [] fruits.push('banana', 'apple', 'peach') console.log(fruits.length) // 3 when setting a property on a javascript array when the property is a valid array index and that index is outside the current bounds of the array, the engine will update the array's length property accordingly: fruits[5] = 'mango' console.log(fruits[5]) // 'mango' console.log(object.keys(fruits)) // ['0', '1', '2', '5'] console.log(fruits.length) // 6 increasing the length. fruits.length = 10 console.log(fruits) // ['banana', 'apple', ...
JSON.stringify() - JavaScript
gint value. description json.stringify() converts a value to json notation representing it: if the value has a tojson() method, it's responsible to define what data will be serialized. boolean, number, and string objects are converted to the corresponding primitive values during stringification, in accord with the traditional conversion semantics. undefined, functions, and symbols are not valid json values. if any such values are encountered during conversion they are either omitted (when found in an object) or changed to null (when found in an array). json.stringify() can return undefined when passing in "pure" values like json.stringify(function(){}) or json.stringify(undefined). all symbol-keyed properties will be completely ignored, even when using the replacer function. the insta...
...age console.log(restoredsession); well-formed json.stringify() engines implementing the well-formed json.stringify specification will stringify lone surrogates, any code point from u+d800 to u+dfff, using unicode escape sequences rather than literally. ...
...nt from u+d800 to u+dfff, using unicode escape sequences rather than literally. before this change json.stringify would output lone surrogates if the input contained any lone surrogates; such strings could not be encoded in valid utf-8 or utf-16: json.stringify("\ud800"); // '"�"' but with this change json.stringify represents lone surrogates using json escape sequences that can be encoded in valid utf-8 or utf-16: json.stringify("\ud800"); // '"\\ud800"' this change should be backwards-compatible as long as you pass the result of json.stringify to apis such as json.parse that will accept any valid json text, because they will treat unicode escapes of lone surrogates as identical to the lone surrogates themselves. only if you are directly interpreting the result of json.stringify do you n...
String.fromCodePoint() - JavaScript
repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax string.fromcodepoint(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of code points. return value a string created by using the specified sequence of code points. exceptions a rangeerror is thrown if an invalid unicode code point is given (e.g. "rangeerror: nan is not a valid code point"). description this method returns a string (and not a string object). because fromcodepoint() is a static method of string, you must call it as string.fromcodepoint(), rather than as a method of a string object you created. polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not b...
...; ++index) { var codepoint = +arguments[index]; // correctly handles all cases including `nan`, `-infinity`, `+infinity` // the surrounding `!(...)` is required to correctly handle `nan` cases // the (codepoint>>>0) === codepoint clause handles decimals and negatives if (!(codepoint < 0x10ffff && (codepoint>>>0) === codepoint)) throw rangeerror("invalid code point: " + codepoint); if (codepoint <= 0xffff) { // bmp code point codelen = codeunits.push(codepoint); } else { // astral code point; split in surrogate halves // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae codepoint -= 0x10000; codelen = codeunits.push( (codepoint >> 10) + 0xd800, // highsurroga...
...eturn 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.fromcodepoin...
Symbol.toStringTag - JavaScript
... and more built-in tostringtag symbols object.prototype.tostring.call(new map()); // "[object map]" object.prototype.tostring.call(function* () {}); // "[object generatorfunction]" object.prototype.tostring.call(promise.resolve()); // "[object promise]" // ... ...
...ototype.tostring.call(new map()); // "[object map]" object.prototype.tostring.call(function* () {}); // "[object generatorfunction]" object.prototype.tostring.call(promise.resolve()); // "[object promise]" // ... ...
...e.tostring.call(promise.resolve()); // "[object promise]" // ... and more custom classes default to object tag when creating your own class, javascript defaults to the "object" tag: class validatorclass {} object.prototype.tostring.call(new validatorclass()); // "[object object]" custom tag with tostringtag now, with the help of tostringtag, you are able to set your own custom tag: class validatorclass { get [symbol.tostringtag]() { return 'validator'; } } object.prototype.tostring.call(new validatorclass()); // "[object validator]" tostringtag available on all dom prototype objects due to a webidl spec change in mid-2020, browsers are adding a symbol.tostringtag property to all dom prototype objects. for example, to acccess the symbol.tostringtag property on htmlbuttonelem...
WebAssembly - JavaScript
.instantiate() function. creating new memory and table instances via the webassembly.memory()/webassembly.table() constructors. providing facilities to handle errors that occur in webassembly via the webassembly.compileerror()/webassembly.linkerror()/webassembly.runtimeerror() constructors. constructor properties webassembly.compileerror() indicates an error during webassembly decoding or validation. webassembly.global() represents a global variable instance, accessible from both javascript and importable/exportable across one or more webassembly.module instances. this allows dynamic linking of multiple modules. webassembly.instance() is a stateful, executable instance of a webassembly.module webassembly.linkerror() indicates an error during module instantiation (besides traps fro...
... webassembly module directly from a streamed underlying source, returning both a module and its first instance. webassembly.compile() compiles a webassembly.module from webassembly binary code, leaving instantiation as a separate step. webassembly.compilestreaming() compiles a webassembly.module directly from a streamed underlying source, leaving instantiation as a separate step. webassembly.validate() validates a given typed array of webassembly binary code, returning whether the bytes are valid webassembly code (true) or not (false). examples stream a .wasm module then compile and instantiate it the following example (see our instantiate-streaming.html demo on github, and view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, ...
... 61firefox android full support 58opera android full support 45safari ios no support nosamsung internet android full support 8.0nodejs no support novalidatechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support n...
Lexical grammar - JavaScript
onsole.log() call is never issued, since it's inside a comment. any number of lines of code can be disabled this way. hashbang comments a specialized third comment syntax, the hashbang comment, is in the process of being standardized in ecmascript (see the hashbang grammar proposal). a hashbang comment behaves exactly like a single line-only (//) comment. instead, it begins with #! and is only valid at the absolute start of a script or module. note also that no whitespace of any kind is permitted before the #!. the comment consists of all the characters after #! up to the end of the first line; only one such comment is permitted. the hashbang comment specifies the path to a specific javascript interpreter that you want to use to execute the script. an example is as follows: #!/usr/bin/env ...
...that can represent integers with arbitrary precision. bigint literals are created by appending n to the end of an integer. 123456789123456789n // 123456789123456789 0o777777777777n // 68719476735 0x123456789abcdefn // 81985529216486895‬ 0b11101001010101010101n // 955733 note that legacy octal numbers with just a leading zero won't work for bigint: // 0755n // syntaxerror: invalid bigint syntax for octal bigint numbers, always use zero followed by the letter "o" (uppercase or lowercase): 0o755n for more information about bigint, see also javascript data structures. numeric separators to improve readability for numeric literals, underscores (_, u+005f) can be used as separators: // separators in decimal numbers 1_000_000_000_000 1_050.95 // separators in binary numbe...
...4, 1974, 1990, 2014] string literals a string literal is zero or more unicode code points enclosed in single or double quotes. unicode code points may also be represented by an escape sequence. all code points may appear literally in a string literal except for these closing quote code points: u+005c \ (backslash), u+000d <cr>, and u+000a <lf>. prior to the proposal to make all json text valid ecma-262, u+2028 <ls> and u+2029 <ps>, were also disallowed from appearing unescaped in string literals. any code points may appear in the form of an escape sequence. string literals evaluate to ecmascript string values. when generating these string values unicode code points are utf-16 encoded. 'foo' "bar" hexadecimal escape sequences hexadecimal escape sequences consist of \x followed by ex...
Optional chaining (?.) - JavaScript
the ?. operator functions similarly to the . chaining operator, except that instead of causing an error if a reference is nullish (null or undefined), the expression short-circuits with a return value of undefined. when used with function calls, it returns undefined if the given function does not exist. ...
...l request. syntax obj?.prop obj?.[expr] arr?.[index] func?.(args) description the optional chaining operator provides a way to simplify accessing values through connected objects when it's possible that a reference or function may be undefined or null. for example, consider an object obj which has a nested structure. without optional chaining, looking up a deeply-nested subproperty requires validating the references in between, such as: let nestedprop = obj.first && obj.first.second; the value of obj.first is confirmed to be non-null (and non-undefined) before then accessing the value of obj.first.second. this prevents the error that would occur if you simply accessed obj.first.second directly without testing obj.first. with the optional chaining operator (?.), however, you don't have ...
...onerror) { try { // ... do something with the data } catch (err) { onerror?.(err.message); // no exception if onerror is undefined } } optional chaining with expressions you can also use the optional chaining operator when accessing properties with an expression using the bracket notation of the property accessor: let nestedprop = obj?.['prop' + 'name']; optional chaining not valid on the left-hand side of an assignment let object = {}; object?.property = 1; // uncaught syntaxerror: invalid left-hand side in assignment array item access with optional chaining let arrayitem = arr?.[42]; examples basic example this example looks for the value of the name property for the member bar in a map when there is no such member. the result is therefore undefined. let mymap = ne...
export - JavaScript
e achieved with the "export from" syntax: export { default as function1, function2 } from 'bar.js'; which is comparable to a combination of import and export: import { default as function1, function2 } from 'bar.js'; export { function1, function2 }; but where function1 and function2 do not become available inside the current module. ...
... function2 } from 'bar.js'; which is comparable to a combination of import and export: import { default as function1, function2 } from 'bar.js'; export { function1, function2 }; but where function1 and function2 do not become available inside the current module. ...
...able to a combination of import and export: import { default as function1, function2 } from 'bar.js'; export { function1, function2 }; but where function1 and function2 do not become available inside the current module. ...
throw - JavaScript
zip code. if the zip code us...
...); } } 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. zip code. if the zip code uses an invalid format, the throw statement throws an exception by creating an object of type zipcodeformatexception. /* * creates a zipcode object. * * accepted formats for a zip code are: * 12345 * 12345-6789 * 123456789 * 12345 6789 * * if the argument passed to the zipcode constructor does not * conform to one of these patterns, an exception is thrown. */ function zipcode(zip) { z...
... this.tostring = function() { return string(this.value) }; } else { throw new zipcodeformatexception(zip); } } function zipcodeformatexception(value) { this.value = value; this.message = 'does not conform to the expected format for a zip code'; this.tostring = function() { return this.value + this.message; }; } /* * this could be in a script that validates address data * for us addresses. */ const zipcode_invalid = -1; const zipcode_unknown_error = -2; function verifyzipcode(z) { try { z = new zipcode(z); } catch (e) { if (e instanceof zipcodeformatexception) { return zipcode_invalid; } else { return zipcode_unknown_error; } } return z; } a = verifyzipcode(95060); // returns 950...
SVG Core Attributes - SVG: Scalable Vector Graphics
Web › SVG › Attribute › Core
the svg core attributes are all the common attributes that can be specified on any svg element. id lang tabindex xml:base xml:lang xml:space attributes id defines a unique identifier (id) which must be unique in the whole document. its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css). value: any valid id string; animatable: no lang participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. the tag contains one single entry value in the format defined in the tags for identifying languages (bcp47) ietf document. svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are u...
...guage of the element, the language that non-editable elements are written in or the language that editable elements should be written in. the tag contains one single entry value in the format defined in the tags for identifying languages (bcp47) ietf document. svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are used, xml:lang has priority over lang. value: any valid language id; animatable: no tabindex the tabindex svg attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation. value type: <integer>; animatable: no xml:base specifies a base iri other than the base iri of the document. value type: <iri>; animatable: no xml:lang it is a universal at...
...natural human language that an element contains. it's almost identical in usage to html's lang, but in conforming xml 1.0 documents, it does not allow the use of a null attribute value (xml:lang="") to indicate an unknown language. instead, use xml:lang="und". svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are used, xml:lang has priority over lang. value: any valid language id; animatable: no xml:space deprecated since svg 2 svg supports the standard xml attribute xml:space to specify the handling of white space characters within a given <text> element's character data. note: instead of using the xml:space attribute you should use the white-space css property. value: default | preserve; animatable: no ...
href - SVG: Scalable Vector Graphics
Web › SVG › Attribute › href
the given animation element, or if the given target element is not part of the current document, then the animation element will not affect any target element. however, the animation element will still operate normally with regard to its timing properties. specifically, timeevents are dispatched and the animation element can be used as syncbase in an identical fashion to when the url refers to a valid target element. if the href attribute or the deprecated xlink:href attribute is not provided, then the target element will be the immediate parent element of the current animation element. if both xlink:href and href are specified, the value of the latter attribute is used. refer to the descriptions of the individual animation elements for any restrictions on what types of elements can be targe...
...nder. value <url> default value none animatable yes example html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <image href="/files/2917/fxlogo.png" x="0" y="0" height="100" width="100"/> </svg> lineargradient for <lineargradient>, href defines url referring to a template gradient element; to be valid, the reference must be to a different <lineargradient> or <radialgradient> element. value <url> default value none animatable yes mpath for <mpath>, href defines a url referring to the <path> element or basic shape which defines the motion path. value <url> default value none animatable no pattern for <patte...
...ferenced element inherits attributes or children due to its own href attribute, then the current element can inherit those attributes or children. on the <pattern> element, the href attribute is animatable. value <url> default value none animatable yes radialgradient for <radialgradient>, href defines url referring to a template gradient element; to be valid, the reference must be to a different <lineargradient> or <radialgradient> element. value <url> default value none animatable yes script for <script>, href defines a url referring to an external resource containing the script code. value <url> default value none animatable no textpath for <textpath>, href de...
Types of attacks - Web security
ripting (xss) is a security exploit which allows an attacker to inject into a website malicious client-side code. this code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. these attacks succeed if the web app does not employ enough validation or encoding. the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content. cross-site scripting attacks usually occur when 1) data enters a web app through an untrusted source (most often a web request) or 2) dynamic content is...
...ser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content. cross-site scripting attacks usually occur when 1) data enters a web app through an untrusted source (most often a web request) or 2) dynamic content is sent to a web user without being validated for malicious content. the malicious content often includes javascript, but sometimes html, flash, or any other code the browser can execute. the variety of attacks based on xss is almost limitless, but they commonly include transmitting private data like cookies or other session information to the attacker, redirecting the victim to a webpage controlled by the attacker, or performing other ...
... wikipedia mentions a good example for csrf. in this situation, someone includes an image that isn’t really an image (for example in an unfiltered chat or forum), instead it really is a request to your bank’s server to withdraw money: <img src="https://bank.example.com/withdraw?account=bob&amount=1000000&for=mallory"> now, if you are logged into your bank account and your cookies are still valid (and there is no other validation), you will transfer money as soon as you load the html that contains this image. 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"> <inpu...
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
templates that have the element as an ancestor, unless overridden by another default-collation attribute on an inner element. it also determines the collation used by certain xslt constructs (such as <xsl:key> and xsl:for-each-group) within its scope. default-mode defines the default value for the mode attribute of all <xsl:template> and <xsl:apply-templates> elements within its scope. default-validation defines the default value of the validation attribute of all relevant instructions appearing within its scope. expand-text determines whether descendant text nodes of the element are treated as text value templates. id specifies an id for this stylesheet. this is most often used when the stylesheet is embedded in another xml document. input-type-annotations specifies whether type anno...
... scope. expand-text determines whether descendant text nodes of the element are treated as text value templates. id specifies an id for this stylesheet. this is most often used when the stylesheet is embedded in another xml document. 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. use-when determines whether the element and all the nodes that have it as ancestor are excluded from the stylesheet. xpath-default-namespace specifies the namespace that will be used if the element name is unprefixed or an unprefixed type name within an xpath expression. type required outermost element of stylesheet. specifications specification s...
...refixed type name within an xpath expression. type required outermost element of stylesheet. specifications specification status comment xslt 3.0the definition of '<xsl:stylesheet>' in that specification. recommendation added the attributes default-mode, expand-text, and use-when. xslt 2.0 added the attributes xpath-default-namespace, default-validation, default-collation, and input-type-annotations and made all attributes except version optional. xslt 1.0 initial definition ...
Understanding WebAssembly text format - WebAssembly
es. so that means the webassembly s-expression: (module (memory 1) (func)) represents a tree with the root node “module” and two child nodes, a "memory" node with the attribute "1" and a "func" node. we’ll see shortly what these nodes actually mean. the simplest module let's start with the simplest, shortest possible wasm module. (module) this module is totally empty, but is still a valid module. if we convert our module to binary now (see converting webassembly text format to wasm), we’ll see just the 8 byte module header described in the binary format: 0000000: 0061 736d ; wasm_binary_magic 0000004: 0100 0000 ; wasm_binary_version adding functionality to your module ok, that’s not very interesting, let’s add some executable code to this module...
...d up and emptied as the body’s instructions are executed. so for example, after executing the following function: (func (param $p i32) (result i32) local.get $p local.get $p i32.add) the stack contains exactly one i32 value — the result of the expression ($p + $p), which is handled by i32.add. the return value of a function is just the final value left on the stack. the webassembly validation rules ensure the stack matches exactly: if you declare a (result f32), then the stack must contain exactly one f32 at the end. if there is no result type, the stack must be empty. our first function body as mentioned before, the function body is simply a list of instructions that are followed as the function is called. putting this together with what we have already learned, we can finall...
... i32.const 13 call $log)) webassembly has a two-level namespace so the import statement here is saying that we’re asking to import the log function from the console module. you can also see that the exported logit function calls the imported function using the call instruction we introduced above. imported functions are just like normal functions: they have a signature that webassembly validation checks statically, and they are given an index and can be named and called. javascript functions have no notion of signature, so any javascript function can be passed, regardless of the import’s declared signature. once a module declares an import, the caller of webassembly.instantiate() must pass in an import object that has the corresponding properties. for the above, we need an object...
page-mod - Archive of obsolete content
de: ["*"], onattach: function onattach(worker) { console.log(worker.tab.title); } }); destroying workers workers generate a detach event when their associated document is closed: that is, when the tab is closed or when the associated window's unload event occurs. if you are maintaining a list of workers belonging to a page-mod, you can use this event to remove workers that are no longer valid. ...
...his event to remove workers that are no longer valid. ...
io/text-streams - Archive of obsolete content
xt encoding. you can also create textreader objects using io/file's open() function. parameters inputstream : stream the backing stream, an nsiinputstream. it must already be opened. charset : string inputstream is expected to be in the character encoding named by this value. if not specified, "utf-8" is assumed. see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this. textwriter(outputstream, charset) creates a buffered output stream that writes text to a backing stream using a given text encoding. you can also create textwriter objects using io/file's open() function. parameters outputstream : stream the backing stream, an nsioutputstream. it must already be opened. charset : string text will be written to outputstream using the chara...
... you can also create textwriter objects using io/file's open() function. parameters outputstream : stream the backing stream, an nsioutputstream. it must already be opened. charset : string text will be written to outputstream using the character encoding named by this value. if not specified, "utf-8" is assumed. see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this. textreader methods close() closes both the stream and its backing stream. read(numchars) reads and returns a string from the stream. if the stream is closed, an exception is thrown. parameters numchars : number the number of characters to read. if not given, the remainder of the stream is read. returns string : the string read. if the stream is at the end, the empty st...
jpm - Archive of obsolete content
ign --api-key ${jwt_issuer} --api-secret ${jwt_secret} --xpi <xpi file> alternatively, you can omit the --xpi argument, in which case jpm sign will generate an xpi from the current directory (or --addon-dir). jpm sign --api-key ${jwt_issuer} --api-secret ${jwt_secret} this submits an xpi it to the addons.mozilla.org signing api, then downloads a signed xpi to the working directory if it passes validation. to get values for --api-key and --api-secret, you will need to create api credentials on addons.mozilla.org. on the amo key management page, these values are labeled "jwt_issuer" and "jwt_secret". here are some possible outcomes of running the sign command: your add-on passed validation, was signed by mozilla, and a new signed xpi was downloaded to your working directory. your add-on ...
... to get values for --api-key and --api-secret, you will need to create api credentials on addons.mozilla.org. on the amo key management page, these values are labeled "jwt_issuer" and "jwt_secret". here are some possible outcomes of running the sign command: your add-on passed validation, was signed by mozilla, and a new signed xpi was downloaded to your working directory. your add-on failed validation, was not signed, and you got a link to a detailed report. after fixing the validation errors, you can run the command again. you add-on passed validation but it could not be automatically signed because your add-on is listed. listed add-ons will require a manual review before they can be signed. your add-on at this exact version number already exists, so it was not signed. increment the ve...
Bootstrapped extensions - Archive of obsolete content
d add-ons. localization (l10n) localizing bootstrapped add-ons is very much the same since firefox 7, as that is when chrome.manifest compatibility landed. js and jsm files - using property files to localize your .js and .jsm files you have to use property files. the absolute minimum needed here is: file: install.rdf file: chrome.manifest file: bootstrap.js folder: locale folder: valid_locale_here file: anything.properties in the locale folder you must have folders for each of the languages you want to provide; each folder must be named a valid locale (ex: en-us). inside this folder must be a property file. inside the chrome.manifest file these locale must be defined. for example if you had a subfolder of en-us in locale folder your chrome.manifest fil...
...fined point to a dtd file in your locale folder such as: <!doctype html system "chrome://l10n/locale/mozilla.dtd"> must add xmlns attribute to html tag for example: <html xmlns="http://www.w3.org/1999/xhtml"> if you have multiple dtd files read on here: using multiple dtds the bare minimum needed is: file: install.rdf file: chrome.manifest file: bootstrap.js folder: locale folder: valid_locale_here file: anything.dtd the chrome.manifest file must include a definition for content for example: content name_of_your_addon ./ the chrome.manifest file must also include a line pointing to the locale, just like in the above property section, if you had a folder named en-us in locale, the chrome.manifest file should contain: locale name_of_your_addon en-us loca...
JavaScript Daemons Management - Archive of obsolete content
*******/ /*\ |*| |*| ie-specific polyfill which enables the passage of arbitrary arguments to the |*| callback functions of javascript timers (html5 standard syntax). ...
...bitrary arguments to the |*| callback functions of javascript timers (html5 standard syntax). ...
Install Manifests - Archive of obsolete content
<em:id>{daf44bf7-a45e-4450-979c-91cf07434c3d}</em:id> name the name of the add-on; intended for display in the ui. examples <em:name>my extension</em:name> targetapplication an object specifying an application targeted by this add-on. this means that the add-on will work with the application identified by the id property (<em:id>) specified (for a comprehensive list of application ids and valid min/maxversions for them see valid application versions for add-on developers), from the minimum version (<em:minversion>) up to and including the maximum version (<em:maxversion>). however, while <em:maxversion> is a required property, it is ignored unless you also set <em:strictcompatibility> in the main <description> of your install.rdf (i.e. not in <em:targetapplication>). these version strin...
... the version of the add-on being supplied. for firefox/thunderbird 1.0, the format must conform to the rules specified in extension versioning, update and compatibility. for firefox/thunderbird 1.5, see toolkit version format. examples <em:version>2.0</em:version> <em:version>1.0.2</em:version> <em:version>0.4.1.2005090112</em:version> firefox 1.5 / xulrunner 1.8 - add-ons that do not use a valid version format will not be installed. the version format is different from, although backwards-compatible with, 1.0's. for add-ons hosted on addons.mozilla.org - mozilla's update website may repackage your add-on and correct or reject malformed version strings. optional property reference you may need to supply these properties, depending on the capabilities of your add-on. abouturl the chro...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
ents mixed up. so let’s update the _letfunc function as shown in listing 6. if we run the test again, we should get a green bar, showing that it ran correctly. benefits of testing implementing the tests described here confirms that the methods work correctly, and builds confidence in your implementations. multiplication and division are implemented the same way, but what will you do if an invalid string is passed? what if you attempt to run with nothing in the stack—what result will you return then? try to keep in mind real-world circumstances while you’re working on this. listing 4: test_calc.js (adding sample test case) '2 1 -': function() { var calc = new rpncalc.rpncalc(); calc.init(); calc.push(2); calc.push(1); calc.minus(); assert.equals(calc.pop(), 1); }, listi...
...he function implementing initwithpath. use that as your search string. that should produce nslocalfilewin.cpp and other os-specific files. let’s look inside nslocalfilewin.cpp—we’ll see, for example, that it’s checking for the presence of a “:” in the drive name. we can also see how network paths are handled differently on wince. just looking at initwithpath, we can see how the path-validation process works. conclusion in this chapter, we looked at some tools beyond the introductory level. if you had any “aha!” moments while reading this, then i hope you’ll take the next step and actually put them to work. i hope you’ll find that this chapter helps make you a more effective extension developer. gonzui gonzui is a full-text source-code search engine from satoru takabaya...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
javascript files with properties references it may happen your extension displays some useful messages such as alerts to the user. though they are nested in javascript, the strings should be localized too, for the sake of ui consistency. ...
....setboolpref("access.authenticated", true); } else { alert ("invalid password"); ...... function clear() { sure = confirm("are you sure?"); first, you have to find or create a myextension.properties file in your locale folder (notice: always stick to utf-8). then you simply write variable names and the sentences or words that should appear to the final user. something like : wrongpassmessage=invalid password areyousuremessage=are you sure? (where invalid password and are you sure? are the strings to be displayed to the final user) notice : a simple sign is enough now you go back to the .js file where the strings to be localized are nested. at the very top of the file you create one string bundle with the address of the properties file where to find strings. var gmyextensionbundle = co...
Intercepting Page Loads - Archive of obsolete content
is the content document of the loaded page. let doc = event.originaltarget; if (doc instanceof htmldocument) { // is this an inner frame? if (doc.defaultview.frameelement) { // frame within a tab was loaded. // find the root document: while (doc.defaultview.frameelement) { doc = doc.defaultview.frameelement.ownerdocument; } } } } the second if validation is necessary if you need to make a distinction for html documents being loaded in inner page frames. few modern sites use framesets, but it is common for ads to appear inside iframe elements. in most cases you'll need to compare the page url with some string or regular expression: if (some_regular_expression.test(doc.defaultview.location.href)) you can access and modify the dom of the loa...
...&& (astateflags & components.interfaces.nsiwebprogresslistener.state_is_document)) note the use of the binary mask & operator. to detect if this is a frame being loaded or not, you can do this: if (awebprogress.domwindow != awebprogress.domwindow.top) { // this is a frame. } in this case, the url can be obtained from arequest.name. make sure you access it from inside the state validation if condition. there may be other cases where accessing this property will throw an exception. canceling the request works just like with onlocationchange. see "recognizing page load failure" at mozilla.dev.extensions for tips on detecting connection failures and http response codes. xpcom solutions there are a couple more solutions you may be interested in trying if the previous o...
XPCOM Objects - Archive of obsolete content
me, in string avalue); one of the most important details to notice is that both paratemers have the in keyword. this specifies that these are input parameters, values that the method will use to perform its actions. when is a parameter not an in parameter? in some methods the out keyword is used for parameters that are return values in reality. this is done for certain value types that are not valid as return values in idl, such as typed arrays. void getchildlist(in string astartingat, out unsigned long acount,[array, size_is(acount), retval] out string achildarray); this method returns an array of strings. the first parameter is an input that tells the method where to start looking. the second one will hold the length of the return array, and the third parameter will hold the array it...
...easy to understand. the only aspects to take into account are that methods and attributes must have the same names as their idl counterparts, and that the queryinterface method is implemented: queryinterface : function(aiid) { if (!aiid.equals(ci.xsihellocounter) && !aiid.equals(ci.nsisupports)) { throw cr.ns_error_no_interface; } return this; } the method is very simple, it validates that the caller is requesting a supported interface, otherwise it throws an exception. the rest of the code looks long and complicated, but it is pretty much the same for all components, so you shouldn't worry too much about it. all you have to do to use it in other components is copy it and change some names. the purpose of this code is to register the component so that you can get referenc...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
the new design clearly shows what some experts have been saying: that standards-based design can be visually compelling and preserve the interface conventions we've come to expect from web pages. ...
...rmatting. but writers, editors, and producers have been inserting stories into vignette for years sans closing paragraph (</p>) tags. unquoted attributes and uppercase html tags? we've got them in spades, and they're embedded in all past stories of the database. fortunately, our chief engineer was able to write some code that scraped through the database looking for errors like this which would invalidate our markup. we don't make any claims about past archived content, but we've taken many efforts to make sure even stories from a few years ago are as valid as possible. while conversion to xhtml and css definitely shaved off development time that would have normally been spent manipulating the code, it didn't come entirely easy or without cost. our engineer, aaron jones, actually ended up rebu...
CSS3 - Archive of obsolete content
orking draft status. css modules status completed modules a few css modules already became a standard as a w3c recommendation. these should be no more changes. css color module level 3 recommendation since june 7th, 2011 adds the opacity property, and the hsl(), hsla(), rgba() and rgb() functions to create <color> values. it also defines the currentcolor keyword as a valid color. the transparent color is now a real color (thanks to the support for the alpha channel) and is a now an alias for rgba(0,0,0,0.0). it deprecates the system-color keywords that shouldn't be used in a production environment anymore. css namespaces module recommendation since september 29th, 2011 adds the support for the xml namespaces by definin...
...le level 3 recommendation since june 21st, 2018 adds: the ability to tweak the box model using the css box-sizing property. at risk: due to insufficient browser support, standardization of the padding-box value may be postponed to the next iteration of this module. allow the styling of forms according their content using the css :indeterminate, :default, :valid, :invalid, :in-range, :out-of-range, :required, :optional, :read-only, and :read-write pseudo-classes and the ::value, ::choices, ::repeat-item, and ::repeat-index pseudo-elements. at risk: due to insufficient browser support, standardization of the pseudo-elements ::value, ::choices, ::repeat-item, and ::repeat-index may be postponed to the next iteration of this module . support for...
Editor Embedding Guide - Archive of obsolete content
y or when the document is done loading. ...
... nsicommandmanager from the nsiwebbrowser using do_getinterface: nscomptr<nsicommandmanager> commandmanager; nsiwebbrowser->do_getinterface(getter_addrefs(commandmgr)); 2. call a command -- docommand: commandmanager->docommand(acommand, acommandparams); acommand is a const char * to a supported command name (see list below). acommandparams could possibly be a null pointer or a pointer to a valid structure filled with relative parameters to acommand (see list below for legal params). 3. verify if a command is enabled -- iscommandenabled: commandmanager->iscommanddisabled(acommand, retval) 4. get the current command state of a given command -- getcommandstate: commandmanager->getcommandstate(acommand,acommandparams) index of commands and parameters cmd_bold toggles bold style on s...
Layout System Overview - Archive of obsolete content
normal in-flow case this is quite natural because the sequential addition of new content results in sequential addition of new frames, and because everything is in-flow, the new frames do not influence the geometry of the frames that have already been formatted. when out-of-flow frames are present this is a more difficult problem, however. sometimes a content element comes in incrementally, and invalidates the formatting of some of the frames that precede it, frame that have already been formatted. in this case the layout system has to detect that impact and reflow again the impacted frames. this is referred to as an incremental reflow. another responsibility of layout is to manage dynamic changes to the content model, changes that occur after the document has been loaded and (possibly) present...
... destroyed (again, impacts to other elements are managed). if a content element is modified, layout must determine if the change influences the formatting of that or other elements' presentations, and must then reformat, or re-reflow, the impacted elements. in all cases, the determination of the impact is critical to avoid either the problem of not updating impacted elements, thus presenting an invalid presentation, or updating too much of the presentation and thus doing too much work, potentially causing performance problems. one very special case of dynamic content manipulation is the html editor. layout is used to implement both a full-blown wysiwyg html editor, and a single and multi-line text entry control. in both cases, the content is manipulated by the user (via the dom) and the resulti...
importUserCertificates - Archive of obsolete content
tabase. the request id in the response being imported must match the request id in the associated certification request or recovery request. if the import operation succeeds, an empty string will be returned. ...
...returned. ...
New Security Model for Web Services - Archive of obsolete content
on nsiwebscriptsaccessservice this interface provides a way to check whether the running script has access to the server that the script wishes to communicate. boolean canaccess(in nsiuri atransporturi, in astring atype); atransporturi - the service uri atype - type requested by the script ( ex. soapv, soap, load, etc. ) return pr_true if access granted else pr_false void invalidatecache(in string atransporturi); invalidate cached entry for the given transport uri. empty the cache by passing in a empty string nswebscriptsaccess(implements nsiwebscriptsaccessservice) maintains access information, for servers, in an access-info-cache ( hashtable ). if an entry was not found in the cache creates one by loading the declaration file (web-scripts-access.xml) an...
...servers, in an access-info-cache ( hashtable ). if an entry was not found in the cache creates one by loading the declaration file (web-scripts-access.xml) and extracting information from it (declaration file); requested type and subject princple's prefix are compared to the allowed type and prefix in order to determine access. an entry is created if and only if the declaration file is considered valid (validation based on the syntax described above); an invalid document will result in access denial. denies script access in the event of an xml-wellformedness error, or validation error, or if the declaration file does not grant access. reports errors (validation, wellformedness, file not found, etc.) to the console via nsiconsoleservice. note: script access is checked via declaration file only...
Example Sticky Notes - Archive of obsolete content
="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme,&nbsp;inc. ...
...nc. fax - respond today.</p></div> <div class="sticker"><p>don't forget the eggs!</p></div> <div class="sticker"><p>the new project - who's on charge?</p></div> <div class="sticker"><p>learn more about xbl.</p></div> <p style="clear: left"><a href="http://validator.w3.org/check?uri=referer"><img src="https://udn.realityripple.com/samples/e2/dd625ef1cd.png" width="88" height="31" alt="valid html 4.01" style="border: 1px none"></a></p> </body> </html> notes.xml <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- in above only xbl namespace declaration is mandatory. the others are only needed if y...
Install script template - Archive of obsolete content
current browser var errblock1; // error return codes when we try and do a secondary installation var errblock2 = 0; // global variable containing our secondary install location var secondaryfolder; //special error values used by the cycore developers (www.cycore.com) who helped make this install script var exceptionoccurederror = -4711; var winregisnullerror = -4712; var invalidrootkeyerror = -4713; var registrykeynotwritableerror = -4714; //initinstall block //the installation is initialized here -- if we fail here, cancel the installation // initinstall is quite an overloaded method, but i have invoked it here with three strings // which are globally defined err = initinstall(software_name, plid, version); if (err != 0) { // call initinstall again in case...
...r; } // which root to start from hklm, hkcu if (rootkey == hkey_local_machine) { logcomment("moz registerplid: rootkey=="+hkey_local_machine); winreg.setrootkey(winreg.hkey_local_machine); } else if (rootkey == hkey_current_user) { logcomment("moz registerplid: rootkey=="+hkey_current_user); winreg.setrootkey(winreg.hkey_current_user); } else { logcomment("moz registerplid: invalid rootkey, "+rootkey); return invalidrootkeyerror; } if (!winreg.iskeywritable(plidpath)) { logcomment("moz registerplid: registry key not writable"); return registrykeynotwritableerror; } // if we can't find the plidpath create the key if (!winreg.keyexists(plidpath)) { logcomment("moz registerplid: creating missing key "+plidpath+"."); myregstatus = winreg.createkey(plidpath, "...
events - Archive of obsolete content
you can send a custom event by calling the updatecommands method of the command dispatcher. ...
...you can send a custom event by calling the updatecommands method of the command dispatcher. ...
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
tem.label xul attributes, xul reference no summary! 405 treelines no summary! 406 type no summary! 407 unread xul, xul attributes, xul reference no summary! 408 uri xul, xul attribute, xul reference no summary! 409 useraction xul attributes, xul reference no summary! 410 validate xul attributes, xul reference no summary! 411 value xul attributes, xul reference no summary! 412 var xul attributes, xul reference no summary! 413 visuallyselected no summary! 414 wait-cursor xul attributes, xul reference no summary! 415 where.subject xul attributes, xul reference ...
...for other changes you should be aware of, see adapting xul applications for firefox 1.5. 977 xul coding style guidelines xul no summary! 978 xul event propagation dom, xul no summary! 979 xul events mozilla, non-standard, overview, reference, xul, xul_events, events the following tables and sections describe the event handler that are valid for most xul elements. the events listeners can be attached using addeventlistener and removed using removeeventlistener. 980 checkboxstatechange event, events the checkboxstatechange event is executed when the state of a <checkbox> element has changed. 981 dommenuitemactive the dommenuitemactive event is executed when a <menu> or a <menuitem> has been...
Creating a Wizard - Archive of obsolete content
lns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> when the user clicks the finish button, the function savedoginfo() will be called, which would be defined in a script file to save the information that was entered. if the function returns true, the wizard closes. if it returns false, then the wizard does not close, which might occur if the function savedoginfo() encountered invalid input, for example. there are also related onwizardback, onwizardnext and onwizardcancel attributes, which are called when the back, next and cancel buttons are pressed respectively. these functions are called regardless of which page is currently displayed. to have different code called depending on which page you are on, use the onpagerewound or onpageadvanced attributes on a wizardpage eleme...
...e back, next and cancel buttons are pressed respectively. these functions are called regardless of which page is currently displayed. to have different code called depending on which page you are on, use the onpagerewound or onpageadvanced attributes on a wizardpage element. they work in a similar way to the other functions except that you can use different code for each page. this allows you to validate the input entered on each page before the user continues. a third option is to use the onpagehide and onpageshow attributes on the wizardpage element. these methods will be called when the page is hidden or shown, regardless of which button was pressed (except when cancel is pressed -- you need to use onwizardcancel to check for this.) these three methods should provide enough flexibility to...
Using Remote XUL - Archive of obsolete content
eed a web server for this tutorial; you can load the document you create on your computer via a "file" url or the "open file" function of your browser. step 1: a basic xul document the first thing we need to do is create a basic xul document. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" /> a xul document requires only two entities to be valid, an xml processing instruction on the first line that identifies the file as xml, and a window element that defines a xul application window (or in this case web page). the processing instruction is required because xul is an xml-based language, and this instruction tells browsers how to parse the document. the window element is the root (outermost) element in a xul document and encompasses all ...
...ow element that defines a xul application window (or in this case web page). the processing instruction is required because xul is an xml-based language, and this instruction tells browsers how to parse the document. the window element is the root (outermost) element in a xul document and encompasses all other elements. it is analogous to the <html> element in html. these two elements give us a valid xul document we can load and display in our web browser, even though there's nothing to see yet. source | rendered step 2: an iframe for displaying the web site content now that we have a basic xul document, we need a way to display pages from the mozilla.org web site. for that we'll use a xul iframe element. <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/...
XUL element attributes - Archive of obsolete content
the pack attribute is related to the alignment but is used to specify the position in the opposite direction. you can also specify the value of align using the style property -moz-box-align. allowevents type: boolean if true, events are passed to children of the element. otherwise, events are passed to the element only. allownegativeassertions type: boolean valid on any element that has a datasources attribute. when multiple datasources are used, one may override an assertion from another. this attribute, if true, which is the default, allows a datasource to negate an earlier assertion. class type: string the style class of the element. multiple classes may be specified by separating them with spaces. coalesceduplicatearcs type: boolean ...
... on any element that has a datasources attribute. when multiple datasources are used, one may override an assertion from another. this attribute, if true, which is the default, allows a datasource to negate an earlier assertion. class type: string the style class of the element. multiple classes may be specified by separating them with spaces. coalesceduplicatearcs type: boolean valid on any element that has a datasources attribute. when multiple datasources are used, one may override an assertion from another. this attribute, if true, which is the default, allows a datasource to negate an earlier assertion. collapsed type: boolean if true, then the element is collapsed and does not appear. it is equivalent to setting the css visibility property to collapse. ...
commandset - Archive of obsolete content
mmandset> <command id="cmd_open" oncommand="alert('open!');"/> <command id="cmd_help" oncommand="alert('help!');"/> </commandset> attributes commandupdater type: boolean if true, the commandset is used for updating commands. typically, this is used to update menu commands such as undo and cut based on when an event occurs. for example, since the cut command is only valid when something is selected, a command updater might be used when the select event occurs. events type: comma-separated list a comma-separated list of event names that the command updater will update upon. if this attribute is not specified, or you set it to the value '*', all events are valid. valid events are listed below, or you can use your own events. you can send a ...
... oncommandupdate type: script code this event occurs when a command update occurs. you would use this to update the disabled status of items. targets type: comma-separated list of element ids a comma-separated list of element ids that the command updater will update upon. if this attribute is not specified, or you set it to the value '*', all elements are valid. the command update will only occur when the event occurs to one of the specified elements. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , p...
image - Archive of obsolete content
Archive › Mozilla › XUL › image
used to specify the url of the image. more information is available in the xul tutorial. note: prior to gecko 8.0, images did not shrink down with the same ratio in both directions when specifying maximum sizes using maxheight or maxwidth. the new behavior aligns more with the html <img> element and shrinks both the width and height down proportionally. attributes onerror, onload, src, validate properties accessibletype, src style classes alert-icon, error-icon, message-icon, question-icon examples <image src='firefoxlogo.png' width='135' height='130'/> attributes onerror type: script code this event is sent to an image element when an error occurs loading the image. image.onload type: script code this event handler will be called on the image eleme...
...will be called on the image element when the image has finished loading. this applies whether the image is applied via the src attribute or the list-style-image style property. if you change the image, the event will fire again when the new image loads. this event will not bubble up the element tree. src type: uri the uri of the content to appear in the element. validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the i...
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
thods | related ] a single tab which should be placed inside a tabs element. the user may click a tab to bring the associated page of the tabbox to the front. more information is available in the xul tutorial. attributes accesskey, afterselected, beforeselected, command, crop, disabled, first-tab, image, label, last-tab, linkedpanel, oncommand, pending, pinned, selected, tabindex, unread, validate, value properties accesskey, accessibletype, command, control, crop, disabled, image, label, linkedpanel, selected, tabindex, value examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. afterselect...
...n which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. unread type: boolean this attribute is set to true if the tab is unread; that is, either it has not yet been selected during the current session, or has changed since the last time it was selected. this attribute is not present if the tab is not unread. validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the i...
tabbrowser - Archive of obsolete content
may also be optionally used to set the referrer page. getbrowseratindex( index ) return type: browser element returns a browser at the specified tab index. getbrowserindexfordocument( document ) return type: integer returns the index of the browser for the specified document in the tabbrowser the method was invoked on. the returned index is dependent on the tabs in the tabbrowser and is invalidated when the tab ordering changes. it should not be used to track per-tab data during a session; the use of linkedpanel on the corresponding tab is preferred instead. getbrowserfordocument( document ) return type: browser element returns a browser for the specified document. getbrowserfortab( tab ) return type: browser element returns a browser for the specified tab element. ge...
...be a string, not a nsiuri object. to get a string from an nsiuri, use nsiuri.spec or nsiuri.asciispec loaduriwithflags( uri, flags, referrer, charset, postdata ) return type: no return value load a url into the document, with the specified load flags, the given referrer, character set, and post data. in addition to the flags allowed for the reloadwithflags method, the following flags are also valid: load_flags_is_refresh: this flag is used when the url is loaded because of a meta tag refresh or redirect. load_flags_is_link: this flag is used when the url is loaded because a user clicked on a link. the http referer header is set accordingly. load_flags_bypass_history: do not add the url to the session history. load_flags_replace_history: replace the current url in the session histo...
toolbarbutton - Archive of obsolete content
, provide keyboard alternatives. where possible, duplicate functionality in a menu item or context menu. where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
... to create a toggle button which will switch the checked state each time the button is pressed. radio: use this type to create a radio button. you can also create a group of toolbarbuttons using this type and the attribute group. examples: type value <toolbarbutton > menu menu-button checkbox radio validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the images are stored remotely or you plan on swapping the image frequently. the following values are accepted, or leave out the attribute entirely for default handling: always the image is always checked to see whether it should be reloaded. never the i...
XUL Explorer - Archive of obsolete content
xul explorer is a xulrunner application that provides an easy way to experiment with xul. it’s a simple editor that can preview xul inline or in a separate popup window. it has a list of code snippets (small fragments of xul or javascript) that can be quickly inserted into the editor. the xul can be loaded from and saved to files. a xul validator and the error console are both available to help debug problems. the help menu provides access to xul information on mdc. there is even simple “keyword” help lookup for xul elements. roadmap features: the preview pane can be toggled with the editor. previewing in a popup window is still available. option to automatically update the preview as the editor changes. indicator in the statusbar shows errors. double-click to display error...
...statusbar shows errors. double-click to display error console. option to specify the snippet used to load the editor on startup. option to include a user snippet file. the snippets are merged with the built-in snippets at startup. double-click or drag-and-drop to insert a snippet file > new allows user to pick any “template” snippet, as well as blank. simple xul checker can be used to ‘validate’ the xul snippet. it checks for legal element and attribute names, including allowed attributes for a given element. support attribute value checking where appropriate (boolean and enumerated values) - xul checker support “best practice” checks such as: using of commands and keys, strings in dtds and so on - xul checker multi-tabbed editor support support wizards to generate common p...
Mozilla release FAQ - Archive of obsolete content
preciated. in what directory should i be in order to get a cvs update of the source? you should be at the top of the source (the directory with the top-level makefile). if you wish only to refresh a certain area of the tree, you can go to that area and do a cvs update there. ...
...o that area and do a cvs update there. when i try to use cvs on windows, i get an error about no home directory you need to set the home environment variable to a valid directory, as cvs was designed with unix in mind, and wants to put a file in your home directory (the password file) i'm on a unix system, and still am having problems building here's a brief guide to common build problems: cc1: invalid option 'foo' cc: no such file or directory 'foo' these are almost always caused by your platform-specific makefile being incorrect for your system, either because you're not using the compiler that you're expected to (i.e. gcc instead of the sun workshop compiler), or because you're not using a recognized version of your os. go dig through the makefiles in config and remove the offending portion...
Extentsions FAQ - Archive of obsolete content
b) should be able do this if you set it to always open "file://*" urls in an ie tab. the appearance with a firefox tab isn't quite the same as having a completely separate explorer window. however, it's functional and does allow for the explorer to be handling the display of the folder contents, and all of the right-click context menu support is present so it should meet my needs. what is the valid location and things needed to to release a mozilla extension on mozallia site? you must remove updateurl from the install.rdf and use a known to amo minversion/maxversion. no confirmation that the answer given worked yet. is it possible to open the url in a new tab? var tab = gbrowser.addtab( url ); // and if you want it to load in the foreground: gbrowser.selectedtab = tab; is it possi...
...r should souch extension work gainst? did you mean exchange? how to attach information using the stringproperties of an imap message with out changing the properties? string properties are implemented as imap user flags. however not all servers support user flags, in which case you get reduced functionality as follows: all flags are stored in your local cache and are lost if your cache gets invalidated, and only "known" properties are copied when messages are copied. the list of "known" properties is: junkscore junkscoreorigin label priority keywords. keywords - in the gui they are called tags. they replace the old labels (although the labels are still recognised). preserved properties source code - nsimapmailfolder::copymessages uaq friday, september 22 - 29, 2006 (↑ top) why ex...
2006-11-03 - Archive of obsolete content
summary: mozilla.dev.security - october 28, 2006 to november 3, 2006 return to mozilla-dev-security announcements none during this week. discussions extended validation certificates major discussion this week started by gervase markham about security certificates, more specifically extended validation certificates. the aim of the group is to develop a new, higher standard for the validation which is done before certificate issuance, called extended validation. the idea was that such certs would be presented differently in the ui, to give the cas a reason to go to the extra effort, and to give customers a reason to buy them. in ie 7 at least, the use of an ev certificate is tied to the green background in the url bar. a decision has to be made as to the usefulness of exte...
...if it does make a difference, does it warrant a different ui presentation for these certificates (ie the green bar). he would like to have some comments before november 19th, after which there will possibly be a vote. ...
Browser-side plug-in API - Archive of obsolete content
ides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. ...
...api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. warning: you must only call these from the main thread; calling them from other threads is not supported and may have unpredictable results. ...
NPPrint - Archive of obsolete content
npfullprint fullprint; /* if mode is np_full */ npembedprint embedprint; /* if mode is np_embed */ } print; } npprint; fields the data structure has the following fields: mode determines whether plug-in prints in full-page or embedded mode. values: np_full: pointer to npfullprint structure. plug-in can optionally print in full-page mode. the fullprint field of the union is valid. ...
...ucture has the following fields: mode determines whether plug-in prints in full-page or embedded mode. values: np_full: pointer to npfullprint structure. plug-in can optionally print in full-page mode. the fullprint field of the union is valid. see npfullprint and npp_print. np_embed: pointer to npembedprint structure. plug-in should print in embedded mode. the embedprint field of the union is valid. see npembedprint. description the npp_print function passes a pointer to an npprint object (previously allocated by the browser) to the plug-in. the pointer and fields within the npprint structure are valid only for the duration of the npp_print call. see also npp_print, npfullprint, npembedprint ...
NPRect - Archive of obsolete content
rectangular area of a plug-in's content area. ...
...f struct _nprect { uint16 top; uint16 left; uint16 bottom; uint16 right; } nprect; fields the data structure has the following fields: top, left, bottom, right the top, left, bottom, and right sides of the rectangle. description nprect defines the bounding box of the area of the plug-in window to be updated, painted, invalidated, or clipped to. see also npn_forceredraw() npn_invalidaterect() npn_invalidateregion() npregion npwindow ...
NPAPI plugin reference - Archive of obsolete content
ata stream produced by the plug-in and consumed by the browser. npn_createobject allocates a new npobject. npn_destroystream closes and deletes a stream. npn_enumerate gets the names of the properties and methods of the specified npobject. npn_evaluate evaluates a script in the scope of the specified npobject. npn_forceredraw asks the plugin host to immediately (synchronously) repaint invalid areas. npn_getauthenticationinfo the function is called by plugins to get http authentication information from the browser. npn_getintidentifier returns an opaque identifier for the integer that is passed in. npn_getproperty gets the value of a property on the specified npobject. npn_getstringidentifier returns an opaque identifier for the string that is passed in. npn_getstringidentifie...
...e the cookies or preferred proxy. npn_hasmethod determines whether or not the specified npobject has a particular method. npn_hasproperty determines whether or not the specified npobject has a particular property. npn_identifierisstring determines whether or not an identifier is a string. npn_intfromidentifier returns the integer value corresponding to the given integer identifier. npn_invalidaterect invalidates the specified portion of the plugin's drawing area, adding it to the region that needs to be redrawn when the plugin next repaints its contents. npn_invalidateregion invalidates the specified drawing region prior to repainting or refreshing a windowless plug-in. npn_invoke invokes a method on the given npobject. npn_invokedefault invokes the default method, if one exists...
Reference - Archive of obsolete content
es should be updated to reflect current practices and code if they cannot be written in a "version-neutral" manner. do you think this makes sense? -- dria 04:27, 22 september 2005 (pdt) those examples are not "bad examples" per se. they are there specifically to show the differences between the two versions. i was wondering what should be done about those examples, since they would no longer be valid with fx 1.5+ and family. btw, https://bugzilla.mozilla.org/attachment.cgi?id=195375 is a screenshot of a table of differences. --maian 05:10, 22 september 2005 (pdt) if the examples are there specifically to show the differences between two versions of js, and if we have a section in the reference that is dedicated to discussing these differences, i would think that those samples should be inc...
... get removed/deprecated, or is it missing from the documentation? brundlefly 13:15, 19 december 2005 (pst) neither: core javascript 1.5 reference:operators:special operators:delete operator --nickolay 14:48, 19 december 2005 (pst) reading offline? well, may be it's no so common in today's world... but is there a way to get content of jsref-1.5 or other documents as a tarball? there are still valid needs for this: computers on slow links, computers behind insane firewalls, as well as computers not connected to internet. unfortunately there is not an [easy] method to download content/packages of content off of devmo for 'local' browsing/viewing/printing, yet. it is in the "nice to have" category for us here, however i am unaware of anyone feverishly working on it. (there are some other pri...
Developing Mozilla XForms - Archive of obsolete content
debugging always start with a debug build of the xforms and the schema-validation extensions. see building mozilla xforms for a .mozconfig for debug builds. you should create a new, clean profile for debugging. then start firefox out of the build directory: cd obj-*/dist/firefox ./firefox -no-remote -jsconsole -p yourprofilename the xforms extension that was built together with firefox should be already installed. then open your form that causes problems and have a look on the console. often you'll find the first starting points here or in the error console. schema validation problems the schema-validation extension contains a logging facility that can show some internals on the schema processing. to activate this logging output, set the nspr_log_modules environment variable: export nsp...
... then open your form that causes problems and have a look on the console. often you'll find the first starting points here or in the error console. schema validation problems the schema-validation extension contains a logging facility that can show some internals on the schema processing. to activate this logging output, set the nspr_log_modules environment variable: export nspr_log_modules=schemavalidation:5 this only works on a debug build as described above. ...
Mozilla XForms User Interface - Archive of obsolete content
representations: combobox - default representation listbox - used when appearance = 'compact' radio group - used when appearance = 'full' additional elements these elements may be used as child elements to the form controls described above. label specifies the label for the xforms control (see the spec). every form control other than the output element must contain a label element. it is valid for a form control to have an empty label element. help specifies contextual help for the containing form control (see the spec). the help will be displayed if the f1 key is pressed while the containing form control has focus. hint similar to a tooltip (see the spec). the hint is displayed when the mouse moves and pauses over the containing form control. alert this message will be shown when the ...
...he containing form control (see the spec). the help will be displayed if the f1 key is pressed while the containing form control has focus. hint similar to a tooltip (see the spec). the hint is displayed when the mouse moves and pauses over the containing form control. alert this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec). message used in combination with event listeners to display a message to the user when the specified event occurs (see the spec). xforms user interface these elements are mainly used to organize and manage the form's markup. they can be bound to instance nodes to define context for the xforms controls that they contain, should any...
Scope - MDN Web Docs Glossary: Definitions of Web-related terms
," then it is unavailable for use. scopes can also be layered in a hierarchy, so that child scopes have access to parent scopes, but not vice versa. a function serves as a closure in javascript, and thus creates a scope, so that (for example) a variable defined exclusively within the function cannot be accessed from outside the function or within other functions. ...
... a variable defined exclusively within the function cannot be accessed from outside the function or within other functions. ...
CSS selectors - Learn web development
be combined into a selector list so that the rule is applied to all of the individual selectors. for example, if i have the same css for an h1 and also a class of .special, i could write this as two separate rules. h1 { color: blue; } .special { color: blue; } i could also combine these into a selector list, by adding a comma between them. h1, .special { color: blue; } white space is valid before or after the comma. you may also find the selectors more readable if each is on a new line. h1, .special { color: blue; } in the live example below try combining the two selectors which have identical declarations. the visual display should be the same after combining them. when you group selectors in this way, if any selector is invalid the whole rule will be ignored. in the fol...
...omma. you may also find the selectors more readable if each is on a new line. h1, .special { color: blue; } in the live example below try combining the two selectors which have identical declarations. the visual display should be the same after combining them. when you group selectors in this way, if any selector is invalid the whole rule will be ignored. in the following example, the invalid class selector rule will be ignored, whereas the h1 would still be styled. h1 { color: blue; } ..special { color: blue; } when combined however, neither the h1 nor the class will be styled as the entire rule is deemed invalid. h1, ..special { color: blue; } types of selectors there are a few different groupings of selectors, and knowing which type of selector you might need will hel...
How to structure a web form - Learn web development
xpiration 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> the last section we'll add is a lot simpler, containing only a <button> of type submit, for submitting the form data. ...
...of form widgets you'll want to use to collect information from your users. ...
Introduction to events - Learn web development
g, and the browser to be redirected to a "success message" page of some kind (or the same page, if another is not specified.) the trouble comes when the user has not submitted the data correctly — as a developer, you want to prevent the submission to the server and give an error message saying what's wrong and what needs to be done to put things right. some browsers support automatic form data validation features, but since many don't, you are advised to not rely on those and implement your own validation checks. let's look at a simple example. first, a simple html form that requires you to enter your first and last name: <form> <div> <label for="fname">first name: </label> <input id="fname" type="text"> </div> <div> <label for="lname">last name: </label> <input id="l...
...'s wrong: const form = document.queryselector('form'); const fname = document.getelementbyid('fname'); const lname = document.getelementbyid('lname'); const para = document.queryselector('p'); form.onsubmit = function(e) { if (fname.value === '' || lname.value === '') { e.preventdefault(); para.textcontent = 'you need to fill in both names!'; } } obviously, this is pretty weak form validation — it wouldn't stop the user validating the form with spaces or numbers entered into the fields, for example — but it is ok for example purposes. the output is as follows: note: for the full source code, see preventdefault-validation.html (also see it running live here.) event bubbling and capture the final subject to cover here is something that you won't come across often, but it...
Dynamic behavior in Svelte: working with variables and props - Learn web development
llow us to save them to a web service or local storage and later retrieve them for update. so let's turn the array into a prop. in todos.svelte, replace the existing let todos = ... block with export let todos = []. export let todos = [] this may feel a little weird at first. that's not how export normally works in javascript modules! this is how svelte 'extends' javascript by taking valid syntax and giving it a new purpose. in this case svelte is using the export keyword to mark a variable declaration as a property or prop, which means it becomes accessible to consumers of the component. you can also specify a default initial value for a prop. this will be used if the component's consumer doesn't specify the prop on the component — or if its initial value is undefined — whe...
...letedtodos variables to be reactive by prefixing them with $:. svelte will generate the code to automatically update them whenever data they depend on is changed. note: svelte uses the $: javascript label statement syntax to mark reactive statements. just like the export keyword being used to declare props, this may look a little alien. this is another example in which svelte takes advantage of valid javascript syntax and gives it a new purpose — in this case to to mean "re-run this code whenever any of the referenced values change". once you get used to it, there's no going back. update your totaltodos and completedtodos variable definitions inside src/components/todos.svelte to look like so: $: totaltodos = todos.length $: completedtodos = todos.filter(todo => todo.completed).length i...
Handling common accessibility problems - Learn web development
ements with javascript code to fake functionality if at all possible — it is error prone, and more work than using the free functionality html gives you. simple functionality generally simple functionality should work with just the html in place — javascript should only be used to enhance functionality, not build it in entirely. good uses of javascript include: providing client-side form validation, which alerts users to problems with their form entries quickly, without having to wait for the server to check the data. if it isn't available, the form will still work, but validation might be slower. providing custom controls for html5 <video>s that are accessible to keyboard-only users (as we said earlier, the default browser controls aren't keyboard-accessible in most browsers). not...
...t). try to get some screenreader users involved, some keyboard-only users, some non-hearing users, and perhaps other groups too, as suits your requirements. accessibility testing checklist the following list provides a checklist for you to follow to make sure you've carried out the recommended accessibility testing for your project: make sure your html is as semantically correct as possible. validating it is a good start, as is using an auditing tool. check that your content makes sense when the css is turned off. make sure your functionality is keyboard accessible. test using tab, return/enter, etc. make sure your non-text content has text alternatives. an auditing tool is good for catching such problems. make sure your site's color contrast is acceptable, using a suitable checking to...
Introducing a complete toolchain - Learn web development
work. code linting tools linting helps with code quality but also is a way to catch potential errors earlier during development. it's a key ingredient of a good toolchain and one that many development projects will include by default. web development linting tools mostly exist for javascript (though there are a few available for html and css). this makes sense: if an unknown html element or invalid css property is used, due to the resilient nature of these two languages nothing is likely to break. javascript is a lot more fragile — mistakenly calling a function that doesn't exist for example causes your javascript to break; linting javascript is therefore very important, especially for larger projects. the go to tool for javascript linting is eslint. it's an extremely powerful and versat...
...onsider having eslint installed globally so that you can quickly use it to check any file you want. for the sake of simplicity, in this chapter we're not going to explore all the features of eslint, but we will put a configuration in place that works for our particular project and its requirements. however, bear in mind that if you want to refine and enforce a rule about how your code looks (or validates), it's very likely that it can be done with the right eslint configuration. a little later in this chapter, we'll provide the eslint config. once a working configuration is in place, running the command can generate some useful information. here is an example eslint output: ./my-project/src/index.js 2:8 error 'react' is defined but never used no-unused-vars 22:20 error 'body' is define...
How Mozilla's build system works
y developers, typing mach build to build the tree is sufficient to work with the source tree. this document explains how the build system works. note: this document is not intended for developers who just want to build mozilla. for that, see the build documentation. phases when you type mach build to build the tree, three high-level phases occur within the build system: system detection and validation preparation of the build backend invocation of the build backend phase 1: configure phase 1 centers around the configure script. the configure script is a bash shell script. the file is generated from a file called configure.in, which is written in m4 and processed using autoconf 2.13 to create the final configure script. you don't have to worry about how you obtain a configure file: th...
...pt is a bash shell script. the file is generated from a file called configure.in, which is written in m4 and processed using autoconf 2.13 to create the final configure script. you don't have to worry about how you obtain a configure file: the build system does this for you. the primary job of configure is to determine characteristics of the system and compiler, apply options passed into it, and validate everything looks ok to build. the primary output of the configure script is an executable file in the object directory called config.status. configure also produces some additional files (like autoconf.mk). however, the most important file in terms of architecture is config.status. the existence of a config.status file may be familiar to those who have worked with autoconf before. however, mo...
How to implement a custom autocomplete search component
= comments; } providerautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _defaultindex: 0, _errordescription: "", _results: [], _comments: [], /** * @return {string} the original search string */ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) */ get searchresult() { return this._searchresult; }, /** * @return {number} the index of the default item that should be entered if * none is selected */ get defaultindex() { return this._defaultindex; }, /** * @return {string} ...
...ts = results; this._comments = comments; } simpleautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _defaultindex: 0, _errordescription: "", _results: [], _comments: [], /** * the original search string */ get searchstring() { return this._searchstring; }, /** * the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) */ get searchresult() { return this._searchresult; }, /** * index of the default item that should be entered if none is selected */ get defaultindex() { return this._defaultindex; }, /** * a string describing the cau...
IPDL Tutorial
ct }; type type(); void_t& get_void_t(); bool& get_bool(); int& get_int(); double& get_double(); nscstring& get_nscstring(); ppluginscriptableobject* get_ppluginscriptableobject(); }; aunion.type() can be used to determine the type of a union received in an ipdl message handler, with the remaining functions granting access to its contents. to initialize a union, simply assign a valid value to it, as follows: avariant = false; structs ipdl has built-in support for arbitrary collections of serializable data types. struct namevaluepair { nscstring name; nscstring value; }; in implementation code, these structs can be created and used like so: namevaluepair entry(astring, anotherstring); foo(entry.name(), entry.value()); // named accessor functions return references to...
...ols. the `manages` statement declares that this protocol manages pplugininstance. the pplugin protocol must declare constructor and destructor messages for pplugininstance actors. the `manages` statement also means that pplugininstance actors are tied to the lifetime of the plugin actor that creates them: if this pplugin instance is destroyed, all the pplugininstances associated with it become invalid or are destroyed as well. the mandatory constructor and destructor messages (pplugininstance and __delete__ respectively) exist, confusingly, in separate locations. the constructor must be located in the managing protocol, while the destructor belongs to the managed subprotocol. these messages have syntax similar to c++ constructors, but the behavior is different. constructors and destructors ...
Introduction to Layout in Mozilla
target frame child rs.reason set based on rc’s type incremental reflow propagate damage to frames later “in the flow” incremental reflow multiple reflow commands are batched nsreflowpath maintains a tree of target frames amortize state recovery and damage propagation cost painting as reflow proceeds through the frame hierarchy, areas are invalidated via nsiviewmanager::updateview unless immediate, invalid areas are coalesced and processed asynchronously via os expose event native expose event dispatched to widget; widget delegates to the view manager view manager paints views back-to-front, invoking presshell’s paint method presshell::paint walks from the view to the frame; invokes nsiframe::paint for each layer incrementalism...
... will” parser and content sink do some buffering content sink has “notification limits” efficiency vs. responsiveness trade-off frame construction runs to completion css parsing runs to completion reflow runs to completion (mostly) painting runs to completion future (?) tech talks content model and dom - jst, jkeiser parser and content sink (esp. ...
Timer.jsm
code modules or content frame scripts). ...
...("resource://gre/modules/timer.jsm"); then call settimeout and cleartimeout just as you would in a dom window, for example: let timeoutid = settimeout(function() { console.log("hello!"); }, 500); cleartimeout(timeoutid); similarly, you can use setinterval and clearinterval like so: let intervalid = setinterval(function() { console.log("happening every 500ms!"); }, 500); clearinterval(intervalid); ...
Localization content best practices
is a significant need for a placeholder, use a placeholder. the word version may have to go before or after flash and one or both may need to be inflected. idiom idiom, in a loose sense, also has an impact on localization if it leads to strings being prepared in a way that renders them unlocalizable. for example, in english all the following begin with the same clause: the url of this feed is invalid; the url of this feed cannot be reached; the url of this feed cannot be parsed. it might be tempting to 'save time' by presenting this as the url of this feed %s and then is invalid; cannot be reached and cannot be parsed. however, linguistically these are different types of sentences and will be handled differently in other languages. this is usually not a case of translator choice but obligator...
...gs updating entity names if you are changing a string such that its meaning has changed, you must update the entity or property name for the string to match the new meaning. if your changes are relevant only for english — for example, to correct a typographical error or to make letter case consistent — then there is generally no need to update the entity name. changing the string id will invalidate the existing translation, the new string will be reported as missing in all tools, and localizers will have to retranslate it. given the diversity of tools used by localization teams, this is the only reliable method to ensure that localizers update existing localizations. if you change the entity or property name of a string, you must also update all instances where that entity or property n...
Mozilla Framework Based on Templates (MFBT)
t available on all platforms and so cannot be used directly. this header also provides a useful "hook" for embeddings that must customize the types underlying the fixed-size integer types.) types.h includes standardinteger.h and further provides size_t. checkedint.h implements checked integers. they behave like integers, but safely check for integer overflow and divide-by-zero. useful for input validation. floatingpoint.h provides various operations for examining and working upon double-precision floating point values, and for producing various special floating point values. core types.h further provides macros to define imported and exported c symbols. attributes.h implements various function and class attribute macros. the function macros control inlining, note whether a function return...
... period of time than the scope where it's found, so it usually isn't what was desired.) data structures linkedlist.h implements a type-safe doubly-linked list class. most new code should use this rather than prclist. rangedptr.h implements rangedptr, a smart pointer template whose value may be manipulated only within a range specified at construction time, and which may be dereferenced only at valid locations in that range. this pointer is a useful way to expose access to values within an array. refptr.h implements various smart pointer templates to simplify reference counting of values of particular classes. scoped.h implements scope-based resource management, to simplify the task of cleaning up resources when leaving a scope. threadlocal.h implements thread-local storage, aka "tls", al...
Leak And Bloat Tests
r_pref("mail.account.account2.server", "server2"); user_pref("mail.accountmanager.accounts", "account1,account2"); user_pref("mail.accountmanager.defaultaccount", "account2"); user_pref("mail.accountmanager.localfoldersserver", "server1"); user_pref("mail.identity.id1.fullname", "tinderbox"); user_pref("mail.identity.id1.smtpserver", "smtp1"); user_pref("mail.identity.id1.useremail", "tinderbox@invalid.com"); user_pref("mail.identity.id1.valid", true); user_pref("mail.root.none-rel", "[profd]mail"); user_pref("mail.root.pop3-rel", "[profd]mail"); user_pref("mail.server.server1.directory-rel", "[profd]mail/local folders"); user_pref("mail.server.server1.hostname", "local folders"); user_pref("mail.server.server1.name", "local folders"); user_pref("mail.server.server1.type", "none"); user_pref("m...
..._pref("mail.server.server1.username", "nobody"); user_pref("mail.server.server2.check_new_mail", false); user_pref("mail.server.server2.directory-rel", "[profd]mail/tinderbox"); user_pref("mail.server.server2.download_on_biff", true); user_pref("mail.server.server2.hostname", "tinderbox"); user_pref("mail.server.server2.login_at_startup", false); user_pref("mail.server.server2.name", "tinderbox@invalid.com"); user_pref("mail.server.server2.type", "pop3"); user_pref("mail.server.server2.username", "tinderbox"); user_pref("mail.smtp.defaultserver", "smtp1"); user_pref("mail.smtpserver.smtp1.hostname", "tinderbox"); user_pref("mail.smtpserver.smtp1.username", "tinderbox"); user_pref("mail.smtpservers", "smtp1"); user_pref("mail.startup.enabledmailcheckonce", true); user_pref("mailnews.start_page_o...
Named Shared Memory
ment after detaching the same prsharedmemory object. be sure to detach it when you're finished. pr_detachsharedmemory should be called to unmap the shared memory segment from the application's address space. pr_closesharedmemory should be called when no further use of the prsharedmemory object is required within a process. following a call to pr_closesharedmemory, the prsharedmemory object is invalid and cannot be reused. pr_deletesharedmemory should be called before process termination. after you call pr_deletesharedmemory, any further use of the shared memory associated with the name may cause unpredictable results. filenames the name passed to pr_opensharedmemory should be a valid filename for a unix platform. pr_opensharedmemory creates file using the name passed in. some platforms may...
...pped files; the filename may be used to define the namespace. on windows, the name is significant, but there is no file associated with the name. no assumptions about the persistence of data in the named file should be made. depending on platform, the shared memory may be mapped onto system paging space and be discarded at process termination. all names provided to pr_opensharedmemory should be valid filename syntax or name syntax for shared memory for the target platform. referenced directories should have permissions appropriate for writing. limits on shared memory resources different platforms have limits on both the number and size of shared memory resources. the default system limits on some platforms may be smaller than your requirements. these limits may be adjusted on some platforms...
PR_CreateThread
as the following parameters: type specifies that the thread is either a user thread (pr_user_thread) or a system thread (pr_system_thread). start a pointer to the thread's root function, which is called as the root of the new thread. returning from this function is the only way to terminate a thread. arg a pointer to the root function's only parameter. nspr does not assess the type or the validity of the value passed in this parameter. priority the initial priority of the newly created thread. scope specifies your preference for making the thread local (pr_local_thread), global (pr_global_thread) or global bound (pr_global_bound_thread). however, nspr may override this preference if necessary. state specifies whether the thread is joinable (pr_joinable_thread) or unjoinable (pr_un...
...thread) or unjoinable (pr_unjoinable_thread). stacksize specifies your preference for the size of the stack, in bytes, associated with the newly created thread. if you pass zero in this parameter, pr_createthread chooses the most favorable machine-specific stack size. returns the function returns one of the following values: if successful, a pointer to the new thread. this pointer remains valid until the thread returns from its root function. if unsuccessful, (for example, if system resources are unavailable), null. description if you want the thread to start up waiting for the creator to do something, enter a lock before creating the thread and then have the thread's root function enter and exit the same lock. when you are ready for the thread to run, exit the lock. for more inform...
PR_FindSymbol
name a textual representation of the symbol to resolve. ...
...ied symbol in the specified library. if the lib parameter is null, all libraries known to the runtime and the main program are searched in an unspecified order. use this function to look up functions or data symbols in a shared library. getting a pointer to a symbol in a library does indicate that the library is available when the search was made. the runtime does nothing to ensure the continued validity of the symbol. if the library is unloaded, for instance, the results of any pr_findsymbol calls become invalid as well. ...
PR_PopIOLayer
m which the specified layer is to be removed. id identity of the layer to be removed from the stack. returns the function returns one of the following values: if the layer is successfully removed from the stack, a pointer to the removed layer. ...
...in other words, stack continues to point to the top of the stack after the function returns. ...
Threads
s chapter describes the basic nspr threading api. threading types and constants threading functions a thread has a limited number of resources that it truly owns. these resources include a stack and the cpu registers (including pc). to an nspr client, a thread is represented by a pointer to an opaque structure of type prthread. a thread is created by an explicit client request and remains a valid, independent execution entity until it returns from its root function or the process abnormally terminates. threads are critical resources and therefore require some management. to synchronize the termination of a thread, you can join it with another thread (see pr_jointhread). joining a thread provides definitive proof that the target thread has terminated and has finished with both the resource...
...es its use, see introduction to nspr. for api reference information related to thread synchronization, see locks and condition variables. threading types and constants prthread prthreadtype prthreadscope prthreadstate prthreadpriority prthreadprivatedtor threading functions most of the functions described here accept a pointer to the thread as an argument. nspr does not check for the validity of the thread. it is the caller's responsibility to ensure that the thread is valid. the effects of these functions on invalid threads are undefined. creating, joining, and identifying threads controlling thread priorities interrupting and yielding setting global thread concurrency getting a thread's scope creating, joining, and identifying threads pr_createthread creates a new thr...
4.3 Release Notes
release date: 01 april 2009 introduction network security services for java (jss) 4.3 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library pkcs11 needslogin method support hmacsha256, hmacsha384, and hmacsha512 support for all nss 3.12 initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. new in jss 4.3 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initializ...
...mplemented in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type. ...
JSS
Mozilla › Projects › NSS › JSS
in java. jss is available under the mozilla public license, the gnu general public license, and the gnu lesser general public license. jss requires nspr and nss. java provides a jce provider called sunpkcs11 (see java pkcs#11 reference guide.) sunpkcs11 can be configured to use the nss module as the crytographic provider. if you are planning to just use jss jce provider as a bridge to nss's fips validated pkcs#11 module, then the sunpkcs11 jce provider may do all that you need. note that java 1.5 claimed no fips compliance, and java 1.6 or higher needs to be used. a current limitation to the configured sunpkcs11-nss bridge configuration is if you add a pkcs#11 module to the nss database such as for a smartcard, you won't be able to access that smartcard through the sunpkcs11-nss bridge. if you...
... mailing list newsgroup rss feed related topics security ...
NSS_3.12.1_release_notes.html
bug 430916: add sustaining asserts bug 431805: leak in nssarena_destroy() bug 431929: memory leaks on error paths in devutil.c bug 432303: replace pkix_pl_memcpy with memcpy bug 433177: fix the gcc compiler warnings in lib/util and lib/freebl bug 433437: vfychain ignores the -a option...
...new and revised documents available since the release of nss 3.11 include the following: build instructions for nss 3.11.4 and above n...
NSS 3.16.2.3 release notes
ocket option that enables tls_fallback_scsv. off by default. in sslerr.h ssl_error_inappropriate_fallback_alert - a new ssl error code. in sslproto.h tls_fallback_scsv - a a signaling cipher suite value that indicates a handshake is the result of tls version fallback. notable changes in nss 3.16.2.3 bug 1057161: check that an imported elliptic curve public key is valid. ...
...lback_scsv. off by default. in sslerr.h ssl_error_inappropriate_fallback_alert - a new ssl error code. in sslproto.h tls_fallback_scsv - a a signaling cipher suite value that indicates a handshake is the result of tls version fallback. notable changes in nss 3.16.2.3 bug 1057161: check that an imported elliptic curve public key is valid. previously nss would only validate the peer's public key before performing ecdh key agreement. now ec public keys are validated at import time. bugs fixed in nss 3.16.2.3 bug 1057161 - nss hangs with 100% cpu on invalid ec key bug 1036735 - add support for draft-ietf-tls-downgrade-scsv to nss compatibility nss 3.16.2.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked wi...
NSS 3.48 release notes
n of versions lower than 1.3 after helloretryrequest bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 1522203 - remove an old pentium pro performance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar "beginning-of-validity-period" parameter to mozilla::pkix::trustdomain::checkrevocation bug 1591363 - fix a pbkdf2 memory leak in nsc_generatekey if key length > max_key_len (256) bug 1592869 - use arm neon for ctr_xor bug 1566131 - ensure sha-1 fallback disabled in tls 1.2 bug 1577803 - mark pkcs#11 token as friendly if it implements ckp_public_certificates_token bug 1566126 - power ghash vector acceleration ...
...max_key_len (256) bug 1592869 - use arm neon for ctr_xor bug 1566131 - ensure sha-1 fallback disabled in tls 1.2 bug 1577803 - mark pkcs#11 token as friendly if it implements ckp_public_certificates_token bug 1566126 - power ghash vector acceleration bug 1589073 - use of new pr_assert_arg in certdb.c bug 1590495 - fix a crash in pk11_makecertfromhandle bug 1591742 - ensure des iv length is valid before usage from pkcs#11 bug 1588567 - enable mozilla::pkix gtests in nss ci bug 1591315 - update nsc_decrypt length in constant time bug 1562671 - increase nss mp kdf default iteration count, by default for modern key4 storage, optionally for legacy key3.db storage bug 1590972 - use -std=c99 rather than -std=gnu99 bug 1590676 - fix build if arm doesn't support neon bug 1575411 - enable tl...
NSS API Guidelines
g2); } aside from error cases, all documented entry points should check pointers in a debug, wherever possible. pointers to user-supplied buffers, and templates, should be checked against null. pointers to context-style functions should be checked using special debug macros. these macros only define code when debug is turned on, providing a way for systems to register, deregister, and check valid pointers. secport_decl_ptr_class(classname, size) - declare a class of pointers (labelled classname) this object file needs to check. this class is local only to this object file. size is the expected number of pointers of type classname. secport_decl_global_ptr_class(classname, size) - same as above except classname can be used in other object files. secport_add_pointer(classname, pointer) - ...
...rt_decl_ptr_class(classname, size) - declare a class of pointers (labelled classname) this object file needs to check. this class is local only to this object file. size is the expected number of pointers of type classname. secport_decl_global_ptr_class(classname, size) - same as above except classname can be used in other object files. secport_add_pointer(classname, pointer) - add pointer as a valid pointer for classclassname. this is usually called by a create function. secport_verify_pointer(classname, pointer, secerror, returnvalue)- check if a given pointer really belongs to the requested class. if it doesn't set the error secerror and return the value returnvalue. secport_remove_pointer(classname, pointer) - remove a pointer from the valid list. usually called by a destroy function. ...
Overview of NSS
11 and rfc 2633). ietf message specification (based on the popular internet mime standard) that provides a consistent way to send and receive signed and encrypted mime data. x.509 v3. itu standard that governs the format of certificates used for authentication in public-key cryptography. ocsp (rfc 2560). the online certificate status protocol (ocsp) governs real-time confirmation of certificate validity. pkix certificate and crl profile (rfc 3280). the first part of the four-part standard under development by the public-key infrastructure (x.509) working group of the ietf (known at pkix) for a public-key infrastructure for the internet. rsa, dsa, ecdsa, diffie-hellman, ec diffie-hellman, aes, triple des, des, rc2, rc4, sha-1, sha-256, sha-384, sha-512, md2, md5, hmac: common cryptographic a...
... the ietf (known at pkix) for a public-key infrastructure for the internet. rsa, dsa, ecdsa, diffie-hellman, ec diffie-hellman, aes, triple des, des, rc2, rc4, sha-1, sha-256, sha-384, sha-512, md2, md5, hmac: common cryptographic algorithms used in public-key and symmetric-key cryptography. fips 186-2 pseudorandom number generator. for complete details, see encryption technologies. fips 140 validation and niscc testing the nss software crypto module has been validated three times for conformance to fips 140 at security levels 1 and 2. for more information, see the nss fips page (or this one). the nss libraries passed the niscc tls/ssl and s/mime test suites (1.6 million test cases of invalid input data). complete software development kit in addition to libraries and apis, nss provides...
NSS tools : crlutil
rtificate or to access a certificate database. this is a plain-text file containing one password. be sure to prevent unauthorized access to this file. -l algorithm-name specify a specific signature algorithm. list of possible algorithms: md2 | md4 | md5 | sha1 | sha256 | sha384 | sha512 -n nickname specify the nickname of a certificate or key to list, create, add to a database, modify, or validate. bracket the nickname string with quotation marks if it contains spaces. -o output-file specify the output file name for new crl. bracket the output-file string with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -t crl-type specify type of crl. possible types are: 0 - sec_krl_type, 1 - sec_crl_type. this option ...
...n-critical code where: reasoncode: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension code: the following codes are available: unspecified (0), keycompromise (1), cacompromise (2), affiliationchanged (3), superseded (4), cessationofoperation (5), certificatehold (6), removefromcrl (8), privilegewithdrawn (9), aacompromise (10) * add invalidity date extension: the invalidity date is a non-critical crl entry extension that provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. invaliditydate non-critical date where: crlnumber: identifies the name of an extension non-critical: should be set to 0 since this is non-critical extension date: invalidi...
gtstd.html
t module contents, enable or disable slots, enable or disable fips-140-1 compliance, and assign default providers for cryptographic operations. setting up the certificate and key databases before you can run the sample programs (server.c and client.c) that come with nss, you must set up certificate, key, and security module databases for both the client and the server and populate them with valid ca, client ssl, and server ssl certificates. the following sections decribe how to the certificate database tool to perform these tasks: setting up the ca db and certificate setting up the server db and certificate setting up the client db and certificate verifying the server and client certificates warning: the instructions below illustrate the use of nss command line tools to operat...
...rtutil -l -d client_db the trust flag settings "u,u,u" indicate that the client's databases contain the private key for this certificate. this is necessary for the ssl client to be able to authenticate to the server. verifying the server and client certificates when you have finished setting up the server and client certificate databases, verify that the client and server certificates are valid, as follows: >certutil -v -d server_db -u v -n myco.mcom.org certutil: certificate is valid >certutil -v -d client_db -u c -n "joe client" certutil: certificate is valid building nss programs on unix, use the gnu utility gmake to run the makefile. on windows nt, use the nmake utility that comes with visual c++. if you create your own makefiles, be sure to include the libraries in the s...
sslintro.html
ket is already connected before ssl gets involved, you must provide this extra hint. functions that can be used by both clients and servers during communication include the following: pr_send or pr_write pr_read or pr_recv pr_geterror pr_getpeername pr_sleep pr_malloc pr_free pr_poll pr_now pr_intervaltomilliseconds pr_millisecondstointerval pr_shutdown pr_close ssl_invalidatesession after establishing a connection, an application first calls pr_send, pr_recv, pr_read, pr_write, or ssl_forcehandshake to initiate the handshake. the application's protocol (for example, http) determines which end has responsibility to talk first. the end that has to talk first should call pr_send or pr_write, and the other end should call pr_read or pr_recv. use ssl_forcehandshake w...
...w handshake and then call ssl_forcehandshake to drive the handshake to completion. functions used by callbacks an ssl application typically provides one or more callback functions that are called by the ssl or pkcs #11 library code under certain circumstances. ...
GC Rooting Guide
raw pointer because all of the api methods that may gc take a js::handle<t>, as described below, and js::rooted<t> autoconverts to js::handle<t> but a bare pointer does not. js::handle<t> all gc thing pointers that are parameters to a function must be wrapped in js::handle<t>. a js::handle<t> is a reference to a js::rooted<t>, and is created implicitly by referencing a js::rooted<t>: it is not valid to create a js::handle<t> manually (the whole point of a handle is that it only reference pointers that the gc knows about so it can update them when they move). like js::rooted<t>, a js::handle<t> can be used as if it were the underlying pointer. since only a js::rooted<t> will cast to a js::handle<t>, the compiler will enforce correct rooting of any parameters passed to a function that may tri...
...cx, foo()); eventlogger logger(cx); ...code... return obj; } say that ~eventlogger constructs some sort of object in its destructor, which could trigger a gc. what will happen is that the return statement will pull the bare jsobject* out of the rooted obj variable and either put it in the stack or store it in the return value register. then ~eventlogger will fire and trigger a gc, invalidating that unrooted stack/register pointer. this scenario is rare but very difficult to notice manually, and will probably be caught by the static rooting hazard analysis. there are two different approaches to resolving this; use whichever better fits your situation: void somefunction(jscontext* cx, js::mutablehandleobject obj) { eventlogger(cx); ...code... obj.set(foo()); } (note t...
Bytecode Descriptions
ameindex, uint32_t sourcestart, uint32_t sourceend) stack: ⇒ constructor create and push a default constructor for a base class. a default constructor behaves like constructor() {}. implements: classdefinitionevaluation for classtail, steps 10.b. and 12-17. the sourcestart/sourceend offsets are the start/end offsets of the class definition in the source buffer, used for tostring(). they must be valid offsets into the source buffer, measured in code units, such that scriptsource->substring(cx, start, end) is valid. format: jof_class_ctor derivedconstructor operands: (uint32_t nameindex, uint32_t sourcestart, uint32_t sourceend) stack: proto ⇒ constructor create and push a default constructor for a derived class. a default derived-class constructor behaves like constructor(...args) { super...
...me that an operation always throws. for example, delete super.prop; is allowed in methods, but always throws a referenceerror. msgnumber must be one of the error codes listed in js/src/js.msg; it determines the .message and [[prototype]] of the new error object. the number of arguments in the error message must be 0. throwsetconst operands: (uint32_t nameindex) throws a runtime typeerror for invalid assignment to a const binding. format: jof_atom, jof_name try operands: (int32_t jumpatendoffset) no-op instruction that marks the top of the bytecode for a trystatement. the jumpatendoffset operand must be the offset (relative to the current op) of the jsop::goto at the end of the try-block body. this is used by bytecode analysis and jit compilation. location information for catch/finally blo...
JIT Optimization Strategies
, and are an indication that the type inference engine has failed to collect enough information to guide the optimization process. getelement getelem_typedobject attempts to optimized element accesses on array typed objects. getelem_dense attempts to optimize element accesses on densely packed array objects. dense arrays are arrays which do not have any 'holes'. this means that the array has valid values for all indexes from 0 to length-1. getelem_typedstatic attempts to optimize element accesses on a typed array that can be determined to always refer to the same array object. if this optimization succeeds, the 'array' object is treated as a constant, and is not looked up or retrieved from a variable. getelem_typedarray attempts to optimize element accesses on a typed array. getelem_s...
...r to the same array object. if this optimization succeeds, the 'array' object is treated as a constant, and is not looked up or retrieved from a variable. setelem_typedarray attempts to optimize element writes on a typed array. setelem_dense attempts to optimize element writes on densely packed array objects. dense arrays are arrays which do not have any 'holes'. this means that the array has valid values for all indexes from 0 to length-1. setelem_arguments attempts to optimize element writes to the arguments special object available in functions. this optimization only works if the arguments object is used in well-understood ways within the function. the function containing the arguments.length is allowed to use the arguments object in the following ways without disabling this optimizat...
JS_IsConstructor
if so, js_isconstructor returns true. ...
...if so, js_isconstructor returns true. ...
JS_IsIdentifier
syntax bool js_isidentifier(jscontext *cx, js::handlestring str, bool *isidentifier); bool js_isidentifier(const char16_t *chars, size_t length); // added in spidermonkey 38 name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str js::handlestring the string to test. chars const char16_t * the pointer of the string to test. ...
...in a request on this jscontext. str js::handlestring the string to test. chars const char16_t * the pointer of the string to test. length size_t the length of chars. isidentifier bool * out parameter. on success, *isidentifier receives whether str is an identifier or not. description js_isidentifier tests if the given string is a valid ecmascript identifier. on successful, js_isidentifier stores the test result to *isidentifier and returns true, otherwise returns false and the value of *isidentifier is undefined. js_isidentifier which takes chars and length is infallible, so just returns whether the chars are an identifier. see also mxr id search for js_isidentifier js_valuetoid bug 692627 bug 990484 ...
Property attributes
is keeps the resolve hook from accidentally triggering itself: unchecked recursion. for enumerate hooks, triggering the resolve hook would be merely silly, not fatal, except in some cases involving non-configurable properties. added in spidermonkey 45 mxr id search for jsprop_resolving jsprop_ignore_enumerate ignore the value in jsprop_enumerate. this flag only valid when defining over an existing property. added in spidermonkey 38 mxr id search for jsprop_ignore_enumerate jsprop_ignore_readonly ignore the value in jsprop_readonly. this flag only valid when defining over an existing property. added in spidermonkey 38 mxr id search for jsprop_ignore_readonly jsprop_ignore_permanent ignore the value in jsprop_...
...added in spidermonkey 38 mxr id search for jsprop_ignore_permanent jsprop_ignore_value ignore the js::value in the descriptor. ...
TPS Tests
that in this example, the foobar@restmail.net account must be registered on stage, otherwise authentication will fail (and the whole test will fail as well. you can sign up for an fxa account on stage or dev by creating an fxa account after adding the identity.fxaccounts.autoconfig.uri preference (with the appropriate value) to about:config. additionally, note that the config file must parse as valid json, and so you can't have comments in it (sorry, i know this is annoying). one alternative is to put underscores before the "disabled" preferences, e.g. "_identity.fxaccounts.autoconfig.uri": "...". writing tps tests each tps test is run as a series of "phases". a phase runs in some firefox profile, and contains some set of actions to perform or check on that profile. phases have an n to m re...
...t:sync-log. every sync should have a log and every item synced should have a record. run runtps with --debug. this will enable much more verbose logging in all engines. check the tps.log file written out after tps runs. it will include log output written by the python driver, which includes information about where the temporary profiles it uses are stored. run test_sync.js. this test generally validates your tps setup and does a light test of a few engines. comment out the goquitapplication() calls in services/sync/tps/extensions/tps/modules/tps.jsm (remember to undo this later!). you will have to manually quit the browser at each phase, but you will be able to inspect the browser state manually. using this technique in conjunction with aboutsync is helpful. (note that the python t...
Web Replay
artment the debug objects hold heap structures with information about some thing in the child process. the debugger can explore the heap by sending messages to the child process to fill in the contents of the debug objects it creates. whenever the debugger is interacting with the child process the child process is paused at some point in execution, and the contents of the debug objects are only valid until the middleman notifies the child process that it can resume forward execution or must rewind to an earlier snapshot. when the child process pauses again (at a breakpoint, say) the debug objects must be reconstructed. there is an exception to this, for scripts and script source objects; debug objects for these will continue to hold the same referent after resuming or rewinding the replayin...
...fferent value from eval("x.f"). while the strange behavior could be fixed (it's due to caching) it would be good to prevent or at least discourage users from performing such effectful operations. the underlying object of a debugger.object is inaccessible; object.unsafedereference is null. as described above under "debugger integration", child objects besides scripts and script sources become invalid when the debugger resumes execution, and must be reconstructed each time the replaying process pauses. inspecting a replaying process access to js objects in the replaying process is currently only done through the js debugger interface — debugger.object, debugger.frame.eval, and so forth. this interface overlays a separate implementation from the c++ debugger, implemented in devtools/serve...
Frecency algorithm
frecency is a score given to each unique uri in places, encompassing bookmarks, history and tags. this score is determined by the amount of revisitation, the type of those visits, how recent they were, and whether the uri was bookmarked or tagged. the word "frecency" itself is a combination of the words "frequency" and "recency." the default frecency value for all valid entries is -1. places with this value can show up in autocomplete results. invalid places have a frecency value of zero, and will not show up in autocomplete results. examples of invalid places are "place:" queries, and unvisited livemark feed entries. the frecency calculation process for the 10 most recent visits (where 10 is determined by places.frecency.numvisits): .. determine percentage bonus for ...
... +14 10 * (140/100.0) - fifth bucket weight and bookmarked bonus +14 10 * (140/100.0) - fifth bucket weight and bookmarked bonus -- 252 (4 * 252 / 4) - final frecency score notes the number of sampled visits is min(10 most recent visits pref, total visit counts). the total visit count includes embedded, undefined, etc visits (does not exclude invalid or embedded visits). developer notes there are various development notes you can read about places that may offer additional insights: initial algorithm ideas implementation notes history the initial algorithm design was by mike connor and seth spitzer. the initial implementation was done by seth and dietrich ayala. further features and refinement by ed lee (implemented adaptive mat...
Using the Places annotation service
annotations for your annotation name, you should use the format <namespace>/<name>. for example, "my_extension/page_state". the annotation service does not currently enforce the annotation name format, but this may change in the future. also, we may add functions to get all of "your" annotations matching a given namespace. you should not use any characters in your annotation names that are not valid as part of an html path. this includes colons, spaces, most punctuation, and non-ascii characters. you should try to have relatively few annotation names. the service stores these names in a separate table, and the fewer names there are, the more efficient retrieving names will be. you should not design your service so that you require hundreds of unique annotation names. setting an annotation ...
... make up your own uris, because these functions will efficiently default to the default page favicon when it does not exist. see using the places favicon service for more information. lifetime of annotations annotation expiration can be explicitly stated when the annotation is created. if no expiration is specified, the annotation is expired when the number of visits to the url is set to zero. valid values for expiration are: expire_with_history : default. annotations live as long as the uri is in history (eg: has >0 visits). expire_never : never expire. must be explictly removed. expire_session : removed at application exit. expire_days : removed at 7 days. expire_weeks : removed at 30 days. expire_months : removed at 180 days. annotationservice.setpageannotation(uri, "my_extensio...
An Overview of XPCOM
iid. of the three methods on the nsiid class, equals, parse, and tostring, equals is by far the most important, because it is used to compare two nsiids in this interface querying process. when you implement the nsisupports class (and you'll see in the chapter using xpcom utilities to make things easier how macros can make this process much easier), you must make sure the class methods return a valid result when the client calls queryinterface with the nsisupports iid. queryinterface should support all interfaces that the component supports. in implementations of queryinterface, the iid argument is checked against the nsiid class. if there is a match, the object's this pointer is cast to void, the reference count is incremented, and the interface returned to the caller. if there isn't a matc...
...pcom error codes ns_error_not_initialized returned when an instance is not initialized. ns_error_already_initialized returned when an instance is already initialized. ns_error_not_implemented returned by an unimplemented method. ns_error_no_interface returned when a given interface is not supported. ns_error_null_pointer returned when a valid pointer is found to be nsnull. ns_error_failure returned when a method fails. generic error case. ns_error_unexpected returned when an unexpected error occurs. ns_error_out_of_memory returned when a memory allocation fails. ns_error_factory_not_registered returned when a requested class is not registered. « previousnext » copyrig...
Building the WebLock UI
arbitrary url) for specifying urls. in the xul section we'll go into how the user interface is defined. this section describes the functions that are called from the interface and how they interact with the weblock component. the url that the addsite method expects is a string, so we can pass a string directly in from the user interface, or we can do a check on the string and verify that it's a valid url. 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 f...
... site adding ui the next step is to create that part of the user interface that lets you add a new site to the white list. there are other, more sophisticated ways to do this; you may also want to include some ui that lets you view the white list or edit it as a list. in this part of the tutorial, however, we only provide the means of adding an url provided as a string (which is not checked for validity) and passing it through to the addsite api we defined in the earlier part of the tutorial. <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. the separator that appears at the top of this snippet creates a little divide...
IAccessibleHypertext
[out] long hyperlinkcount ); methods hyperlink() returns the specified link. the returned iaccessiblehyperlink object encapsulates the hyperlink and provides several kinds of information describing it. [propget] hresult hyperlink( [in] long index, [out] iaccessiblehyperlink hyperlink ); parameters index this 0 based index specifies the hyperlink to return. hyperlink if the given index is valid, that is it lies in the interval from 0 to the number of links minus one, a reference to the specified hyperlink object is returned. if the index is invalid then a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. hyperlinkindex() returns the index of the hyperlink that is associated with this character index. this is the case when a link spans th...
...yperlink that is associated with this character index. this is the case when a link spans the given character index. [propget] hresult hyperlinkindex( [in] long charindex, [out] long hyperlinkindex ); parameters charindex a 0 based index of the character for which to return the link index. if iaccessibletext is used to represent the text containing the link, then the character index is only valid if it is greater than or equal to zero and lower than the number of characters in the text. hyperlinkindex the 0 based index of the hyperlink that is associated with this character index, or -1 if charindex is not on a link. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is -1. s_ok. nhyperlinks() returns the number of links ...
imgIContainer
flag_decode_no_premultiply_alpha 0x2 flag_decode_no_colorspace_conversion 0x4 flag_clamp 0x8 frame_first 0 constants for specifying various "special" frames. frame_first: the first frame frame_current: the current frame. frame_max_value should be set to the value of the maximum constant above, as it is used for ensuring that a valid value was passed in. frame_current 1 frame_max_value 1 knormalanimmode 0 animation mode constants 0 = normal 1 = do not animate 2 = loop once. kdontanimmode 1 klooponceanimmode 2 kdisposeclearall -1 "disposal" method indicates how the image should be handled before the subsequent image is display...
...e size, in bytes, of a particular frame's image data. unsigned long getframeimagedatalength( in unsigned long framenumber ); parameters framenumber missing description return value missing description exceptions thrown missing exception missing description native code only!getimagecontainer attempts to create an imagecontainer (and image) containing the current frame. only valid for raster type images. imagecontainer getimagecontainer(); parameters none. return value missing description exceptions thrown missing exception missing description violates the xpcom interface guidelines getrootlayoutframe() if this image is type_vector, that is really an embedded svg document, and this method returns a pointer to the root nsiframe of that document. if not (or...
jsdIStackFrame
t object on its 'obj' param's scope chain as the ecma 'variables object'. private data for this object is an nsisupports object. attempting to alter this bit will result in an ns_error_illegal_value. opt_* values above, or'd together. last version set on this context. scripts typically select this with the "language" attribute. see the version_* consts on jsdidebuggerservice. unique tag among all valid jsdicontext objects, useful as a hash key. private data for this context, if it is an nsisupports, |null| otherwise. retrieve the underlying context wrapped by this jsdicontext. top of the scope chain for this context. |true| if this context should be allowed to run scripts, |false| otherwise. this attribute is only valid for contexts which implement nsiscriptcontext. setting or getting this attr...
...herwise. retrieve the underlying context wrapped by this jsdicontext. top of the scope chain for this context. |true| if this context should be allowed to run scripts, |false| otherwise. this attribute is only valid for contexts which implement nsiscriptcontext. setting or getting this attribute on any other context will throw a ns_error_no_interface exception. stack frame objects. these are only valid inside the jsdiexecutionhook which gave it to you. after you return from that handler the bottom frame, and any frame you found attached through it, are invalidated via the jsdiephemeral interface. once a jsdistackframe has been invalidated all method and property accesses will throw a ns_error_not_available exception. method overview boolean eval(in astring bytes, in autf8string filename, in ...
nsIChannel
ox 19.0 / thunderbird 19.0 / seamonkey 2.16) once a channel is created (via nsiioservice.newchannel()), parameters for that request may be set by using the channel attributes, or by calling queryinterface() to retrieve a subclass of nsichannel for protocol-specific parameters. then, the uri can be fetched by calling open() or asyncopen(). after a request has been completed, the channel is still valid for accessing protocol-specific results. for example, queryinterfacing to nsihttpchannel allows response headers to be retrieved for the corresponding http transaction. this interface must be used only from the xpcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttpchannel.cpp. method overview void asyncopen(in nsistreamlistener alist...
...ommonly requested include: nsiprogresseventsink, nsiprompt, and nsiauthprompt / nsiauthprompt2. when the channel is done, it must not continue holding references to this object. note: a channel implementation should take care when "caching" an interface pointer queried from its notification callbacks. if the notification callbacks are changed, then a cached interface pointer may become invalid and may therefore need to be re-queried. originaluri nsiuri the original uri used to construct the channel. this is used in the case of a redirect or uri "resolution" (for example resolving a resource: uri to a file: uri) so that the original pre-redirect uri can still be obtained. this is also used as the ri of the document resulting from the channel, unless the channel has...
nsICommandLine
flag=param are normalized to the form -flag param. astring getargument( in long aindex ); parameters aindex the argument to retrieve. this index is 0-based, and does not include the application name. return value the value of the specified argument. this is the full text of that argument, so if the argument is a flag, the returned value is "-flag [<flagvalue>]". exceptions thrown ns_error_invalid_arg the specified index is out of bounds. handleflag() finds the specified flag, removing it from the array of flags. reports whether or not the specified flag was found. this is useful for boolean flags; that is, flags that don't accept a parameter. you can determine if the flag was provided and remove it from the list of flags waiting to be processed in one operation. boolean handleflag( in ...
...ents() into one operation. astring handleflagwithparam( in astring aflag, in boolean acasesensitive ); parameters aflag the flag name to find and remove. acasesensitive whether to do case-sensitive flag search. return value the value of the specified flag, an empty string if the flag's value is the empty string, or null if the specified parameter wasn't found. exceptions thrown ns_error_invalid_arg the specified flag has no value. removearguments() removes a range of arguments from the command line; this is typically done once those arguments have been handled. void removearguments( in long astart, in long aend ); parameters astart the index to the first argument to remove from the command line; this is 0-based, and the name of the application is not included. aend the index to t...
nsIContentView
ffset in chrome-document css pixels. read only. viewportheight float height of the viewport in chrome-document css pixels. read only. viewportwidth float width of the viewport in chrome-document css pixels. read only. methods scrollby() scrolls the content view by the specified number of chrome-document css pixels along each axis. fails if the view isn't valid. void scrollby( in float dxpx, in float dypx ); parameters dxpx the number of css pixels to scroll on the x axis; specify a positive value to scroll to the right or a negative value to scroll to the left. dypx the number of css pixels to scroll on the y axis; specify a positive value to scroll down or a negative value to scroll up. scrollto() scrolls the content view to the specif...
... dxpx the number of css pixels to scroll on the x axis; specify a positive value to scroll to the right or a negative value to scroll to the left. dypx the number of css pixels to scroll on the y axis; specify a positive value to scroll down or a negative value to scroll up. scrollto() scrolls the content view to the specified position, in chrome-document css pixels. fails if the view isn't valid. void scrollto( in float xpx, in float ypx ); parameters xpx the x coordinate to scroll to, in css pixels. ypx the y coordinate to scroll to, in css pixels. setscale() sets the content view's scale for each axis. void setscale( in float xscale, in float yscale ); parameters xscale horizontal scaling factor; specify 1.0 to use the natural size of the content. yscale ve...
nsICryptoHMAC
the hashing object. this method may be called multiple times with different algorithm types. warning: this approach is not fips compliant. note: this method must be called before any other method on this interface is called. void init( in unsigned long aalgorithm, in nsikeyobject akeyobject ); parameters aalgorithm the algorithm type to be used. ...
... reset() reinitialize hmac context to be reused with the same settings (the key and hash algorithm) but on different set of data. void reset(); parameters none. update() void update( [const, array, size_is(alen)] in octet adata, in unsigned long alen ); parameters adata a buffer to calculate the hash over. ...
nsICryptoHash
initialize the hashing object. this method may be called multiple times with different algorithm types. note: this method or " .. manch("initwithstring") .. " must be called before any other method on this interface is called. void init( in unsigned long aalgorithm ); parameters aalgorithm the hash algorithm to use. must be one of the hash algorithms. exceptions thrown ns_error_invalid_arg indicates that an unsupported algorithm type was passed initwithstring() initialize the hashing object. this method may be called multiple times with different algorithm types. note: this method or " .. manch("init") .. " must be called before any other method on this interface is called. void initwithstring( in acstring aalgorithm ); parameters aalgorithm the hash algorithm typ...
...() initialize the hashing object. this method may be called multiple times with different algorithm types. note: this method or " .. manch("init") .. " must be called before any other method on this interface is called. void initwithstring( in acstring aalgorithm ); parameters aalgorithm the hash algorithm type to be used as a string, such as "sha256". exceptions thrown ns_error_invalid_arg indicates that an unsupported algorithm type was passed update() adds an array of data to be hashed to the object. see computing the hash of a string for an example of using this method. void update( [const, array, size_is(alen)] in octet adata, in unsigned long alen ); parameters adata a buffer to calculate the hash over. alen the length of the buffer adata. exceptions thr...
nsIDOMHTMLSourceElement
se add a summary to this article. last changed in gecko 1.9.1.2 inherits from: nsidomhtmlelement the source element allows authors to specify multiple media resources for media elements. it does not specify anything on its own. attributes attribute type description src domstring the src attribute gives the address of the media resource. the value must be a valid url. this attribute must be present. note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or video) instead. type domstring the type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it...
.... note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or video) instead. type domstring the type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it. if specified, its value must be a valid mime type. the codecs parameter may be specified and might be necessary to specify exactly how the resource is encoded. media unimplemented domstring the media attribute gives the intended media type of the media resource, to help the user agent determine if this media resource is useful to the user before fetching it. its value must be a valid media query. example <video c...
nsIDOMHTMLTimeRanges
methods end() returns the time offset to the end of the specified time range. float end( in unsigned long index ); parameters index the index to the time range whose end time is to be returned. return value the time at which the specified range ends, in seconds measured from the beginning of the timeline represented by the object. exceptions thrown index_size_err the specified index is not valid. start() returns the time offset to the start of the specified time range. float start( in unsigned long index ); parameters index the index to the time range whose start time is to be returned. return value the time at which the specified range starts, in seconds measured from the beginning of the timeline represented by the object. exceptions thrown index_size_err the specified index is ...
... ...
nsIDocShell
t. allowwindowcontrol boolean specifies whether or not content is allowed to control the window (that is, to resize or move the window). default is true, which lets content control the window. apptype unsigned long the type of application that created this window. types are defined in constants. busyflags unsigned long current busy state for docshell. valid states are defined in constants. read only. canexecutescripts boolean whether this docshell can execute scripts based on its hierarchy. the rule of thumb here is that we disable js if this docshell or any of its parents disallow scripting, unless the only reason for js being disabled in this docshell is a parent docshell having a document that is in design mode. in that case, we ex...
...eing painted to a canvas), and should be treated accordingly. layouthistorystate nsilayouthistorystate loadedtransindex long keeps track of the previous shtransaction index and the current shtransaction index at the time that the doc shell begins to load. used for contentviewer eviction. read only. loadtype unsigned long load type for the document. valid states are defined in constants. note that nsidocshell may use other states internally so you should check for the specific state bit. marginheight long the value of the marginheight attribute on the frame element, or negative if it was not set. marginwidth long the value of the marginwidth attribute on the frame element, or negative if it was not set. paren...
nsIDownloader
netwerk/base/public/nsidownloader.idlscriptable a special implementation of a nsistreamlistener that will make the contents of the stream available as a file. this may utilize the disk cache as an optimization to avoid an extra copy of the data on disk. the resulting file is valid from the time the downloader completes until the last reference to the downloader is released. inherits from: nsistreamlistener last changed in gecko 1.7 method overview void init(in nsidownloadobserver observer, in nsifile downloadlocation); methods init() initialize this downloader. void init( in nsidownloadobserver observer, in nsifile downloadlocation ); parameters observer the nsidownloadobserver to be notified when the download completes. downloadlocation the ...
...it() initialize this downloader. void init( in nsidownloadobserver observer, in nsifile downloadlocation ); parameters observer the nsidownloadobserver to be notified when the download completes. downloadlocation the location where the stream contents should be written. if null, the downloader will select a location and the resulting file will be deleted (or otherwise made invalid) when the downloader object is destroyed. if an explicit download location is specified then the resulting file will not be deleted, and it will be the callers responsibility to keep track of the file, and so on. ...
nsIDroppedLinkHandler
check includes any parent, sibling and child frames in the same content tree. if true, the source is not checked. return value true if the link being dragged can be dropped. exceptions thrown missing exception missing description droplink() given a drop event, determines the link being dragged. if a uri is returned the caller can, for instance, load it. if null is returned, there is no valid link to be dropped. astring droplink( in nsidomdragevent aevent, out astring aname, [optional] in boolean adisallowinherit ); parameters aevent a drop event. aname the link title if it exists, or an empty string otherwise. return value a uri, or null if there is no valid link to be dropped. exceptions thrown ns_error_dom_security_err error will be thrown and the event cance...
...reasons. this will occur if the source of the drag initiated a link for dragging that it itself cannot access. this prevents a source document from tricking the user into a dragging a chrome url for example. droplinks() given a drop event, determines the link being dragged. if non-empty links array is returned the caller can, for instance, load it. if empty links array is returned, there is no valid link to be dropped. void droplinks( in nsidomdragevent aevent, [optional] in boolean adisallowinherit, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidroppedlinkitem alinks ); parameters aevent a drop event. adisallowinherit acount receives the count of alinks array alinks recives an array of objects with nsidroppedlinkitem interface return v...
nsIException
there is no unambiguous indicator for unknown. read only. data nsisupports arbitary data for the implementation. read only. filename string filename location. ...
...he error, which may or may not be a source file location. for example, standard language errors would generally have the same location as their top stack entry. file parsers may put the location of the file they were parsing. null indicates "no data" read only. inner nsiexception an inner exception that triggered this, if available. read only. linenumber pruint32 valid line numbers begin at '1'. '0' indicates unknown. read only. location nsistackframe a stack trace, if available. read only. message string a custom message set by the thrower. [binaryname(messagemoz)] read only. name string the name of the error code (a string representation of result) read only. result nsresult the nsresult associated w...
nsIFaviconService
which will then cause the corresponding favicon data to be loaded from this service. for pages where we don't have a favicon, this will be a chrome uri of the default icon for a web page. getfaviconlinkforicon() this method, for a given icon uri will return a uri that will result in the image. in most cases, this is an annotation uri. for chrome, this will do nothing and return the input uri. no validity checking is done. if you pass an icon uri that we've never seen, you'll get back a uri that references an invalid icon. the moz-anno protocol handler's special case for "favicon" annotations will resolve invalid icons to the default icon, although without caching. for invalid chrome uris, you'll get a broken image. nsiuri getfaviconlinkforicon( in nsiuri afaviconuri ); parameters afavi...
...f the favicon service. for a normal page with a favicon we've stored, this will be an annotation uri which will then cause the corresponding favicon data to be loaded from this service. for pages where we don't have a favicon, this will be a chrome uri of the default icon for a web page. for chrome, the output will be the same as the input. for chrome, the output will be the same as the input. no validity checking is done. if you pass an icon uri that we've never seen, you'll get back a uri that references an invalid icon. the moz-anno protocol handler's special case for "favicon" annotations will detect most invalid icons and it will resolve to the default icon, although without caching. for invalid chrome uris, you'll get a broken image. isfailedfavicon() this method checks to see if this fav...
nsIFile
the c stdlib. there are problems that affect platforms on which a path does not fully specify a file because two volumes can have the same name (for example mac). this is solved by holding "private", native data in the nsifile implementation. this native data is lost when you convert to a string. do not pass to use with nspr or stdlib! read only. exceptions thrown ns_error_file_invalid_path indicates that this nsifile does not reference a symbolic link. constants constant value description normal_file_type 0 a normal file. directory_type 1 a directory/folder. delete_on_close 0x80000000 optional parameter used by opennsprfiledesc methods append() this function is used for constructing a de...
...e. parameters none. return value true if the nsifile may be executed by the user. otherwise it returns false. isfile() this method tests whether or not this nsifile corresponds to a normal file. boolean isfile(); parameters none. return value true if this nsifile corresponds to a normal file. otherwise it returns false. this method will throw ns_error_file_not_found if the path is invalid. to avoid this, check with nsifile.exists() first. ishidden() this method tests whether or not this nsifile corresponds to a file or directory that is hidden. in unix, hidden files start with a period. on mac and windows, they have an attribute bit set. boolean ishidden(); parameters none. return value true if the file or directory is hidden. otherwise it returns false. isreadable() thi...
nsIMsgDatabase
the nsimsgdatabase interface is an abstract interface used to access the mail database backend. mailnews/db/msgdb/public/nsimsgdatabase.idlscriptable please add a summary to this article. ...
...iclenum nsmsgkey readonly: nextpseudomsgkey nsmsgkey for undo-redo of move pop->imap. nextfakeofflinemsgkey nsmsgkey readonly: for saving "fake" offline msg hdrs. defaultviewflags nsmsgviewflagstypevalue readonly: defaultsorttype nsmsgviewsorttypevalue readonly: defaultsortorder nsmsgviewsortordervalue readonly: msghdrcachesize unsigned long folderstream nsioutputstream summaryvalid boolean methods open() opens a database folder. void open(in nsilocalfile afoldername, in boolean acreate, in boolean aleaveinvaliddb); parameters afoldername the name of the folder to create. acreate whether or not the file should be created. aleaveinvaliddb set to true if you do not want the database to bedeleted if it is invalid. exceptions thrown ns_error_file...
nsIMsgFilterCustomAction
search/ public/ nsimsgfiltercustomaction.idl interface nsimsgfiltercustomaction : nsisupports { /* globally unique string to identify this filter action. * recommended form: extensionname@example.com#actionname */ readonly attribute acstring id; /* action name to display in action list. this should be localized. */ readonly attribute astring name; /** * is this custom action valid for a particular filter type? * * @param type the filter type * @param scope the search scope * * @return true if valid */ boolean isvalidfortype(in nsmsgfiltertypetype type, in nsmsgsearchscopevalue scope); /** * after the user inputs a particular action value for the action, determine * if that value is valid. * * @param actionvalue the va...
...rchscopevalue scope); /** * after the user inputs a particular action value for the action, determine * if that value is valid. * * @param actionvalue the value entered. * @param actionfolder folder in the filter list * @param filtertype filter type (manual, offlinemail, etc.) * * @return errormessage a localized message to display if invalid * set to null if the actionvalue is valid */ autf8string validateactionvalue(in autf8string actionvalue, in nsimsgfolder actionfolder, in nsmsgfiltertypetype filtertype); /* allow duplicate actions in the same filter list? default no. */ attribute boolean allowduplicates; /* * the cu...
nsIMutableArray
n weak ); parameters element the element to insert. index the position in the array: if the position is lower than the current length of the array, the elements at that position and onwards are bumped one position up. if the position is equal to the current length of the array, the new element is appended. an index lower than 0 or higher than the current length of the array is invalid and will be ignored. weak whether or not to store the element using a weak reference. exceptions thrown ns_error_failure when a weak reference is requested, but the element does not support nsiweakreference. removeelementat() remove an element at a specific position, moving all elements stored at a higher position down one. to remove a specific element, use nsiarray.indexof() t...
...dex the position in the array. if the position is lower than the current length of the array, an existing element will be replaced. if the position is equal to the current length of the array, the new element is appended. if the position is higher than the current length of the array, empty elements are appended followed by the new element at the specified position. an index lower than 0 is invalid and will be ignored. weak whether or not to store the new element using a weak reference. exceptions thrown ns_error_failure when a weak reference is requested, but the element does not support nsiweakreference. see also nsiarray ...
nsINavHistoryResultObserver
d containerclosed(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containeropened(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containerstatechanged(in nsinavhistorycontainerresultnode acontainernode, in unsigned long aoldstate, in unsigned long anewstate); void invalidatecontainer(in nsinavhistorycontainerresultnode acontainernode); void nodeannotationchanged(in nsinavhistoryresultnode anode, in autf8string aannoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavh...
...sinavhistorycontainerresultnode acontainernode, in unsigned long aoldstate, in unsigned long anewstate ); parameters acontainernode the container node whose state changed. aoldstate the prior state of the node; this will be one of the nsinavhistorycontainerresultnode.state constants. anewstate the new state of the node; this is one of the nsinavhistorycontainerresultnode.state constants. invalidatecontainer() called when something has happened that requires that the contents of a container be rebuilt. void invalidatecontainer( in nsinavhistorycontainerresultnode acontainernode ); parameters acontainernode the container that should be rebuilt. nodeannotationchanged() called right after the annotation on a node has changed. this is called when the annotation is changed, set, or unset.
nsINavHistoryResultTreeViewer
t will be more efficient. default = true. changing this value is somewhat heavyweight since it will force a tree refresh. obsolete since gecko 1.9 flatitemcount pruint32 this tells you how many items are in the flattened list of results, that is how many rows are in this tree right now. the tree adaptor will also qi to nsitreeview, and this will be the same as nsitreeview.rowcount. this is only valid when a tree is attached, the result will be 0 otherwise. read only. obsolete since gecko 1.9 constants constant value description index_invisible 0xffffffff returned by treeindexfornode() when the requested node isn't visible (such as when its parent is collapsed). also returned if there is no tree attached. methods nodefortreeindex() returns the node for a given row index. this is onl...
...hen a tree is attached, the result will be 0 otherwise. read only. obsolete since gecko 1.9 constants constant value description index_invisible 0xffffffff returned by treeindexfornode() when the requested node isn't visible (such as when its parent is collapsed). also returned if there is no tree attached. methods nodefortreeindex() returns the node for a given row index. this is only valid when a tree is attached. nsinavhistoryresultnode nodefortreeindex( in unsigned long aindex ); parameters aindex the row index of the note to return. return value the node located at the specified index in the tree. treeindexfornode() returns the row index corresponding to the specified node within the tree, or index_invisible if the tree is unattached or the node is not visible (if, for exam...
Component; nsIPrefBranch
ef atype, in nsisupports avalue); void setintpref(in string aprefname, in long avalue); void unlockpref(in string aprefname); attributes attribute type description root string called to get the root on which this branch is based, such as "browser.startup." read only. constants constant value description pref_invalid 0 long pref_string 32 long data type. pref_int 64 long data type. pref_bool 128 long data type. methods addobserver() adds a preference change observer. on preference changes, the following arguments will be passed to nsiobserver.observe(): asubject - the nsiprefbranch object (this). atopic - the string defined by ns_prefbranch_prefcha...
.... return value returns long - the value of the requested integer preference. getpreftype() called to determine the type of a specific preference. long getpreftype( in string aprefname ); parameters aprefname the preference to get the type of. return value returns long - a value representing the type of the preference. this value will be pref_string, pref_int, pref_bool, or pref_invalid. lockpref() called to lock a specific preference. locking a preference will cause the preference service to always return the default value regardless of whether there is a user set value or not. note: this method can be called on either a default or user branch but, in effect, always operates on the default branch. void lockpref( in string aprefname ); parameters aprefname the prefer...
nsITaskbarPreview
rosoft windows as a common interface for both window and tab taskbar previews. 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) you can not directly instantiate this interface. instead, you use nsitaskbartabpreview or nsitaskbarwindowpreview as appropriate. method overview void invalidate(); attributes attribute type description active boolean indicates whether or not the preview is marked as active (currently selected) in the taskbar. controller nsitaskbarpreviewcontroller the controller for this preview. the controller provides the behavior and appearance for the taskbar previ...
...hether or not the preview is visible; by default, this is false. note: changing this value is computationally expensive for tab previews, because doing so causes the proxy window to be destroyed and rebuilt, then re-registered with the taskbar. if any step of that process fails, an exception is thrown. for window previews, changing this value is computationally trivial. methods invalidate() invalidates the taskbar's cached image of the preview, forcing a redraw if necessary. void invalidate(); parameters none. see also nsitaskbarpreviewcontroller nsitaskbartabpreview nsitaskbarwindowpreview nsitaskbarpreviewbutton nsiwintaskbar ...
nsITreeColumns
read only. length long an alias for count (for the benefit of scripts which treat this as an array). read only. tree nsitreeboxobject the tree widget for these columns. read only. methods getcolumnat() get the column for a given index. nsitreecolumn getcolumnat( in ...
...edcolumn() get a column for a given name. nsitreecolumn getnamedcolumn( in astring id ); parameters id a column id return value the nsitreecolumn for this id. getprimarycolumn() get the primary column. nsitreecolumn getprimarycolumn(); parameters none. return value the primary nsitreecolumn. getsortedcolumn() nsitreecolumn getsortedcolumn(); parameters none. return value a nsitreecolumn. invalidatecolumns() this method is called whenever a treecol is added or removed and the column cache needs to be rebuilt. void invalidatecolumns(); parameters none. restorenaturalorder() restore the original order of the columns before the user moved them. void restorenaturalorder(); parameters none. see also nsitreecolumn ...
nsITreeSelection
et to get information about what is selected. ...
...in long i, out long min, out long max ); parameters i index of range to get (0 <= i < getrangecount()) min index of first object in range. max index of last object in this range. for single selections, min == max. getrangecount() returns a count of selection ranges. long getrangecount(); parameters none. return value long - number of selection ranges invalidateselection() can be used to invalidate the selection. void invalidateselection(); parameters none. invertselection() inverts the selection. void invertselection(); parameters none. isselected() indicates whether or not the row at the specified index is part of the selection. boolean isselected( in long index ); parameters index index of the row to check. return value rangedselect...
nsIUTF8ConverterService
be mistaken for ascii / utf-8 but is actually not in ascii / utf-8 so that astring has to go through the conversion. skipping asciiness/utf8ness check. 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. return value the converted string in utf-8. exceptions thrown ns_error_uconv_noconv when there is no decoder for acharset or error code of nsiunicodedecoder in case of conversion failure. converturispectoutf8() ensure that aspec (after url-unescaping it) is encoded in utf-8. if not, convert it to utf-8, assuming it's encoded in acharset, ...
...if not, convert it to utf-8, assuming it's encoded in acharset, and return the result. 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. no valid spec going around in mozilla code would break this assumption. autf8string converturispectoutf8( in acstring aspec, in string acharset ); parameters aspec an url-escaped uri spec to ensure its utf8ness. acharset the character set to convert from if aspec is not in utf-8. return value the converted spec in utf-8. exceptions thrown ns_error_uconv_noconv when there is no decoder for acharset...
nsIUserCertPicker
security/manager/ssl/public/nsiusercertpicker.idlscriptable please add a summary to this article. ...
... nsisupports last changed in gecko 1.7 method overview nsix509cert pickbyusage(in nsiinterfacerequestor ctx, in wstring selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean canceled); methods pickbyusage() nsix509cert pickbyusage( in nsiinterfacerequestor ctx, in wstring selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean canceled ); parameters ctx selectednickname certusage allowinvalid allowduplicatenicknames canceled return value ...
nsIWebBrowserPersist
ri object with a file scheme. aoutputcontenttype the desired mime type format to save the document and all sub-documents into or nsnull to use the default behavior. aencodingflags flags to pass to the encoder. awrapcolumn for text documents, indicates the desired width to wrap text at. parameter is ignored if wrapping is not specified by the encoding flags. exceptions thrown ns_error_invalid_arg one or more arguments was invalid. saveuri() as of firefox 26, this method should no longer be used from add-on code. please use downloads.createdownload() instead. as of firefox 36, a new parameter areferrerpolicy was added as the fourth argument, changing the number of parameters from 7 to 8 and shifting the order of the parameters in a backwards incompatible way. save the specified...
...y be passed in the event that no such relevant context exists (ie. the uri being saved is unrelated to any current browsing session). important: if you think that you should be passing null here, you are almost certainly wrong. null should be passed only when no plausible privacy context exists for the uri to be saved, which is an exceedingly rare corner case. exceptions thrown ns_error_invalid_arg one or more arguments was invalid. saveprivacyawareuri() save the specified uri to file, explicitly dictating whether the operation should be considered private for the purposes of network requests, caching, etc. all arguments and exceptions are identical to saveuri, with the exception of aisprivate which is used to indicate the private nature of the operation. example function download...
nsIXFormsModelElement
ipulating instance data and updating computed and displayed values. 1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned. return value an nsidomdocument. exceptions thrown domexception if there is no matching instance data. rebuild() signals the xforms processor to rebuild any internal data structures used to track computational dependencies...
...d instance data prior to invoking recalculate, the dom mutations are not cached. thus, a full recalculation is necessary to ensure the proper changes are effected throughout the xforms model. void recalculate(); parameters none. refresh() signals the xforms processor to perform a full refresh of form controls bound to instance nodes for the given xforms model. void refresh(); parameters none. revalidate() signals the xforms processor to perform a full revalidation of the given xforms model. void revalidate(); parameters none. see also xforms 1.1rec ...
nsIXULRuntime
e. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/xre/app-info;1. to get an instance, use: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); method overview void invalidatecachesonrestart(); attributes attribute type description accessibilityenabled boolean if true, the accessibility service is running. read only. browsertabsremoteautostart boolean if true, browser tabs may be opened by default in a different process from the main browser ui. read only. insafemode boolean whether the applic...
...ns_error_not_available. read only. constants process type constants constant value description process_type_default 0 the default (chrome) process. process_type_plugin 1 a plugin subprocess. process_type_content 2 a content subprocess. process_type_ipdlunittest 3 ipdl unit testing subprocess. methods invalidatecachesonrestart() signal the apprunner to invalidate caches on the next restart. this will cause components to be auto registered and all fast load data to be re-created. void invalidatecachesonrestart(); parameters none. example display the user's operating system in an alert box: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(...
nsIXULTemplateBuilder
queries, each may generate results with the same id. more than one of these results may match one of the rules in their respective queries, however only the result for the earliest matching query in the template becomes the active match and generates output. the addresult, removeresult, replaceresult and resultbindingchanged methods may be called by the query processor to indicate that the set of valid results has changed, such that a different query may match. if a different match would become active, the content for the existing match is removed and the content for the new match is generated. a query processor is not required to provide any support for updating results after they have been generated. see the template guide for more information about templates. /xul/templates/public/nsixultem...
...ing both removeresult for the old result and addresult for the new result. void replaceresult( in nsixultemplateresult aoldresult, in nsixultemplateresult anewresult, in nsidomnode aquerynode ); parameters aoldresult the old result. anewresult the new result. aquerynode the query that the new result applies to. errors throws ns_error_null_pointer if either argument is null, or ns_error_invalid_arg if the ids don't match resultbindingchanged() informs the template builder that one or more of the optional bindings for a result has changed. in this case, the rules are not reapplied as it is expected that the same rule will still apply. the builder will resynchronize any variables that are referenced in the action body. void resultbindingchanged( in nsixultemplateresult aresult ); param...
nsIZipReader
o match the pattern 'pat2'. this may be used to perform filtering upon the results of one pattern to remove all matches which also match another pattern. for example, because '*' matches any string and '*z*' matches any string containing a 'z', '*~*z*' will match all strings except those containing a 'z'. note that a pattern may not use '~' multiple times, so a string such as '*~*z*~*y*' is not a valid pattern. (foo|bar) will match either the pattern foo or the pattern bar. neither of the patterns foo or bar may use the 'pat~pat2' syntax described immediately above. \ will escape a special character. escaping is required for all special characters unless otherwise specified. all other characters match case-sensitively. an apattern not conforming to this syntax has undefined behavior...
...mediately above. \ will escape a special character. escaping is required for all special characters unless otherwise specified. all other characters match case-sensitively. an apattern not conforming to this syntax has undefined behavior. return value the nsiutf8stringenumerator containing the matching entry names. exceptions thrown ns_error_illegal_value on many but not all invalid apattern values. getcertificateprincipal() returns an object describing the entity which signed an entry. parsemanifest must be called first. if aentryname is an entry in the jar, getinputstream() must be called after parsemanifest. if aentryname is an external file which has meta-information stored in the jar, verifyexternalfile (not yet implemented) must be called before getprincipal. nsipr...
xptcall FAQ
are required by xpconnect. these facilities are also used by xpcom/proxy. it may also be used by other subsystems in the future. the xptcall approach was chosen over an approach that would have required generating stub code for calling and implementing all interfaces. though the chosen approach requires some core platform specific code, it has minimal footprint and is extendable to work with any valid xpcom interface without requiring additional per platform compiled code to be distributed. what does xptcall really do? the core invoke function has the declaration: xptc_public_api(nsresult) xptc_invokebyindex(nsisupports* that, pruint32 methodindex, pruint32 paramcount, nsxptcvariant* params); nsxptcvariant is a discriminated un...
...n a fully cross platform way. nor can they generally be done fully in c or c++. let's take them one at a time to see why. the invoke facility requires code that can build and invoke an arbitrary call frame. the c++ compiler builds such call frames all the time. but the compiler builds frames customized at compile time for the specific signature of the callee. xptcall needs to be able to call any valid xpcom method signature and it needs to specify this at runtime. the stubs facility needs to impersonate the full vtbl full of methods for any given valid xpcom interface (including ancestor methods). there are a few ways to do this. we could run the compiler at runtime and dynamically build and load stubs. or, we could write a bunch of platform specific code to build interface specific vtbls and...
Address Book examples
rdfromproperty("jobtitle", "software engineer", false); if you are searching for a card with a particular email address, you can use the cardforemailaddress function that will match against multiple email addresses stored in one card. again, this function returns the first match that it finds in the collection, or null. let collection = ... let card = collection.cardforemailaddress("foo@bar.invalid.com"); note: both of these functions may raise an ns_error_not_implemented exception if the collection has not implemented that function. this is currently true in the case of ldap, but may be true in other cases as well. how do i search for multiple contacts? formulate a boolean search string (see nsiabcard for built-in property names): var searchquery = "(or(primaryemail,bw,@v)(nickname,bw,...
...database specific information, that is used on edits. editing contacts once you have obtained a card from an nsiabdirectory (see above), you can edit it in a t...
CData
parameters none. return value a string identifying the data. methods available on string objects these methods must be called on objects that are arrays or pointers to 8-bit or 16-bit character or integer types, terminated by a null character. readstring() converts a character array to a javascript string. 8-bit strings are assumed to be encoded as utf-8. if the 8-bit string contains invalid encoded character, a typeerror exception is thrown. string readstring(); parameters none. return value a new string object that is a copy of the original string contents. readstringreplacemalformed() converts a character array to a javascript string. 8-bit strings are assumed to be encoded as utf-8. if the 8-bit string contains invalid encoded character, no exception is thrown. string ...
...is a copy of the original string contents. readstringreplacemalformed() converts a character array to a javascript string. 8-bit strings are assumed to be encoded as utf-8. if the 8-bit string contains invalid encoded character, no exception is thrown. string readstringreplacemalformed(); parameters none. return value a new string object that is a copy of the original string contents. invalid encoded characters will be replaced by �(u+fffd). here is a method to read "malformed", it attempts to do readstring on it, if it errors then it tries to read it in another way, so this is an alternative to readstringreplacemalformed, it is an attempt at readingmalformed function readaschar8thenaschar16(stringptr, known_len, jschar) { // when reading as jschar it assumes max length of 50...
FunctionType
urntype a ctype indicating the type of the value returned by the function. argtype1... argtypen zero or more ctype objects indicating the types of each of the parameters passed into the c function. return value a ctype describing the function type. the equivalent c function type declaration would be: returntype (*) ([argtype1, ..., argtypen]); exceptions thrown typeerror abi is not a valid abi constants, or returntype or any of the argument types are not valid ctype objects. properties property type description abi one of the abi constants the abi of the function. read only. argtypes ctype[] a sealed array of the argument types. read only. returntype ctype the return type of the function. read only. properties in...
...e these properties are available on all ctype objects. property type description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for other function, pointer, and array types, this should be a valid c type expression. ptr ctype returns a ctype representing the data type "pointer to this type". this is the result of calling ctypes.pointertype(the_type). read only. size number the size of the type, in bytes. this is the same value as the c sizeof. read only. note: ctypes.void_t.size is undefined. method overview methods inherited from cty...
Gecko Plugin API Reference - Plugins
nstance creation instance destruction shutdown initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the p...
...sks the browser to create a stream for the specified url. npn_geturlnotify requests creation of a new stream with the contents of the specified url; gets notification of the result. npn_getvalue allows the plug-in to query the browser for information. npn_getvalueforurl provides information to a plug-in which is associated with a given url, for example the cookies or preferred proxy. npn_invalidaterect invalidates specified drawing area prior to repainting or refreshing a windowless plug-in. npn_invalidateregion invalidates specified drawing region prior to repainting or refreshing a windowless plug-in. npn_memalloc allocates memory from the browser's memory space. npn_memflush requests that the browser free a specified amount of memory. npn_memfree deallocates a block of alloca...
Debugger - Firefox Developer Tools
gger.object instances for all objects allocated in the scope of debuggee globals. the query object may have the following properties: class if present, only return objects whose internal [[class]]’s name matches the given string. note that in some cases, the prototype object for a given constructor has the same [[class]] as the instances that refer to it, but cannot itself be used as a valid instance of the class. code gathering objects by class name may need to examine them further before trying to use them. all properties of query are optional. passing an empty object returns all objects in debuggee globals. unlike findscripts, this function is deterministic and will never return debugger.objects referring to previously unreachable objects that had not been collected yet. ...
...an equivalent debugger.object owned by this debugger. otherwise, if value is some other kind of object, and hence not a proper debuggee value, throw a typeerror instead. static methods of the debugger object the functions described below are not called with a this value. iscompilableunit(source) given a string of source code, designated bysource, return false if the string might become a valid javascript statement with the addition of more lines. otherwise return true. the intent is to support interactive compilation - accumulate lines in a buffer until iscompilableunit is true, then pass it to the compiler. source metadata generated from file: js/src/doc/debugger/debugger.md watermark: sha256:03b36132885e046a5f213130ba22b1139b473770f7324b842483c09ab7665f7c changeset: e91b...
Network request details - Firefox Developer Tools
ed from the server. (there may be some exceptions, such as x-firefox-spdy, which is added by firefox.) you can copy some or all of the response header in json format by using the context menu: if you select copy, a single key word, value pair is copied. ...
...e results through a json validator): { "response headers (1.113 kb)": { "headers": [ { "name": "accept-ranges", "value": "bytes" }, { "name": "age", "value": "0" }, { "name": "backend-timing", "value": "d=74716 t=1560258099074460" }, { "name": "cache-control", "value": "private, must-revalidate, max-age=0" }, { "name": "content-disposition", "value": "inline; filename=api-result.js" }, { "name": "content-encoding", "value": "gzip" }, { "name": "content-length", "value": "673" }, { "name": "content-type", "value": "text/javascript; charset=utf-8" }, { "na...
Examine and edit CSS - Firefox Developer Tools
ou can: toggle pseudo-classes; toggle classes; add a new rule; change the display based on the color scheme preference (as of firefox 72, you must set devtools.inspector.color-scheme-simulation.enabled to true in the configuration editor to enable this feature); change the display based on print media rules. a warning icon appears next to unsupported css properties or rules that have invalid values. this can help you understand why certain styles are not being applied. in the following example, a spelling error, "background-colour" instead of "background-color" has made the rule invalid: rule display it displays each rule as in a stylesheet, with a list of selectors followed by a list of property:value; declarations. highlight matched elements: next to the selector is a targ...
...e (the line occupied by the closing brace). as you start typing a property name, you'll see a list of autocomplete suggestions. press tab to accept the current suggestion or up and down to move through the list. the default choice is the most common property that starts with the letters you've typed. for example, here the user has typed "c" and the default choice is "color": if you enter an invalid value for a property when editing it, or an unknown property name, a yellow alert icon appears besides the declaration. edits that you make in the rules view are reflected in the style editor, and vice versa. any changes you make are temporary: reloading the page will restore the original styling. while you're editing css, the context menu you'll see is the normal one for working with editable ...
AddressErrors.addressLine - Web APIs
an object based on addresserrors includes an addressline property when validation of the address finds one or more errors in the array of strings in the address's addressline. the returned string explains the error and should offer suggestions for how to correct it. syntax var addresslineerror = addresserrors.addressline; value if an error occurred during validation of the address due to one of the strings in the addressline array having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error. the text should also include, when possible, advice about how to go about correcting the error. ...
... specifications specification status comment payment request apithe definition of 'addresserrors.addressline' in that specification. ...
AddressErrors.languageCode - Web APIs
an object based on addresserrors includes a languagecode property when the address's languagecode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var languageerror = addresserrors.languagecode; value if the value specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. ...
...he returned string explains the error and should offer suggestions for how to correct it. syntax var languageerror = addresserrors.languagecode; value if the value specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. this validation might be as simple as ensuring the text of the string is compliant with the syntax defined in bcp-47, or as detailed as actually verifying that the specified string matches a value from a database. if the languagecode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment requ...
AddressErrors.organization - Web APIs
an object based on addresserrors includes an organization property when the address's organization property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var organizationerror = addresserrors.organization; value if the value specified in the paymentaddress object's organization property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. ...
...ing explains the error and should offer suggestions for how to correct it. syntax var organizationerror = addresserrors.organization; value if the value specified in the paymentaddress object's organization property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. for example, if validation simply ensures that only permitted characters are included in the organization's name, this might return a string such as "the organization name may only contain the letters a-z, digits, spaces, and commas." if the organization value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment pa...
AudioConfiguration - Web APIs
the audioconfiguration dictionary of the media capabilities api defines the audio file being tested when calling mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() to query whether a specific audio configuration is supported, smooth, and/or power efficient. properties the audioconfiguration dictionary is made up of four audio properties, including: contenttype: a valid audio mime type, for information on possible values and what they mean, see the web audio codec guide. channels: the number of channels used by the audio track. bitrate: the number of bits used to encode one second of the audio file. samplerate: the number of audio samples making up one second of the audio file. examples //create media configuration to be tested const mediaconfig = { type : 'fi...
... the number of channels used by the audio track. bitrate: the number of bits used to encode one second of the audio file. samplerate: the number of audio samples making up one second of the audio file. examples //create media configuration to be tested const mediaconfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. } }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.support...
AudioNode.disconnect() - Web APIs
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. if this value is an audioparam, then the connection to that audioparam is terminated, and the node's contributions to that computed parameter become 0 going forward once the change takes effect. if no matching connection is found, an invalidaccesserror exception is thrown. output optional an index describing which output from the current audionode is to be disconnected. the index numbers are defined according to the number of output channels (see audio channels). if this parameter is out-of-bound, an indexsizeerror exception is thrown. input optional an index describing which input into the specified destination audionode is to b...
...nd, an indexsizeerror exception is thrown. input optional an index describing which input into the specified destination audionode is to be disconnected. the index numbers are defined according to the number of input channels (see audio channels). if this parameter is out-of-bound, an indexsizeerror exception is thrown. exceptions indexsizeerror a value specified for input or output is invalid, referring to a node which doesn't exist or outside the permitted range. invalidaccesserror the node on which disconnect() was called isn't connected to the specified destination node. example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var oscillator = audioctx.createoscillator(); var gainnode = audioctx.creategain(); oscillator...
CSSPrimitiveValue.getFloatValue() - Web APIs
ethod of the cssprimitivevalue interface is used to get a float value in a specified unit. if this css value doesn't contain a float value or can't be converted into the specified unit, a domexception is raised. syntax var floatvalue = cssprimitivevalue.getfloatvalue(unit); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. css_ems the value is a <length> in em units. css_exs the value is a <length> in ex units. css_grad ...
...he value is a <percentage>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. css_s the value is a <time> in seconds. return value a float value in the specified unit. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the float value can't be converted into the specified unit. example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("margin-top"); console.log(cssvalue.getfloatvalue(cssprimitivevalue.css_cm)); specifications specification status comment document objec...
CSSPrimitiveValue.setFloatValue() - Web APIs
cssprimitivevalue interface is used to set a float value. if the property attached to this value can't accept the specified unit or the float value, the value will be unchanged and a domexception will be raised. syntax cssprimitivevalue.setfloatvalue(unittype, floatvalue); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. css_ems the value is a <length> in em units. css_exs the value is a <length> in ex units. css_grad ...
...e>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. css_s the value is a <time> in seconds. floatvalue a float representing the new float value. return value void. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the string value can't be converted into the specified unit. an no_modification_allowed_err is raised if this property is read-only. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.setfloatvalue' in th...
Cache.match() - Web APIs
Web › API › Cache › match
al an object that sets options for the match operation. the available options are: ignoresearch: a boolean that specifies whether to ignore the query string in the url. for example, if set to true the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e. if the url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. return value a promise that resolves to the first respon...
...ents retrieved with the get http verb will be cached. if our if() condition is false, then this fetch handler won't intercept the request. if there are any other fetch handlers registered, they will get a chance to call event.respondwith(). if no fetch handlers call event.respondwith(), the request will be handled by the browser as if there were no service worker involvement. if fetch() returns a valid http response with an response code in the 4xx or 5xx range, the catch() will not be called. self.addeventlistener('fetch', function(event) { // we only want to call event.respondwith() if this is a get request for an html document. if (event.request.method === 'get' && event.request.headers.get('accept').indexof('text/html') !== -1) { console.log('handling fetch event for', event...
CustomElementRegistry.define() - Web APIs
ported: extends: string specifying the name of a built-in element to extend. used to create a customized built-in element. return value void. exceptions exception description notsupportederror the customelementregistry already contains an entry with the same name or the same constructor (or is otherwise already defined), or extends is specified and it is a valid custom element name, or extends is specified but the element it is trying to extend is an unknown element. syntaxerror the provided name is not a valid custom element name. typeerror the referenced constructor is not a constructor. note: you'll often get notsupportederrors thrown that seem like define() is failing, but instead it is likely a problem with element.at...
... customized built-in element the following code is taken from our word-count-web-component example (see it live also). // create a class for...
DOMConfiguration - Web APIs
r been supported in gecko, and has been removed from the dom specification. ...
...rted in gecko, and has been removed from the dom specification. ...
Document.createProcessingInstruction() - Web APIs
rget, data) parameters pinode is the resulting processinginstruction node. target is a string containing the first part of the processing instruction (i.e., <?target … ?>) data is a string containing any information the processing instruction should carry, after the target. the data is up to you, but it can't contain ?>, since that closes the processing instruction. exceptions dom_invalid_character throws if either of the following are true: the processing instruction target is invalid — it should be a valid xml name that doesn't contain "xml", "xml", or any case combination of the two, other than standardized ones such as <?xml-stylesheet ?>. the closing processing instruction sequence (?>) is part of the data. example var doc = new domparser().parsefromstring('<f...
...xml-stylesheet href="mycss.css" type="text/css"?><foo/> specifications specification status comment domthe definition of 'createprocessinginstruction()' in that specification. living standard no change dom4the definition of 'createprocessinginstruction()' in that specification. obsolete added more explicit definition of how the data parameter is validated. document object model (dom) level 3 core specificationthe definition of 'createprocessinginstruction()' in that specification. obsolete added note that the namespace of the target name is not checked whether it is well-formed, defined what is considered an illegal character for the target name and specified the returned processinginstruction object more precisely. doc...
Document.evaluate() - Web APIs
Web › API › Document › evaluate
pe 8 a result set containing any single node that matches the expression. the node is not necessarily the first node in the document that matches the expression. first_ordered_node_type 9 a result set containing the first node in the document that matches the expression. results of node_iterator types contain references to nodes in the document. ...
...ts of node_iterator types contain references to nodes in the document. modifying a node will invalidate the iterator. after modifying a node, attempting to iterate through the results will result in an error. results of node_snapshot types are snapshots, which are essentially lists of matched nodes. you can make changes to the document by altering snapshot nodes. modifying the document doesn't invalidate the snapshot; however, if the document is changed, the snapshot may not correspond to the current state of the document, since nodes may have moved, been changed, added, or removed. specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'document.evaluate' in that specification. recommendation ini...
Document.querySelectorAll() - Web APIs
returns a static (not live) nodelist representing a list of the document's elements that match the specified group of selectors. note: this method is implemented based on the parentnode mixin's queryselectorall() method. syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, ...
...ecial characters for more information. return value a non-live nodelist containing one element object for each element that matches at least one of the specified selectors or an empty nodelist in case of no matches. note: if the specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. examples obtaining a list of matches to obtain a nodelist of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with a class of either note or alert: var matches = document.queryselectorall("div.note, div.alert"); here, we get a list of <p> elements whose immediate parent element is...
Document.requestStorageAccess() - Web APIs
the maximum: the user is not prompted. the origin is given an ephemeral storage access grant for the current top-level origin. the number of origins the requesting origin has storage access to is incremented by one. note that this number is also incremented when automatic access grants are given through our compatibility heuristics. the ephemeral storage access grant is: invalidated at the end of the browser session. not persisted to disk (e.g. will not persist if the browser crashes). reset after 24 hours in the case of a long-running browser session. ...equal or more origins than the maximum: the user is prompted if the user clicks “allow” or “allow on any site” the request is resolved. if the user clicks “don’t allow”, the storage acces...
...t is rejected and the requesting origin can re-request once it receives another user interaction. if the user allows storage the requesting origin is given a persistent storage access grant on the current top-level origin. the number of origins the requesting origin has storage access to is incremented by one. the persistent storage access permission is: persisted to disk and will remain valid in future browser sessions. reset after 30 days. when an ephemeral or persistent storage access grant expires, the number of origins the requesting origin has storage access to is decremented by one. note: if the requesting origin is not classified as a tracking origin, the access request is automatically given an ephemeral storage access grant, which will go away when the page is rel...
EXT_float_blend - Web APIs
need to enable the use of 32-bit floating-point draw buffers by enabling the extension webgl_color_buffer_float (for webgl1) or ext_color_buffer_float (for webgl2). doing so automatically enables ext_float_blend as well. with this extension enabled, calling drawarrays() or drawelements() with blending enabled and a draw buffer with 32-bit floating-point components will no longer result in an invalid_operation error. usage notes on devices that support the ext_float_blend extension, it is automatically, implicitly, enabled when any one or more of ext_color_buffer_float, oes_texture_float, or webgl_color_buffer_float are enabled. this ensures that content written before ext_float_blend was exposed by webgl will function as expected. examples const gl = canvas.getcontext('webgl2'); // enab...
...l.bindtexture(gl.texture_2d, tex); // use floating point format gl.teximage2d(gl.texture_2d, 0, gl.rgba32f, 1, 1, 0, gl.rgba, gl.float, null); const fb = gl.createframebuffer(); gl.bindframebuffer(gl.framebuffer, fb); gl.framebuffertexture2d(gl.framebuffer, gl.color_attachment0, gl.texture_2d, tex, 0); // enable blending gl.enable(gl.blend); gl.drawarrays(gl.points, 0, 1); // won't throw gl.invalid_operation with the extension enabled specifications specification status ext_float_blend draft ...
Element.attachShadow() - Web APIs
shadow dom tree to the specified element and returns a reference to its shadowroot. elements you can attach a shadow to note that you can't attach a shadow root to every type of element. there are some that can't have a shadow dom for security reasons (for example <a>), and more besides. the following is a list of elements you can attach a shadow root to: any autonomous custom element with a valid name <article> <aside> <blockquote> <body> <div> <footer> <h1> <h2> <h3> <h4> <h5> <h6> <header> <main> <nav> <p> <section> <span> syntax var shadowroot = element.attachshadow(shadowrootinit); parameters shadowrootinit a shadowrootinit dictionary, which can contain the following fields: mode a string specifying the encapsulation mode for the shadow dom tree. th...
... delegatesfocus a boolean that, when set to true, specifies behavior that mitigates custom element issues around focusability. when a non-focusable part of the shadow dom is clicked, the first focusable part is given focus, and the shadow host is given any available :focus styling. return value returns a shadowroot object. exceptions exception explanation invalidstateerror the element you are trying to attach to is already a shadow host. notsupportederror you are trying to attach a shadow root to an element outside the html namespace, or the element cannot have a shadow attached to it (see above). examples the following example is taken from our word-count-web-component demo (see it live also). you can see that we use attachshadow()...
Element.querySelector() - Web APIs
the queryselector() method of the element interface returns the first element that is a descendant of the element on which it is invoked that matches the specified group of selectors. syntax element = baseelement.queryselector(selectors); parameters selectors a group of selectors to match the descendant elements of the element baseelement against; this must be valid css syntax, or a syntaxerror exception will occur. the first element found which matches this group of selectors is returned. return value the first descendant element of baseelement which matches the specified group of selectors. the entire hierarchy of elements is considered when matching, including those outside the set of elements including baseelement and its descendants; in other words, selectors is first applied t...
... is first applied to the whole document, not the baseelement, to generate an initial list of potential elements. the resulting elements are then examined to see if they are descendants of baseelement. the first match of those remaining elements is returned by the queryselector() method. if no matches are found, the returned value is null. exceptions syntaxerror the specified selectors are invalid. examples let's consider a few examples. find a specific element with specific values of an attribute in this first example, the first <style> element which either has no type or has type "text/css" in the html document body is returned: var el = document.body.queryselector("style[type='text/css'], style:not([type])"); the entire hierarchy counts this example demonstrates that the hierar...
Element.querySelectorAll() - Web APIs
a list of elements matching the specified group of selectors which are descendants of the element on which the method was called. note: this method is implemented based on the parentnode mixin's queryselectorall() method. syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backspace escaping, ...
...g these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each descendant node that matches at least one of the specified selectors. note: if the specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. examples dataset selector & attribute selectors <section class="box" id="sect1"> <div class="funnel-chart-percent1">10.900%</div> <div class="funnel-chart-percent2">3700.00%</div> <div class="funnel-chart-percent3">0.00%</div> </section> // dataset selectors const refs = [...document.queryselectorall(`[data-name*="funnel-chart-percent"]`)]; // attribute selectors // const refs = [..
FileEntrySync - Web APIs
es (fileexception); methods createwriter() creates a new filewriter associated with the file that the fileentry represents. void createwriter ( ) raises (fileexception); parameter none. returns filewritersync exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist. invalid_state_err the file is no longer valid for some reason other than it having been deleted. file() returns a file that represents the current state of the file that this fileentry represents. void file ( ) raises (fileexception); parameter none. returns file exceptions this method can raise a fileexception with the following codes: exception description ...
...son other than it having been deleted. file() returns a file that represents the current state of the file that this fileentry represents. void file ( ) raises (fileexception); parameter none. returns file exceptions this method can raise a fileexception with the following codes: exception description not_found_err the file does not exist. invalid_state_err the file is no longer valid for some reason other than it having been deleted. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvi...
HTMLAnchorElement - Web APIs
htmlelement, and implements those from htmlhyperlinkelementutils. element.accesskey is a domstring representing a single character that switches input focus to the hyperlink. htmlanchorelement.download is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser. the value represent the proposed name of the file. if the name is not a valid filename of the underlying os, browser will adapt it. htmlhyperlinkelementutils.hash is a usvstring representing the fragment identifier, including the leading hash mark ('#'), if any, in the referenced url. htmlhyperlinkelementutils.host is a usvstring representing the hostname and port (if it's not the default port) in the referenced url. htmlhyperlinkelementutils.hostname is a usvstring ...
... the referenced url. htmlhyperlinkelementutils.host is a usvstring representing the hostname and port (if it's not the default port) in the referenced url. htmlhyperlinkelementutils.hostname is a usvstring representing the hostname in the referenced url. htmlhyperlinkelementutils.href is a usvstring that is the result of parsing the href html attribute relative to the document, containing a valid url of a linked resource. htmlanchorelement.hreflang is a domstring that reflects the hreflang html attribute, indicating the language of the linked resource. htmlanchorelement.media is a domstring that reflects the media html attribute, indicating the intended media for the linked resource. htmlhyperlinkelementutils.password is a usvstring containing the password specified before the domai...
HTMLAreaElement - Web APIs
containing alternative text for the element. htmlareaelement.coords is a domstring that reflects the coords html attribute, containing coordinates to define the hot-spot region. htmlareaelement.download is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser. the value represent the proposed name of the file. if the name is not a valid filename of the underlying os, browser will adapt it. htmlhyperlinkelementutils.hash is a usvstring containing the fragment identifier (including the leading hash mark (#)), if any, in the referenced url. htmlhyperlinkelementutils.host is a usvstring containing the hostname and port (if it's not the default port) in the referenced url. htmlhyperlinkelementutils.hostname is a usvstring conta...
...leading hash mark (#)), if any, in the referenced url. htmlhyperlinkelementutils.host is a usvstring containing the hostname and port (if it's not the default port) in the referenced url. htmlhyperlinkelementutils.hostname is a usvstring containing the hostname in the referenced url. htmlhyperlinkelementutils.href is a usvstring containing that reflects the href html attribute, containing a valid url of a linked resource. htmlareaelement.hreflang is a domstring containing that reflects the hreflang html attribute, indicating the language of the linked resource. htmlareaelement.media is a domstring containing that reflects the media html attribute, indicating target media of the linked resource. htmlareaelement.nohref is a boolean flag indicating if the area is inactive (true) or a...
HTMLCanvasElement - Web APIs
xt></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlcanvaselement.height the height html attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or rgba values) going down one column of the canvas. when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. if no [separate] css height is assigned to the <canvas>, then this value will also be used as the height of the canvas in the length-unit css pixel. htmlcanvaselement.width the width html attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or rgba values) going across one row of the canvas. wh...
...if no [separate] css height is assigned to the <canvas>, then this value will also be used as the height of the canvas in the length-unit css pixel. htmlcanvaselement.width the width html attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or rgba values) going across one row of the canvas. when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used. if no [separate] css width is assigned to the <canvas>, then this value will also be used as the width of the canvas in the length-unit css pixel. htmlcanvaselement.mozopaque is a boolean reflecting the moz-opaque html attribute of the <canvas> element. it lets the canvas know whether or not translucency will be a factor. if the canv...
HTMLFontElement.color - Web APIs
the obsolete htmlfontelement.color property is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format. ...
...ment.color property is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format. ...
HTMLImageElement.srcset - Web APIs
iate images for the rendering situation. syntax htmlimageelement.srcset = imagecandidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a comma-separated list of one or more image candidate strings to be used when determining which image resource to present inside the <img> element represented by the htmlimageelement. each image candidate string must begin with a valid url referencing a non-interactive graphic resource. this is followed by a comma (,) character and then a condition descriptor that indicates the circumstances in which the indicated image should be used. space characters, other than the whitespace separating the url and the corresponding condition descriptor, are ignored; this includes both leading and trailing space, as well as space before or a...
... value followed by the lower-case letter "x". as an example, to state that the corresponding image should be used when the pixel density is double the standard density, you can give the pixel density descriptor 2x or 2.0x. you may mix and match the two types of descriptor. you must not, however, provide multiple image candidate strings that specify the same descriptor. all of the following are valid image candidate strings: "images/team-photo.jpg 1x, images/team-photo-retina.jpg 2x, images/team-photo-full 2048w" this string provides versions of an image to be used at the standard pixel density (1x) as well as double that pixel density (2x). also available is a version of the image for use at a width of 2048 pixels (2048w). "header640.png 640w, header960.png 960w, header1024.png 1024w, hea...
HTMLImageElement.x - Web APIs
in other words: it has either of those values set explicitly on it, or it has inherited it from a containing element, or by being located within a column described by either <col> or <colgroup>. ...
...e <img> element's border box. the nearest root element is the outermost <html> element that contains the image. if the image is in an <iframe>, its x is relative to that frame. in the diagram below, the left border edge is the left edge of the blue padding area. so the value returned by x would be the distance from that point to the left edge of the content area. note: the x property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>. example the example below demonstrates the use of the htmlimageelement properties x and y. html in this exam...
HTMLImageElement.y - Web APIs
in other words: it has either of those values set explicitly on it, or it has inherited it from a containing element, or by being located within a column described by either <col> or <colgroup>. ...
... the <img> element's border box. the nearest root element is the outermost <html> element that contains the image. if the image is in an <iframe>, its y is relative to that frame. in the diagram below, the top border edge is the top edge of the blue padding area. so the value returned by y would be the distance from that point to the top edge of the content area. note: the y property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>. example the example below demonstrates the use of the htmlimageelement properties x and y. html in this exam...
The HTML DOM API - Web APIs
ion 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. formdataevent htmlformcontrolscollection htmloptionscollection radionodelist validitystate canvas and image interfaces these interfaces represent objects used by the canvas api as well as the <img> element and <picture> elements. canvasgradient canvaspattern canvasrenderingcontext2d imagebitmap imagebitmaprenderingcontext imagedata offscreencanvas offscreencanvasrenderingcontext2d path2d textmetrics media interfaces the media interfaces provide html access ...
...ently has a value. javascript const namefield = document.getelementbyid("username"); const sendbutton = document.getelementbyid("sendbutton") sendbutton.disabled = true; // [note: this is disabled since it causes this article to always load with this example focused and scrolled into view] //namefield.focus(); namefield.addeventlistener("input", event => { const elem = event.target; const valid = elem.value.length != 0; if (valid && sendbutton.disabled) { sendbutton.disabled = false; } else if (!valid && !sendbutton.disabled) { sendbutton.disabled = true; } }); this code uses the document interface's getelementbyid() method to get the dom object representing the <input> elements whose ids are username and sendbutton. with these, we can access the properties and methods ...
HTML Drag and Drop API - Web APIs
rag event type has an associated global event handler: event on event handler fires when… drag ondrag …a dragged item (element or text selection) is dragged. dragend ondragend …a drag operation ends (such as releasing a mouse button or hitting the esc key; see finishing a drag.) dragenter ondragenter …a dragged item enters a valid drop target. (see specifying drop targets.) dragexit ondragexit …an element is no longer the drag operation's immediate selection target. dragleave ondragleave …a dragged item leaves a valid drop target. dragover ondragover …a dragged item is being dragged over a valid drop target, every few hundred milliseconds. dragstart ondragstart...
...(see performing a drop.) note: neither dragstart nor dragend events are fired when dragging a file into the browser from the os. interfaces the html drag and drop interfaces are dragevent, datatransfer, datatransferitem and datatransferitemlist. ...
IDBDatabase.createObjectStore() - Web APIs
ey path and uses out-of-line keys. you can also pass in an array as a keypath. autoincrement if true, the object store has a key generator. defaults to false. unknown parameters are ignored. returns a new idbobjectstore. ...
... the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback. for older webkit browsers, you must call first. transactioninactiveerror occurs if a request is made on a source database that doesn't exist (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database. invalidaccesserror if autoincrement is set to true and keypath is either an empty string or an array containing an empty string. ...
IDBDatabase.deleteObjectStore() - Web APIs
with idbdatabase.createobjectstore, this method can be called only within a versionchange transaction. note: this feature is available in web workers. syntax dbinstance.deleteobjectstore(name); parameters name the name of the object store you want to delete. ...
...names are case sensitive. ...
IDBDatabase.transaction() - Web APIs
the idbdatabase interface immediately returns a transaction object (idbtransaction) containing the idbtransaction.objectstore method, which you can use to access your object store. note: this feature is available in web workers. syntax idbdatabase.transaction(storenames); idbdatabase.transaction(storenames, mode); parameters "durability" -- the durability constrints for the transction. valid values are: "default", "strict", and "relaxed". storenames the names of object stores that are in the scope of the new transaction, declared as an array of strings. specify only the object stores that you need to access. if you need to access only one object store, you can specify its name as a string. therefore the following lines are equivalent: var transaction = db.transaction(['my-st...
...bdatabase.transaction.) this is currently experimental, and can only be used if the dom.indexeddb.experimental pref is set to true in about:config. details optional dictionary of other settings, supported only by chrome: return value an idbtransaction object. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the close() method has previously been called on this idbdatabase instance. notfounderror an object store specified in in the storenames parameter has been deleted or removed. typeerror the value for the mode parameter is invalid. invalidaccesserror the function was called with an empty list of store names. example in this ex...
IDBFactory.cmp() - Web APIs
Web › API › IDBFactory › cmp
the cmp() method of the idbfactory interface compares two values as keys to determine equality and ordering for indexeddb operations, such as storing and iterating. note: this feature is available in web workers. note: do not use this method for comparing arbitrary javascript values, because many javascript values are either not valid indexeddb keys (booleans and objects, for example) or are treated as equivalent indexeddb keys (for example, since indexeddb ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric arrays are treated as equivalent). this throws an exception if either of the values is not a valid key. syntax var result = indexeddb.cmp(first, second); parameters first the first key to compare. second the second key to compare. ...
... example var a = 1; var b = 2; var result = window.indexeddb.cmp(a, b); console.log( "comparison results: " + result ); specifications specification status comment indexed database api 2.0the definition of 'cmp()' in that specification. recommendation indexed database api draftthe definition of 'cmp()' in that specification. recommendat...
IDBObjectStore.deleteIndex() - Web APIs
that this method synchronously modifies the idbobjectstore.indexnames property. note: this feature is available in web workers. syntax objectstore.deleteindex(indexname); parameters indexname the name of the existing index to remove. ...
...method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction mode callback. transactioninactiveerror occurs if the transaction this idbobjectstore belongs to is not active (e.g. has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror occurs if there is no index with the given name (case-sensitive) in the database. example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version...
IDBObjectStore.openCursor() - Web APIs
with a cursor. to determine if the add operation has completed successfully, listen for the results’s success event. note: this feature is available in web workers. syntax var request = objectstore.opencursor(); var request = objectstore.opencursor(query); var request = objectstore.opencursor(query, direction); parameters query optional a key or idbkeyrange to be queried. if a single valid key is passed, this will default to a range containing only that key. if nothing is passed, this will default to a key range that selects all the records in this object store. direction optional an idbcursordirection telling the cursor what direction to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which s...
...on optional an idbcursordirection telling the cursor what direction to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store: var transaction...
IDBObjectStore.openKeyCursor() - Web APIs
iterating through the keys of an object store with a cursor. to determine if the add operation has completed successfully, listen for the results’s success event. syntax var request = objectstore.openkeycursor(); var request = objectstore.openkeycursor(query); var request = objectstore.openkeycursor(query, direction); parameters query optional the key range to be queried. if a single valid key is passed, this will default to a range containing only that key. if nothing is passed, this will default to a key range that selects all the records in this object store. direction optional an idbcursordirection telling the cursor what direction to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which s...
...on optional an idbcursordirection telling the cursor what direction to travel. valid values are "next", "nextunique", "prev", and "prevunique". the default is "next". return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store: var transaction...
IDBRequest - Web APIs
ll asynchronous operations immediately return an idbrequest instance. each request has a readystate that is set to the 'pending' state; this changes to 'done' when the request is completed or fails. when the state is set to done, every request returns a result and an error, and an event is fired on the request. when the state is still pending, any attempt to access the result or error raises an invalidstateerror exception. in plain words, all asynchronous methods return a request object. if the request has been completed successfully, the result is made available through the result property and an event indicating success is fired at the request (idbrequest.onsuccess). if an error occurs while performing the operation, the exception is made available through the result property and an error ev...
...est</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits properties from eventtarget. idbrequest.error read only returns a domexception in the event of an unsuccessful request, indicating what went wrong. idbrequest.result read only returns the result of the request. if the the request failed and the result is not available, an invalidstateerror exception is thrown. idbrequest.source read only the source of the request, such as an idbindex or an idbobjectstore. if no source exists (such as when calling idbfactory.open), it returns null. idbrequest.readystate read only the state of the request. every request starts in the pending state. the state changes to done when the request completes successfully or when an error oc...
Basic concepts - Web APIs
of the stored value. it is found using a key path. an in-line key can be generated using a generator. after the key has been generated, it can then be stored in the value using the key path or it can also be used as a key. out-of-line key a key that is stored separately from the value being stored. key path defines where the browser should extract the key from in the object store or index. a valid key path can include one of the following: an empty string, a javascript identifier, or multiple javascript identifiers separated by periods or an array containing any of those. it cannot include spaces. value each record has a value, which could include anything that can be expressed in javascript, including boolean, number, string, date, object, array, regexp, undefined, and null. when an...
...identifiers separated by periods or an array containing any of those. it cannot include spaces. value each record has a value, which could include anything that can be expressed in javascript, including boolean, number, string, date, object, array, regexp, undefined, and null. when an object or array is stored, the properties and values in that object or array can also be anything that is a valid value. blobs and files can be stored, cf. specification . range and scope scope the set of object stores and indexes to which a transaction applies. the scopes of read-only transactions can overlap and execute at the same time. on the other hand, the scopes of writing transactions cannot overlap. you can still start several transactions with the same scope at the same time, but they jus...
MediaError.message - Web APIs
might be fixed. this is not simply a generic description of the mediaerror.code property's value, but instead goes deeper into the specifics of this particular error and its circumstances. if no specific details are available, this string is empty. ...
...this lets us see the behavior of the error event handler, which is received by an event handler we add to the <audio> element itself. ...
MediaRecorder.requestData() - Web APIs
recorder.requestdata() method (part of the mediarecorder api) is used to raise a dataavailable event containing a blob object of the captured media as it was when the method was called. this can then be grabbed and manipulated as you wish. ...
... example ... ...
MediaRecorder.resume() - Web APIs
the mediarecorder.resume() method (part of the mediarecorder api) is used to resume media recording when it has been previously paused. when the resume() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.state is "inactive", raise a dom invalidstate error and terminate these steps. if mediarecorder.state is not "inactive", continue to the next step. set mediarecorder.state to "recording". continue gathering data into the current blob. raise a resume event. ...
... example ... ...
Media Capabilities API - Web APIs
e). media capabilities dictionaries mediaconfiguration describes how video and audio configuration dictionaries must be configured, or defined, to be passed as a parameter of the mediacapabilities.encodinginfo() and mediacapabilities.decodinginfo() methods. it is inherited by the mediadecodingconfiguration and mediaencodingconfiguration dictionaries. ...
...consists of a media encoding type and a videoconfiguration or audioconfiguration dictionary. ...
Node.insertBefore() - Web APIs
Web › API › Node › insertBefore
node being inserted (the same as newnode) parentnode the parent of the newly inserted node. newnode the node to be inserted. referencenode the node before which newnode is inserted. if this is null, then newnode is inserted at the end of parentnode's child nodes. note: referencenode is not an optional parameter. you must explicitly pass a node or null. failing to provide it or passing invalid values may behave differently in different browser versions. return value returns the added child (unless newnode is a documentfragment, in which case the empty documentfragment is returned). example example 1 <div id="parentelement"> <span id="childelement">foo bar</span> </div> <script> // create the new node to insert let newnode = document.createelement("span") // get a reference t...
...: childelement is of type undefined let sp2 = undefined // non-existent node of id "childelement" parentdiv.insertbefore(newnode, sp2) // implicit dynamic cast to type node // end test case [ 2 ] // begin test case [ 3 ] : childelement is of type "undefined" ( string ) let sp2 = "undefined" // non-existent node of id "childelement" parentdiv.insertbefore(newnode, sp2) // generates "type error: invalid argument" // end test case [ 3 ] </script> example 2 <div id="parentelement"> <span id="childelement">foo bar</span> </div> <script> // create a new, plain <span> element let sp1 = document.createelement("span") // get the reference element let sp2 = document.getelementbyid("childelement") // get the parent element let parentdiv = sp2.parentnode // insert the new element into before sp2 p...
NodeIterator.detach() - Web APIs
the nodeiterator.detach() method is a no-op, kept for backward compatibility only. originally, it detached the nodeiterator from the set over which it iterates, releasing any resources used by the set and setting the iterator's state to invalid. once this method had been called, calls to other methods on nodeiterator would raise the invalid_state_err exception. ...
... calls to other methods on nodeiterator would raise the invalid_state_err exception. syntax nodeiterator.detach(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); nodeiterator.detach(); // detaches the iterator nodeiterator.nextnode(); // throws an invalid_state_err exception specifications specification status comment domthe definition of 'nodeiterator.detach' in that specification. living standard transformed in a no-op document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.detach' in that specification. obsolete initial definition. ...
PaintWorklet.registerPaint - Web APIs
let.registerpaint() method of the paintworklet interface registers a class programmatically generate an image where a css property expects a file. syntax registerpaint(name, class); parameters name the name of the worklet class to register. class a reference to the class that implements the worklet. return value undefined exceptions typeerror thrown when one of the arguments is invalid or missing. invalidmodificationerror thrown when the a worklet already exists with the specified name. examples the following shows registering an example worklet module. this should be in a separate js file. note that registerpaint() is called without a reference to paintworklet. the file itself is loaded through css.paintworklet.addmodule() (documented here on the parent class of paintwork...
...sterpaint('checkerboard', checkerboardpainter); the first step in using a paintworket is defining the paint worklet using the registerpaint() function, as done above. to use it, you register it with the css.paintworklet.addmodule() method: <script> css.paintworklet.addmodule('checkboardworklet.js'); </script> you can then use the paint() css function in your css anywhere an <image> value is valid. li { background-image: paint(checkerboard); } specifications specification status comment css painting api level 1the definition of 'paintworklet.registerpaint' in that specification. working draft initial definition. ...
ParentNode.querySelector() - Web APIs
od was called. if you need all the elements matching the selector list, use queryselectorall() instead. note: this method is implemented as document.queryselector(), documentfragment.queryselector() and element.queryselector(). syntax element = parentnode.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid compound selector list supported by the browser; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript al...
... string literals using these characters. see escaping special characters for more information. return value the first element that matches at least one of the specified selectors or null if no such element is found. note: if the specified selectors include a css pseudo-element, the returned value is always null. exceptions syntaxerror the syntax of the specified selectors string is not valid. specifications specification status comment domthe definition of 'parentnode.queryselector()' in that specification. living standard living standard selectors api level 2the definition of 'parentnode.queryselector()' in that specification. obsolete no change dom4the definition of 'parentnode.queryselector()' in that specification. o...
ParentNode.querySelectorAll() - Web APIs
called. if you need only a single result, consider the queryselector() method instead. note: this method is implemented as element.queryselectorall(), document.queryselectorall(), and documentfragment.queryselectorall() syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, ...
...g these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each descendant node that matches at least one of the specified selectors. note: if the specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. examples to obtain a nodelist of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with a class of either note or alert: var matches = document.queryselectorall("div.note, div.alert"); here, we get a list of <p> elements whose immediate parent element is a <div> with the class highl...
PayerErrors - Web APIs
the payererrors dictionary is used by the payment request api to indicate the presence of—and to explain how to correct—validation errors in the payer details. for each field in the payment information that fails validation, the payererrors object contains a string explaining the error. the payer details include the payer's name, phone number, and email address. properties email optional if present, this domstring is a string describing the validation error from which the payer's email address—as given by paymentresponse.payeremail—currently suffers. if this property is absent from the payererrors object, the email address passed validation. ...
... properties email optional if present, this domstring is a string describing the validation error from which the payer's email address—as given by paymentresponse.payeremail—currently suffers. if this property is absent from the payererrors object, the email address passed validation. name optional if this domstring is present in the object, the paymentresponse.payername property failed validation, and this string explains what needs to be corrected. if this property is absent, the paer name is fine phone optional if present, this string is an error message explaining why the payer's phone number (paymentresponse.payerphone) failed validation. this property is absent if the phone number passed validation. example specifications specification status comment ...
PaymentAddress.country - Web APIs
the country read-only property of the paymentaddress interface is a string identifying the address's country using the iso 3166-1 alpha-2 standard. the string is always in its canonical upper-case form. some examples of valid country values: "us", "gb", "cn", or "jp". syntax var paymentcountry = paymentaddress.country; value a domstring which contains the iso3166-1 alpha-2 code identifying the country in which the address is located, or an empty string if no country is available, which frequently can be assumed to mean "same country as the site owner." usage notes if the payment handler validates the address and determines that the value of country is invalid, a call to paymentrequestupdateevent.updatewith() will be made with a details object containing a shippingaddresserrors field. th...
... can be assumed to mean "same country as the site owner." usage notes if the payment handler validates the address and determines that the value of country is invalid, a call to paymentrequestupdateevent.updatewith() will be made with a details object containing a shippingaddresserrors field. that field contains an addresserrors-compliant object whose country property is a string indicating the validation error that occurred and, if possible, suggests how to fix it. specifications specification status comment payment request apithe definition of 'paymentaddress.country' in that specification. candidate recommendation initial definition. ...
PaymentRequest.PaymentRequest() - Web APIs
syntax var paymentrequest = new paymentrequest(methoddata, details, [options]); parameters methoddata contains an array of identifiers for the payment methods the merchant web site accepts and any associated payment method specific data. each item in the array contains the following fields: supportedmethods for early implementations of the spec, this was a sequence of identifiers for payment methods that the merchant website accepts. ...
...e payer's shipping address and submit it with the payment request. if you set this type to true, you should select an appropriate shippingtype. the default is false. shippingtype lets you specify how the user interface refers to shipping when the word 'shipping' isn't appropriate for your use case. for example, in english speaking countries you would say "pizza delivery" not "pizza shipping". valid values are "shipping", "delivery", and "pickup". quotation marks must be included. the default value is "shipping". return value a new paymentrequest object, configured for use as configured by the input parameters. examples the following example shows minimal functionality and focuses instead on showing the complete context of instantiating a paymentrequest object. var supportedinstrum...
RTCDataChannel: error event - Web APIs
celable no interface rtcerrorevent event handler property onerror the rtcerrorevent object provides details about the error that occurred; see that article for details. ...
...ples // strings for each of the sctp cause codes found in rfc // 4960, section 3.3.10: // https://tools.ietf.org/html/rfc4960#section-3.3.10 const sctpcausecodes = [ "no sctp error", "invalid stream identifier", "missing mandatory parameter", "stale cookie error", "sender is out of resource (i.e., memory)", "unable to resolve address", "unrecognized sctp chunk type received", "invalid mandatory parameter", "unrecognized parameters", "no user data (sctp data chunk has no data)", "cookie received while shutting down", "restart of an association with new addresses", "user-initiated abort", "protocol violation" ]; dc.addeventlistener("error", ev => { const err = ev.error; console.error("webrtc error: ", err.message); // handle specific error detail types sw...
RTCIceCandidate.RTCIceCandidate() - Web APIs
alized as follows: each member of the rtcicecandidateinit object is initialized to the value of the property by the same name from rtcicecandidateinit. this includes the candidate, sdpmid, sdpmlineindex, and usernamefragment properties. the candidate string (which is sdp text) is parsed; each property found is stored in the corresponding field in the rtcicecandidate. if any of the fields is invalid, parsing of the string silently aborts without throwing an exception. the default value of candidate is the empty string, which indicates that the candidate is an "end-of-candidates" message. the following fields are initialized to null if they are not included in the rtcicecandidate.candidate property: foundation, component, priority , ip, protocol, port, type, tcptype, relatedaddress, and rela...
...ion, component, priority , ip, protocol, port, type, tcptype, relatedaddress, and relatedport. note: parsing of the candidate string is performed using the candidate-attribute grammar from the webrtc specification. exceptions typeerror the specified rtcicecandidateinit has values of null in both the sdpmid and sdpmlineindex properties. usage notes this constructor does not do complete validation of the specified candidateinfo object or string. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate()' in that specification. candidate recommendation initial definition. ...
RTCIceTransportState - Web APIs
broken the connection, but that should resolve itself automatically without your code having to take any action. see the disconnected state for additional details. "failed" the rtcicetransport has finished the gathering process, has received the "no more candidates" notification from the remote peer, and has finished checking pairs of candidates, without successfully finding a pair that is both valid and for which consent can be obtained. this is a terminal state, indicating that the connection cannot be achieved or maintained. "closed" the transport has shut down and is no longer responding to stun requests. usage notes if an ice restart occurs, the candidate gathering and connectivity check process is started over again; this will cause a transition from the "connected" state if the re...
...ve its own scenarios that can trigger the "disconnected" state. possible causes include: the network interface being used by the connection has gone offline. stun requests being sent to the remote device have gone unanswered repeatedly. the "disconnected" state can also occur when the transport has finished checking all existing candidate pairs and has not found a pair that will work—or a valid pair was found but rejected due to consent to use the pair being denied. in this scenario, the transport is still continuing to gather candidates, and/or to wait for candidates to be sent by the remote peer. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicerole' in that specification. candidate re...
RTCInboundRtpStreamStats - Web APIs
sender. this is an indicator of how often the stream has lagged, requiring frames to be skipped in order to catch up. this value is only available for video streams. framesdecoded a long integer value indicating the total number of frames of video which have been correctly decoded so far for this media source. this is the number of frames that would have been rendered if none were dropped. only valid for video streams. lastpacketreceivedtimestamp a domhighrestimestamp indicating the time at which the last packet was received for this source. the timestamp property, on the other hand, indicates the time at which the statistics object was generated. nackcount an integer value indicating the total number of negative acknolwedgement (nack) packets this receiver has sent. packetsduplicated a...
... of times the receiver has notified the sender that some amount of encoded video data for one or more frames has been lost, using picture loss indication (pli) packets. this is only available for video streams. qpsum a 64-bit value containing the sum of the qp values for every frame decoded by this rtp receiver. you can determine the average qp per frame by dividing this value by framesdecoded. valid only for video streams. receiverid a string indicating which identifies the rtcaudioreceiverstats or rtcvideoreceiverstats object associated with the stream's receiver. this id is stable across multiple calls to getstats(). remoteid a string which identifies the rtcremoteoutboundrtpstreamstats object that provides statistics for the remote peer for this same ssrc. this id is stable across mul...
RTCPeerConnection.addIceCandidate() - Web APIs
he ice agent. the promise does not receive any input parameters. exceptions when an error occurs while attempting to add the ice candidate, the promise returned by this method is rejected, returning one of the errors below as the name attribute in the specified domexception object passed to the rejection handler. typeerror the specified candidate's sdpmid and sdpmlineindex are both null. invalidstateerror the rtcpeerconnection currently has no remote peer established (remotedescription is null). operationerror this can happen for a number of reasons: the value specified for sdpmid is non-null and doesn't match the media description id of any media description included within the remotedescription. the specified value of sdpmlineindex is greater than or equal to the number of med...
...oesn't match the media description id of any media description included within the remotedescription. the specified value of sdpmlineindex is greater than or equal to the number of media descriptions included in the remote description. the specified ufrag doesn't match the ufrag field in any of the remote descriptions being considered. one or more of the values in the candidate string are invalid or could not be parsed. attempting to add the candidate fails for any reason. examples this code snippet shows how to signal ice candidates across an arbitrary signaling channel. // this example assumes that the other peer is using a signaling channel as follows: // // pc.onicecandidate = event => { // if (event.candidate) { // signalingchannel.send(json.stringify({ice: event.can...
RTCPeerConnection.peerIdentity - Web APIs
a domstring identifying the remote peer. once this promise resolves successfully, the resulting identity is the target peer identity and cannot change for the duration of the connection. syntax var identity = rtcpeerconnection.peeridentity; value a javascript promise which resolves to an rtcidentityassertion that describes the remote peer's identity. if an error occcurs while attempting to validate an incoming identity assertion (that is, the information describing a peer's identity), the promise is rejected. if there isn't already a target peer identity, peeridentity is set to a newly created promise and the process begins again, until the process succeeds or no further attempts to authenticate occur. note: the promise returned by setremotedescription() cannot resolve until any target...
... (that is, the information describing a peer's identity), the promise is rejected. if there isn't already a target peer identity, peeridentity is set to a newly created promise and the process begins again, until the process succeeds or no further attempts to authenticate occur. note: the promise returned by setremotedescription() cannot resolve until any target peer identity that's been set is validated. if the identity hasn't been validated yet, the promise returned by setremotedescription() will be rejected. if there's no target peer identity, setremotedescription() doesn't need to wait for validation to occur before it resolves. example in this example, a function, getidentityassertion(), is created which asynchronously waits for the peer's identity to be verified, then returns the ide...
RTCRtpSender.setParameters() - Web APIs
parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters(). return value a promise that resolves when the rtcrtpsender.track property is updated with the given parameters. exceptions if an error occurs, the returned promise is rejected with the appropriate exception from the list below. invalidmodificationerror one of the following problems was detected: the number of encodings specified in the parameters object's encodings property does not match the number of encodings currently listed for the rtcrtpsender. you cannot change the number of encoding options once the sender has been created. the order of the specified encodings has changed from the current list's order. an attem...
...n the parameters object's encodings property does not match the number of encodings currently listed for the rtcrtpsender. you cannot change the number of encoding options once the sender has been created. the order of the specified encodings has changed from the current list's order. an attempt has been made to alter a property that cannot be changed after the sender is first created. invalidstateerror the transceiver of which the rtcrtpsender is a part is not running, or has no parameters to set. operationerror any error condition which occurs that isn't covered by one of the other error codes results in an operationerror. rangeerror the value specified for scaleresolutiondownby is less than 1.0, which would result in scaling up rather than down, which is not allowed; or one or ...
RTCRtpTransceiver.setCodecPreferences() - Web APIs
eference, each providing the parameters for one of the transceiver's supported codecs. if codecs is empty, the codec configurations are all returned to the user agent's defaults. note: any codecs not included in codecs will not be considered during the process of negotiating a connection. this lets you prevent the use of codecs you don't wish to use. return value undefined exceptions invalidaccesserror the codecs list includes one or more codecs which are not supported by the transceiver. usage notes getting a list of supported codecs you can only include in the codecs list codecs which the transceiver actually supports. that means that either the associated rtcrtpsender or the rtcrtpreceiver needs to support every codec in the list. if any unsupported codecs are listed, the bro...
...cs list includes one or more codecs which are not supported by the transceiver. usage notes getting a list of supported codecs you can only include in the codecs list codecs which the transceiver actually supports. that means that either the associated rtcrtpsender or the rtcrtpreceiver needs to support every codec in the list. if any unsupported codecs are listed, the browser will throw an invalidaccesserror exception when you call this method. a good approach to setting codec preferences is to first get the list of codecs that are actually supported, then modify that list to match what you want. pass the altered list into setcodecpreferences() to specify your preferences. to determine which codecs are supported by the transceiver, call the sender's getcapabilities() and the receiver's g...
SVGAngle - Web APIs
Web › API › SVGAngle
a read-only attribute, or when the object itself is read-only. valueasstring the value as a domstring value, in the units expressed by unittype. setting this attribute will cause value, valueinspecifiedunits, and unittype to be updated automatically to reflect this setting. exceptions on setting: a domexception with code syntax_err is raised if the assigned string cannot be parsed as a valid <angle>. a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. methods newvaluespecifiedunits reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object. exceptions: a domexception with code not_supported_err is r...
...n_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. methods newvaluespecifiedunits reset the value as a number with an associated unittype, thereby replacing the values for all of the attributes on the object. exceptions: a domexception with code not_supported_err is raised if unittype is svg_angletype_unknown or not a valid unit type constant (one of the other svg_angletype_* constants defined on this interface). a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only. converttospecifiedunits preserve the same underlying stored value, but reset the stored unit identifier to the given unittype. object attributes unit...
SVGFETurbulenceElement - Web APIs
nt-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeturbulenceelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants turbulence types name value description svg_turbulence_type_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_turbulence_type_fractalnoise 1 corresponds to the fractalnoise value. svg_turbulence_type_turbulence 2 corresponds to turbulence value. stitch options name value description svg_stitchtype_unknown 0 the type is not one of pre...
... new value of this type or to attempt to switch an existing value to this type. svg_turbulence_type_fractalnoise 1 corresponds to the fractalnoise value. svg_turbulence_type_turbulence 2 corresponds to turbulence value. stitch options name value description svg_stitchtype_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_stitchtype_stitch 1 corresponds to the stitch value. svg_stitchtype_nostitch 2 corresponds to nostitch value. properties this interface also inherits properties from its parent interface, svgelement, and also implements properties of svgfilterprimitivesta...
SVGMarkerElement - Web APIs
normative document svg 1.1 (2nd edition) constants orientation name value description svg_marker_orient_unknown 0 the marker orientation is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_marker_orient_auto 1 attribute orient has value 'auto'. svg_marker_orient_angle 2 attribute orient has an angle value. units ...
...ue 'auto'. svg_marker_orient_angle 2 attribute orient has an angle value. units name value description svg_markerunits_unknown 0 the marker unit type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_markerunits_userspaceonuse 1 attribute markerunits is 'userspaceonuse'. svg_markerunits_strokewidth 2 attribute markerunits is 'strokewidth'. properties ...
SVGPreserveAspectRatio - Web APIs
= 9 svg_preserveaspectratio_xmaxymax = 10 svg_meetorslice_unknown = 0 svg_meetorslice_meet = 1 svg_meetorslice_slice = 2 normative document svg 1.1 (2nd edition) constants name value description svg_preserveaspectratio_unknown 0 the enumeration was set to a value that is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_preserveaspectratio_none 1 corresponds to value none for attribute preserveaspectratio. svg_preserveaspectratio_xminymin 2 corresponds to value xminymin for attribute preserveaspectratio. svg_preserveaspectratio_xmidymin 3 corresponds to value xmid...
...lue xminymax for attribute preserveaspectratio. svg_preserveaspectratio_xmidymax 9 corresponds to value xmidymax for attribute preserveaspectratio. svg_preserveaspectratio_xmaxymax 10 corresponds to value xmaxymax for attribute preserveaspectratio. svg_meetorslice_unknown 0 the enumeration was set to a value that is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_meetorslice_meet 1 corresponds to value meet for attribute preserveaspectratio. svg_meetorslice_slice 2 corresponds to value slice for attribute preserveaspectratio. properties name type description align unsigned short t...
SVGTextPathElement - Web APIs
="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextpathelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants method types name value description textpath_methodtype_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. textpath_methodtype_align 1 corresponds to the value align. textpath_methodtype_stretch 2 corresponds to the value stretch. spacing types name value description textpath_spacingtype_unknown 0 the type is not one of predefined typ...
...to define a new value of this type or to attempt to switch an existing value to this type. textpath_methodtype_align 1 corresponds to the value align. textpath_methodtype_stretch 2 corresponds to the value stretch. spacing types name value description textpath_spacingtype_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. textpath_spacingtype_auto 1 corresponds to the value auto. textpath_spacingtype_exact 2 corresponds to the value exact. properties this interface also inherits properties from its parent interface, svgtextcontentelement, and also implements properties of svgu...
SVGUseElement - Web APIs
the width attribute of the given element. svguseelement.height read only an svganimatedlength corresponding to the height attribute of the given element. svguseelement.instanceroot read only an svgelement corresponding to the instance root of the given element, which is a direct child of the elements shadow root. ...
... methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement and implements methods from svgurireference. ...
SubtleCrypto.unwrapKey() - Web APIs
ivekey: the key may be used in deriving a new key. derivebits: the key may be used in deriving bits. wrapkey: the key may be used to wrap a key. unwrapkey: the key may be used to unwrap a key return value result is a promise that fulfills with the unwrapped key as a cryptokey object. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when the unwrapping key is not a key for the requested unwrap algorithm or if the cryptokey.usages value of that key doesn't contain unwrap. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for encryption or wrapping. syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private. typeerror raised ...
... the unwrapping key is not a key for the requested unwrap algorithm or if the cryptokey.usages value of that key doesn't contain unwrap. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for encryption or wrapping. syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private. typeerror raised when trying to use an invalid format. supported algorithms the unwrapkey() method supports the same algorithms as the wrapkey() method. examples note: you can try the working examples on github. unwrapping a "raw" key in this example we unwrap an aes-gcm symmetric key. the key was exported in "raw" format and encrypted using the aes-kw algorithm, with a key derived from a password. to unwrap, we ask the user for the...
TextRange - Web APIs
Web › API › TextRange
xtrange.scrollintoview() scroll the range to the visible range (top or bottom). it can be used as an alternative to element.scrollintoview in the lower version of ie. textrange.select() select the current range (i.e. the blue selection seen by the user). textrange.setendpoint() sets the end point of the current range based on the bounds of other textrange. example the following example is valid under ie9. the example gets the textrange through document.selection, and sets the specified element to be selected. ie9 supports the standard alternative range. var range = document.selection.createrange(); var element = document.getelementbyid("test"); range.movetoelementtext(element); range.select(); // selected "sometexttobeselected" <!doctype html> <html> <head> <title>textrange example<...
...ts the standard alternative range. var range = document.selection.createrange(); var element = document.getelementbyid("test"); range.movetoelementtext(element); range.select(); // selected "sometexttobeselected" <!doctype html> <html> <head> <title>textrange example</title> </head> <body> <p id="test">sometexttobeselected</p> </body> </html> notes use textrange to operate the selection valid only under ie9. the selection interface should be used first, if the browser allows it. document.selection property returns a non-standard selection object, and the selection.createrange() method creates a textrange object consistent with the currently selection. var sel = document.selection; var range = sel.createrange(); alert(range.text); // output plaintext of the selection note that the ...
VideoConfiguration - Web APIs
apabilities api is used to define the video file being tested when calling the mediacapabilities methods encodinginfo() and decodinginfo() to determine whether or not the described video configuration is supported, and how smoothly and how smoooth and power-efficient it can be handled. properties the videoconfiguration dictionary is made up of five video properties, including: contenttype: a valid video mime type. see our web video codec guide for types which may be supported. width: the width of the video. height: the height of the video. bitrate: the number of bits used to encode one second of the video file. framerate: the number of frames making up one second of video playback. examples // create media configuration to be tested const mediaconfig = { type : 'file', // see m...
...: the height of the video. bitrate: the number of bits used to encode one second of the video file. framerate: the number of frames making up one second of video playback. examples // create media configuration to be tested const mediaconfig = { type : 'file', // see mediadecodingconfiguration and mediaencodingconfiguration video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; specifications specification status comment media capabilitiesthe definition of 'videoconfiguration' in that specifi...
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
p of three vertices. count a glsizei specifying the number of elements to be rendered. type a glenum specifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying an offset in the element array buffer. must be a valid multiple of the size of the given type. instancecount a glsizei specifying the number of instances of the set of elements to execute. return value none. exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count or instancecount are negative, a gl.
...ultiple of the size of the given type. instancecount a glsizei specifying the number of instances of the set of elements to execute. return value none. exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count or instancecount are negative, a gl.invalid_value error is thrown. examples gl.drawelementsinstanced(gl.points, 2, gl.unsigned_short, 0, 4); specifications specification status comment webgl 2.0the definition of 'drawelementsinstanced' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldrawelementsinstanced' in that specification. standard ...
WebGL2RenderingContext.isSampler() - Web APIs
examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); // ... gl.issampler(sampler); specifications specification status comment webgl 2.0the definition of 'issampler' in that specification. ...
... examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); // ... gl.issampler(sampler); specifications specification status comment webgl 2.0the definition of 'issampler' in that specification. ...
WebGL2RenderingContext.isTransformFeedback() - Web APIs
examples gl must be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); // ... ...
... examples gl must be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); // ... ...
WebGL2RenderingContext.isVertexArray() - Web APIs
examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... gl.isvertexarray(vao); specifications specification status comment webgl 2.0the definition of 'isvertexarray' in that specification. editor's draft initial definition. ...
... examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... gl.isvertexarray(vao); specifications specification status comment webgl 2.0the definition of 'isvertexarray' in that specification. editor's draft initial definition. ...
WebGLRenderingContext.getProgramInfoLog() - Web APIs
when a webglprogram object is initially created, its information log will be a string of length 0. ...
...when a webglprogram object is initially created, its information log will be a string of length 0. ...
WebGLRenderingContext.getUniformLocation() - Web APIs
u can't use this function to get the location of any uniforms starting with the reserved string "gl_", since those are internal to the webgl layer. the possible values correspond to the uniform names returned by getactiveuniform; see that function for specifics on how declared uniforms map to uniform location names. additionally, for uniforms declared as arrays, the following names are also valid: the uniform name without the [0] suffix. e.g. the location returned for arrayuniform is equivalent to the one for arrayuniform[0]. the uniform name indexed with an integer. e.g. the location returned for arrayuniform[2] would point directly to the third entry of the arrayuniform uniform. return value a webgluniformlocation value indicating the location of the named variable, if i...
...ory at which the uniform variable is located. with this value in hand, you can call other webgl methods to access the value of the uniform variable. the webgluniformlocation type is compatible with the glint type when specifying the index or location of a uniform attribute. errors the following errors may occur; to check for errors after getuniformlocation() returns, call geterror(). gl_invalid_value the program parameter is not a value or object generated by webgl. gl_invalid_operation the program parameter doesn't correspond to a glsl program generated by webgl, or the specified program hasn't been linked successfully. example in this example, taken from the animatescene() method in the article a basic 2d webgl animation example, obtains the locations of three uniforms from the ...
WebGLRenderingContext.makeXRCompatible() - Web APIs
arameters none. return value a promise which successfully resolves once the webgl context is ready to be used for rendering webxr content. exceptions this method doesn't throw traditional exceptions; instead, the promise rejects with one of the following errors as the value passed into the rejection handler: aborterror switching the context over to the webxr-compatible context failed. invalidstateerror the webgl context has been lost or there is no available webxr device. usage notes because makexrcompatible() may involve replacing the underlying webgl context with a new one that uses the new rendering hardware, the existing contents of the context may be lost and, therefore, would need to be re-rendered. this is why the webglcontextlost and webglcontextrestored events are used: t...
...r the current scene. ...
WebGLRenderingContext.readPixels() - Web APIs
.unsigned_int_5_9_9_9_rev pixels an arraybufferview object to read data into. the array type must match the type of the type parameter. uint8array for gl.unsigned_byte. uint16array for gl.unsigned_short_5_6_5, gl.unsigned_short_4_4_4_4, or gl.unsigned_short_5_5_5_1. float32array for gl.float. dstoffset optional offset. defaults to 0. return value none. ...
...nto. the array type must match the type of the type parameter. uint8array for gl.unsigned_byte. uint16array for gl.unsigned_short_5_6_5, gl.unsigned_short_4_4_4_4, or gl.unsigned_short_5_5_5_1. float32array for gl.float. dstoffset optional offset. defaults to 0. return value none. exceptions a gl.invalid_enum error is thrown if format or type is not an accepted value. a gl.invalid_operation error is thrown if type is gl.unsigned_short_5_6_5 and format is not gl.rgb. type is gl.unsigned_short_4_4_4_4 and format is not gl.rgba. type does not match the typed array type of pixels. a gl.invalid_framebuffer_operation error is thrown if the currently bound framebuffer is not framebuffer complete. examples var canvas = document.getelementbyid('canvas'); var gl...
Taking still photos with WebRTC - Web APIs
drawimage(video, 0, 0, width, height); var data = canvas.todataurl('image/png'); photo.setattribute('src', data); } else { clearphoto(); } } as is the case any time we need to work with the contents of a canvas, we start by getting the 2d drawing context for the hidden canvas. then, if the width and height are both non-zero (meaning that there's at least potentially valid image data), we set the width and height of the canvas to match that of the captured frame, then call drawimage() to draw the current frame of the video into the context, filling the entire canvas with the frame image. note: this takes advantage of the fact that the htmlvideoelement interface looks like an htmlimageelement to any api that accepts an htmlimageelement as a parameter, with the vid...
...ent interface looks like an htmlimageelement to any api that accepts an htmlimageelement as a parameter, with the video's current frame presented as the image's contents. once the canvas contains the captured image, we convert it to png format by calling htmlcanvaselement.todataurl() on it; finally, we call photo.setattribute() to make our captured still box display the image. if there isn't a valid image available (that is, the width and height are both 0), we clear the contents of the captured frame box by calling clearphoto(). fun with filters since we're capturing images from the user's webcam by grabbing frames from a <video> element, we can very easily apply filters and fun effects to the video. as it turns out, any css filters you apply to the element using the filter property affec...
WebRTC API - Web APIs
rtcsessiondescriptioncallback the rtcsessiondescriptioncallback is passed into the rtcpeerconnection object when requesting it to create offers or answers. identity and security these apis are used to manage user identity and security, in order to authenticate the user for a connection. rtcidentityprovider enables a user agent is able to request that an identity assertion be generated or validated. rtcidentityassertion represents the identity of the remote peer of the current connection. if no peer has yet been set and verified this interface returns null. once set it can't be changed. rtcidentityproviderregistrar registers an identity provider (idp). rtcidentityevent represents an identity assertion generated by an identity provider (idp). this is usually for an rtcpeerconnectio...
...ty provider (idp). rtcidentityevent represents an identity assertion generated by an identity provider (idp). this is usually for an rtcpeerconnection. the only event sent with this type is identityresult. rtcidentityerrorevent represents an error associated with the identity provider (idp). this is usually for an rtcpeerconnection. two events are sent with this type: idpassertionerror and idpvalidationerror. rtccertificate represents a certificate that an rtcpeerconnection uses to authenticate. telephony these interfaces and events are related to interactivity with public-switched telephone networks (ptsns). they're primarily used to send tone dialing sounds—or packets representing those tones—across the network to the remote peer. interfaces rtcdtmfsender manages the encodin...
Window.open() - Web APIs
Web › API › Window › open
this only works from the same parent, ie. if the current window is the opener of the window you try to get an handle on. otherwise the call to window.open() will just create a new window. to open a new window on every call of window.open(), use the special value _blank for windowname. note on the use of window.open() to reopen an existing window with name windowname : this functionality is not valid for all browsers and more with variable conditions. firefox (50.0.1) functions as described: from the same domain+port reopen with same name will access the previously created window. google chrome (55.0.2883.87 m ) on the other hand will do it only from the same parent (as if the window was created dependent, which is the "opener"). this is a wide limitation and generates unbelievable complexity...
...javascript:" links will interfere with the process of indexing webpages by search engines. "javascript:" links interfere with assistive technologies (e.g. voice browsers) and several web-aware applications (e.g. pdas and mobile browsers). "javascript:" links also interfere with "mouse gestures" features implemented in browsers. protocol scheme "javascript:" will be reported as an error by link validators and link checkers. further reading: top ten web-design mistakes of 2002, 6. javascript in links, jakob nielsen, december 2002 links & javascript living together in harmony, jeff howden, february 2002 comp.lang.javascript newsgroup discussion faq on "javascript:" links never use <a href="#" onclick="window.open(...);"> such pseudo-link also breaks accessibility of links. always use ...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
to the top of your script: /*\ |*| |*| polyfill which enables the passage of arbitrary arguments to the |*| callback functions of javascript timers (html5 standard syntax). |*| |*| https://developer.mozilla.org/docs/dom/window.setinterval |*| |*| syntax: |*| var timeoutid = window.settimeout(func, delay[, arg1, arg2, ...]); |*| var timeoutid = window.settimeout(code, delay); |*| var intervalid = window.setinterval(func, delay[, arg1, arg2, ...]); |*| var intervalid = window.setinterval(code, delay); |*| \*/ (function() { settimeout(function(arg1) { if (arg1 === 'test') { // feature test is passed, no need for polyfill return; } var __nativest__ = window.settimeout; window.settimeout = function(vcallback, ndelay /*, argumenttopass1, argumenttopass2, etc. ...
...indow.settimeout=f(window.settimeout); window.setinterval=f(window.setinterval); })(function(f){return function(c,t){ var a=[].slice.call(arguments,2);return f(function(){c instanceof function?c.apply(this,a):eval(c)},t)} }); </script><![endif]--> workarounds another possibility is to use an anonymous function to call your callback, but this solution is a bit more expensive. example: var intervalid = settimeout(function() { myfunc('one', 'two', 'three'); }, 1000); the above example can also be written with the help of an arrow function: var intervalid = settimeout(() => { myfunc('one', 'two', 'three'); }, 1000); yet another possibility is to use function's bind. example: settimeout(function(arg1){}.bind(undefined, 10), 1000); the "this" problem when you pass a method to settimeout...
Using XMLHttpRequest - Web APIs
to stringify a submitted data, use the previous pure-ajax example. note also that, although in this example there are some file <input> fields, when you submit a form through the formdata api you do not need to use the filereader api also: files are automatically loaded and uploaded. ...
...estring() + "!"); }); if you want to know if the current page has changed, please read the article about document.lastmodified. cross-site xmlhttprequest modern browsers support cross-site requests by implementing the cross-origin resource sharing (cors) standard. as long as the server is configured to allow requests from your web application's origin, xmlhttprequest will work. otherwise, an invalid_access_err exception is thrown. bypassing the cache a cross-browser compatible approach to bypassing the cache is appending a timestamp to the url, being sure to include a "?" or "&" as appropriate. for example: http://foo.com/bar.html -> http://foo.com/bar.html?12345 http://foo.com/bar.html?foobar=baz -> http://foo.com/bar.html?foobar=baz&12345 as the local cache is indexed by url, this cau...
XPathResult - Web APIs
resents the results generated by evaluating an xpath expression within the context of a given node. since xpath expressions can result in a variety of result types, this interface makes it possible to determine and handle the type and value of the result. properties xpathresult.booleanvalueread only a boolean representing the value of the result if resulttype is boolean_type. xpathresult.invaliditeratorstateread only signifies that the iterator has become invalid. it is true if resulttype is unordered_node_iterator_type or ordered_node_iterator_type and the document has been modified since this result was returned. xpathresult.numbervalueread only a number representing the value of the result if resulttype is number_type. xpathresult.resulttyperead only a number code representing...
...the result if resulttype is string_type. methods xpathresult.iteratenext() if the result is a node set, this method iterates over it and returns the next node from it or null if there are no more nodes. xpathresult.snapshotitem() returns an item of the snapshot collection or null in case the index is not within the range of nodes. unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated. constants result type defined constant value description any_type 0 a result set containing whatever type naturally results from evaluation of the expression. note that if the result is a node-set then unordered_node_iterator_type is always the resulting type. number_type 1 a resu...
ARIA Test Cases - Accessibility
is given. documenting and filing bugs review the information on how to file a bug on an aria implementation. when documenting an issue, please also list it in the relevant compatibility table below. when possible provide a link to the bug in the database so that its status can be reviewed. widget test cases alert simple alert complex alert real alert example with aria-required and aria-invalid -- type in a email address without an at sign to test the alert expected at behavior: a screen reader or screen magnifier must speak an alert when it becomes visible. a screen magnifier should move the current view to the alert or open a new panel with the alert information optional, but desired: if there are widgets within the alert, their role and any keyboard mnemonic (accesskey) should...
...when pressing space, new state should be announced automatically. markup used: role="checkbox" aria-checked="true" or "false" notes: need te...
Cognitive accessibility - Accessibility
e alerted to the error and informed of what is wrong. if there is client side error detection, observe the following guidelines to make the error as effective as possible when conveyed to the user: the error must be described in the text. ensure that the error message is as specific as possible. provide text to identify incomplete required fields and text descriptions if a value entered is invalid. if the error prevented a form submission, focus on the error. if multiple errors are present, provide a summary, with each error linking to the related input. include text along with use of icons, images, color and so on. some people have difficulty understanding the meaning of icons and other visual cues. other people may have difficulty understanding the text version of your error message.
...form with text instructions on how to operate it. include labels or instructions when users need to input information, using the <label>, <fieldset>, and <legend> elements to do so. labels should be descriptive and positioned close to the input they relate to. when requiring a specific format for input, provide an example formatted in the proper way. additionally, consider performing server-side validation to help format input data, to aid in the ease of user input. if a form control is required, indicate it both visually and via code. if a form control changes context, describe what will happen in a way that the user will understand it before they cause the context change to happen. error suggestion provide suggested input to the user if an input error is automatically detected and ...
:optional - CSS: Cascading Style Sheets
Web › CSS › :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. note: the :required pseudo-class selects required form fields. syntax :optional examples see :invalid for an example. accessibility concerns if a form contains optional <input>s, required inputs should be indicated using the required attribute. this will ensure that people navigating with the aid of assistive technology such as a screen reader will be able to understand which inputs need valid content to ensure a successful form submission. required inputs should also be indicated visually, us...
... selectors level 4the definition of ':optional' in that specification. working draft no change. ...
:required - CSS: Cascading Style Sheets
Web › CSS › :required
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. note: the :optional pseudo-class selects optional form fields. syntax :required examples see :invalid for an example. accessibility concerns mandatory <input>s should have the required attribute applied to them. this will ensure that people navigating with the aid of assistive technology such as a screen reader will be able to understand which inputs need valid content to ensure a successful submission. if the form also contains optional inputs, required inputs should...
... selectors level 4the definition of ':required' in that specification. working draft no change. ...
src - CSS: Cascading Style Sheets
Web › CSS › @font-face › src
the src css descriptor of the @font-face rule specifies the resource containing font data. it is required for the @font-face rule to be valid. syntax /* <url> values */ src: url(https://somewebsite.com/path/to/font.woff); /* absolute url */ src: url(path/to/font.woff); /* relative url */ src: url(path/to/font.woff) format("woff"); /* explicit format */ src: url('path/to/font.woff'); /* quoted url */ src: url(path/to/svgfont.svg#example); /* fragment identifying font */ /* <font-face-name> values */ src: local(font); /* unquoted name */ src: local(some font); /* name containing space */ src: local("font"); /* quoted name */ /* multiple items */ src: local(font), url(path/to/font.svg) format("svg"), url(path/to...
...quely identifies a single font face within a larger family. the name can optionally be enclosed in quotes. description the value of this descriptor is a prioritized, comma-separated list of external references or locally-installed font face names. when a font is needed the user agent iterates over the set of references listed using the first one it can successfully activate. fonts containing invalid data or local font faces that are not found are ignored and the user agent loads the next font in the list. as with other urls in css, the url may be relative, in which case it is resolved relative to the location of the style sheet containing the @font-face rule. in the case of svg fonts, the url points to an element within a document containing svg font definitions. if the element reference is...
Grid template areas - CSS: Cascading Style Sheets
redefining the grid using media queries as our layout is now contained in one part of the css, this makes it very easy to make changes at di...
... redefining the grid using media queries as our layout is now contained in one part of the css, this makes it very easy to make changes at different breakpoints. ...
Using CSS gradients - CSS: Cascading Style Sheets
kwise direction. negative angles run in the counterclockwise direction. declaring colors & creating effects all css gradient types are a range of position-dependent colors. the colors produced by css gradients can vary continuously with position, producing smooth color transitions. it is also possible to create bands of solid colors, and hard transitions between two colors. the following are valid for all gradient functions: using more than two colors you don't have to limit yourself to two colors—you may use as many as you like! by default, colors are evenly spaced along the gradient. <div class="auto-spaced-linear-gradient"></div> div { width: 120px; height: 120px; } .auto-spaced-linear-gradient { background: linear-gradient(red, yellow, blue, orange); } positionin...
...color wheels, but they can also be used for creating checker boards and other intersting effects. the conic-gradient syntax is similar to the radial-gradient syntax, but the color-stops are placed around a gradient arc, the circumference of a circle, rather than on the gradient line emerging from the center of the gradient, and the color-stops are percentages or degrees: absolute lengths are not valid. in a radial gradient, the colors transition from the center of an ellipse, outward, in all directions. with conic gradients, the colors transition as as if spun around the center of a circle, starting at the top and going clockwise. similar to radial gradients, you can position the center of the gradient. similar to linear gradients, you can change the gradient angle. a basic conic gradient ...
CSS values and units - CSS: Cascading Style Sheets
ed. in the css specifications, values that can be defined by the web developer, like keyframe animations, font-family names, or grid areas are listed as a <custom-ident>, <string>, or both. when both quoted and unquoted user defined text values are permitted, the specification will list <custom-ident> | <string>, meaning quotes are optional, such as is the case with animation names: @keyframe validident { /* keyframes go here */ } @keyframe 'validstring' { /* keyframes go here */ } some text values are not valid if encompassed in quotes. for example, the value of grid-area can be a <custom-ident>, so if we had a grid area named content we would use it without quotes: .item { grid-area: content; } in comparison, a data type that is a <string>, such as a string value of the content ...
... not have a decimal point with a fractional component, for example 0.255, 128 or -1.2. numbers may also be preceded by a + or - symbol. dimensions a <dimension> is a <number> with a unit attached to it, for example 45deg, 100ms, or 10px. the attached unit identifier is case insensitive. there is never a space or any other characters between a the number and the unit identifier: i.e. 1 cm is not valid. css uses dimensions to specify: <length> (distance units) <angle> <time> <frequency> <resolution> these are all covered in subsections below. distance units where a distance unit, also known as a length, is allowed as a value for a property, this is described as the <length> type. there are two types of lengths in css: relative and absolute. relative length units specify a length in...
Mozilla CSS extensions - CSS: Cascading Style Sheets
sequence ::-moz-pagebreak ::-moz-pagecontent :-moz-placeholderobsolete since gecko 51 ::-moz-placeholderdeprecated since gecko 51 ::-moz-progress-bar ::-moz-range-progress ::-moz-range-thumb ::-moz-range-track :-moz-read-only :-moz-read-write s ::-moz-scrolled-canvas ::-moz-scrolled-content ::-moz-scrolled-page-sequence ::-moz-selectiondeprecated since gecko 62 :-moz-submit-invalid :-moz-suppressed ::-moz-svg-foreign-content t ::-moz-table ::-moz-table-cell ::-moz-table-column ::-moz-table-column-group ::-moz-table-outer ::-moz-table-row ::-moz-table-row-group :-moz-tree-cell :-moz-tree-cell-text :-moz-tree-cell-text(hover) :-moz-tree-checkbox :-moz-tree-column :-moz-tree-drop-feedback :-moz-tree-image :-moz-tree-indentation :-moz-tree-line :-moz-tr...
...column-group ::-moz-table-outer ::-moz-table-row ::-moz-table-row-group :-moz-tree-cell :-moz-tree-cell-text :-moz-tree-cell-text(hover) :-moz-tree-checkbox :-moz-tree-column :-moz-tree-drop-feedback :-moz-tree-image :-moz-tree-indentation :-moz-tree-line :-moz-tree-progressmeter :-moz-tree-row :-moz-tree-row(hover) :-moz-tree-separator :-moz-tree-twisty u – x :-moz-ui-invalid :-moz-ui-valid :-moz-user-disabled ::-moz-viewport ::-moz-viewport-scroll :-moz-window-inactive ::-moz-xul-anonymous-block at-rules @-moz-document media features -moz-mac-graphite-theme -moz-maemo-classic -moz-device-pixel-ratio -moz-os-version -moz-scrollbar-end-backward -moz-scrollbar-end-forward -moz-scrollbar-start-backward -moz-scrollbar-start-forward -moz-scrollb...
Selector list - CSS: Cascading Style Sheets
tors in comma-separated lists. syntax element, element, element { style properties } examples single line grouping grouping selectors in a single line using a comma-separated lists. h1, h2, h3, h4, h5, h6 { font-family: helvetica; } multi line grouping grouping selectors in a multiple lines using a comma-separated lists. #main, .content, article { font-size: 1.1em; } selector list invalidation a downside to using selector lists is that the following aren't equivalent: h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } h1, h2:maybe-unsupported, h3 { font-family: sans-serif } this is because a single unsupported selector in a selector list invalidates the whole rule. a way to remedy this us to use the :is() selector, w...
...sing selector lists is that the following aren't equivalent: h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } h1, h2:maybe-unsupported, h3 { font-family: sans-serif } this is because a single unsupported selector in a selector list invalidates the whole rule. a way to remedy this us to use the :is() selector, which simply ignores invalid selectors in its arguments, but at the cost of all selectors having the same specificity, because of how :is() calculates specificity. h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } :is(h1, h2:maybe-unsupported, h3) { font-family: sans-serif } specifications specification status comment selectors level...
animation - CSS: Cascading Style Sheets
Web › CSS › animation
constituent properties this property is a shorthand for the following css properties: animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function syntax the animation property is specified as one or more single animations, separated by commas. each individual...
...ring> zero, one, or two <time> values the order of values within each animation definition is important: the first value that can be parsed as a <time> is assigned to the animation-duration, and the second one is assigned to animation-delay. the order within each animation definition is also important for distinguishing animation-name values from other keywords. when parsed, keywords that are valid for properties other than animation-name, and whose values were not found earlier in the shorthand, must be accepted for those properties rather than for animation-name. furthermore, when serialized, default values of other properties must be output in at least the cases necessary to distinguish an animation-name that could be a value of another property, and may be output in additional cases. v...
background-position - CSS: Cascading Style Sheets
her value is top or bottom, then this value defines x, relative to the left edge. if both values are <length> or <percentage> values, then the first defines x and the second y. note that: if one value is top or bottom, then the other value may not be top or bottom. if one value is left or right, then the other value may not be left or right. this means, e.g., that top top and left right are not valid. the default value is top left or 0% 0%. 3-value syntax: two values are keyword values, and the third is the offset for the preceding value: the first value is one of the keyword values top, left, bottom, right, or center. if left or right are given here, then this defines x. if top or bottom are given, then this defines y and the other keyword value defines x. the <length> or <pe...
...en, then this defines y and the other keyword value defines x. the <length> or <percentage> value, if it is the second value, is the offset for the first value. if it is the third value, it is the offset for the second value. the single length or percentage value is an offset for the keyword value that precedes it. the combination of one keyword with two <length> or <percentage> values is not valid. 4-value syntax: the first and third values are keyword value defining x and y. the second and fourth values are offsets for the preceding x and y keyword values: the first value and third values one of the keyword values top, left, bottom, right. if left or right are given here, then this defines x. if top or bottom are given, then this defines y and the other keyword value defines x...
<basic-shape> - CSS: Cascading Style Sheets
adius shorthand syntax. a pair of insets in either dimension that add up to more than the used dimension (such as left and right insets of 75% apiece) define a shape enclosing no area. for this specification, this results in an empty float area. circle() circle( [<shape-radius>]? [at <position>]? ) the <shape-radius> argument represents r, the radius of the circle. negative values are invalid. a percentage value here is resolved from the used width and height of the reference box as sqrt(width^2+height^2)/sqrt(2). the <position> argument defines the center of the circle. this defaults to center if omitted. ellipse() ellipse( [<shape-radius>{2}]? [at <position>]? ) the <shape-radius> arguments represent rx and ry, the x-axis and y-axis radii of the ellipse, in that order. neg...
... from the used width and height of the reference box as sqrt(width^2+height^2)/sqrt(2). the <position> argument defines the center of the circle. this defaults to center if omitted. ellipse() ellipse( [<shape-radius>{2}]? [at <position>]? ) the <shape-radius> arguments represent rx and ry, the x-axis and y-axis radii of the ellipse, in that order. negative values for either radius are invalid. percentage values here are resolved against the used width (for the rx value) and the used height (for the ry value) of the reference box. the position argument defines the center of the ellipse. this defaults to center if omitted. polygon() polygon( [<fill-rule>,]? [<shape-arg> <shape-arg>]# ) <fill-rule> represents the filling rule used to determine the interior of the polygon. possi...
<custom-ident> - CSS: Cascading Style Sheets
mp-chinese-informal, tamil, telugu, thai, tibetan, trad-chinese-formal, trad-chinese-informal, upper-armenian, disclosure-open, and disclosure-close. grid-row-start grid-row-end grid-column-start grid-column-end forbids the span value. will-change forbids the global css values (unset, initial, and inherit), as well as the values will-change, auto, scroll-position, and contents. ...
...-12rad it must not start with a dash followed by a decimal digit. bili.bob only alphanumeric characters, _, and - needn't be escaped. --toto it must not start with two dashes. this would be a custom property. 'bilibob' this would be a <string>. "bilibob" this would be a <string>. ...
flex - CSS: Cascading Style Sheets
Web › CSS › flex
a <number>: in this case it is interpreted as flex: <number> 1 0; the <flex-shrink> value is assumed to be 1 and the <flex-basis> value is assumed to be 0. one of the keywords: none, auto, or initial. two-value syntax: the first value must be a <number> and it is interpreted as <flex-grow>. the second value must be one of: a <number>: then it is interpreted as <flex-shrink>. a valid value for width: then it is interpreted as <flex-basis>. three-value syntax: the values must be in the following order: a <number> for <flex-grow>. a <number> for <flex-shrink>. a valid value for width for <flex-basis>. values initial the item is sized according to its width and height properties. it shrinks to its minimum size to fit the container, but does not grow ...
..., and shrinks to its minimum size to fit the container. this is equivalent to setting "flex: 1 1 auto". none the item is sized according to its width and height properties. it is fully inflexible: it neither shrinks nor grows in relation to the flex container. this is equivalent to setting "flex: 0 0 auto". <'flex-grow'> defines the flex-grow of the flex item. negative values are considered invalid. defaults to 1 when omitted. <'flex-shrink'> defines the flex-shrink of the flex item. negative values are considered invalid. defaults to 1 when omitted. <'flex-basis'> defines the flex-basis of the flex item. a preferred size of 0 must have a unit to avoid being interpreted as a flexibility. defaults to 0 when omitted. description for most purposes, authors should set flex to one of the ...
<frequency> - CSS: Cascading Style Sheets
Web › CSS › frequency
wed by one of the units listed below. as with all css dimensions, there is no space between the unit literal and the number. units hz represents a frequency in hertz. examples: 0hz, 1500hz, 10000hz. khz represents a frequency in kilohertz. examples: 0khz, 1.5khz, 10khz. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0hz or 0khz. though the units are case-insensitive, it is good practice to use a capital "h" for hz and khz, as specified in the si. examples valid frequency values 12hz positive integer 4.3hz non-integer 14khz the unit is case-insensitive, though non-si capitalization is not recommended. +0hz zero, with a leading + and a unit -0khz zero, with a leading...
...resent 0hz or 0khz. though the units are case-insensitive, it is good practice to use a capital "h" for hz and khz, as specified in the si. examples valid frequency values 12hz positive integer 4.3hz non-integer 14khz the unit is case-insensitive, though non-si capitalization is not recommended. +0hz zero, with a leading + and a unit -0khz zero, with a leading - and a unit invalid frequency values 12.0 this is a <number>, not an <frequency>, because it is missing a unit. 7 hz no space is allowed between the number and the unit. 0 although unitless zero is an allowable <length>, it's an invalid <frequency>. specifications specification status comment css values and units module level 3the definition of '<frequency>' in that spec...
grid-area - CSS: Cascading Style Sheets
Web › CSS › grid-area
id line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the corresponding edge of the grid item’s grid area is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the ...
... is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. formal definition initial valueas each of the properties of the shorthand:grid-row-start: autogrid-column-start: autogrid-row-end: autogrid-column-end: autoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas each of the properties of the shorthand:grid-row-start: as specifiedgrid-column-start: as specifiedgrid-row-end: a...
grid-column-end - CSS: Cascading Style Sheets
id line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the column end edge of the grid item’s grid area is n lines from the start edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search...
...rea is n lines from the start edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. formal definition initial valueautoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax <grid-line>where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> | <custom-ident> ] ] exam...
grid-column-start - CSS: Cascading Style Sheets
e nth grid line to the grid item’s placement. if a negative integer is given, it counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement, such that the column start edge of the grid item’s grid area is n lines from the end edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the searc...
...area is n lines from the end edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers and 0 are invalid. the <custom-ident> cannot take the span value. formal definition initial valueautoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax <grid-line>where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> | <custom-ident> ] ] exam...
grid-column - CSS: Cascading Style Sheets
id line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the corresponding edge of the grid item’s grid area is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the ...
... is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. formal definition initial valueas each of the properties of the shorthand:grid-column-start: autogrid-column-...
grid-row-end - CSS: Cascading Style Sheets
id line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the row end edge of the grid item’s grid area is n lines from the start edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search di...
...rea is n lines from the start edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. formal definition initial valueautoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax <grid-line>where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> | <custom-ident> ] ] examples setting row end for a grid item html <div...
grid-row-start - CSS: Cascading Style Sheets
id line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement; such that the row start edge of the grid item’s grid area is n lines from the end edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search ...
...rea is n lines from the end edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. formal definition initial valueautoapplies togrid items and absolutely-positioned boxes whose containing block is a grid containerinheritednocomputed valueas specifiedanimation typediscrete formal syntax <grid-line>where <grid-line> = auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> | <custom-ident> ] ] exam...
grid-row - CSS: Cascading Style Sheets
Web › CSS › grid-row
id line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines are assumed to have that name for the purpose of finding this position. an <integer> value of 0 is invalid. span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the corresponding edge of the grid item’s grid area is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the ...
... is n lines from the opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. formal definition initial valueas each of the properties of the shorthand:grid-row-start: autogrid-row-end: a...
ident - CSS: Cascading Style Sheets
Web › CSS › ident
escaped character (preceded by a backslash, \), a unicode character (in the format of a backslash, \, followed by one to six hexadecimal digits, representing its unicode code point) note that id1, id1, id1 and id1 are all different identifiers as they are case-sensitive. on the other hand, as there are several ways to escape a character, toto\? and toto\3f are the same identifiers. ...
...-12rad it must not start with a dash followed by a decimal digit. bili.bob only alphanumeric characters, _, and - needn't be escaped. 'bilibob' this would be a <string>. "bilibob" this would be a <string>. specifications specification status comment css values and units module level 4the definition of '...
<image> - CSS: Cascading Style Sheets
Web › CSS › image
marily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. ...
... red swatch. if language is rtl, the image will be horizontally flipped. */ cross-fade(20% url(twenty.png), url(eighty.png)) /* cross faded images, with twenty being 20% opaque and eighty being 80% opaque. */ image-set('test.jpg' 1x, 'test-2x.jpg' 2x) /* a selection of images with varying resolutions */ invalid images nourl.jpg /* an image file must be defined using the url() function. */ url(report.pdf) /* a file pointed to by the url() function must be an image. */ element(#fakeid) /* an element id must be an existing id on the page. */ image(z.jpg#xy=0,0) /* the spatial fragment must be written in the format of xywh=#,#,#,# */ image-set('cat.jpg' 1x, 'dog.jpg' 1x) /* every image...
image() - CSS: Cascading Style Sheets
hat a media fragment will be ignored if not understood, and won't break the source call when used with url(). if the browser doesn't understand the media fragments notation, it simply ignores the fragment, displaying the entire image. browsers that understand image() also understand the fragment notation. therefore, if the fragment is not understood within image(), the image will be considered invalid. color fallback if a color is specified in image() along with your image sources, it acts as a fallback if the images are invalid and do not appear. in such cases, the image() function renders as if no image were included, generating a solid-color image. as a use case, consider a dark image being used as a background for some white text. a dark background color may be needed for foreground text...
...unlike declaring a background-color, which is placed under or behind all the background images, this can be used to put (generally semi-transparent) colors over other images. the size of the color swatch can be set with the background-size property. ...
<integer> - CSS: Cascading Style Sheets
Web › CSS › integer
nts a whole number, whether positive or negative. integers can be used in numerous css properties, such as column-count, counter-increment, grid-column, grid-row, and z-index. syntax the <integer> data type consists of one or several decimal digits, 0 through 9 inclusive, optionally preceded by a single + or - sign. there is no unit associated with integers. note: there is no official range of valid <integer> values. opera 12.1 supports values up to 215-1, ie up to 220-1, and other browsers even higher. during the css3 values cycle there was a lot of discussion about setting a minimum range to support: the latest decision, in april 2012 during the lc phase, was [-227-1; 227-1], but other values like 224-1 and 230-1 were also proposed. however, the latest spec doesn't specify a range anymore.
...r, the latest spec doesn't specify a range anymore. interpolation when animated, values of the <integer> data type are interpolated using discrete, whole steps. the calculation is done as if they were real, floating-point numbers; the discrete value is obtained using the floor function. the speed of the interpolation is determined by the timing function associated with the animation. examples valid integers 12 positive integer (without a leading + sign) +123 positive integer (with a leading + sign) -456 negative integer 0 zero +0 zero, with a leading + -0 zero, with a leading - invalid integers 12.0 this is a <number>, not an <integer>, though it represents an integer. 12. decimal points are not allowed. +---12 only ...
<time> - CSS: Cascading Style Sheets
Web › CSS › time
nd related properties. syntax the <time> data type consists of a​ ​​​​​​<number> followed by one of the units listed below. optionally, it may be preceded by a single + or - sign. as with all dimensions, there is no space between the unit literal and the number. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. ...
...the number. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0s or 0ms. units s represents a time in seconds. examples: 0s, 1.5s, -60s. ms represents a time in milliseconds. examples: 0ms, 150.25ms, -60000ms. note: conversion between s and ms follows the logical 1s = 1000ms. examples valid times 12s positive integer -456ms negative integer 4.3ms non-integer 14ms the unit is case-insensitive, although capital letters are not recommended. +0s zero with a leading + and a unit -0ms zero with a leading - and a unit invalid times 0 although unitless zero is allowed for <length>s, it's invalid for <time>s. 12.0 this is a <numbe...
touch-action - CSS: Cascading Style Sheets
d with pan-x, pan-left, pan-right and/or pinch-zoom. manipulation enable panning and pinch zoom gestures, but disable additional non-standard gestures such as double-tap to zoom. disabling double-tap to zoom removes the need for browsers to delay the generation of click events when the user taps the screen. this is an alias for "pan-x pan-y pinch-zoom" (which, for compatibility, is itself still valid). pan-left, pan-right, pan-up, pan-down enable single-finger gestures that begin by scrolling in the given direction(s). once scrolling has started, the direction may still be reversed. note that scrolling "up" (pan-up) means that the user is dragging their finger downward on the screen surface, and likewise pan-left means the user is dragging their finger to the right. multiple directions...
...n the given direction(s). once scrolling has started, the direction may still be reversed. note that scrolling "up" (pan-up) means that the user is dragging their finger downward on the screen surface, and likewise pan-left means the user is dragging their finger to the right. multiple directions may be combined except when there is a simpler representation (for example, "pan-left pan-right" is invalid since "pan-x" is simpler, but "pan-left pan-down" is valid). pinch-zoom enable multi-finger panning and zooming of the page. this may be combined with any of the pan- values. accessibility concerns a declaration of touch-action: none; may inhibit operating a browser's zooming capabilities. this will prevent people experiencing low vision conditions from being able to read and understand page...
var() - CSS: Cascading Style Sheets
Web › CSS › var
part of a value of another property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the var() function cannot be used in property names, selectors or anything else besides property values. (doing so usually produces invalid syntax, or else a value whose meaning has no connection to the variable.) syntax the first argument to the function is the name of the custom property to be substituted. an optional second argument to the function serves as a fallback value. if the custom property referenced by the first argument is invalid, the function uses the second value. var( <custom-property-name> , <declaration-value>?
...f the function is considered a fallback value. values <custom-property-name> a custom property’s name represented by an identifier that starts with two dashes. custom properties are solely for use by authors and users; css will never give them a meaning beyond what is presented here. <declaration-value> the custom property's fallback value, which is used in case the custom property is invalid in the used context. this value may contain any character except some characters with special meaning like newlines, unmatched closing brackets, i.e. ), ], or }, top-level semicolons, or exclamation marks. examples :root { --main-bg-color: pink; } body { background-color: var(--main-bg-color); } /* fallback */ /* in the component’s style: */ .component .header { color: var(--header-...
Getting Started - Developer guides
state of the request and the http status code of the response, you can do whatever you want with the data the server sent. you have two options to access that data: httprequest.responsetext – returns the server response as a string of text httprequest.responsexml – returns the response as an xmldocument object you can traverse with javascript dom functions note that the steps above are valid only if you used an asynchronous request (the third parameter of open() was unspecified or set to true). if you used a synchronous request you don't need to specify a function, but this is highly discouraged as it makes for an awful user experience. step 3 – a simple example let's put it all together with a simple http request. our javascript will request an html document, test.html, which co...
... with the request.'); } } } catch( e ) { alert('caught exception: ' + e.description); } } step 4 – working with the xml response in the previous example, after receiving the response to the http request we used the request object's responsetext property , which contained the contents of the test.html file. now let's try the responsexml property. first off, let's create a valid xml document that we'll request later on. the document (test.xml) contains the following: <?xml version="1.0" ?> <root> i'm a test. </root> in the script we only need to change the request line to: ... onclick="makerequest('test.xml')"> ... then in alertcontents(), we need to replace the line alert(httprequest.responsetext); with: var xmldoc = httprequest.responsexml; var root_node = x...
Introduction to HTML5 - Developer guides
g in documents using different scripts. note that html5 restricts character sets to those compatible with ascii and using at least 8 bits. this was done to tighten security and prevent some types of attacks. using the new html5 parser the parsing rules of html5, which analyze the meaning of mark-up, have been more precisely defined in html5. until the introduction of html5, only the meaning of valid mark-up was defined, meaning that as soon as one small error was made in the mark-up (most websites have at least one), the behavior was undefined. essentially, it meant that all browsers behaved differently, which is no longer the case. now, faced with errors in the mark-up, all compliant browsers must behave exactly in the same way. this requirement helps web developers quite a bit. while it i...
...sers behaved differently, which is no longer the case. now, faced with errors in the mark-up, all compliant browsers must behave exactly in the same way. this requirement helps web developers quite a bit. while it is true that all modern browsers now use these html5 parsing rules, non-html5-compliant browsers are still used by some. keep in mind that it's still highly recommended that one writes valid mark-up, as such code is easier to read and maintain, and it greatly decreases the prominence of incompatibilities that exists in various older browsers. don't worry — you don't have to change anything on your website. the web browsers' developers have done everything for you! ...
HTML5 - Developer guides
Web › Guide › HTML › HTML5
styling: letting authors write more sophisticated themes. semantics sections and outlines in html5 a look at the new outlining and sectioning elements in html5: <section>, <article>, <nav>, <header>, <footer> and <aside>. using html5 audio and video the <audio> and <video> elements embed and allow the manipulation of new multimedia content. forms improvements a look at the constraint validation api, several new attributes, new values for the <input> attribute type and the new <output> element. new semantic elements beside sections, media and forms elements, there are numerous new elements, like <mark>, <figure>, <figcaption>, <data>, <time>, <output>, <progress>, or <meter> and <main>, increasing the number of valid html5 elements. improvement in <iframe> using the sandbox and ...
... as well as the new html5 tags. downloadable in pdf and png formats. html5 cheat sheet a handy html 5 cheat sheet for beginners who want to master html 5, its elements, event attributes and compatibility. html5-compliant parser the parser, which turns the bytes of an html document into a dom, has been extended and now precisely defines the behavior to use in all cases, even when faced with invalid html. this leads to far greater predictability and interoperability between html5-compliant browsers. connectivity web sockets allows creating a permanent connection between the page and the server and to exchange non-html data through that means. server-sent events allows a server to push events to a client, rather than the classical paradigm where the server could send data only in resp...
Using HTML sections and outlines - Developer guides
conclusion the new semantic elements introduced in html5 bring the ability to describe the structure of a web document in a standard way. they bring a big advantage for people having html5 browsers and needing the structure to help them...
... to be enabled.</strong></p> <p>javascript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.</p> <p><a href="https://goo.gl/koeeaj">how to enable javascript?</a></p> </noscript> note: this code will also cause the html validator to return errors. this isn't a really bad thing neccessarily — sites will often have a few validation errors — but it's something to be aware of still. conclusion the new semantic elements introduced in html5 bring the ability to describe the structure of a web document in a standard way. they bring a big advantage for people having html5 browsers and needing the structure to help them understand the page, for instance people needing the help of some assistive technology. these new sema...
HTML attribute: crossorigin - HTML: Hypertext Markup Language
depending on the element, the attribute can be a cors settings attribute. the crossorigin content attribute on media elements is a cors settings attribute. these attributes are enumerated, and have the following possible values: keyword description anonymous cors requests for this element will have the credentials flag set to 'same-origin'. use-credentials cors requests for this element will have the credentials flag set to 'include'. ...
...crossorigin or crossorigin="", is the same as anonymous. by default (that is, when the attribute is not specified), cors is not used at all. the "anonymous" keyword means that there will be no exchange of user credentials via cookies, client-side ssl certificates or http authentication as described in the terminology section of the cors specification, unless it is in the same origin. an invalid keyword and an empty string will be handled as the anonymous keyword. example: crossorigin with the script element you can use the following <script> element to tell a browser to execute the https://example.com/example-framework.js script without sending user-credentials. <script src="https://example.com/example-framework.js" crossorigin="anonymous"></script> example: webmanifest with credent...
disabled - HTML: Hypertext Markup Language
the boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. the user can neither edit nor focus on the control, nor it's form control descendants. if the disabled attribute is specified on a form control, the element and its form control descendants do not participate in constraint validation. often browsers grey out such controls and it won't receive any browsing events, like mouse clicks or focus-related ones. the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <input>. this boolean disabled attribute indicates that the user cannot interact with the control or it's descendant controls. if this attribute is not specified, the control inherits its s...
...icks or focus-related ones, and aren't submitted with the form. if present on a supporting elements, the :disabled pseudo class will match. if the attribute is not included, the :enabled pseudo class will match. if the element doesn't support the disabled attribute, the attribute will have no effect, including not leading to being matched by the :disabled and :enabled pseudo classes. constraint validation if the element is disabled, then the element's value can not receive focus and cannot be updated by the user, and does not participate in constraint validation. examples when form controls are disabled, many browsers will display them in a lighter, greyed-out color by default. here are examples of a disabled checkbox, radio button, <option> and <optgroup>, as well as some form controls th...
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>. this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the input or textarea has no maximum length. any maxlength value must be greater than or equal to the value of minlength, if present and valid. 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. ...
...this must be an integer value 0 or higher. if no maxlength is specified, or an invalid value is specified, the input or textarea has no maximum length. any maxlength value must be greater than or equal to the value of minlength, if present and valid. 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. constraint validation is only applied when the value is changed by the user. constraint validation while the browser will generally prevent user from entering more text than the maxlength attribute allows, should the length be longer than the maxlength allows, the read-only toolong property of a validitystate object will be true. examples <input type="password" maxlength="4"/> specifications sp...
HTML attribute: readonly - HTML: Hypertext Markup Language
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. ...
...cannot have it's value changed by a user interaction, required does not have any effect on inputs with the readonly attribute also specified. the only way to modify dynamically the value of the readonly attribute is through a script. note: the required attribute is not permitted on inputs with the readonly attribute specified. usability browsers display the readonly attribute... constraint validation if the element is readonly, then the element's value can not be updated by the user, and does not participate in constraint validation. example html <div class="group"> <input type="textbox" value="some value" readonly="readonly"/> <label>textbox</label> </div> <div class="group"> <input type="date" value="2020-01-01" readonly="readonly"/> <label>date</label> </div> <div class="g...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
a certificate, or performing http basic authentication. if the server does not give credentials to the origin site (through access-control-allow-credentials: http header), the image will be tainted and its usage restricted. when not present, the resource is fetched without a cors request (i.e. without sending the origin: http header), preventing its non-tainted used in <canvas> elements. if invalid, it is handled as if the enumerated keyword anonymous was used. see cors settings attributes for additional information. currenttime reading currenttime returns a double-precision floating-point value indicating the current playback position, in seconds, of the audio. if the audio's metadata isn't available yet—thereby preventing you from knowing the media's start time or duration—current...
...wireless technologies (miracast, chromecast, dlna, airplay, etc). see this proposed specification for more information. in safari, you can use x-webkit-airplay="deny" as a fallback. duration read only a double-precision floating-point value which indicates the duration (total length) of the audio in seconds, on the media's timeline. if no media is present on the element, or the media is not valid, the returned value is nan. if the media has no known end (such as for live streams of unknown duration, web radio, media incoming from webrtc, and so forth), this value is +infinity. loop a boolean attribute: if specified, the audio player will automatically seek back to the start upon reaching the end of the audio. muted a boolean attribute that indicates whether the audio will be initially...
<button>: The Button element - HTML: Hypertext Markup Language
Web › HTML › Element › button
server. use when the form contains information that shouldn’t be public, like login credentials. get: the form data are appended to the form's action url, with a ? as a separator, and the resulting url is sent to the server. use this method when the form has no side effects, like search forms. if specified, this attribute overrides the method attribute of the button's form owner. formnovalidate html5 if the button is a submit button, this boolean attribute specifies that the form is not to be validated when it is submitted. if this attribute is specified, it overrides the novalidate attribute of the button's form owner. this attribute is also available on <input type="image"> and <input type="submit"> elements. formtarget html5 if the button is a submit button, this attribute is ...
...s option behaves the same way as _self. name the name of the button, submitted as a pair with the button’s value as part of the form data. type the default behavior of the button. possible values are: submit: the button submits the form data to the server. this is the default if the attribute is not specified for buttons associated with a <form>, or if the attribute is an empty or invalid value. reset: the button resets all the controls to their initial values, like <input type="reset">. (this behavior tends to annoy users.) button: the button has no default behavior, and does nothing when pressed by default. it can have client-side scripts listen to the element's events, which are triggered when the events occur. value defines the value associated with the button’s na...
<form> - HTML: Hypertext Markup Language
Web › HTML › Element › form
the html <form> element represents a document section containing interactive controls for submitting information. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is possible to use the :valid and :invalid css pseudo-classes to style a <form> element based on whether or not the elements inside the form are valid. content categories flow content, palpable content permitted content flow content, but not containing <form> elements tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content implicit...
... post: the post method; form data sent as the request body. get: the get method; form data appended to the action url with a ? separator. use this method when the form has no side-effects. dialog: when the form is inside a <dialog>, closes the dialog on submission. this value is overridden by formmethod attributes on <button>, <input type="submit">, or <input type="image"> elements. novalidate this boolean attribute indicates that the form shouldn't be validated when submitted. if this attribute is not set (and therefore the form is validated), it can be overridden by a formnovalidate attribute on a <button>, <input type="submit">, or <input type="image"> element belonging to the form. target indicates where to display the response after submitting the form. in html 4, this is th...
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
Web › HTML › Element › html
e version information in the document type declaration. xmlns specifies the xml namespace of the document. default value is "http://www.w3.org/1999/xhtml". this is required in documents parsed with xml parsers, and optional in text/html documents. ...
... attribute with a valid ietf identifying language tag on the <html> element will help screen reading technology determine the proper language to announce. the identifying language tag should describe the language used by the majority of the content of the page. without it, screen readers will typically default to the operating system's set language, which may cause mispronunciations. including a valid lang declaration on the <html> element also ensures that important metadata contained in the page's <head>, such as the page's <title>, are also announced properly. mdn understanding wcag, guideline 3.1 explanations understanding success criterion 3.1.1 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe definition of...
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
anywhere on a webpage as required when assigned an event handler function (typically for the click event). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons. given that a <button>’s label text is inserted between the opening and closing tags, you can include html in the label, even images. value a domstring used as the button's label events click supported common attributes type, and value idl attributes value methods...
...nt.queryselector('fieldset'); button.addeventlistener('click', disablebutton); function disablebutton() { fieldset.disabled = true; window.settimeout(function() { fieldset.disabled = false; }, 2000); } note: firefox will, unlike other browsers, by default, persist the dynamic disabled state of a <button> across page loads. use the autocomplete attribute to control this feature. validation buttons don't participate in constraint validation; they have no real value to be constrained. examples the below example shows a very simple drawing app created using a <canvas> element and some simple css and javascript (we'll hide the css for brevity). the top two controls allow you to choose the color and size of the drawing pen. the button, when clicked, invokes a function that clear...
<keygen> - HTML: Hypertext Markup Language
Web › HTML › Element › keygen
ent, not just as descendants of their form elements. keytype the type of key generated. the default value is rsa. name the name of the control, which is submitted with the form data. the element is written as follows: <keygen name="name" challenge="challenge string" keytype="type" keyparams="pqg-params"> the keytype parameter is used to specify what type of key is to be generated. valid values are "rsa", which is the default, "dsa" and "ec". the name and challenge attributes are required in all cases. the keytype attribute is optional for rsa key generation and required for dsa and ec key generation. the keyparams attribute is required for dsa and ec key generation and ignored for rsa key generation. pqg is a synonym for keyparams. that is, you may specify keyparams="pqg-params"...
...e string, then a curve is chosen according to the user's chosen key strength (low, medium, high), using the curve named "secp384r1" for high, and the curve named "secp256r1" for medium keys. (note: choice of the number of key strengths, default values for each strength, and the ui by which the user is offered a choice, are outside of the scope of this specification.) the <keygen> element is only valid within an html form. it will cause some sort of selection to be presented to the user for selecting key size. the ui for the selection may be a menu, radio buttons, or possibly something else. the browser presents several possible key strengths. currently, two strengths are offered, high and medium. if the user's browser is configured to support cryptographic hardware (e.g. "smart cards") the use...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
this attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element. it specifies the type of content being loaded by the <link>, which is necessary for request matching, application of correct content security policy, and setting of correct accept request header. furthermore, rel="preload" uses this as a signal for request prioritization. the table below lists the valid values for this attribute and the elements or resources they apply to. value applies to audio <audio> elements document <iframe> and <frame> elements embed <embed> elements fetch fetch, xhr this value also requires <link> to contain the crossorigin attribute. font ...
...certificate, and/or http basic authentication is performed). if the server does not give credentials to the origin site (through access-control-allow-credentials http header), the resource will be tainted and its usage restricted. if the attribute is not present, the resource is fetched without a cors request (i.e. without sending the origin http header), preventing its non-tainted usage. if invalid, it is handled as if the enumerated keyword anonymous was used. see cors settings attributes for additional information. disabled for rel="stylesheet" only, the disabled boolean attribute indicates whether or not the described stylesheet should be loaded and applied to the document. if disabled is specified in the html when it is loaded, the stylesheet will not be loaded during page load. ins...
Standard metadata names - HTML: Hypertext Markup Language
Web › HTML › Element › meta › name
ynamically inserting <meta name="referrer"> (with document.write() or appendchild()) makes the referrer behaviour unpredictable. when several conflicting policies are defined, the no-referrer policy is applied. theme-color: indicates a suggested color that user agents should use to customize the display of the page or of the surrounding user interface. the content attribute contains a valid css <color>. standard metadata names defined in other specifications the css color adjustment specification defines the following metadata name: color-scheme: specifies one or more color schemes with which the document is compatible. the browser will use this information in tandem with the user's browser or device settings to determine what colors to use for everything from background...
... scheme more than once has the same effect as specifying it only once. indicating multiple color schemes indicates that the first scheme is preferred by the document, but that the second specified scheme is acceptable if the user prefers it. only light indicates that the document only supports light mode, with a light background and dark foreground colors. by specification, only dark is not valid, because forcing a document to render in dark mode when it isn't truly compatible with it can result in unreadable content; all major browsers default to light mode if not otherwise configured. for example, to indicate that a document prefers dark mode but does render functionally in light mode as well: <meta name="color-scheme" content="dark light"> this works at the document level i...
<object> - HTML: Hypertext Markup Language
Web › HTML › Element › object
on. it can be used together with, or in place of, the data attribute. codebasehtml 4 onlyobsolete since html5 the base path used to resolve relative uris specified by classid, data, or archive. if not specified, the default is the base uri of the current document. codetypehtml 4 onlyobsolete since html5 the content type of the data specified by classid. data the address of the resource as a valid url. at least one of data and type must be defined. declarehtml 4 onlyobsolete since html5 the presence of this boolean attribute makes this element a declaration only. the object must be instantiated by a subsequent <object> element. in html5, repeat the <object> element completely each that that the resource is reused. formhtml5 the form element, if any, that the object element is associate...
...ement. in html5, repeat the <object> element completely each that that the resource is reused. formhtml5 the form element, if any, that the object element is associated with (its form owner). the value of the attribute must be an id of a <form> element in the same document. height the height of the displayed resource, in css pixels. -- (absolute values only. no percentages) name the name of valid browsing context (html5), or the name of the control (html 4). standbyhtml 4 onlyobsolete since html5 a message that the browser can show while loading the object's implementation and data. tabindexhtml 4 onlyobsolete since html5 the position of the element in the tabbing navigation order for the current document. type the content type of the resource specified by data. at least one of data...
<template>: The Content Template element - HTML: Hypertext Markup Language
Web › HTML › Element › template
echanism for holding html that is not to be rendered immediately when a page is loaded but may be instantiated subsequently during runtime using javascript. think of a template as a content fragment that is being stored for subsequent use in the document. while the parser does process the contents of the <template> element while loading the page, it does so only to ensure that those contents are valid; the element's contents are not rendered, however. content categories metadata content, flow content, phrasing content, script-supporting element permitted content no restrictions tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts metadata content, phrasing content, or script-supporting ele...
... = "acme kidney beans 2"; tbody.appendchild(clone2); } else { // find another way to add the rows to the table because // the html template element is not supported. } the result is the original html table, with two new rows appended to it via javascript: table { background: #000; } table td { background: #fff; } avoiding documentfragment pitfall a documentfragment is not a valid target for various events, as such it is often preferable to clone or refer to the elements within it. consider the following html and javascript: html <div id="container"></div> <template id="template"> <div>click me</div> </template> javascript const container = document.getelementbyid("container"); const template = document.getelementbyid("template"); function clickhandler(event) { ...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
Web › HTML › Element › track
ment attributes this element includes the global attributes. default this attribute indicates that the track should be enabled unless the user's preferences indicate that another track is more appropriate. this may only be used on one track element per media element. kind how the text track is meant to be used. if omitted the default kind is subtitles. if the attribute contains an invalid value, it will use metadata (versions of chrome earlier than 52 treated an invalid value as subtitles). the following keywords are allowed: subtitles subtitles provide translation of content that cannot be understood by the viewer. for example dialogue or text that is not english in an english language film. subtitles may contain additional content, usually extra background inform...
...nd or where the video cannot be seen. chapters chapter titles are intended to be used when the user is navigating the media resource. metadata tracks used by scripts. not visible to the user. label a user-readable title of the text track which is used by the browser when listing available text tracks. src address of the track (.vtt file). must be a valid url. this attribute must be specified and its url value must have the same origin as the document — unless the <audio> or <video> parent element of the track element has a crossorigin attribute. srclang language of the track text data. it must be a valid bcp 47 language tag. if the kind attribute is set to subtitles, then srclang must be defined. usage notes track data types the type of d...
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
a certificate, or performing http basic authentication. if the server does not give credentials to the origin site (through access-control-allow-credentials: http header), the image will be tainted and its usage restricted. when not present, the resource is fetched without a cors request (i.e. without sending the origin: http header), preventing its non-tainted used in <canvas> elements. if invalid, it is handled as if the enumerated keyword anonymous was used. see cors settings attributes for additional information. currenttime reading currenttime returns a double-precision floating-point value indicating the current playback position of the media specified in seconds. if the media has not started playing yet, the time offset at which it will begin is returned. setting currenttime sets...
...s that are attached using wired (hdmi, dvi, etc.) and wireless technologies (miracast, chromecast, dlna, airplay, etc). in safari, you can use x-webkit-airplay="deny" as a fallback. duration read only a double-precision floating-point value which indicates the duration (total length) of the media in seconds, on the media's timeline. if no media is present on the element, or the media is not valid, the returned value is nan. if the media has no known end (such as for live streams of unknown duration, web radio, media incoming from webrtc, and so forth), this value is +infinity. height the height of the video's display area, in css pixels (absolute values only; no percentages.) intrinsicsize this attribute tells the browser to ignore the actual intrinsic size of the image and pretend ...
lang - HTML: Hypertext Markup Language
always specify this attribute with the appropriate value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if the attribute value is the empty string (lang=""), the language is set to unknown; if the language tag is not valid according to bcp47, it is set to invalid. language tag syntax the full bcp47 syntax is in-depth enough to mark extremely specific language dialects, but most usage is much simpler. a language tag is made of hyphen-separated language subtags, where each subtag indicates a certain property of the language. the 3 most common subtags are: language subtag required. a 2-or-3-character code that...
...would just be es. the script subtag precedes the region subtag if both are present — ru-cyrl-by is russian, written in the cyrillic alphabet, as spoken in belarus. to find the correct subtag codes for a language, try the language subtag lookup. even if the lang attribute is set, it may not be taken into account, as the xml:lang attribute has priority. for the css pseudo-class :lang, two invalid language names are different if their names are different. so while :lang(es) matches both lang="es-es" and lang="es-419", :lang(xyzzy) would not match lang="xyzzy-zorp!". specifications specification status comment html living standardthe definition of 'lang' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the d...
Using the application cache - HTML: Hypertext Markup Language
network: switches to the online whitelist section of the cache manifest. fallback: switches to the fallback section of the cache manifest. the section header line may include whitespaces, but must include the colon (:) in the section name. section data the format for lines of data varies from section to section. ...
...itespaces, but must include the colon (:) in the section name. section data the format for lines of data varies from section to section. in the explicit (cache:) section, each line is a valid uri or iri reference to a resource to cache (no wildcard characters are allowed in this sections). whitespace is allowed before and after the uri or iri on each line. in the fallback section each line is a valid uri or iri reference to a resource, followed by a fallback resource that is to be served up when a connection with the server cannot be made. in the network section, each line is a valid uri or iri reference to a resource to fetch from the network (or the wildcard character * can be used in this section). note: relative uris are relative to the cache manifest's uri, not to the uri of the documen...
HTTP authentication - HTTP
exist, a different set of headers and status codes is needed. in the case of proxies, the challenging status code is 407 (proxy authentication required), the proxy-authenticate response header contains at least one challenge applicable to the proxy, and the proxy-authorization request header is used for providing the credentials to the proxy server. access forbidden if a (proxy) server receives valid credentials that are inadequate to access a given resource, the server should respond with the 403 forbidden status code. unlike 401 unauthorized or 407 proxy authentication required, authentication is impossible for this user. authentication of cross-origin images a potential security hole recently been fixed by browsers is authentication of cross-site images. from firefox 59 onwards, image re...
...enhancements, basic authentication should not be used to protect sensitive or valuable information. restricting access with apache and basic authentication to password-protect a directory on an apache server, you will need a .htaccess and a .htpasswd file. the .htaccess file typically looks like this: authtype basic authname "access to the staging site" authuserfile /path/to/.htpasswd require valid-user the .htaccess file references a .htpasswd file in which each line consists of a username and a password separated by a colon (:). you cannot see the actual passwords as they are hashed (using md5-based hashing, in this case). note that you can name your .htpasswd file differently if you like, but keep in mind this file shouldn't be accessible to anyone. (apache is usually configured to prev...
CSP: child-src - HTTP
for workers, non-compliant requests are treated as fatal network errors by the user agent. csp version 2 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. ...
...content-security-policy: child-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: font-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. syntax one or more sources can be allowed for the font-src policy: content-security-policy: font-src <source>; content-security-policy: font-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. ...
... content-security-policy: font-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: frame-ancestors - HTTP
setting this directive to 'none' is similar to x-frame-options: deny (which is also supported in older browsers). csp version 2 directive type navigation directive default-src fallback no. not setting this allows anything. this directive is not supported in the <meta> element. ...
...t fall back to a default-src setting. only the sources listed below are allowed: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number, separated by spaces. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. single quotes surrounding the host are not allowed. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. if no url scheme is ...
CSP: frame-src - HTTP
csp version 1 directive type fetch directive fallback if this directive is absent, the user agent will look for the child-src directive (which falls back to the default-src directive). syntax one or more sources can be allowed for the frame-src policy: content-security-policy: frame-src <source>; content-security-policy: frame-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. ...
...content-security-policy: frame-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: img-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. syntax one or more sources can be allowed for the img-src policy: content-security-policy: img-src <source>; content-security-policy: img-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. ...
... content-security-policy: img-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: media-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. syntax one or more sources can be allowed for the media-src policy: content-security-policy: media-src <source>; content-security-policy: media-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. ...
...content-security-policy: media-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: object-src - HTTP
to set allowed types for <object>, <embed>, and <applet> elements, use the plugin-types directive. elements controlled by object-src are perhaps coincidentally considered legacy html elements and aren't receiving new standardized features (such as the security attributes sandbox or allow for <iframe>). therefore it is recommended to restrict this fetch-directive (e.g. explicitly set object-src 'none' if possible). csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. ...
...ontent-security-policy: object-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: plugin-types - HTTP
the http content-security-policy (csp) plugin-types directive restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded. instantiation of an <embed>, <object> or <applet> element will fail if: the element to load does not declare a valid mime type, the declared type does not match one of specified types in the plugin-types directive, the fetched resource does not match the declared type. csp version 2 directive type document directive default-src fallback no. not setting this allows anything. syntax one or more mime types can be set for the plugin-types policy: content-security-policy: plugin-types <type>/<subtype>; content-security-policy: plugin-types <type>/<subtype> <type>/<s...
...tch the declared type. csp version 2 directive type document directive default-src fallback no. not setting this allows anything. syntax one or more mime types can be set for the plugin-types policy: content-security-policy: plugin-types <type>/<subtype>; content-security-policy: plugin-types <type>/<subtype> <type>/<subtype>; <type>/<subtype> a valid mime type. examples disallowing plugins to disallow all plugins, the object-src directive should be set to 'none' which will disallow plugins. the plugin-types directive is only used if you are allowing plugins with object-src at all. <meta http-equiv="content-security-policy" content="object-src 'none'"> allowing flash content the content security policy content-security-policy: plugin-t...
CSP: prefetch-src - HTTP
csp version 3 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. syntax one or more sources can be allowed for the prefetch-src policy: content-security-policy: prefetch-src <source>; content-security-policy: prefetch-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. ...
...tent-security-policy: prefetch-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: script-src-attr - HTTP
this includes only inline script event handlers like onclick, but not urls loaded directly into <script> elements. csp version 3 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the script-src directive, and if both of them are absent, fallback to default-src directive. ...
...; content-security-policy: script-src-attr <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: script-src-elem - HTTP
csp version 3 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the script-src directive, and if both of them are absent, fallback to default-src directive. ...
...; content-security-policy: script-src-elem <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: script-src - HTTP
this includes not only urls loaded directly into <script> elements, but also things like inline script event handlers (onclick) and xslt stylesheets which can trigger script execution. csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. ...
...ntent-security-policy: script-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: style-src-attr - HTTP
csp version 3 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the style-src directive, and if both of them are absent, fallback to default-src directive. ...
...ce>; content-security-policy: style-src-attr <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: style-src-elem - HTTP
csp version 3 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the style-src directive, and if both of them are absent, fallback to default-src directive. ...
...>; content-security-policy: style-src-elem <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: style-src - HTTP
csp version 1 directive type fetch directive default-src fallback yes. if this directive is absent, the user agent will look for the default-src directive. syntax one or more sources can be allowed for the style-src policy: content-security-policy: style-src <source>; content-security-policy: style-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. ...
...content-security-policy: style-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: worker-src - HTTP
csp version 3 directive type fetch directive fallback if this directive is absent, the user agent will first look for the child-src directive, then the script-src directive, then finally for the default-src directive, when governing worker execution. chrome 59 and higher skips the child-src directive. edge 17 skips the script-src directive (bug). ...
...ontent-security-policy: worker-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
Public-Key-Pins-Report-Only - HTTP
some browsers might allow other hashing algorithms than sha-256 in the future. max-age=<expire-time> this directive is meaningless for the public-key-pins-report-only header, it will be ignored by user agents and the header will not be cached. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" pin validation failures are reported to the given url. this directive should be used with this header, otherwise this header will be a no-op. example public-key-pins-report-only: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cup...
...ws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production. the second pin declaration pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe=" also pins the backup key. this key pinning is also valid for all subdomains, which is told by the includesubdomains declaration. finally, report-uri="https://www.example.org/hpkp-report" explains where to report pin validation failures. specifications specification title rfc 7469, section 2.1: public-key-pins-report-only public key pinning extension for http ...
Public-Key-Pins - HTTP
hashing algorithms than sha-256 in the future. max-age=<expire-time> the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" optional if this optional parameter is specified, pin validation failures are reported to the given url. example hpkp has the potential to lock out users for a long time if used incorrectly! the use of backup certificates and/or pinning the ca certificate is recommended. public-key-pins: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; re...
...rt" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production. the second pin declaration pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe=" also pins the backup key. max-age=5184000 tells the client to store this information for two months, which is a reasonable time limit according to the ietf rfc. this key pinning is also valid for all subdomains, which is told by the includesubdomains declaration. finally, report-uri="https://www.example.org/hpkp-report" explains where to report pin validation failures. specifications specification title rfc 7469, section 2.1: public-key-pins public key pinning extension for http ...
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
tal number. because this is not the case with 08 and 09, javascript warns about it. note that octal literals and octal escape sequences are deprecated and will present an additional deprecation warning. ...
...ional deprecation warning. with ecmascript 6 and later, the syntax uses a leading zero followed by a lowercase or uppercase latin letter "o" (0o or 0o). see the page about lexical grammar for more information. ...
TypeError: X.prototype.y called on incompatible type - JavaScript
as a property of an object as an argument to another function. in this case, the object that stores the function won't be the this target of that function when it is called by the other function. to work-around this issue, you will either need to provide a lambda which is making the call, or use the function.prototype.bind() function to force the this argument to the expected object. ...
...or use the function.prototype.bind() function to force the this argument to the expected object. examples invalid cases var myset = new set; ['bar', 'baz'].foreach(myset.add); // myset.add is a function, but "myset" is not captured as this. var myfun = function () { console.log(this); }; ['bar', 'baz'].foreach(myfun.bind); // myfun.bind is a function, but "myfun" is not captured as this. valid cases var myset = new set; ['bar', 'baz'].foreach(myset.add.bind(myset)); // this works due to binding "myset" as this. var myfun = function () { console.log(this); }; ['bar', 'baz'].foreach(x => myfun.bind(x)); // this works using the "bind" function. it creates a lambda forwarding the argument. ...
SyntaxError: JSON.parse: bad parsing - JavaScript
examples json.parse() does not allow trailing commas both lines will throw a syntaxerror: json.parse('[1, 2, 3, 4,]'); json.parse('{"foo": 1,}'); // syntaxerror json.parse: unexpected ...
... property names must be double-quoted strings syntaxerror: json.parse: expected property name or '}' syntaxerror: json.parse: unexpected character syntaxerror: json.parse: unexpected non-whitespace character after json data syntaxerror: json.parse error: invalid character at position {0} (edge) error type syntaxerror what went wrong? json.parse() parses a string as json. this string has to be valid json and will throw this error if incorrect syntax was encountered. examples json.parse() does not allow trailing commas both lines will throw a syntaxerror: json.parse('[1, 2, 3, 4,]'); json.parse('{"foo": 1,}'); // syntaxerror json.parse: unexpected character // at line 1 column 14 of the json data omit the trailing commas to parse the json correctly: json.parse('[1, 2, 3, 4]'); json.par...
SyntaxError: Malformed formal parameter - JavaScript
the javascript exception "malformed formal parameter" occurs when the argument list of a function() constructor call is invalid somehow. message syntaxerror: expected {x} (edge) syntaxerror: malformed formal parameter (firefox) error type syntaxerror what went wrong? there is a function() constructor with at least two arguments passed in the code. the last argument is the source code for the new function you're creating. all the rest make up your new function's argument list. the argument list is invalid somehow. perhaps you accidentally picked a keyword like if or var as an argument name, or perhaps there's some stray punctuation in your argument list. or maybe you accidentally passed an invalid value, like a number or object. ok, that fixed my problem. but why didn't you say that in...
...ou accidentally passed an invalid value, like a number or object. ok, that fixed my problem. but why didn't you say that in the first place? admittedly the wording in the error message is slightly strange. "formal parameter" is a fancy way of saying "function argument". and we use the word "malformed" because all firefox engineers are huge fans of 19th-century gothic horror novels. examples invalid cases var f = function('x y', 'return x + y;'); // syntaxerror (missing a comma) var f = function('x,', 'return x;'); // syntaxerror (extraneous comma) var f = function(37, "alert('ok')"); // syntaxerror (numbers can't be argument names) valid cases var f = function('x, y', 'return x + y;'); // correctly punctuated var f = function('x', 'return x;'); // if you can, avoid using function -...
RangeError: repeat count must be non-negative - JavaScript
the string.prototype.repeat() method has been used. it has a count parameter indicating the number of times to repeat the string. ...
...negative (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong? the string.prototype.repeat() method has been used. it has a count parameter indicating the number of times to repeat the string. it must be between 0 and less than positive infinity and cannot be a negative number. the range of allowed values can be described like this: [0, +∞). examples invalid cases 'abc'.repeat(-1); // rangeerror valid cases 'abc'.repeat(0); // '' 'abc'.repeat(1); // 'abc' 'abc'.repeat(2); // 'abcabc' 'abc'.repeat(3.5); // 'abcabcabc' (count will be converted to integer) ...
RangeError: precision is out of range - JavaScript
for these methods is usually between 0 and 20 (or 21). however, the ecmascript specification allows to extend this range. ...
...ber.prototype.tofixed() -20 to 100 0 to 20 number.prototype.toprecision() 1 to 100 1 to 21 examples invalid cases 77.1234.toexponential(-1); // rangeerror 77.1234.toexponential(101); // rangeerror 2.34.tofixed(-100); // rangeerror 2.34.tofixed(1001); // rangeerror 1234.5.toprecision(-1); // rangeerror 1234.5.toprecision(101); // rangeerror valid cases 77.1234.toexponential(4); // 7.7123e+1 77.1234.toexponential(2); // 7.71e+1 2.34.tofixed(1); // 2.3 2.35.tofixed(1); // 2.4 (note that it rounds up in this case) 5.123456.toprecision(5); // 5.1235 5.123456.toprecision(2); // 5.1 5.123456.toprecision(1); // 5 ...
TypeError: "x" is read-only - JavaScript
y 'x' of #<object> (chrome) typeerror: cannot assign to read only property '0' of [object array] (chrome) error type typeerror what went wrong? the global variable or object property that was assigned to is a read-only property. (technically, it is a non-writable data property.) this error happens only in strict mode code. in non-strict code, the assignment is silently ignored. examples invalid cases read-only properties are not super common, but they can be created using object.defineproperty() or object.freeze(). 'use strict'; var obj = object.freeze({name: 'elsa', score: 157}); obj.score = 0; // typeerror 'use strict'; object.defineproperty(this, 'lung_count', {value: 2, writable: false}); lung_count = 3; // typeerror 'use strict'; var frozenarray = object.freeze([0, 1, 2]); fr...
...re also a few read-only properties built into javascript. maybe you tried to redefine a mathematical constant. 'use strict'; math.pi = 4; // typeerror sorry, you can't do that. ...
TypeError: Reduce of empty array with no initial value - JavaScript
ray.prototype.reduceright()). these functions optionally take an initialvalue (which will be used as the first argument to the first call of the callback). however, if no initial value is provided, it will use the first element of the array or typedarray as the initial value. this error is raised when an empty array is provided because no initial value can be returned in that case. examples invalid cases this problem appears frequently when combined with a filter (array.prototype.filter(), typedarray.prototype.filter()) which will remove all elements of the list. thus leaving none to be used as the initial value. var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y) // no more elements to use for the initial value. sim...
...ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y) // no more elements to use for the initial value. similarly, the same issue can happen if there is a typo in a selector, or an unexpected number of elements in a list: var names = document.getelementsbyclassname("names"); var name_list = array.prototype.reduce.call(names, (acc, name) => acc + ", " + name); valid cases these problems can be solved in two different ways. one way is to actually provide an initialvalue as the neutral element of the operator, such as 0 for the addition, 1 for a multiplication, or an empty string for a concatenation. var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y, 0) // the initial value is the neutra...
ReferenceError: reference to undefined property "x" - JavaScript
enceerror: reference to undefined property "x" (firefox) error type (firefox only) referenceerror warning which is reported only if javascript.options.strict preference is set to true. what went wrong? the script attempted to access an object property which doesn't exist. there are two ways to access properties; see the property accessors reference page to learn more about them. ...
...e. what went wrong? ...
Arrow function expressions - JavaScript
however, note that in // this example we are not assigning `length` value to the made up property. instead, the literal name // itself of the variable `length` is used as the property we want to retrieve from the object. ...
...b, c) => { return 1 }; var func = ( a, b, c ) => 1; // no syntaxerror thrown parsing order although the arrow in an arrow function is not an operator, arrow functions have special parsing rules that interact differently with operator precedence compared to regular functions. ...
Array.prototype.filter() - JavaScript
is [12, 130, 44] find all prime numbers in an array the following example returns all prime numbers in the array: const array = [-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]; function isprime(num) { for (let i = 2; num > i; i++) { if (num % i == 0) { return false; } } return num > 1; } console.log(array.filter(isprime)); // [2, 3, 5, 7, 11, 13] filtering invalid entries from json the following example uses filter() to create a filtered json of all elements with non-zero, numeric id. let arr = [ { id: 15 }, { id: -1 }, { id: 0 }, { id: 3 }, { id: 12.2 }, { }, { id: null }, { id: nan }, { id: 'undefined' } ] let invalidentries = 0 function filterbyid(item) { if (number.isfinite(item.id) && item.id !== 0) { return true } inva...
... { }, { id: null }, { id: nan }, { id: 'undefined' } ] let invalidentries = 0 function filterbyid(item) { if (number.isfinite(item.id) && item.id !== 0) { return true } invalidentries++ return false; } let arrbyid = arr.filter(filterbyid) console.log('filtered array\n', arrbyid) // filtered array // [{ id: 15 }, { id: -1 }, { id: 3 }, { id: 12.2 }] console.log('number of invalid entries = ', invalidentries) // number of invalid entries = 5 searching in array following example uses filter() to filter array content based on search criteria. let fruits = ['apple', 'banana', 'grapes', 'mango', 'orange'] /** * filter array items based on search criteria (query) */ function filteritems(arr, query) { return arr.filter(function(el) { return el.tolowercase().indexo...
Error - JavaScript
ng statements. evalerror creates an instance representing an error that occurs regarding the global function eval(). internalerror creates an instance representing an error that occurs when an internal error in the javascript engine is thrown. e.g. "too much recursion". rangeerror creates an instance representing an error that occurs when a numeric variable or parameter is outside of its valid range. referenceerror creates an instance representing an error that occurs when de-referencing an invalid reference. syntaxerror creates an instance representing a syntax error. typeerror creates an instance representing an error that occurs when a variable or parameter is not of a valid type. urierror creates an instance representing an error that occurs when encodeuri() or decodeuri() ...
... constructor error() creates a new error object. static methods error.capturestacktrace() a non-standard v8 function that creates the stack property on an error instance. instance properties error.prototype.message error message. error.prototype.name error name. ...
Intl.getCanonicalLocales() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.getcanonicallocales(locales) parameters locales a list of string values for which to get the canonical locale names. return value an array containing the canonical locale names. ...
...cales(locales) parameters locales a list of string values for which to get the canonical locale names. return value an array containing the canonical locale names. examples using getcanonicallocales intl.getcanonicallocales('en-us'); // ["en-us"] intl.getcanonicallocales(['en-us', 'fr']); // ["en-us", "fr"] intl.getcanonicallocales('en_us'); // rangeerror:'en_us' is not a structurally valid language tag specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.getcanonicallocales' in that specification. ...
JSON.parse() - JavaScript
string to parse as json. see the json object for a description of json syntax. reviver optional if a function, this prescribes how the value originally produced by parsing is transformed, before being returned. return value the object, array, string, number, boolean, or null value corresponding to the given json text. exceptions throws a syntaxerror exception if the string to parse is not valid json. polyfill // from https://github.com/douglascrockford/json-js/blob/master/json2.js if (typeof json.parse !== "function") { var rx_one = /^[\],:{}\s]*$/; var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fa-f]{4})/g; var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[ee][+\-]?\d+)?/g; var rx_four = /(?:^|:|,)(?:\s*\[)+/g; var rx_dangerous = /[\u0000\u00ad\u0600-\u0604...
... var j; function walk(holder, key) { // the walk method is used to recursively walk the resulting structure so // that modifications can be made. var k; var v; var value = holder[key]; if (value && typeof value === "object") { for (k in value) { if (object.prot...
JSON - JavaScript
izing objects, arrays, numbers, strings, booleans, and null. it is based upon javascript syntax but is distinct from it: some javascript is not json. objects and arrays property names must be double-quoted strings; trailing commas are forbidden. numbers leading zeros are prohibited. a decimal point must be followed by at least one digit. nan and infinity are unsupported. any json text is a valid javascript expression... ...but only in javascript engines that have implemented the proposal to make all json text valid ecma-262. in engines that haven't implemented the proposal, u+2028 line separator and u+2029 paragraph separator are allowed in string literals and property keys in json; but their use in these features in javascript string literals is a syntaxerror. consider this example w...
...rrayelements = json or arrayelements , json insignificant whitespace may be present anywhere except within a jsonnumber (numbers must contain no whitespace) or jsonstring (where it is interpreted as the corresponding character in the string, or would cause an error). the tab character (u+0009), carriage return (u+000d), line feed (u+000a), and space (u+0020) characters are the only valid whitespace characters. static methods json.parse(text[, reviver]) parse the string text as json, optionally transform the produced value and its properties, and return the value. any violations of the json syntax, including those pertaining to the differences between javascript and json, cause a syntaxerror to be thrown. the reviver option allows for interpreting what the replacer has used t...
handler.construct() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { construct: function(target, argumentslist, newtarget) { } }); parameters the following parameters are passed to the construct() method. this is bound to the handler. ...
... * 10 }; } }); console.log(new p(1).value); // "called: 1" // 10 the following code violates the invariant. const p = new proxy(function() {}, { construct: function(target, argumentslist, newtarget) { return 1; } }); new p(); // typeerror is thrown the following code improperly initializes the proxy. the target in proxy initialization must itself be a valid constructor for the new operator. const p = new proxy({}, { construct: function(target, argumentslist, newtarget) { return {}; } }); new p(); // typeerror is thrown, "p" is not a constructor specifications specification ecmascript (ecma-262)the definition of '[[construct]]' in that specification. ...
String.fromCharCode() - JavaScript
ored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax string.fromcharcode(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of numbers that are utf-16 code units. the range is between 0 and 65535 (0xffff). numbers greater than 0xffff are truncated. no validity checks are performed. return value a string of length n consisting of the n specified utf-16 code units. description this method returns a string and not a string object. because fromcharcode() is a static method of string, you always use it as string.fromcharcode(), rather than as a method of a string object you created. returning supplementary characters in utf-16, the most common c...
...). however, this set of characters, known as the base multilingual plane (bmp), is only 1/17th of the total addressable unicode code points. the remaining code points, in the range of 65536 (0x010000) to 1114111 (0x10ffff) are known as supplementary characters. in utf-16, supplementary characters are represented by two 16-bit code units, known as surrogates, that were reserved for this purpose. a valid combination of two surrogates used to represent a supplementary character is known as a surrogate pair. because fromcharcode() only works with 16-bit values (same as the \u escape sequence), a surrogate pair is required in order to return a supplementary character. for example, both string.fromcharcode(0xd83c, 0xdf03) and \ud83c\udf03 return code point u+1f303 "night with stars". while there is...
parseFloat() - JavaScript
the given string. or nan when the first non-whitespace character cannot be converted to a number. description parsefloat is a top-level function and not a method of any object. if parsefloat encounters a character other than a plus sign (+), minus sign (- u+002d hyphen-minus), numeral (0–9), decimal point (.), or exponent (e or e), it returns the value up to that character, ignoring the invalid character and characters following it. a second decimal point also stops parsing (characters up to that point will still be parsed). leading and trailing spaces in the argument are ignored. if the argument’s first character can’t be converted to a number (it’s not any of the above characters), parsefloat returns nan. parsefloat can also parse and return infinity. parsefloat converts bi...
... if the argument’s first character can’t be converted to a number (it’s not any of the above characters), parsefloat returns nan. parsefloat can also parse and return infinity. parsefloat converts bigint syntax to numbers, losing precision. this happens because the trailing n character is discarded. consider number(value) for stricter parsing, which converts to nan for arguments with invalid characters anywhere. parsefloat will parse non-string objects if they have a tostring or valueof method. the returned value is the same as if parsefloat had been called on the result of those methods. examples parsefloat returning a number the following examples all return 3.14: parsefloat(3.14); parsefloat('3.14'); parsefloat(' 3.14 '); parsefloat('314e-2'); parsefloat('0.0314e+2'); parse...
Destructuring assignment - JavaScript
; console.log(id); // 42 console.log(is_verified); // true assignment without declaration a variable can be assigned its value with destructuring separate from its declaration. let a, b; ({a, b} = {a: 1, b: 2}); notes: the parentheses ( ... ) around the assignment statement are required when using object literal destructuring assignment without a declaration. {a, b} = {a: 1, b: 2} is not valid stand-alone syntax, as the {a, b} on the left-hand side is considered a block and not an object literal. however, ({a, b} = {a: 1, b: 2}) is valid, as is const {a, b} = {a: 1, b: 2} your ( ... ) expression needs to be preceded by a semicolon or it may be used to execute a function on the previous line. assigning to new variable names a property can be unpacked from an object and assigned to ...
...{z: 'bar'}; console.log(foo); // "bar" rest in object destructuring the rest/spread properties for ecmascript proposal (stage 4) adds the rest syntax to destructuring. rest properties collect the remaining own enumerable property keys that are not already picked off by the destructuring pattern. let {a, b, ...rest} = {a: 10, b: 20, c: 30, d: 40} a; // 10 b; // 20 rest; // { c: 30, d: 40 } invalid javascript identifier as a property name destructuring can be used with property names that are not valid javascript identifiers by providing an alternative identifier that is valid. const foo = { 'fizz-buzz': true }; const { 'fizz-buzz': fizzbuzz } = foo; console.log(fizzbuzz); // "true" combined array and object destructuring array and object destructuring can be combined. say you want th...
super - JavaScript
syntax super([arguments]); // calls the parent constructor. super.functiononparent([arguments]); description when used in a constructor, the super keyword appears alone and must be used before the this keyword is used. the super keyword can also be used to call functions on a parent object. examples using super in classes this code snippet is taken from the classes sample (live demo). ...
... which are all equal' deleting super properties will throw an error you cannot use the delete operator and super.prop or super[expr] to delete a parent class' property, it will throw a referenceerror. class base { constructor() {} foo() {} } class derived extends base { constructor() {} delete() { delete super.foo; // this is bad } } new derived().delete(); // referenceerror: invalid delete involving 'super'. super.prop cannot overwrite non-writable properties when defining non-writable properties with e.g. object.defineproperty, super cannot overwrite the value of the property. class x { constructor() { object.defineproperty(this, 'prop', { configurable: true, writable: false, value: 1 }); } } class y extends x { constructor() { super...
async function - JavaScript
suspend progress through an async function, yielding control and subsequently resuming progress only when an awaited promise-based asynchronous operation is either fulfilled or rejected. the resolved value of the promise is treated as the return value of the await expression. use of async / await enables the use of ordinary try / catch blocks around asynchronous code. the await keyword is only valid inside async functions. if you use it outside of an async function's body, you will get a syntaxerror. the purpose of async/await is to simplify the syntax necessary to consume promise-based apis. the behavior of async/await is similar to combining generators and promises. async functions always return a promise. if the return value of an async function is not explicitly a promise, it will b...
... return await promisevalue vs. return promisevalue the implicit wrapping of return values in promise.resolve does not imply that return await promisevalue is functionally equivalent to return promisevalue. consider the following rewrite of the above c...
SVG Styling Attributes - SVG: Scalable Vector Graphics
Web › SVG › Attribute › Styling
the svg styling attributes are all the attributes that can be specified on any svg element to apply css styling effects. ...
...es that can be specified on any svg element to apply css styling effects. class style attributes class assigns a class name or set of class names to an element. ...
Getting started - SVG: Scalable Vector Graphics
0" text-anchor="middle" fill="white">svg</text> </svg> copy the code and paste it in a file demo1.svg. then open the file in firefox. it will render as shown in the following screenshot. (firefox users: click here) the rendering process involves the following: we start with the <svg> root element: a doctype declaration as known from (x)html should be left off because dtd based svg validation leads to more problems than it solves before svg 2, to identify the version of the svg for other types of validation the version and baseprofile attributes should always be used instead. both version and baseprofile attributes are deprecated in svg 2. as an xml dialect, svg must always bind the namespaces correctly (in the xmlns attribute). see the namespaces crash course page for more...
...the text is positioned by setting an anchor where we want the midpoint to be: in this case, the midpoint should correspond to the center of the green circle. fine adjustments can be made to the font size and vertical position to ensure the final result is aesthetically pleasing. basic properties of svg files the first important thing to notice is the order of rendering elements. the globally valid rule for svg files is, that later elements are rendered atop previous elements. the further down an element is the more it will be visible. svg files on the web can be displayed directly in the browser or embedded in html files via several methods: if the html is xhtml and is delivered as type application/xhtml+xml, the svg can be directly embedded in the xml source. if the html is html...
XML introduction - XML: Extensible Markup Language
b-article in process writing... whole structure xml and xml based languages built on tags. xml declaration xml - declaration is not a tag. it is used for the transmission of the meta-data of a document. <?xml version="1.0" encoding="utf-8"?> attributes: version : used version xml in this document. encoding : used encoding in this document. comments <!-- comment --> "correct" xml (valid and well-formed) Сorrect design rules for an xml document to be correct, the following conditions must be fulfilled: document must be well-formed. document must conform to all xml syntax rules. document must conform to semantic rules, which are usually set in an xml schema or a dtd (document type definition). example <?xml version="1.0" encoding="utf-8"?> <message> <warning> ...
...ema or a dtd (document type definition). example <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world <!--missing </warning> --> </message> now let's look at a corrected version of that same document: <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world </warning> </message> a document that contains an undefined tag is invalid. for example, if we never defined the <warning> tag, the document above wouldn't be valid. most browsers offer a debugger that can identify poorly-formed xml documents. entities like html, xml offers methods (called entities) for referring to some special reserved characters (such as a greater than sign which is used for tags). there are five of these characters that you should know: ...
Introduction to using XPath in JavaScript - XPath
sult object returned is a node-set of matched nodes which will behave as an iterator, allowing us to access the individual nodes contained by using the iteratenext() method of the xpathresult. once we have iterated over all of the individual matched nodes, iteratenext() will return null. note however, that if the document is mutated (the document tree is modified) between iterations that will invalidate the iteration and the invaliditeratorstate property of xpathresult is set to true, and a ns_error_dom_invalid_state_err exception is thrown. iterator example var iterator = document.evaluate('//phonenumber', documentnode, null, xpathresult.unordered_node_iterator_type, null ); try { var thisnode = iterator.iteratenext(); while (thisnode) { alert( thisnode.textcontent ); thisnod...
...is a static node-set of matched nodes, which allows us to access each node through the snapshotitem(itemnumber) method of the xpathresult object, where itemnumber is the index of the node to be retrieved. the total number of nodes contained can be accessed through the snapshotlength property. snapshots do not change with document mutations, so unlike the iterators, the snapshot does not become invalid, but it may not correspond to the current document, for example, the nodes may have been moved, it might contain nodes that no longer exist, or new nodes could have been added. snapshot example var nodessnapshot = document.evaluate('//phonenumber', documentnode, null, xpathresult.ordered_node_snapshot_type, null ); for ( var i=0 ; i < nodessnapshot.snapshotlength; i++ ) { alert( nodessnapsho...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
rameters apply to all stylesheets as a consequence of that all stylesheets are imported into a single stylesheet per the xslt spec.reference? note that multiple xml-stylesheet xslt pis are not supported in firefox currently. xslt-param the xslt-param pi supports 4 attributes: name the local-name part of the parameter name. no syntax checking is done on the attribute, however if it is not a valid ncname it will never match any parameter in the stylesheet. namespace the namespace of the parameter name. no syntax checking is done on the attribute. value contains the string value for the parameter. the value of the attribute is used as value for the parameter. the datatype will always bestring. select an xpath expression for the parameter. the value of the attribute is parsed as an ...
...lt-param-namespace pi affects the expression in the select attribute for all xslt-params following the pi. this applies even if there are other nodes such as comments or other pis between the xslt-param-namespace and xslt-param pis. it is not an error for multiple pis to use the same prefix, every new pi just changes what namespace the prefix maps to. if prefix is missing, empty, or equals an invalid ncname, the pi is ignored. if namespace is missing, the pi is ignored. if namespace is empty, the prefix mapping is removed. examples set the parameter 'books' to a nodeset containing all <book> elements in the 'http://www.example.org/mynamespace' namespace: <?xslt-param-namespace prefix="my" namespace="http://www.example.org/mynamespace"?> <?xslt-param name="books" select="//my:book"?> sup...
SDK API Lifecycle - Archive of obsolete content
n this. during this time, the module will be in the deprecated state. the sdk team will track usage of deprecated modules on addons.mozilla.org and support developers migrating their code. the sdk will continue to provide warnings: api documentation will inform users that the module is deprecated. attempts to use a deprecated module at runtime will log an error to the error console. the amo validator will throw errors when deprecated modules are used, and these add-ons will therefore fail amo review. all warnings should include links to further information about what to use instead of the deprecated module and when the module will be completely removed. removal the target removal date is 18 weeks after deprecation. in preparation for this date the sdk team will decide whether to go ah...
Working with Events - Archive of obsolete content
s explained in the working with content scripts guide. adding listeners you can add a listener to an event emitter by calling its on(type, listener) method. it takes two parameters: type: the type of event we are interested in, identified by a string. many event emitters may emit more than one type of event: for example, a browser window might emit both open and close events. the list of valid event types is specific to an event emitter and is included with its documentation. listener: the listener itself. this is a function which will be called whenever the event occurs. the arguments that will be passed to the listener are specific to an event type and are documented with the event emitter. for example, the following add-on registers a listener with the tabs module to liste...
request - Archive of obsolete content
throw an error. since the request is not being made by any particular website, requests made here are not subject to the same-domain restriction that requests made in web pages are subject to. with the exception of response, all of a request object's properties correspond with the options in the constructor. each can be set by simply performing an assignment. however, keep in mind that the same validation rules that apply to options in the constructor will apply during assignment. thus, each can throw if given an invalid value. the example below shows how to use request to get the most recent tweet from the @mozhacks account: var request = require("sdk/request").request; var latesttweetrequest = request({ url: "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=mozhacks&c...
self - Archive of obsolete content
access data that is bundled with the add-on, and add-on metadata. note that the self module is completely different from the global self object accessible to content scripts, which is used by a content script to communicate with the add-on code. globals properties uri this property represents an add-on associated unique uri string. this uri can be used for apis which require a valid uri string, such as the passwords module. id this property is a printable string that is unique for each add-on. it comes from the id property set in the package.json file in the main package (i.e. the package in which you run jpm xpi). while not generally of use to add-on code directly, it can be used by internal api code to index local storage and other resources that are associated with a particular add...
simple-prefs - Archive of obsolete content
utes these are attributes that all preferences must have. attribute description type the type of preference, as defined in the "preference types" section below. name an identifier for the preference. this is used to access the preference from your add-on: console.log(require("sdk/simple-prefs").prefs.mysettingname); this means that it must be a valid javascript identifier. title this is used as a label for the preference in the add-ons manager user interface. optional common attributes these are attributes that all preferences may have: attribute description description this appears below the preference title in the add-ons manager ui. value a default value for the prefere...
tabs - Archive of obsolete content
by setting the url property you can load a new page in the tab: var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { tab.url = "http://www.example.com"; }); run scripts in a tab you can attach a content script to the page hosted in a tab, and use that to access and manipulate the page's content (see the modifying the page hosted...
High-Level APIs - Archive of obsolete content
ore preferences across application restarts. simple-storage lets an add-on store data so that it's retained across firefox restarts. system query the add-on's environment and access arguments passed to it. tabs open, manipulate, and access tabs, and receive tab events. timers set one-off and periodic timers. ui provides access to button, toolbar, and sidebar ui objects. url construct, validate, and parse urls. widget create a simple user interface for an add-on in firefox's add-on bar. windows enumerate and examine open browser windows, open new windows, and listen for window events. ...
content/loader - Archive of obsolete content
provides one of the building blocks for those modules that use content scripts to interact with web content, such as panel and page-mod. usage the module exports a constructor for the loader object, which inherits on(), once(), and removelistener() functions that enable its users to listen to events. loader adds code to initialize and validate a set of properties for managing content scripts: contenturl contentscript contentscriptfile contentscriptwhen contentscriptoptions allow when certain of these properties are set, the loader emits a propertychange event, enabling its users to take the appropriate action. the loader is used by modules that use content scripts but don't themselves load content, such as page-mod. modules that load their own content, such as panel and page-w...
stylesheet/utils - Archive of obsolete content
"author". removesheet(window, uri, type) remove the document style sheet at sheeturi from the list of additional style sheets of the document. the removal takes effect immediately. parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet. it accepts the following values: "agent", "user" and "author". if not provided, the default value is "author". istypevalid(type) verifies that the type given is a valid stylesheet's type. the values considered valid are: "agent", "user" and "author". parameters type : string the type of the sheet. returns boolean : true if the type given is valid, otherwise false. ...
ui/sidebar - Archive of obsolete content
tively, the view->sidebar submenu in firefox will contain a new item which the user can use to show or hide the sidebar: the sidebar generates a show event when it is shown and a hide event when it is hidden. once you've finished using the sidebar you can destroy it by calling its dispose() method. to show what a sidebar looks like, here's a sidebar that displays the results of running the w3c validator on the current page: specifying sidebar content the content of a sidebar is specified using html, which is loaded from the url supplied in the url option to the sidebar's constructor. unlike modules such as panel, the content must be local, typically loaded from the add-on's data directory via a url constructed using self.data.url(): var sidebar = require("sdk/ui/sidebar").sidebar({ id...
package.json - Archive of obsolete content
updateurl same as the updateurl for an install.rdf file. see supporting updates for self-hosted add-ons. note: this key is only available with jpm. version string representing the version of the add-on. defaults to "0.0.1". this value is used as the add-on's em:version element in its install.rdf. note: for jpm the version must be a valid semver. reorder package.json the package.json file is simple format. you can describe keys in any order. but sometimes it should be better reorder it for improve readability. a tool "fixpack" will reorder your package.json as follows: name first description second version third author fourth all other keys in alphabetical order dependencies and devdependencies sorted alph...
Dialogs and Prompts - Archive of obsolete content
<!-- content --> </dialog> you can even get the element object for any of predefined buttons with gdialog.getbutton(dlgtype);, where gdialog is the <dialog> element and dlgtype is one of the six button types listed above. explicit if you are not satisfied with the layout of predefined buttons in dialog, you can put explicit button elements in your xul file and add a dlgtype attribute to them. valid values for dlgtype are the six button types listed above. be sure to use ondialog* attributes on dialog element instead of putting oncommand on the button with dlgtype, because button's oncommand is executed only when the button is pressed, and ondialog* handlers are executed for keyboard and other events too. example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="t...
StringView - Archive of obsolete content
in front of a 5/6-byte sequence stringview tries to * encode it in any case. */ var nlen = achars.length, npart = achars[nidx]; return npart > 251 && npart < 254 && nidx + 5 < nlen ? /* (npart - 252 << 30) may be not safe in ecmasc...
Enhanced Extension Installation - Archive of obsolete content
file "appearing" into a directory based install location. installation from a file initiation when an item is installed from a file (such as, when an item is installed from the web, via xpinstall, upgraded by xpinstall or dropped into a directory-based install location), the install manifest supplied by the item is expanded into a temporary location and read. the guid and version supplied are validated, and then compatibility is checked for by the new _getinstalldata function. this function returns the guid, version, and type of the item, and also an error code listing either success, or the reason for a failure, such as invalid guid, version, or incompatible item. depending on the failure, the install function may take several steps. if the item is found incompatible, a version update che...
Extension Etiquette - Archive of obsolete content
at the vast majority of your users don't have inner working knowledge of mozilla. make sure your extension's homepage states the "obvious," including the purpose of your extension. users also appreciate when your extension is shipped with a simple how-to document. ids firefox/thunderbird 1.5 or later are much more strict about the ids of extensions than their 1.0 counterparts. make sure they're valid. version numbering please follow the mozilla pattern: major version dot current incarnation dot security/bugfix release (like 1.0.7). internationalization locales always use locale dtds and property files, even if providing your extension in one language. it will make translation of your extension to another language easier. it occurs more often than you would think. options firefox users ...
How to convert an overlay extension to restartless - Archive of obsolete content
xtensions load default preferences from a standardized file automatically. restartless extensions don't (for no good reason). this part is fairly easy to implement yourself, at least. ...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
hnologies, please refer to other sources. xml coding css coding basic javascript syntax xml: a text-based structural language extensible markup language (xml) is a meta-language for expressing various kinds of data. it was specified in 1998 by w3c, the organization that sets standards for web-related technologies. it has a number of useful qualities: it is generic, extensible, and easy to validate as well-formed. some examples of xml-based markup languages include xhtml, which is html redefined on an xml base; svg, for expressing vector images; and mathml, for expressing mathematical formulas. xul, which is used in firefox, is also based on xml. listing 1: xml syntax <elementname someattribute="somevalue"> content </elementname> as shown in listing 1, xml uses elements, which cons...
Adding Events and Commands - Archive of obsolete content
xtension. one way to solve this is to have the actions on the site to generate a custom event that can be easily recognized by your extension. you can capture the events in the xul overlay, since they'll bubble all the way up: // in the overlay code. document.addeventlistener( "xshellogreetingevent", function(aevent) { /* do stuff*/ }, false); be careful when doing this! you should at least validate the url of the page that is generating the custom event, so that you know that it's coming from the right place. you should also avoid this kind of events to trigger actions that could be destructive to the user's data, because a malicious site could try to trigger these events and cause damage. there's a reason for the division between remote content and local chrome, so make sure you respect...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
the button to the palette using an overlay. in order to add your button to the main toolbar on first run, you'll have to use javascript code. keep in mind that you shouldn't assume anything about the location (or presence!) of any specific buttons; remember users could have moved them or removed them altogether. the toolbar code snippets page has a code sample you can use to do this. remember to validate if your button is already present, to prevent duplicates. it's also a good idea to set a preference that indicates that you added your button already, so that it can be removed permanently if the user chooses to. another option is to use fuel's firstrun property, which also relies on a preference. firefox 3 let extension = application.extensions.get(your_extension_id); if (extension.firstru...
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
ntain "attack!'); format_computer(); alert('done" settimeout("alert('attack!'); format_computer(); alert('done');", 100); as a general rule of thumb, just don't pass code around as strings and execute it by calling eval, settimeout and friends. alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead. closures will ensure the code is still valid, even if your outer function already returned from execution. addeventlistener("load", function() { myaddon.init(); myaddon.onload(); }, true); function doxhr() { //... var response = xhr.responsetext; settimeout(function() { alert(response); }, 100); } alternative: use function.bind() introduced in javascript 1.8.5 function.bind is a new utility function that you may use to (par...
Connecting to Remote Content - Archive of obsolete content
ringify method. let string = json.stringify(jsobject); xml content xml is possibly the most popular data interchange format. let's assume that the xml returned from remote server is this: <?xml version="1.0"?> <data> <shops> <shop> <name>apple</name> <code>a001</code> </shop> <shop> <name>orange</name> </shop> </shops> <total>2</total> </data> when a valid xml response comes back from the remote server, the xml document object can be manipulated using different dom methods, to display the data in the ui or store it into a local datasource. request.onload = function(aevent) { let responsexml = aevent.target.responsexml; let rootelement = responsexml.documentelement; if (rootelement && "parseerror" != rootelement.tagname) { let shopelemen...
JavaScript Object Management - Archive of obsolete content
ect. module files can be imported to a chrome script or to other code modules with the following line: components.utils.import("resource://xulschoolhello/messagecount.js"); when using components.utils.import, code modules must be loaded using a file: or resource: url pointing to a file on the disk. in particular, chrome: urls (even those that point to a file outside a jar archive) are not valid. to get a better idea, let's look at the code of the modified hello world example. we have defined two files, one to declare namespaces and another one for the message count functionality mentioned in the previous exercise. here again we're using a placeholder, 〈modulenamespace〉, for the identifier name that you'll need to choose. var exported_symbols = [ "〈modulenamespace〉" ]; cons...
Setting Up a Development Environment - Archive of obsolete content
n example project with xpcom components is included in the xpcom section. there is also a mention about building c++ xpcom, which is something much more complicated. signing extensions in order to provide additional security for your users, you can choose to add a signature to your extension. the signature verifies that you are the author of this extension, and it can only be done if you have a valid certificate provided by a trusted certificate authority. the only noticeable difference for the user is that the xpi installation dialog will say that the extension was created by you, making the dialog a little easier to trust. it's not common to sign extensions because most users will trust the official add-ons site (amo) rather than rely on extension signatures. on the other hand, it is stand...
XUL School Tutorial - Archive of obsolete content
xul school is a comprehensive add-on development tutorial, focusing on firefox extension development. it is recommended that you read through all of it at least once. while firefox changes rapidly, the content in this tutorial should be up to date and valid. introduction introduction getting started with firefox extensions the essentials of an extension setting up a development environment javascript object management basic functionality adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics the...
Signing an extension - Archive of obsolete content
nsion to work in firefox it must be signed by mozilla, not by yourself. see signing and distributing your add-on. this article describes how to digitally sign your extension for firefox and thunderbird, with a code signing certificate for object signing. the following instructions also apply to a theme and other xpi files. these instructions assume you're working on mac and you've already got a valid certificate from ca. get the signing tool we use nss to sign an extension. this can be easily installed with macports. sudo port install nss export your certificate if you have your certificate in firefox, export it by following the steps below. the certificate which the author purchased from verisign was directly installed to firefox. click the firefox button and select options. in the ...
XUL user interfaces - Archive of obsolete content
if you use a different theme, it changes some user-interface styles and the demonstration might look strange. open the document in your mozilla browser and use the interface. this wiki does not...
Index of archived content - Archive of obsolete content
thenticationinfo npn_getintidentifier npn_getproperty npn_getstringidentifier npn_getstringidentifiers npn_geturl npn_geturlnotify npn_getvalue npn_getvalueforurl npn_hasmethod npn_hasproperty npn_identifierisstring npn_intfromidentifier npn_invalidaterect npn_invalidateregion npn_invoke npn_invokedefault npn_memalloc npn_memflush npn_memfree npn_pluginthreadasynccall npn_posturl npn_posturlnotify npn_releaseobject npn_releasevariantvalue npn_reloadplugins npn_removeproperty n...
MMgc - Archive of obsolete content
nter to a gc object, and the pointer was a member variable in an unmanaged (non-gc) object, check whether the unmanaged object is a gcroot. if it isn't, maybe it needs to be. finding missing write barriers there are some automatic aids in the mmgc library which can help you find missing write barriers. look in mmgc/gc.cpp. // before sweeping we check for missing write barriers bool gc::incrementalvalidation = false; // check for missing write barriers at every alloc bool gc::incrementalvalidationpedantic = false; if you suspect you have missing write barriers, turn these switches on in a debug build. (the second switch will slow your application down a lot more than the first switch, so you could try the first, then the second.) when a missing write barrier is detected, mmgc will assert and d...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
and it sure doesn't help fix old designs that are suddenly blowing apart in recent browsers. there's another obvious fix, which is to make sure your document doesn't trigger the "standards"rendering mode. you can do this by using a doctype that will trigger either "quirks" mode or "almost standards" mode, or not having a doctype appear in your document at all. the lack of a doctype will prevent validation, and so is not recommended. for authors who are working with legacy documents, a "quirks" mode doctype is the best choice. in cases where an author is writing a new document or trying to migrate a design to be as standards-based as possible, then "almost standards" mode is probably a better choice. of course, documents authored in xhtml strict or html strict will trigger the "standards" ren...
Source code directories overview - Archive of obsolete content
or generic high-level browser functions (e.g. forward, back, history). the [#seamonkey-webshell webshell] code wraps these interfaces according to the particular platform and way (e.g. activex) that is being supported. extensions contains c interfaces, c code, xul and javascript code for various add-ins that are related to browsing. these include: cookies, irc, wallet, dom inspector, p3p, schema validation, spellchecker, transformiix, typeaheadfind, javascript debugger, xforms, etc. gfx contains c interfaces and code for platform independent drawing and imaging. it can be used to draw rectangles, lines, images, etc. essentially, it is a a set of interfaces for a platform-independent device (drawing) context. it does not handle widgets or specific drawing routines; it just provides the primiti...
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
it is now possible to automatically handle failed asserts in debug builds of mozilla for windows. the handler receives the assert string, and sequentially attempts to match each word in the string (left to right) to registry dword names from hklm\software\mozilla.org\windbgdlg and hkcu\software\mozilla.org\windbgdlg. at the first match, it will take the action specified by the dword's value. the valid values are: 0x5 automatically ignore 0x4 automatically retry 0x3 automatically abort note that you can also force windbgdlg to prompt, by setting a value of 0xfffffffe. to "comment out" a value, set its value to 0xffffffff. as an example, consider the following failed assertion: assertion: no document: 'mdocument != nsnull', file d:/cvs-1.11.4/mozilla/content/xul/content/src/nsxulelement.cpp, l...
Creating regular expressions for a microsummary generator - Archive of obsolete content
the form <name>=<value>, where <name> and <value> are arbitrary strings. in our url, "item=280018439106" is the only such parameter. but urls can contain multiple named parameters separated by ampersands (&), and the parameters can appear in any order, so even though the "item" parameter seems to be necessary, it might not appear right next to "viewitem". ...
Drag and Drop - Archive of obsolete content
once, such as a set of files. region a region used for feedback indication. this should usually be set to null. actions the actions that the drag uses. this should be set to one of the following constants, or several added together. the action can be changed during the drag depending on what is being dragged over. nsidragservice.dragdrop_action_none used to indicate that no drag is valid. nsidragservice.dragdrop_action_copy the item being dragged should be copied to its dropped location. nsidragservice.dragdrop_action_move the item being dragged should be moved to its dropped location. nsidragservice.dragdrop_action_link a link (or shortcut or alias) to the item being dragged should be created in the dropped location. the interface nsidragservice also provide...
Hidden prefs - Archive of obsolete content
ui has "name or email contains:". this entity (searchnameoremail.label) is defined in messenger.dtd. so if you change the quick search query to match based on phone number, the ui will not match the query. the default (defined in mailnews.js) is: pref("mail.addr_book.quicksearchquery.format","?(or(primaryemail,c,@v)(displayname,c,@v)(firstname,c,@v)(lastname,c,@v))"); "and", "or" and "not" are valid. see http://lxr.mozilla.org/mozilla/sourc...drdatabase.idl for the list of valid attributes "c" == contains. see nsabquerystringtoexpression::createbooleanconditionstring() for other operators. mail composition "other header" pref ("mail.compose.other.header") the format for this a comma delimited list of mail headers, like "approved,x-no-archive" an example for your prefs.js would be: user_pr...
generateCRMFRequest() - Archive of obsolete content
st object. the javascript passed in as the "crmf generation done code" parameter should look at the attribute request of the returned object to get the result of the crmf generation. the string found by accessing crmfobject.request is the base-64 encoded crmf message to be sent to the ca/ra, or an error string. the possible error strings are: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value. "error:usercancel" the user has canceled the key generation operation "error:internalerror" the software encountered some internal error, such as out of memory ...
popChallengeResponse - Archive of obsolete content
hallcontent message. the current implementation does not conform to that defined in the cmmf draft, and we intend to change this implementation to that defined in the cmc rfc.. see below for the current implementation. the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value. "error:internalerror" the software encountered some internal error, such as out of memory challenge-response proof of possession expected input: popodeckeychallcontent ::= sequence of challenge -- one challenge per encryption key certification request (in the -- same order as these requests appear in fullcerttemplate...
First run - Archive of obsolete content
st-run page is defined by the firstrunpage property of your jetpack's manifest. a manifest is simply an object set to a variable named manifest. you may define this variable anywhere in the global namespace of your jetpack. it's the same manifest you use when defining settings for your jetpack. the value of firstrunpage must be either a string or e4x xml. if the value is a both a string and a valid url, the page at that url becomes your first-run page. otherwise, the value is assumed to be html, and it becomes the body of your first-run page. this example sets the first-run page to some html: var manifest = { firstrunpage: '<p>thanks for installing! visit my <a href="http://example.com/myjetpack">homepage</a>.</p>' }; this does the same but uses e4x xml: var manifest = { firstrunpage...
First Run - Archive of obsolete content
first-run page is defined by the firstrunpage property of your jetpack's manifest. a manifest is simply an object set to a variable named manifest. you may define this variable anywhere in the global namespace of your jetpack. it's the same manifest you use when defining settings for your jetpack. the value of firstrunpage must be either a string or e4x xml. if the value is a both a string and a valid url, the page at that url becomes your first-run page. otherwise, the value is assumed to be html, and it becomes the body of your first-run page. this example sets the first-run page to some html: var manifest = { firstrunpage: '<p>thanks for installing! visit my <a href="http://example.com/myjetpack">homepage</a>.</p>' }; this does the same but uses e4x xml: var manifest = { firstrunpa...
Microsummary topics - Archive of obsolete content
ryservice.installgenerator(generatordoc); the service installs the generator by serializing its xml to a file in the user's profile directory and adding the generator to the service's in-memory generator cache. when programmatically installing generators, you should specify a unique identifier for the generator in the uri attribute of the <generator> element. the value of the attribute must be a valid uri, but you can specify an arbitrary identifier using a urn, for example: urn:{835daeb3-6760-47fa-8f4f-8e4fdea1fb16} to guarantee uniqueness, use urns containing uuids generated by the nsuuidgenerator component. see generating a uuid in the nsiuuidgenerator documentation. you may also use another form appropriate to your extension. note: when web sites install generators via window.sidebar.addm...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
"loose" doctype (for example, <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en">, <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">) for the ibm doctype (<!doctype html system "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd">) you can read more about the image gap issue. quirks mode currently, the web is full of invalid html markup, as well as markup that only functions due to bugs in browsers. the old netscape browsers, when they were the market leaders, had bugs. when internet explorer arrived, it mimicked those bugs in order to work with the content at that time. as newer browsers came to market, most of these original bugs, usually called quirks, were kept for backwards compatibility. mozilla supports many o...
NSC_SetPIN - Archive of obsolete content
the user's pin. 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] . description nsc_setpin modifies the pin of user that is currently logged in. this is only valid for the private_key_slot. return value ckr_ok examples #include <assert.h> see also fc_setpin ...
Nanojit - Archive of obsolete content
assembler. the result of compilation is a function that the application can call from c via a pointer to the first instruction. example the following code works with spidermonkey's hacked version of nanojit. figuring out how to compile it is left as an exercise for the reader; the following works when run in the object directory of an --enable-debug spidermonkey shell: g++ -ddebug -g3 -wno-invalid-offsetof -fno-rtti -include js-confdefs.h -i dist/include/ -i.. -i ../nanojit -o jittest ../jittest.cpp libjs_static.a note: remove the -ddebug if you have not compiled spidermonkey with --enable-debug, and use whatever you called the sample source file in place of jittest.cpp. #include <stdio.h> #include <stdint.h> #include "jsapi.h" #include "jstracer.h" #include "nanojit.h" using namespace...
Plug-n-Hack Get Involved - Archive of obsolete content
if you would like to add pnh support to a browser or tool, or even get involved in onward pnh development, then please get in touch and we will give you whatever assistance we can. to contribute or keep up to date with plug-n-hack changes please joion the mozilla plug-n-hack google group. ...
Priority Content - Archive of obsolete content
this page once all articles are migrated. migrators: serge k. keller equivalents security developer central -> security plugins central -> plugins devedge community -> mozilla web developer community notes from devmo wishlist devedge toolbox tools on devedge examples on devedge started: devedge sidebar completed: standards-compliant authoring tools on devedge mostly completed: tools:validators on devedge dependant on the sidebar tabs and the tune-up wizard. ...
Reading textual data - Archive of obsolete content
get to close the stream when you're done with it (is.close()). not doing so can cause problems if you try to rename or delete the file at a later time on some platforms. note that you may get less characters than you asked for, especially (but not only) at the end of the file (stream). unsupported byte sequences you can specify what should happen with byte sequences that do not correspond to a valid character. the last (4th) argument to init specifies which character they get replaced with; nsiconverterinputstream.default_replacement_character is u+fffd replacement character, which is often a good choice. if you do not want any replacement, you can specify 0x0000 as replacement character; that way, readstring will throw an exception when reaching unsupported bytes. reading lines the nsiun...
Frequently Asked Questions - Archive of obsolete content
status page for svg in the development trunk. why does mozilla show source code/gibberish instead of svg? there are two possible reasons for this: a simple mistake in the svg file, or a misconfigured server. if there's a grey area at the top of the source with the text "this xml file does not appear to have any style information associated with it" then the problem is with the svg file. to be valid the root <svg> tag in svg files must have at least the following two "namespace bindings". <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> actually the second binding isn't always required, but unless you understand namespaces, we'd strongly recommend you include it. for more information see this link. if source code is displayed without a gray area at the ...
open - Archive of obsolete content
use to open the file, described in detail here. type a string describing the type of file being opened. description this method opens the file, preparing its resources for use by subsequent methods to examine or modify the file. certain methods of file, such as read and write should not be used when the file is not open. other methods, such as remove may not be used when the file is open. valid file types are text, binary and unicode. text indicates ascii text without nul characters. binary indicates utf-8 files. unicode indicates ucs-2 files. for all file types, carriage returns and linefeeds are treated in a platform-agnostic way. examples example: using open in the following example, myfile is a file object: myfile.open("read", "text"); see also ...
Actionscript Acceptance Tests - Archive of obsolete content
ed after the multiabc file listings. here is a more complicated example that passes both avm args, multiple abcs and test args: -ojit |multiabc| $dir/testname_support/a.abc -- test_args a dir.avm_args file can also be created with the same contents that will apply to the entire directory. testname.as.avm_args files will take precedence over the dir.avm_args file testname.as.tz if a test is only valid for certain timezones, the timezones can be specified in this support file. below is a sample file that covers the 4 main us timezones: # place all timezones that this file applies to. # these values correspond to the value returned by time.tzname tuple. # (see http://docs.python.org/library/time.html for details) # e.g.: eastern standard time/eastern daylight time = ('est','edt') # write timez...
Tamarin - Archive of obsolete content
. see also the possible errata. tamarin build documentation how to get, build, and use tamarin. tamarin build system documentation documentation on how the tamarin build system works and how to modify. tamarin commit hook instructions for installing and using the mercurial hook for tamarin. tamarin acceptance testing instructions on how to validate changes to the tamarin source code. tamarin pages at wiki.mozilla.org more documentation. mmgc overview an overview of the tamarin garbage collector. nanojit lir in nanojit, lir is the source language for compilation to machine code. tamarin strings documentation the implementation of tamarin strings has chang...
URIs and URLs - Archive of obsolete content
the base uri scheme. unfortunately, this can conflict with the correct parsing of non-hierarchical uri. for backwards compatibility, an implementation may work around such references by removing the scheme if it matches that of the base uri and the scheme is known to always use the "hier_part" syntax. the parser can then continue with the steps below for the remainder of the reference components. validating parsers should mark such a misformed relative reference as an error. the decision was made against backwards compatibility. this means that urls like "http:page.html" or "http:/directory/page.html" are interpreted as absolute urls and "corrected" by the parser. also the handling of query segments is different from the examples given in rfc 2396: within an object with a well-define...
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
ing thread context switches. the actual copying of the stack is not such a hardship as one would imagine. with the speed of today's processors (even those running win-16), the copying of 10 - 50 kilobytes of data between two locations in memory is barely measurable 1. what is a hardship is that addresses of dynamic variables, those allocated on the call stack, in a function's local frame, are not valid across thread boundaries. the simplest demonstration of the problem is as follows: typedef struct shareddata { prlock *ml; prcondvar *cv; print32 counter; } shareddata; static void forkedthread(void *arg) { shareddata *shared = (shareddata*)arg; while (--shared->counter > 0) pr_waitcondvar(shared->cv, pr_interval_no_timeout); return; } /* forkedthread */ printn...
Anonymous Content - Archive of obsolete content
enerated from a template if there are insertion points defined within the template for all of the explicit content found underneath the bound element at the time the check for generation is made. if the binding specifies no insertion points for explicit content, then anonymous content will only be constructed if the bound element has no explicit children. assuming that all explicit children have valid insertion points, the anonymous content is generated underneath the bound element. the binding responsible for the generation is referred to as the primary generating binding. whenever the primary generating binding changes on a bound element, all anonymous nodes in the scope of the bound element are destroyed. attribute forwarding attributes on anonymous content elements can be tied to attribu...
Elements - Archive of obsolete content
will match if the shift key is pressed, whether or not the control key is pressed. this will match shift-x or control-shift-x, but no other combinations. keycode - the keycode attribute imposes a filter on key handlers. its value is a key identifier for a specific keycode, e.g., vk_enter. [editor's note: a forthcoming dom events specification will presumably outline the list of valid keycode strings.] if this attribute is present, then its value must match the keycode field of the dom key event object in order for the handler to fire. charcode - the charcode attribute imposes a filter on key handlers. its value is a single character, e.g., "z". if this attribute is present, then its value must match the charcode field of the dom key event object in order for the handler to...
Creating XPI Installer Modules - Archive of obsolete content
a little redundant--and if you want you can instead use the xpi to archive the install script and "flat", or uncompressed, versions of the resources. but the xpi puts all of the resources of your package together, including the instructions for installing it. like the jar format that mozilla uses to archive the ui packages, the xpi format is just a specially-ordered zip file. for a xpi file to be valid and installable, it must contain an installation script like the one above that tells mozilla xpinstall where to put the new resources and how to register them. to create a xpi, use your zip archiver[zip] again to archive the jar file and the installation script install.js. the archive, named barley.xpi, should contain the following two files: barley.jar install.js this zip file, when opened fro...
dirCreate - Archive of obsolete content
rror code. for a list of possible values, see return codes. description the input parameter is a filespecobject that you have already created with the install object's getfolder method. the following simple example demonstrates the use of the dircreate method. note that the getfolder method does not require that the folder or directory you specify exist in order for the object reference to be a valid one. example f = getfolder("program", "mynewdirectory"); err = file.dircreate(f); ...
cancelInstall - Archive of obsolete content
the software; performs cleanup of temporary files. method of install object syntax void cancelinstall() void cancelinstall( int errorcode ) parameters none. returns an integer error code. the optional argument is an error code that can be returned to the triggering page. for most purposes, it's recommended that one of the standard return codes be used. but a script can, in fact, return any valid integer. for a list of possible values, and any custom errorcode created by install writer, see return codes. example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code: initinstall("royal airways tripplanner","/royalairways/ tripplanner","1.0.0.0"); ... err = getlasterror(); if (!err) performinstall(); else cancelinstall(err...
getFolder - Archive of obsolete content
it must be in file: url format minus the "file:///" part. for example, mydir = getfolder("file:///", "c|/mysoftco/somedir"); note that forward slashes are used, regardless of the platform. the folders whose names start with "win", "mac", or "unix" are specific to those platforms. you should be careful about using one of those directories, as it makes yo...
setRootKey - Archive of obsolete content
key an integer representing a root key in the registry. returns nothing. description the setrootkey changes the root key. when you create a winreg object, it is set to access keys under the hkey_classes_root portion of the registry. if you want to access keys in another portion, you must use this method to change the root key. on 16-bit windows platforms, hkey_classes_root is the only valid value and this method does nothing. these root keys are represented as fields of the winreg object. the values you can use are: hkey_classes_root hkey_current_user hkey_local_machine hkey_users example to use the hkey_users section, use these statements: winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_users); ...
XTech 2006 Presentations - Archive of obsolete content
opment with mozilla xulrunner (open office format) - benjamin smedberg this presentation demonstrates the convergence of rich-client and web application development and discuss application deployment using mozilla xulrunner. etna, a wysiwyg xml relax ng- and gecko-based editor - daniel glazman this presentation describes etna, a new wysiwyg xml editor based on gecko, the relax ng parser and validator disruptive innovations implemented for it and its query api, and relax ng extensions that were necessary to solve very old and well known problems in markup languages. an html version of the paper is available here. ...
allownegativeassertions - Archive of obsolete content
when multiple datasources are used, one may override an assertion from another. ...
coalesceduplicatearcs - Archive of obsolete content
when multiple datasources are used, one may override an assertion from another. ...
commandupdater - Archive of obsolete content
...
keycode - Archive of obsolete content
...
popup.position - Archive of obsolete content
word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, including examples, please see popup positioning see also position ...
targets - Archive of obsolete content
the command update will only occur when the event occurs to one of the specified elements. ...
value - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
Attribute (XUL) - Archive of obsolete content
tfocus showcaret showcommentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri useraction validate value var visuallyselected wait-cursor width windowtype wrap wraparound ...
Dynamically modifying XUL-based user interface - Archive of obsolete content
is a document? a document is a data structure which is manipulated through dom apis. a logical structure of every document is a tree, with nodes being elements, attributes, processing instructions, comments, etc. use the dom inspector tool to see the tree representation of any document. todo: simple example of a xul document and a tree you can think of a document as an in-memory representation of valid html or well-formed xml such as xhtml or xul. it is important to remember that different web pages (and even different instances of the same web page) correspond to different documents. each xul window has its own distinct document, and there may even be a few different documents in a single window, when there is an <iframe>, <browser>, or a <tabbrowser> element. you must be sure to always manipu...
XUL Events - Archive of obsolete content
the events listeners can be attached using addeventlistener and removed using removeeventlistener. some of the events can be attached using attributes as well. when attaching event listeners using attributes, be aware that only one listener can be attached at a time. any previously attached listeners are disconnected. the attribute name is the event name with an 'on' prefix. ...
Accessing Files - Archive of obsolete content
refer to a common directory without having to locate it yourself. for a full list of starting directories, see starting directories below. the second argument to nsiscriptableio.getfile() is the filename to locate, which, here, is 'sample.txt'. the result is that a reference is made to the 'sample.txt' file. it is important to note that this file does not have to exist for a file reference to be valid. that is, nsiscriptableio.getfile() will still return a valid file reference even if the file 'sample.txt' does not yet exist. you can check if the file exists by using nsifile.exists(). var file = io.getfile("profile", "sample.txt"); if (file.exists()) alert("the file is there!"); else alert("file not found!"); here, the same file is retrieved and a further check is performed to see whether...
appendNotification - Archive of obsolete content
thrown. label - the label to appear on the button popup - the id of a popup for the button. if null, the button is not a button popup (e.g. a menu). the type property must also be set to "menu", or "menu-button". isdefault - if true, this is the default button. there can be only one default button. if no button has this set, the first button in the array is the default. type - a string. valid values are "menu-button" and "menu" which must be set if the button is to provide a popup via the popup property. notification box events requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) if you specify the eventcallback parameter, it should be a javascript function that gets called when interesting things happen related to the notification box. this function receive...
getBrowserIndexForDocument - Archive of obsolete content
« xul reference home getbrowserindexfordocument( document ) return type: integer returns the index of the browser for the specified document in the tabbrowser the method was invoked on. the returned index is dependent on the tabs in the tabbrowser and is invalidated when the tab ordering changes. it should not be used to track per-tab data during a session; the use of linkedpanel on the corresponding tab is preferred instead. ...
loadURIWithFlags - Archive of obsolete content
« xul reference home loaduriwithflags( uri, flags, referrer, charset, postdata ) return type: no return value load a url into the document, with the specified load flags, the given referrer, character set, and post data. in addition to the flags allowed for the reloadwithflags method, the following flags are also valid: load_flags_is_refresh: this flag is used when the url is loaded because of a meta tag refresh or redirect. load_flags_is_link: this flag is used when the url is loaded because a user clicked on a link. the http referer header is set accordingly. load_flags_bypass_history: do not add the url to the session history. load_flags_replace_history: replace the current url in the session history with a new one. this flag might be used for a redirect. (see n...
Tooltips - Archive of obsolete content
useful means of providing additional details about a user interface without cluttering up the main interface. note that tooltips can only be activated using the mouse, so they should never contain important information that isn't available elsewhere. the tooltiptext attribute in most cases, the tooltip will display only a single label. for this, the tooltiptext attribute may be used, which is valid for all xul elements. the value of this attribute should be the text to appear in the tooltip. <toolbarbutton label="back" tooltiptext="go back one page"/> in this example, a back button on a toolbar is given additional text to appear on a tooltip. this could also be useful if the toolbar is configured such that labels do not appear. if an element does not have a tooltiptext attribute, yet a ...
Attribute Substitution - Archive of obsolete content
e?? my name is ?name"/> in this example, the label might be 'what is my name? my name is jake'. note that a caret only has a special meaning at the end of a variable, thus two in a row are only needed after a variable. one last thing to point out is that since the only characters that can separate a variable are a caret, a space or the end of the attribute, this means that any other character is valid as a variable name. however, for readability, you should restrict variable names to letters, numbers and perhaps hyphens to separate words. it may be desirable to have longer text wrap by placing it as the content of a description element. this means that we want to do variable replacement as text, not as an attribute value. a special tag is used for this purpose, the textnode tag. it has one att...
Result Generation - Archive of obsolete content
to a. to navigate around, you could start at node a and navigate around the graph following the arrows to b, c or d. or you could start at b and go to a and then go to c and d, etc. no requirement exists to follow the arrows in the direction they point; you can easily go the other way (though in only one direction within a given series of iterations). the picture was generated from the w3c's rdf validator, a good place to go to check if your rdf is valid. the text in red are the labels for the arrows, called predicates. in this example, all the arrows have the same label. usually, this won't be the case. templates provide a means of navigating around using only arrows with specific labels. here is one serialization of rdf/xml for this graph, though there are many others. <?xml version="1.0"?>...
textbox (Toolkit autocomplete) - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
Textbox (XPFE autocomplete) - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
Custom toolbar button - Archive of obsolete content
n-name it must contain an at-sign (@), making it look something like an e-mail address, but it does not need to be a real e-mail address. before and after the at-sign, it can only contain the characters a-z, a-z, 0-9, full stop, hyphen and underscore. if you do not own a domain name, you can make up something else. if you want to make it clear that your made-up name is not a real domain, add .invalid to the end. use your new extension id to rename the directory, and specify the same id in your install.rdf file. in your install.rdf file, remove the sections for applications where your button does not work. for example, if your button only works in thunderbird, remove the sections for firefox and sunbird. do the same in button.xul and chrome.manifest. change "custombutton", "custom-button" a...
Tree Widget Changes - Archive of obsolete content
lumns.getkeycolumn().index instead of tree.treeboxobject.getkeycolumnindex(). the nsitreeboxobject.getpagecount() method has been renamed to make it clearer what it does. it returns the number of rows that can be displayed in the tree. this should correspond to the rows attribute on the tree if it was specified. tree.treeboxobject.getpagecount() is now tree.treeboxobject.getpagelength(). the invalidateprimarycell(row) method has been removed, instead use nsitreeboxobject.invalidatecell() like this invalidatecell(row, tree.columns.getprimarycolumn()). this may be used to redraw a cell after it or its data has been changed. the nsitreeview.cycleheader() method has been changed, cycleheader(colid, element) is now just cycleheader(column), since the code can get the element from the column obje...
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
tch any of the handler events, it is simply passed to the inner content as usual. the general handler syntax is as follows: <binding id="binding-name"> <handlers> <handler event="event-name" action="script"/> </handlers> </binding> place all of your handlers within the handlers element. each handler element defines the action taken for a particular event specified by its event attribute. valid event types are those supported by xul and javascript, such as click and focus. use the event name without the 'on' in front of it. a common reason to set handlers is to modify the custom properties when an event occurs. for example, a custom checkbox might have a checked property which needs to be changed when the user clicks the checkbox: <handlers> <handler event="mouseup" action="this.check...
Anonymous Content - Archive of obsolete content
a window, you will see that it is made up of an arrow button, a slider, a thumb inside it and a second arrow button at the end, which are the elements that appear in the xbl above. these elements would in turn be bound to other bindings that use the base xul elements. notice that the content elements need the xul namespace (they appear preceded with xul:), because they are xul elements and aren't valid in xbl. this namespace was declared on the bindings tag. if you don't use the namespace on xul elements, mozilla will assume that the elements are xbl, not understand them, and your elements won't work correctly. filename input field example another example, this time for a field for entering a filename: <binding id="fileentry"> <content> <textbox/> <button label="browse..."/> </conte...
Creating Dialogs - Archive of obsolete content
f you try the example above, you will find that the dook() function is called when the ok button is pressed and the docancel() function is called when the cancel button is pressed. the two functions dook() and docancel() both return true, which indicates that the dialog should be closed. if the dialog shouldn't be closed, false should be returned instead. this would be used, for example, if an invalid value was entered in a field in the dialog. amongst other useful attributes are buttonlabelaccept - label to appear on the accept button egsave buttonaccesskeyaccept - access key to use for the accept button egs defaultbutton - button is activated when the enter key is pressed note: the label attributes are required by remote sites and are probably missing in the above examples due to bu...
Element Positioning - Archive of obsolete content
is larger than the maximum width of the button. of course, a solution would be to increase the size of the button. however, buttons (and other elements with a label) have a special attribute called crop that allows you to specify how the text may be cropped if it is too big. if the text is cropped, an ellipsis (...) will appear on the button where the text was taken out. four possible values are valid: left the text is cropped on its left side right the text is cropped on its right side center the text is cropped in the middle. none the text is not cropped. this is the default value. this attribute is really only useful when a dialog has been designed to be useful at any size. the crop attribute can also be used with other elements that use the label attribute for labels. the follo...
Focus and Selection - Archive of obsolete content
, when it occurs, will call the displayfocus function. this function will change the value of the text label. we could extend this example to remove the text when the blur event occurs. typically, you will use focus and blur events to update parts of the interface as the user selects elements. for instance, you might update a total as the user enters values in other fields, or use focus events to validate certain values. don't display an alert during a focus or blur event as this will be distracting for the user and is poor user interface design. you can also add event handlers dynamically using the dom function addeventlistener. you can use it for any element and event type. it takes three parameters, the event type, a function to execute when the event occurs and a boolean indicating whether ...
Keyboard Shortcuts - Archive of obsolete content
<menuitem id="close-command" label="close" accesskey="c"/> </menupopup> </menu> </menubar> you can also use the accesskey attribute on buttons. when the key is pressed in this case, the button is selected. you might want to set up more general keyboard shortcuts however. for example, pressing ctrl + c to copy text to the clipboard. although shortcuts such as this might not always be valid, they will usually work any time the window is open. usually, a keyboard shortcut will be allowed at any time and you can check to see whether it should do something using a script. for example, copying text to the clipboard should only work when some text is selected. key element xul provides an element, key, which lets you define a keyboard shortcut for a window. it has attributes to specify ...
More Menu Features - Archive of obsolete content
ting submenus and checked menus creating submenus you can create submenus inside other menus (nested menus) using the existing elements. remember that you can put any element inside a menupopup. we've looked at placing menuitems and menuseparators in menupopups. however, you can create submenus by simply placing the menu element inside the menupopup element. this works because the menu element is valid even when it isn't directly placed inside a menu bar. the example below creates a simple submenu inside the file menu example 1 : source view <toolbox flex="1"> <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menu id="new-menu" label="new"> <menupopup id="new-popup"> <menuitem label="window"/> ...
Numeric Controls - Archive of obsolete content
lt value; if this attribute is omitted, the field will be initially set to the current date or time. the format of the attribute is exactly as above, that is dates are of the form yyyy/mm/dd and times are of the form hh:mm:ss (although the seconds and the accompanying colon may be omitted). these two elements ensure that the user enters a value date or time. this way, you do not have to check for valid dates, ensure that the day isn't greater than the number of days in the month, handle leap years, and so forth. while the timepicker only comes is one style, the datepicker has three different variations. the default style shows three fields for entering the year, month and date. the type attribute may be used to select the other two. using a value of grid uses a calendar grid, as shown in the im...
Tree Box Objects - Archive of obsolete content
object in the previous section. it is used to indicate that one or more rows have been added to the tree or removed from the tree. the tree will redraw the affected area. you don't need to call the rowcountchanged() function when a row has simply changed in some way, for example if a cell's label changes. in this case, there are other drawing functions that can be used. the simplest is to call invalidaterow() which will redraw a specific row in the tree. the tree will call the view to get the updated data and update the contents of the tree on screen. other redrawing functions are invalidatecell() to redraw only a single cell invalidatecolumn() to redraw a column invalidaterange() to redraw a range of rows invalidate() to redraw the entire tree. note that redrawing does not occur unti...
Updating Commands - Archive of obsolete content
of the paste command in your application. the only other thing you need to do is ensure that the enabled status of the paste command, and therefore the button, is updated at the right time, which is described below. command updaters a command updater is a feature of the commandset element which allows it to update commands when certain events happen. you will need to think about when a command is valid and when it is not. in addition, you will need to consider when the state could change and when the commands should be updated. for example, the paste command is valid when a textbox has the focus and there is something on the clipboard to paste. the command will become enabled whenever a textbox is focused and when the clipboard contents change. a command updater will listen for these situations...
XBL Attribute Inheritance - Archive of obsolete content
cel" oktitle="ok" canceltitle="cancel" image="happy.png"> <button label="ok" image="happy.png"/> <button label="cancel"/> </box> note that the attributes are duplicated on the inner (anonymous) content. changing the attributes on the box with the okcancel class will automatically change the values on the buttons. you may also have noticed that we just made up our own attribute names. this is valid in xul. if you need to map an attribute to the text content of the node, use "xbl:text" as the inner attribute, eg: <xul:description xbl:inherits="xbl:text=value"/> in the next section, we look at adding properties, methods and events to a binding. « previousnext » ...
XPCOM Interfaces - Archive of obsolete content
ce is supported by a component, you can use the instanceof operator to check: var afile = components.classes["@mozilla.org/file/local;1"].createinstance(); if (afile instanceof components.interfaces.nsilocalfile){ // do something } the instanceof operator returns true if afile implements the nsilocalfile interface. this also has the side effect of calling queryinterface(), so afile will be a valid nsilocalfile afterwards. calling the functions of an interface now that we have an object that refers to a component with the nsilocalfile interface, we can call the functions of nsilocalfile through it. the table below shows some of the properties and methods of the nsilocalfile interface. initwithpath this method is used to initialize the path and filename for the nsilocalfile. the first...
XUL accessibility tool - Archive of obsolete content
ake them more general sprinkle the a11y techniques throughout the turorial and reference. run checking tool on firefox, thunderbird and other apps looking for bugs and fixing them. improve tool along the way add checking tool to dom inspector or other popular xul debugging tools. merge with other xul checking tools -- this doesn't need to be a11y-specific. one problem is that mark finkle's xul validator tool uses a different engine. add the tool into the addons.mozilla.org review process go through the most useful/popular extensions with tool and fix a11y issues add checker to tinderbox so that bugs are caught at checkin time some or all of this work could be done through grants, and a likely person to oversee the grant deliverables and milestones would be mark finkle. he has volunteered...
browser - Archive of obsolete content
e a string, not a nsiuri object. to get a string from an nsiuri, use nsiuri.spec or nsiuri.asciispec loaduriwithflags( uri, flags, referrer, charset, postdata ) return type: no return value load a url into the document, with the specified load flags, the given referrer, character set, and post data. in addition to the flags allowed for the reloadwithflags method, the following flags are also valid: load_flags_is_refresh: this flag is used when the url is loaded because of a meta tag refresh or redirect. load_flags_is_link: this flag is used when the url is loaded because a user clicked on a link. the http referer header is set accordingly. load_flags_bypass_history: do not add the url to the session history. load_flags_replace_history: replace the current url in the session histo...
description - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
key - Archive of obsolete content
Archive › Mozilla › XUL › key
us and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. key type: character the character that must be pressed. this should be set to a displayable character. keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute. valid keys are listed at keyboard shortcuts. keytext type: string a label for the keyboard shortcut. this text would appear next to a menuitem label if that menuitem is associated with the key element via its key attribute. modifiers type: space-separated list of the values below a list of modifier keys that should be pressed to invoke the keyboard shortcut. multiple keys may be separ...
listbox - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
listitem - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
menulist - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
menupopup - Archive of obsolete content
word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, including examples, please see popup positioning top type: integer overrides the vertical position of the popup specified by the showpopup method. properties accessibletype type: integer ...
menuseparator - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
notification - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
notificationbox - Archive of obsolete content
thrown. label - the label to appear on the button popup - the id of a popup for the button. if null, the button is not a button popup (e.g. a menu). the type property must also be set to "menu", or "menu-button". isdefault - if true, this is the default button. there can be only one default button. if no button has this set, the first button in the array is the default. type - a string. valid values are "menu-button" and "menu" which must be set if the button is to provide a popup via the popup property. getnotificationwithvalue( value ) return type: notification element retrieve the notification with a particular value. the value is specified when adding the notification with appendnotification. if no matching value is found, returns null. removeallnotifications( immediate ) ...
panel - Archive of obsolete content
Archive › Mozilla › XUL › panel
word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, including examples, please see popup positioning titlebar type: string set the panel's titlebar attribute to the value normal to display a panel with a titlebar. the noautohide attribute must be set to true. ...
prefwindow - Archive of obsolete content
hat the button will be activated when the enter key is pressed. this should be set to one of the same values as those for the buttons attribute. instantapply (readonly) indicates whether the window is in "instant apply" mode. the value is read from browser.preferences.instantapply boolean user preference. (?? it's declared as a <field>, so you can set the value, however i don't believe it's valid to do that.) lastselected type: string set this to the id of the last selected pane. it will be opened by default the next time the preferences dialog is opened. preferencepanes type: dom nodelist holds a list of all the prefpane elements in the window. type type: string gets and sets the value of the type attribute. methods inherited methods addeven...
radio - Archive of obsolete content
Archive › Mozilla › XUL › radio
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
radiogroup - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
richlistbox - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
richlistitem - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
scale - Archive of obsolete content
Archive › Mozilla › XUL › scale
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
tooltip - Archive of obsolete content
word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, including examples, please see popup positioning properties accessibletype type: integer a value indicating the type of accessibility object for the element. label type: strin...
treecell - Archive of obsolete content
s you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute...
Deploying XULRunner - Archive of obsolete content
s, etc macos/ xulrunner (this is the "stub executable"... you should copy this file from /library/frameworks/xul.framework/versions/1.8/xulrunner.) when deploying with xulrunner 2.0, move chrome.manifest to the root directory, and adjust resource paths inside chrome.manifest accordingly. additionally, your mac app will not run without a valid info.plist file. here's a sample one: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>cfbundledevelopmentregion</key> <string>english</string> <key>cfbundleexecutable</key> <string>xulrunner</string> <key>cfbundlegetinfostring</key> <string>1.0</string> ...
Archived Mozilla and build documentation - Archive of obsolete content
s xul explorer xul explorer is a xulrunner application that provides an easy way to experiment with xul. it’s a simple editor that can preview xul inline or in a separate popup window. it has a list of code snippets (small fragments of xul or javascript) that can be quickly inserted into the editor. the xul can be loaded from and saved to files. a xul validator and the error console are both available to help debug problems. the help menu provides access to xul information on mdc. there is even simple “keyword” help lookup for xul elements. xulrunner xulrunner is a mozilla runtime package that can be used to bootstrap xul+xpcom applications that are as rich as firefox and thunderbird. it provi...
2006-11-22 - Archive of obsolete content
ssible module, would you please take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=166994 he stated that he almost had it working a couple of years ago. the bug has a very old patch which will no longer be easy to apply but may provide clues as to where they are going wrong. for more information click here. discussions image labelling for blind help machines frank hecker brought up a valid discussion about the problem of getting images tagged for use by screen. he cited some valuable resources on the topic courtesy of the washington post. read the article here meetings none ...
2006-10-06 - Archive of obsolete content
egor announced that .mac support and a dynamically add isp account feature has been added to the thunderbird account manager, however, testing is required before release can be issued. hence, they are looking for a mac user to test out the new features by building a mac.rdf file with all of the various .mac account properties mentioned in the document here. discussions is thunderbird using a valid w3c coding? peter lairo requested someone who are knowledgeable in w3c standards to confirm if the use of <blockquote type="cite"> is valid w3c code. q & a q: walt experienced an unusual behaviour in his build and wanted to perform an experiment to figure out the problem, but he couldn't find the mozilla.org's config file. a: robert helmer pointed out the mozilla.org's config file could be ...
2006-10-13 - Archive of obsolete content
ild. he has disabled xft and has tried looking at related postings by benjamin smedberg gcc-40-workarounds and gcc-and-visibility-one-step-forward-hit-a-brick-wall announcements please help us test the new tinderbox and bonsai server installations paul reed announced that they are setting up a new installation of the tinderbox and bonsai servers onto new, supported hardware. some testing and validation has been done, but they would like other people to look at the installations and complete the setup before they switch over. new tinderbox installation new bonsai installation if any inconsistencies are found please use bugzilla to let them know discussions there were no discussions this week. meetings there were no meetings this week. ...
2006-11-10 - Archive of obsolete content
summary: mozilla.dev.security - november 4, 2006 to november 10, 2006 return to mozilla-dev-security announcements none during this week. discussions why now? (was: extended validation certificates) a continuation of last week's discussion on extended validation certificates, the there post was getting unruly at 147 replies. good ideas a splinter off of the extended validation certificates discussion going over whether or not fraudulent websites may get these certificates and if so how to prevent this from happening. meetings none during this week. ...
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.security - november 11, 2006 to november 17, 2006 return to mozilla-dev-security announcements none during this week. discussions how to detect firefox updates externally? micahc asked if there is an easier way to detect if firefox is installed and fully patched on any given machine, externally. extended validation certificates a note as to how opera is handling extended validation certificates http://labs.opera.com/news/2006/10/09/ fwd: re: mozilla questions regarding the ev standard gervase markham posted a summary of questions emailed to kelvin yiu about the extended validation certificates. meetings none during this week. ...
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.security - november 18, 2006 to november 24, 2006 return to mozilla-dev-security announcements none during this week. discussions continuing discussions on the extended validation certificates large amount of activity this week regarding the extended validation certificates, duane posted several snippets of interesting debates as to whether or not the protocol should be introduced. mozilla backing off from "extended validation"? yet more people disgruntled by ev proposal mozilla, opera and co only tout open standards as it suits them in addition eddy nigg posted an alternative proposal for the use of extended validation certificates ev certificates / another proposal meetings none during this week. ...
2006-09-29 - Archive of obsolete content
summary: mozilla.dev.tech.layout september 22-29, 2006 announcements no announcements for this week. discussions discussion on how the firefox 1.5.0.7 dom generates xhtml inline elements using wordpress. it was determined that the generated elements from wordpress do not follow the wc3 guidelines in appendix c of xhtml 1.0. although the w3 validation accepted the generated xhtml as valid, a bug identified within the html working group ignored the invalid elements. details can be located at layout confusion refactoring the nshtmlreflowstate(computeblockboxdata, initconstraints) and nsimageframe::getdesiredsize which uses ns_inrinsicsize, into the following method: /** * compute the size that a frame will occupy. called while * constructing the nshtmlreflowstate to be used to ...
NPAPI plugin developer guide - Archive of obsolete content
nstance creation instance destruction shutdown initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the p...
NPN_GetURLNotify - Archive of obsolete content
n as possible. for requests that complete successfully: if the target is non-null, the browser calls npp_urlnotify() after it has finished loading the url. if the target is null, the browser calls npp_urlnotify() after closing the stream by calling npn_destroystream(). if this function is called with a target parameter value of _self or a parent to _self, this function should return nperr_invalid_param. this is the only way to notify the plug-in once it is deleted. warning: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), npn_geturlnotify() does not notify the plug-in if notifydata is null. see bug 638367 for details. see also npn_geturl() npn_posturl() npn_posturlnotify() npp_urlnotify() npp ...
NPN NewStream - Archive of obsolete content
eam. when the plug-in has written all of its data into the stream, npn_destroystream terminates the stream and deallocates the npstream object. the target parameter is the name of the target window or frame, or one of several special target names. for parameter values and information about how to use them, see npn_geturl. if the new stream has the target of _self, this function should return an invalid_param np error. see also npp_newstream, npp_write, npp_destroystream, npstream, npp ...
NPN_PostURLNotify - Archive of obsolete content
ory buffer. npn_posturlnotify calls npp_urlnotify upon successful or unsuccessful completion of the request. for more information, see npn_posturl. npn_posturlnotify is typically asynchronous: it returns immediately and only later handles the request and calls npp_urlnotify. if this function is called with a target parameter value of _self or a parent to _self, this function should return an invalid_param nperror. this is the only way to notify the plug-in once it is deleted. see npn_geturl for information about this parameter. see also npn_geturl, npp_urlnotify, npn_posturl ...
NPP - Archive of obsolete content
plug-in instance and passes a pointer to it to npp_new(). this pointer--which is an opaque instance handle of a plug-in--identifies the instance on which api calls should operate. npp contains private instance data for both the plug-in and the browser. the npp_destroy() function informs the plug-in when the npp instance is about to be deleted; after this call returns, the npp pointer is no longer valid. see also npp_new() npp_destroy() ...
NPP_Destroy - Archive of obsolete content
see also npp_new, np_shutdown, npp, npn_memalloc, npsaveddata ...
NPP_New - Archive of obsolete content
ror. if unsuccessful, the function returns an error code. for possible values, see error codes. description npp_new creates a new instance of a plug-in. it is called after np_initialize and is passed the mime type, embedded or full-screen display mode, and, for embedded plug-ins, information about html embed arguments. a new instance pointer (npp instance) is created by the plug-in, which is valid until the instance is destroyed with npp_destroy. if instance data was saved from a previous instance of the plug-in by the npp_destroy function, it is returned in the saved parameter for the current instance to use. all attributes in the embed tag (standard and private) are passed in npp_new in the argn and argv arrays. the browser ignores any non-standard attributes within an embed tag. this ...
NPP_NewStream - Archive of obsolete content
e outparam being initialized to a default np_normal value. returns if successful, the function should return nperr_no_error. if unsuccessful, the function should return one of the nperror error codes. this will cause the browser to destroy the stream without calling npp_destroystream. description npp_newstream notifies the plug-in when a new stream is created. the npstream* pointer is valid until the stream is destroyed. the plug-in can store plug-in-private data associated with the stream in stream->pdata. the mime type of the stream is provided by the type parameter. the data in the stream can be the file specified in the src attribute of the embed tag, for an embedded instance, or the file itself, for a full-page instance. a plug-in can also request a stream with the function np...
NPP_SetWindow - Archive of obsolete content
ime, but with different values. if the window handle is set to null, the window is destroyed. in this case, the plug-in must not perform any additional graphics operations on the window and should free any associated resources. the data structure passed in npp_setwindow is an npwindow object, which contains the coordinates of the instance's area and various platform-specific data. this window is valid for the life of the instance, or until npp_setwindow is called again with a different value. for windowed plug-ins on windows and unix, the window parameter contains a handle to a subwindow of the browser window hierarchy. on mac os, this field points to an np_port structure. for windowless plug-ins, it is a platform-specific handle to a drawable. before setting the window parameter to point to...
NPSetWindowCallbackStruct - Archive of obsolete content
e. depth standard x toolkit attribute. depth of the plug-in window or drawable. description callback structures are used to pass platform-specific information. the npsetwindowcallbackstruct object, allocated by the browser, contains information required for the ws_info field of an npwindow. the npp_setwindow() function passes a pointer to this structure to the plug-in. the structure is valid for the lifetime of the npwindow, that is, until npp_setwindow() is called again or the instance is destroyed. the type field of this structure always contains np_setwindow. the remaining fields are standard x toolkit attributes of the top-level shell window in the browser window hierarchy. see also npp_setwindow() npwindow npprintcallbackstruct npanycallbackstruct ...
NPStream - Archive of obsolete content
. streams produced by the browser: the browser creates the npstream object and passes it to the plug-in initially as a parameter to npp_newstream. all api calls that operate on the stream (such as npp_writeready and npp_write) use a pointer to this stream. the browser informs the plug-in when the stream is about to be deleted through npp_destroystream, after which the npstream object is no longer valid. streams produced by the plug-in: the browser creates the npstream object and returns it as an output parameter when the plug-in calls npp_newstream. the plug-in must pass a pointer to the npstream to all api calls that operate on the stream, such as npn_write and npn_destroystream. see also npp_newstream, npp_destroystream, npp_destroystream ...
NPWindow - Archive of obsolete content
pwindow specify the position and size of this area. the browser calls npp_setvalue whenever the drawable changes. a windowed plug-in is drawn into a native window (or portion of a native window) on a web page. for windowed plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable (a pointer to an npwindow allocated by the browser). this window is valid until npp_setwindow is called again with a different window or the instance is destroyed. a windowless plug-in is drawn into a target called a drawable, which can be defined in several ways depending on the platform. for windowless plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable. the plug-in should not modify the field values in this st...
NP_Port - Archive of obsolete content
porty; } np_port; fields the data structure has the following fields: port standard mac os port into which the plug-in should draw. portx, porty top-left corner of the plug-in rectangle in port coordinates (taking the scroll position into account). description on mac os, the window field of an npwindow structure points to an np_port object, which is allocated by the browser. the np_port is valid for the lifetime of the npwindow, that is, until npp_setwindow is called again with a different value or the instance is destroyed. since the port is shared between the plug-in and other plug-ins and the browser, the plug-in should always do the following: draw only within the area designated by the npwindow. save the current port settings before changing the port for drawing. set the desired...
Digital Signatures - Archive of obsolete content
y is known only to its proprietor. the keys are related mathematically, but the parameters are chosen so that calculating the private key from the public key is either impossible or prohibitively expensive.the encrypted hash, along with other information, such as the hashing algorithm, is known as a digital signature. figure 1 shows a simplified view of the way a digital signature can be used to validate the integrity of signed data. figure 1 shows two items transferred to the recipient of some signed data: the original data and the digital signature, which is basically a one-way hash (of the original data) that has been encrypted with the signer's private key. to validate the integrity of the data, the receiving software first uses the signer's public key to decrypt the hash. it then uses ...
Vulnerabilities - Archive of obsolete content
lability. there are many ways in which vulnerabilities can be categorized. this article uses three high-level vulnerability categories: software flaws, security configuration issues, and software feature misuse. these categories are described below. vulnerability categories a software flaw vulnerability is caused by an unintended error in the design or coding of software. an example is an input validation error, such as user-provided input not being properly evaluated for malicious character strings and overly long values associated with known attacks. another example is a race condition error that allows the attacker to perform a specific action with elevated privileges. a security configuration setting is an element of a software’s security that can be altered through the software itself...
Sunbird Theme Tutorial - Archive of obsolete content
ust contain an at-sign (<tt>@</tt>), making it look something like an e-mail address, but it does not need to be a real e-mail address. before and after the at-sign, it can only contain the characters a-z, a-z, 0-9, full stop, hyphen and underscore. if you do not own a domain name, you can make up something else. if you want to make it clear that your made-up name is not a real domain, add <tt>.invalid</tt> to the end. create a new directory in the <tt>extensions</tt> directory. use the identifer as your new directory's name. this new directory is your theme directory. go into your theme directory. creating information about your theme in your theme directory, create a plain text file named <tt>install.rdf</tt>. copy and paste the content from here, making sure that you scroll to get all of ...
Building a Theme - Archive of obsolete content
<em:homepageurl>http://www.example.com/</em:homepageurl> </description> </rdf> sample@example.net - the id of the extension. this is a value you come up with to identify your extension in email address format (note that it should not be your email). make it unique. you could also use a guid. note: this parameter must be in the format of an email address, although it does not have to be a valid email address. (example.example.example) 4 - the type of the add-on. '4' declares that it is installing a theme. if you were to install an extension it would be 2 (see install manifests#type for other type codes). {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - firefox's application id. 29.0 - the exact version number of the earliest version of firefox you're saying this extension will work with. nev...
Common Firefox theme issues and solutions - Archive of obsolete content
to test this please go to bug 324777 using the default theme and activate the "click me" link. the url bar of the resulting popup window is disabled. ad...
Theme changes in Firefox 3 - Archive of obsolete content
the location bar has been deprecated; instead, themes should style the new #identity-box element depending on its verifieddomain/verifiedidentity class. the go button is now located inside the location bar, so the image for it (chrome://browser/skin/go-arrow.png) needs to be smaller. the rule that's needed to show and hide the go button and other location bar icons is: #urlbar[pageproxystate="invalid"] > #urlbar-icons > :not(#go-button) , #urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button { visibility: collapse; } images to add add the following images: chrome://global/skin/icons/information-16.png used when presenting information notices. chrome://global/skin/icons/warning-16.png used when displaying warnings. images to remove the following images were removed: chr...
References - Archive of obsolete content
ascript best practices lists 15 of the most frequent coding practices which create problems for javascript and dhtml-driven webpages. the webpage explains and proposes with small examples the best coding practices and most recommendable ways of developing problem-free javascript code. from matt kruse debugging html and css is a well designed website explaining well the how, why and where of html validation, css validation and debugging tools. we highly recommend this site. it is also available in french. from dan. <- previous section: summary of changes ...
Using Web Standards in your Web Pages - Archive of obsolete content
opers chained to the browser-quirk-oriented markup of the 1990s-often because they don't realize it is possible to support current standards while accommodating old browsers." -web standards project this article provides an overview of the process for upgrading the content of your web pages to conform to the world wide web consortium (w3c) web standards. the first 2 sections address exclusively validation issues, benefits of validation, deprecated elements, deprecated attributes. how to upgrade a webpage markup code to pass validation and how to implement css are addressed by providing recommendations, tutorials and references. the other sections address dom and dhtml coding practices which are at odds with the w3c web standards and suggest replacements. every proposed w3c web standards repl...
-moz-border-bottom-colors - Archive of obsolete content
er is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the bottom border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3...
-moz-border-left-colors - Archive of obsolete content
rder is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the left border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3...
-moz-border-right-colors - Archive of obsolete content
der is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the right border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3...
-moz-border-top-colors - Archive of obsolete content
order is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the top border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3...
E4X - Archive of obsolete content
Archive › Web › E4X
x 21. use domparser/domserializer or a non-native jxon algorithm instead. ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x is standardized by ecma international in ecma-357 standard (currently in its second edition, december 2005). e4x is implemented (at least partially) in spidermonkey (gecko's javascript engine) and in rhino (javascript engine written in java). note: in gecko 1.8 based browsers such as firefox 1.5, e4x is already partially enabled for web pa...
Introduction - Archive of obsolete content
variable declarations are not limited to one element, and as with all javascript, can span multiple lines. var element2 = <foo> <bar/> </foo>; additionally, you can specify all of the normal attributes on elements that you would normally include in an xml document. var element3 = <foo baz="1"/>; manipulating elements the goal of e4x was to provide an easier way for javascript programmers to manipulate an xml document, without going through the dom interfaces. ...
@cc_on - Archive of obsolete content
ities of the compilers can be determined by using other methods. when you write a script for a web page, always put conditional compilation code in comments. this enables hosts that do not support conditional compilation to ignore it. it is strongly recommended that you use the @cc_on statement in a comment, so that browsers that do not support conditional compilation will accept your script as valid syntax: an @if or @set statement outside of a comment also activates conditional compilation. example the following example illustrates the use of the @cc_on statement. /*@cc_on @*/ /*@ document.write("javascript version: " + @_jscript_version + "."); document.write("<br />"); @if (@_win32) document.write("running on the 32-bit version of windows."); @elif (@_win16) ...
@set - Archive of obsolete content
warning: conditional compilation is not supported in internet explorer 11 standards mode and windows 8.x store apps. conditional compilation is supported in internet explorer 10 standards mode and in all earlier versions. the @set statement creates variables used with conditional compilation statements. syntax @set @varname = term parameters varname valid javascript variable name. must be preceded by an "@" character at all times. term zero or more unary operators followed by a constant, conditional compilation variable, or parenthesized expression. remarks numeric and boolean variables are supported for conditional compilation. strings are not. variables created using @set are generally used in conditional compilation statements, but can be used anywhere in javascript...
LiveConnect Overview - Archive of obsolete content
a try block to handle the exception, as follows: function getclass(javaclassname) { try { var theclass = java.lang.class.forname(javaclassname); } catch (e) { return ("the java exception is " + e); } return theclass; } in this example, if javaclassname evaluates to a legal class name, such as "java.lang.string", the assignment succeeds. if javaclassname evaluates to an invalid class name, such as "string", the getclass function catches the exception and returns something similar to the following: the java exception is java.lang.classnotfoundexception: string for specialized handling based on the exception type, use the instanceof operator: try { // ... } catch (e) { if (e instanceof java.io.filenotfound) { // handling for filenotfound } else { throw e; ...
Old Proxy API - Archive of obsolete content
ived trap is undefined, a default implementation using the fundamental traps is used. in other words: fundamental traps are required, derived traps are optional. fundamental traps emulated javascript code handler method description object.getownpropertydescriptor(proxy, name) getownpropertydescriptor: function(name) -> propertydescriptor | undefined should return a valid property descriptor object, or undefined to indicate that no property with name exists in the emulated object. object.getpropertydescriptor(proxy, name) getpropertydescriptor: function(name) -> propertydescriptor | undefined this function doesn't exist in ecmascript 5. like getownpropertydescriptor, but should also search the prototype chain. object.getownpropertynames(pro...
RDF: Resource Description Framework for metadata - Archive of obsolete content
Archive › Web › RDF
is rdf tim bray's introduction to the resource description framework, at xml.com. ...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
, slippery things, and tables are very much not. so i decided to break up the content so that there is a self-contained bit of markup for each fish, and then get down to styling. here's what one of those bits looks like once all the css has been applied. in order to make the fish cam page as agile as the fish themselves, it was necessary to strip out all of the tables, font tags, and other non-validating stuff. at the end of it, there were a series of div elements that contained a picture of the fish, the name of the fish, and one or more paragraphs of text about the fish. here's a typical (and short) example. <div class="card"> <img src="thumb_clown_trigger.jpg" alt="clown trigger" border="0" width="150" height="115"> <h3>clown trigger</h3> <p> our clown trigger is a bold little fish, th...
Writing JavaScript for XHTML - Archive of obsolete content
n use it to bypass the non-existing cookie, if your document is of type xml. again, you will have to write your own wrapper to respect any given combination of mime type and browser. problem: i can't use document.write() this problem has the same cause as the one above. this method does not exist in xmldocuments anymore. there are reasons why this decision was made, one being that a string of invalid markup will instantly break the whole document. solution: use dom methods many people avoided dom methods because of the typing to create one simple element, when document.write() worked. now you can't do this as easily as before. use dom methods to create all of your elements, attributes and other nodes. this is xml proof, as long as you keep the namespace problem in focus (e.g., there is a do...
XForms Custom Controls - Archive of obsolete content
omstring value); /** * return true if the instance node is readonly as determined by the mdg. */ boolean isreadonly(); /** * return true if the instance node is relevant as determined by the mdg. */ boolean isrelevant(); /** * return true if the instance node is required as determined by the mdg. */ boolean isrequired(); /** * return true if instance node is valid as determined by the mdg. */ boolean isvalid(); /** * return true if the control is bound to an instance node. */ boolean hasboundnode(); /** * return the bound instance node. */ nsidomnode getboundnode(); /** * set the content of the instance node. if aforceupdate is true then the * xforms model will rebuild/recalculate/revalidate/refresh. */ void setcon...
Troubleshooting XForms Forms - Archive of obsolete content
it checks your form for a lot of errors. it is not perfect, but it can spot a lot of errors. always check the javascript console (tools, javascript console) for errors. if you get errors there, do not expect your form to work. ...
XForms Label Element - Archive of obsolete content
the label text can be specified in instance data, in a remote document, or as inline text. if more than one source of label text is specified for this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ...
XForms - Archive of obsolete content
xforms interfaces documentation. xforms ui elements reference xforms user interface elements documentation. ...
Archived open Web documentation - Archive of obsolete content
operating system. e4x ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x tutorial this tutorial walks you through the basic syntax of e4x (ecmascript for xml). with e4x, programmers can manipulate an xml document with a syntax more familiar to javascript programming. talk:array.foreach() ok, in the end i did...
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
to use the same value as its parent element for a given property. /* rule to fix quirks-mode inheritance behavior */ table, caption { font-size: inherit; font-weight: inherit; font-style: inherit; font-variant: inherit; } this rule will override the rule in quirk.css and thus allow the author to have reliable inheritance of font styles into tables when in "quirks" mode. it is also fully valid css2 and so will validate without incident. recommendations in situations where authors must put a document into "quirks" mode but wish to enforce correct font inheritance into tables, use the demonstrated rule. related resources mozilla's doctype sniffing original document information author(s): eric a. meyer, netscape communications last updated date: published 26 nov 2002 copy...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
rendered in "quirks" mode. in browsers based on the engine found in mozilla 1.3b and later, this quirk is extended to cover selectors that combine a bare class selector with the :hover pseudo-class (see bug 169078 for details). named anchor problems in addition to the effects described previously, there are two other relatively common effects that authors may not expect. one is easily fixed by validation, but the other is a little more subtle. first, there is the problem of authors who open a named anchor but do not close it. for example: <a name="pagetop"> <h2>my page</h2> without a </a>, this name will effectively enclose the rest of the document. this generally means that the rest of the document will take hover styles. consider the effects of the following rule: a:hover {color: red;}...
Mozilla's DOCTYPE sniffing - Archive of obsolete content
ublic identifier "-//w3c//dtd html 4.01 transitional//en", with a system identifier. the public identifier "-//w3c//dtd html 4.01 frameset//en", with a system identifier. quirks mode the following trigger quirks mode (this list needs to be comprehensive to ensure that pages already existing on the web trigger quirks mode): the following sites have been useful in preparing this list: w3c html validator, htmlhelp html validator. the absence of a doctype. an xml declaration (pseudo-pi) without a doctype (in other words, ignore the xml declaration and use the doctype). in 1.0 and 1.1alpha and earlier (but not in 1.0.1 or 1.1beta), the presence of an xml declaration triggered full standards mode. a doctype declaration that cannot be understood (e.g., no matching quote). the system identif...
RDF in Mozilla FAQ - Archive of obsolete content
by any mozilla code yet. (do we have a bug registered to track this? -- danbri) another possible problem: for remotely-loaded xul and rdf, you might need to adjust mozilla's security restrictions (see belowfor example code). if xul isn't loading your rdf, and the mimetype is ok, this could well be your problem. you can use the rdfcat and rdfpoll utilities to verify that the rdf/xml is actually valid. both of these programs are built by default on windows, and on linux when the configure --enable-tests is specified. rdfcat url takes as a parameter a url from which to read an rdf/xml file, and will "cat" the file back to the console. you can use it to verify that the rdf/xml that you've written is being properly parsed by mozilla. rdfpoll url [interval ] takes as a parameter a url from...
Web Standards - Archive of obsolete content
tandards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals. community view mozilla forums... mailing list newsgroup rss feed the web standards project webdev feedhouse other community links... tools firebug extension web developer extension markup validation service (w3c) css validation service (w3c) examples mozilla 1.0 demos - showing off what can be done with web standards. gecko demos css zen garden eric meyers's css/edge w3c dom demos related topics css, dhtml, html, web development, xhtml, xml the web standards project ...
Archive of obsolete content
watch. it also adds a preference dialog that lets you switch to a stock other than one of the ones included in the popup menu. an interview with douglas bowman of wired news one of the web's oldest news sites, wired news draws between 20 and 25 million page views every month. on october 11, 2002, wired launched a brand-new site design that uses validating xhtml for its structure and a small collection of css files for its layout. the new design clearly shows what some experts have been saying: that standards-based design can be visually compelling and preserve the interface conventions we've come to expect from web pages. api archived documentation about obsolete web standards apis. archived mozilla a...
Anatomy of a video game - Game development
f the previous one was not empty or terminated. */ ;(function () { function main() { window.requestanimationframe( main ); // your main loop contents } main(); // start the cycle })(); when the browser comes across this iife, it will define your main loop and immediately queue it for the next frame. it will not be attached to any object and main (or main() for methods) will be a valid unused name in the rest of the application, free to be defined as something else. note: in practice, it is more common to prevent the next requestanimationframe() with an if-statement, rather than calling cancelanimationframe(). for the second issue, stopping the main loop, you will need to cancel the call to main() with window.cancelanimationframe(). you will need to pass cancelanimationfram...
asm.js - Game development
ake use of it, and further resources and examples. what is asm.js, exactly? it is a very small, strict subset of javascript that only allows things like `while`, `if`, numbers, top-level named functions, and other simple constructs. it does not allow objects, strings, closures, and basically anything that requires heap allocation. asm.js code resembles c in many ways, but it's still completely valid javascript that will run in all current engines. it pushes js engines to optimize this kind of code, and gives compilers like emscripten a clear definition of what kind of code to generate. we will show what asm.js code looks like and explain how it helps and how you can use it. this subset of javascript is already highly optimized in many javascript engines using fancy just-in-time (jit) compil...
Gecko FAQ - Gecko Redirect 1
principle of course applies to other browser engine development projects and products based upon them as well.) known bugs in the open-source gecko codebase are documented in bugzilla. here are some links to lists of reported bugs related to the standards mentioned above; be aware that these raw lists of open in-process bugs will inevitably include some duplicate, out of date, unreproducible, invalid, and incorrectly tagged reports: the links themselves are probably outdated too. layout component tracks content layout bugs that may be related to a variety of specifications html 4.0 elements, form controls, frames, tables, and form submission bug reports marked with the html4 keyword "meta bug" for tracking outstanding issues with html 4.01 compliance css: style system c...
Plug-in Development Overview - Gecko Plugin API Reference
rent from the name of the file on disk. drawing a plug-in instance before drawing itself on the page, the plug-in must provide information about itself, set the window or other target in which it draws, arrange for redrawing, and handle events. a windowless plug-in can call the following netscape methods to draw itself: npn_forceredraw: force a paint message for windowless plug-ins. npn_invalidaterect: invalidate an area in a windowless plug-in before repainting or refreshing. npn_invalidateregion: invalidate an area in a windowless plug-in before repainting or refreshing. the browser calls these plug-in methods: npp_getvalue: query the plug-in for information. npp_print: request a platform-specific print operation for the instance. npp_setvalue: set the browser information. np...
502 - MDN Web Docs Glossary: Definitions of Web-related terms
normally the upstream server is not down (i.e. ...
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
the control flow is the order in which the computer executes statements in a script. code is run in order from the first line in the file to the last line, unless the computer runs across the (extremely frequent) structures that change the control flow, such as conditionals and loops. for example, imagine a script used to validate user data from a webpage form. the script submits validated data, but if the user, say, leaves a required field empty, the script prompts them to fill it in. to do this, the script uses a conditional structure or if...else, so that different code executes depending on whether the form is complete or not: if (field==empty) { promptuser(); } else { submitform(); } a typical script in javascript or php (and the like) includes many control structures...
Cross-site scripting - MDN Web Docs Glossary: Definitions of Web-related terms
ripting (xss) is a security exploit which allows an attacker to inject into a website malicious client-side code. this code is executed by the victims and lets the attackers bypass access controls and impersonate users. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. these attacks succeed if the web app does not employ enough validation or encoding. the user's browser cannot detect the malicious script is untrustworthy, and so gives it access to any cookies, session tokens, or other sensitive site-specific information, or lets the malicious script rewrite the html content. learn more general knowledge cross-site scripting (xss) cross-site scripting on wikipedia cross-site scripting on owasp another article about cro...
Empty element - MDN Web Docs Glossary: Definitions of Web-related terms
an empty element is an element from html, svg, or mathml that cannot have any child nodes (i.e., nested elements or text nodes). the html, svg, and mathml specifications define very precisely what each element can contain. many combinations have no semantic meaning, for example an <audio> element nested inside an <hr> element. in html, using a closing tag on an empty element is usually invalid. for example, <input type="text"></input> is invalid html. the empty elements in html are as follows: <area> <base> <br> <col> <embed> <hr> <img> <input> <keygen>(html 5.2 draft removed) <link> <meta> <param> <source> <track> <wbr> ...
Fuzz testing - MDN Web Docs Glossary: Definitions of Web-related terms
this is an important way to ensure that software is stable, reliable, and secure, and we use fuzzing a lot at mozilla. ...
Graceful degradation - MDN Web Docs Glossary: Definitions of Web-related terms
...
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
csp navigation directives are used in a content-security-policy header and govern to which location a user can navigate to or submit a form to, for example. navigation directives don't fall back to the default-src directive. list of csp navigation directives form-action restricts the urls which can be used as the target of a form submissions from a given context. frame-ancestors specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. navigate-to restricts the urls to which a document can initiate navigation by any means, including <form> (if form-action is not specified), <a>, window.location, window.open, etc. learn more https://www.w3.org/tr/csp/#directives-navigation other kinds of directives: fetch directive document ...
Null - MDN Web Docs Glossary: Definitions of Web-related terms
the meaning of a null reference varies among language implementations. in javascript, null is marked as one of the primitive values, because its behaviour is seemingly primitive. ...
Progressive Enhancement - MDN Web Docs Glossary: Definitions of Web-related terms
ives should be provided where possible. progressive enhancement is a useful technique that allows web developers to focus on developing the best possible websites while making those websites work on multiple unknown user agents. graceful degradation is related but is not the same thing and is often seen as going in the opposite direction to progressive enhancement. in reality both approaches are valid and can often complement one another. learn more general knowledge progressive enhancement on wikipedia ...
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
hackers can maliciously pass sql commands through the web app for execution by a backend database. sql injection can gain unauthorized access to a database or to retrieve information directly from the database. many data breaches are due to sql injection. ...
Session Hijacking - MDN Web Docs Glossary: Definitions of Web-related terms
session hijacking occurs when an attacker takes over a valid session between two computers. the attacker steals a valid session id in order to break into the system and snoop data. most authentication occurs only at the start of a tcp session. in tcp session hijacking, an attacker gains access by taking over a tcp session between two machines in mid session. session hijacking occurs because no account lockout for invalid session ids weak session-id generation algorithm insecure handling indefinite session expiration time short session ids transmission in plain text session hijacking process sniff, that is perform a man-in-the-middle (mitm) attack, place yourself between victim and server. monitor packets flowing between server and user. break the victim machine's conn...
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
, web browsing, messaging, and other protocols. both ssl and tls are client / server protocols that ensure communication privacy by using cryptographic protocols to provide security over a network. when a server and client communicate using tls, it ensures that no third party can eavesdrop or tamper with any message. all modern browsers support the tls protocol, requiring the server to provide a valid digital certificate confirming its identity in order to establish a secure connection. it is possible for both the client and server to mutually authenticate each other, if both parties provide their own individual digital certificates. note: tls 1.0 and 1.1 support will be removed from all major browsers in early 2020; you'll need to make sure your web server supports tls 1.2 or 1.3 going forw...
Type - MDN Web Docs Glossary: Definitions of Web-related terms
characteristic of a value affecting what kind of data it can store, and the structure that the data will adhere to. for example, a boolean data type can hold only a true or false value at any given time, whereas a string has the ability to hold a string or a sequence of characters, a number can hold numerical values of any kind, and so on. a value's data type also affects the operations that are valid on that value. for example, a value of type number can be multiplied by another number, but not by a string - even if that string contains only a number, such as the string "2". types also provides us with useful knowledge about the comparison between different values. comparison between structured types is not always an easy assumption, as even if the previous data structure is the same, there ...
UTF-8 - MDN Web Docs Glossary: Definitions of Web-related terms
utf-8 (ucs transformation format 8) is the world wide web's most common character encoding. each character is represented by one to four bytes. utf-8 is backward-compatible with ascii and can represent any standard unicode character. the first 128 utf-8 characters precisely match the first 128 ascii characters (numbered 0-127), meaning that existing ascii text is already valid utf-8. all other characters use two to four bytes. each byte has some bits reserved for encoding purposes. since non-ascii characters require more than one byte for storage, they run the risk of being corrupted if the bytes are separated and not recombined. learn more general knowledge utf-8 on wikipedia faq about utf-8 on unicode website ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
ser-defined' } responsetype = 'responsetext'; break; case null: case 'xml': responsetype = 'responsexml'; break; default: alert('xinclude element contains an invalid "parse" attribute value'); return false; break; } request.send(null); if((request.status === 200 || request.status === 0) && request[responsetype] !== null) { response = request[responsetype]; if (responsetype === 'responsexml') { ...
MDN Web Docs Glossary: Definitions of Web-related terms
t layer security (tls) tree shaking trident truthy ttl turn type type coercion type conversion u udp (user datagram protocol) ui undefined unicode uri url urn usenet user agent utf-8 ux v validator value variable vendor prefix viewport visual viewport voip w w3c wai wcag web performance web server web standards webassembly webdav webextensions webgl webidl webkit webm webp webrtc ...
Backgrounds and borders - Learn web development
no-repeat, url(big-star.png) center no-repeat, rebeccapurple; } we'll return to how the shorthand works later in the tutorial, but first let's have a look at the different things you can do with backgrounds in css, by looking at the individual background properties. background colors the background-color property defines the background color on any element in css. the property accepts any valid <color>. a background-color extends underneath the content and padding box of the element. in the example below, we have used various color values to add a background color to the box, a heading, and a <span> element. play around with these, using any available <color> value. background images the background-image property enables the display of an image in the background of an element. in ...
Type, class, and ID selectors - Learn web development
only have a single id value applied to them. it can select an element that has the id set on it, and you can precede the id with a type selector to only target the element if both the element and id match. you can see both of these uses in the following example: warning: using the same id multiple times in a document may appear to work for styling purposes, but don't do this. it results in invalid code, and will cause strange behavior in many places. note: as we learned in the lesson on specificity, an id has high specificity and will overrule most other selectors. this can make them difficult to deal with. in most cases it is preferable to add a class to the element rather than use an id, however if using the id is the only way to target the element — perhaps because you do not have ...
How CSS works - Learn web development
will do this if you have made an error and misspelled a property or value, or if the property or value is just too new and the browser doesn't yet support it. similarly, if a browser encounters a selector that it doesn't understand, it will just ignore the whole rule and move on to the next one. in the example below i have used the british english spelling for color, which makes that property invalid as it is not recognised. so my paragraph has not been colored blue. all of the other css have been applied however; only the invalid line is ignored. <p> i want this text to be large, bold and blue.</p> p { font-weight: bold; colour: blue; /* incorrect spelling of the color property */ font-size: 200%; } this behavior is very useful. it means that you can use new css as an enhancemen...
What text editors are available? - Learn web development
it easier on yourself by choosing a text editor that understands the technologies you're working with. many text editors help you out with features like: syntax highlighting. make your file more legible by color-coding keywords based on the technology you're using. code completion. save you time by auto-completing recurring structures (for example, automatically close html tags, or suggesting valid values for a given css property). code snippets. as you saw when starting a new html document, many technologies use the same document structure over and over. save yourself the hassle of retyping all this by using a code snippet to pre-fill your document. most text editors now support syntax highlighting, but not necessarily the other two features. make sure in particular that your text edito...
What is a URL? - Learn web development
ks on the web. objective: you will learn what a url is and how it works on the web. summary with hypertext and http, url is one of the key concepts of the web. it is the mechanism used by browsers to retrieve any published resource on the web. url stands for uniform resource locator. a url is nothing more than the address of a given unique resource on the web. in theory, each valid url points to a unique resource. such resources can be an html page, a css document, an image, etc. in practice, there are some exceptions, the most common being a url pointing to a resource that no longer exists or that has moved. as the resource represented by the url and the url itself are handled by the web server, it is up to the owner of the web server to carefully manage that resource and ...
Advanced form styling - Learn web development
article of this module, we will explore the different ui pseudo-classes available to us in modern browsers for styling forms in different states. ...
HTML forms in legacy browsers - Learn web development
, if polyfills are missing, it's no big deal. the best way to polyfill missing api is by using the modernizr library and its spin-off project: yepnope. modernizr is a library that allows you to test the availability of functionality in order to act accordingly. yepnope is a conditional loading library. here is an example: modernizr.load({ // this tests if your browser supports the html5 form validation api test : modernizr.formvalidation, // if the browser does not support it, the following polyfill is loaded nope : form-validation-api-polyfill.js, // in any case, your core app file that depends on that api is loaded both : app.js, // once both files are loaded, this function is called in order to initialize the app. complete : function () { app.init(); } }); the mo...
Example - Learn web development
>*</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, text...
Other form controls - Learn web development
e to check up on details. now that you have a grasp of the html behind the different available form controls, we'll take a look at styling them. ...
Styling web forms - Learn web development
, it's easy to style them using css. in the next article, we will see how to handle form widgets which fall into the "bad" and "ugly" categories. ...
Test your skills: Advanced styling - Learn web development
advanced form styling 3 in our final task for this assessment series, we provide you with a feedback form that is already nicely-styled — you've already seen something similar if you've worked through our ui pseudo-classes article, and now we want you to come up with your own solution. what we'd like you to do is make use of some advanced pseudo-classes to provide some useful indicators of validity. 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. download the starting point for this task to work in your own editor or in an online editor. assessment or further help ...
JavaScript basics - Learn web development
believe it's good practice to have semicolons at the end of each statement. there are other rules for when you should and shouldn't use semicolons. for more details, see your guide to semicolons in javascript. note: you can name a variable nearly anything, but there are some restrictions. (see this section about naming rules.) if you are unsure, you can check your variable name to see if it's valid. note: javascript is case sensitive. this means myvariable is not the same as myvariable. if you have problems in your code, check the case! note: for more details about the difference between var and let, see the difference between var and let. after declaring a variable, you can give it a value: myvariable = 'bob'; also, you can do both these operations on the same line: let myvaria...
Getting started with HTML - Learn web development
page had to follow to be considered good html. doctypes used to look something like this: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> more recently, the doctype is a historical artifact that needs to be included for everything else to work right. <!doctype html> is the shortest string of characters that counts as a valid doctype. that is all you need to know! <html></html>: the <html> element. this element wraps all the content on the page. it is sometimes known as the root element. <head></head>: the <head> element. this element acts as a container for everything you want to include on the html page, that isn't the content the page will show to viewers. this includes keywords and a page description that would ...
Marking up a letter - Learn web development
ttp://example.com as the url. mark up the university motto quote and citation with appropriate elements. the head of the document the character set of the document should be set as utf-8 using the appropriate meta tag. the author of the letter should be specified in an appropriate meta tag. the provided css should be included inside an appropriate tag. hints and tips use the w3c html validator to validate your html. award yourself bonus points if it validates. you don't need to know any css to do this assignment. you just need to put the provided css inside an html element. example the following screenshot shows an example of what the letter might look like after being marked up. assessment or further help if you would like your work assessed, or if you get stuck and want ...
Graceful asynchronous programming with Promises - Learn web development
you could even do this, since the functions just pass their arguments directly, so there isn't any need for that extra layer of functions: choosetoppings().then(placeorder).then(collectorder).then(eatpizza).catch(failurecallback); this is not quite as easy to read, however, and this syntax might not be usable if your blocks are more complex than what we've sh...
Function return values - Learn web development
t this point, we'd like you to have a go at writing out a couple of functions of your own and adding them to the library. how about the square or cube root of the number? or the circumference of a circle with a given radius? some extra function related tips: look at another example of writing error handling into functions. it is generally a good idea to check that any necessary parameters are validated, and that any optional parameters have some kind of default value provided. this way, your program will be less likely to throw errors. think about the idea of creating a function library. as you go further into your programming career, you'll start doing the same kinds of things over and over again. it is a good idea to create your own library of utility functions to do these sorts of thing...
Making decisions in your code — conditionals - Learn web development
dition returns true or false. this is not necessarily a bad thing, but it might not be what you want — often you want to run one block of code or the other, not both. as a final point, you may sometimes see if...else statements written without the curly braces, in the following shorthand style: if (condition) code to run if condition is true else run some other code instead this is perfectly valid code, but using it is not recommended — it is much easier to read the code and work out what is going on if you use the curly braces to delimit the blocks of code, and use multiple lines and indentation. a real example to understand this syntax better, let's consider a real example. imagine a child being asked for help with a chore by their mother or father. the parent might say "hey sweethea...
Drawing graphics - Learn web development
orad(0), degtorad(360), false); ctx.fill(); } requestanimationframe(draw); } draw(); note: the <input> range and color types are supported fairly well across browsers, with the exception of internet explorer versions less than 10; also safari doesn't yet support color. if your browser doesn't support these inputs, they will fall back to simple text fields and you'll just have to enter valid color/number values yourself. webgl it's now time to leave 2d behind, and take a quick look at 3d canvas. 3d canvas content is specified using the webgl api, which is a completely separate api from the 2d canvas api, even though they both render onto <canvas> elements. webgl is based on opengl (open graphics library), and allows you to communicate directly with the computer's gpu. as such, wr...
Third-party APIs - Learn web development
meters respectively. so, a complete url would end up looking something like this: https://api.nytimes.com/svc/search/v2/articlesearch.json?api-key=your-api-key-here&page=0&q=cats &fq=document_type:("article")&begin_date=20170301&end_date=20170312 note: you can find more details of what url parameters can be included at the nytimes developer docs. note: the example has rudimentary form data validation — the search term field has to be filled in before the form can be submitted (achieved using the required attribute), and the date fields have pattern attributes specified, which means they won't submit unless their values consist of 8 numbers (pattern="[0-9]{8}"). see form data validation for more details on how these work. requesting data from the api now we've constructed our url, le...
Basic math in JavaScript — numbers and operators - Learn web development
is greater than the right one. 10 > 20 <= less than or equal to tests whether the left value is smaller than or equal to the right one. 3 <= 2 >= greater than or equal to tests whether the left value is greater than or equal to the right one. 5 >= 4 note: you may see some people using == and != in their tests for equality and non-equality. these are valid operators in javascript, but they differ from ===/!==. the former versions test whether the values are the same but not whether the values' datatypes are the same. the latter, strict versions test the equality of both the values and their datatypes. the strict versions tend to result in fewer errors, so we recommend you use them. if you try entering some of these values in a console, you'll see...
Learning area release notes - Learn web development
it has new examples available and techniques covered. it has a new structure to make for a more effective learning experience. more "test your skills" sections have been added. you can see these on: css layout: flexbox css layout: grids css layout: floats december 2019 we are adding a new type of asse...
Introduction to the server side - Learn web development
gramming languages (the exception being javascript, which can be used on the server- and client-side). they run inside different operating system environments. code running in the browser is known as client-side code and is primarily concerned with improving the appearance and behavior of a rendered web page. this includes selecting and styling ui components, creating layouts, navigation, form validation, etc. by contrast, server-side website programming mostly involves choosing which content is returned to the browser in response to requests. the server-side code handles tasks like validating submitted data and requests, using databases to store and retrieve data and sending the correct data to the client as required. client-side code is written using html, css, and javascript — it is ru...
Website security - Learn web development
+ "';" if the user specifies a real name, the statement will work as intended. however, a malicious user could completely change the behavior of this sql statement to the new statement in the following example, by simply specifying the text in bold for the username. select * from users where name = 'a';drop table users; select * from userinfo where 't' = 't'; the modified statement creates a valid sql statement that deletes the users table and selects all data from the userinfo table (which reveals the information of every user). this works because the first part of the injected text (a';) completes the original statement. to avoid this sort of attack, you must ensure that any user data that is passed to an sql query cannot change the nature of the query. one way to do this is to escape a...
Server-side website programming - Learn web development
you want to view a different product on amazon. in the modern world of web development, learning about server-side development is highly recommended. learning pathway getting started with server-side programming is usually easier than client-side development, because dynamic websites tend to perform a lot of very similar operations (retrieving data from a database and displaying it in a page, validating user-entered data and saving it in a database, checking user permissions and logging users in, etc.), and are constructed using web frameworks that make these and other common web server operations easy. basic knowledge of programming concepts (or of a particular programming language) is useful, but not essential. similarly, expertise in client-side coding is not required, but a basic knowl...
Getting started with Ember - Learn web development
a "byte code" that can be parsed faster than javascript. the glimmer vm enables extremely fast dom change tracking without the need to manage and diff a cached virtual representation (which is a common approach to mitigating the slow i/o of dom changes). for more information on the technical aspects of the glimmer vm, the github repository has some documentation — specifically, references and validators may be of interest. everything else in ember is just javascript. in particular, javascript classes. this is where most of the "framework" parts come into play, as there are superclasses, where each type of thing has a different purpose and different expected location within your project. here is a demonstration the impact ember has on the javascript that is in typical projects: gavin demo...
Framework main features - Learn web development
ariable. handlebars uses a double-pair of curly braces, instead of a single pair. given this handlebars template: <header> <h1>hello, {{subject}}!</h1> </header> and this data: { subject: "world" } handlebars will build html like this: <header> <h1>hello, world!</h1> </header> typescript typescript is a superset of javascript, meaning it extends javascript — all javascript code is valid typescript, but not the other way around. typescript is useful for the strictness it allows developers to enforce on their code. for instance, consider a function add(), which takes integers a and b and returns their sum. in javascript, that function could be written like this: function add(a, b) { return a + b; } this code might be trivial for someone accustomed to javascript, but it could ...
Getting started with Svelte - Learn web development
ript> svelte uses the export keyword to mark a variable declaration as a property (or prop), which means it becomes accessible to consumers of the component (e.g. other components). this is one example of svelte extending javascript syntax to make it more useful, while keeping it familiar. the markup section in the markup section you can insert any html you like, and in addition you can insert valid javascript expression inside single curly brackets ({}). in this case we are embedding the value of the name prop right after the hello text. <main> <h1>hello {name}!</h1> <p>visit the <a href="https://svelte.dev/tutorial">svelte tutorial</a> to learn how to build svelte apps.</p> </main> svelte also supports tags like {#if...}, {#each...}, and {#await...} — these examples allow you to co...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
hat its parent can call to give focus to it. it's a very common scenario that a component needs to expose some behavior or information to the consumer; let's see how to achieve it with svelte. we've already seen that svelte uses export let var = ... to declare props. but if instead of using let you export a const, class or function, it is read-only outside the component. function expressions are valid props, however. in the following example, the first three declarations are props, and the rest are exported values: <script> export let bar = 'optional default initial value' // prop export let baz = undefined // prop export let format = n => n.tofixed(2) // prop // these are readonly export const thisis = 'readonly' ...
Creating our first Vue component - Learn web development
way is to just list props out as an array of strings. each entry in the array corresponds to the name of a prop. the second way is to define props as an object, with each key corresponding to the prop name. listing props as an object allows you to specify default values, mark props as required, perform basic object typing (specifically around javascript primitive types), and perform simple prop validation. note: prop validation only happens in development mode, so you can't strictly rely on it in production. additionally, prop validation functions are invoked before the component instance is created, so they do not have access to the component state (or other props). for this component, we’ll use the object registration method. go back to your todoitem.vue file. add a props propert...
Getting started with Vue - Learn web development
ile: app.vue. let's explore this now. app.vue open your app.vue file — you’ll see that it has three parts: <template>, <script>, and <style>, which contain the component’s template, scripting, and styling information. all single file components share this same basic structure. <template> contains all the markup structure and display logic of your component. your template can contain any valid html, as well as some vue-specific syntax that we'll cover later. note: by setting the lang attribute on the <template> tag, you can use pug template syntax instead of standard html — <template lang="pug">. we'll stick to standard html through this tutorial, but it is worth knowing that this is possible. <script> contains all of the non-display logic of your component. most importantly, you...
Adding a new todo form: Vue events, methods, and models - Learn web development
of event modifiers: .stop: stops the event from propagating. equivalent to event.stoppropagation() in regular javascript events. .prevent: prevents the event's default behavior. equivalent to event.preventdefault(). .self: triggers the handler only if the event was dispatched from this exact element. {.key}: triggers the event handler only via the specified key. mdn has a list of valid key values; multi-word keys just need to be converted to kebab case (e.g. page-down). .native: listens for a native event on the root (outer-most wrapping) element on your component. .once: listens for the event until it's been triggered once, and then no more. .left: only triggers the handler via the left mouse button event. .right: only triggers the handler via the right mouse butto...
Styling Vue components with CSS - Learn web development
enter; margin: 0; margin-bottom: 1rem; } </style> if you check the app, you'll see that our todo list is now in a card, and we have some better formatting of our to-do items. now we can go through and begin editing our components to use some of these styles. adding css classes in vue we should apply the button css classes to the <button> in our todoform component. since vue templates are valid html, this is done in the same way to how you might do it in plain html — by adding a class="" attribute to the element. add class="btn btn__primary btn__lg" to your form’s <button> element: <button type="submit" class="btn btn__primary btn__lg"> add </button> while we're here, there's one more semantic and styling change we can make. since our form denotes a specific section of our page...
Implementing feature detection - Learn web development
'd use those properties. first of all, make a local copy of the modernizr-js.html example file. attach the modernizr library to the html using a <script> element, as we have done in previous demos. put it above the existing <script> element, which is attaching the google maps api to the page. next, fill in the your-api-key placeholder text in the second <script> element (as it is now) with a valid google maps api key. to get a key, sign in to a google account, go to the get a key/authentication page, then click the blue get a key button and follow the instructions. finally, add another <script> element at the bottom of the html body (just before the </body> tag), and put the following script inside the tags: if (modernizr.geolocation) { navigator.geolocation.getcurrentposition(functi...
Handling common JavaScript problems - Learn web development
nt and eslint; these can be used in a variety of ways, some of which we'll detail below. online the jshint homepage provides an online linter, which allows you to enter your javascript code on the left and provides an output on the right, including metrics, warnings, and errors. code editor plugins it is not very convenient to have to copy and paste your code over to a web page to check its validity several times. what you really want is a linter that will fit into your standard workflow with the minimum of hassle. many code editors have linter plugins, for example github's atom code editor has a jshint plugin available. to install it: install atom (if you haven't got an up-to-date version already installed) — download it from the atom page linked above. go to atom's preferences...
Deploying our app - Learn web development
ach project. open the package.json file in your project's root directory, and find the scripts property. we'll add a build command that we can run to build our code. add the following line to your project now: "scripts": { ... "build": "parcel build src/index.html" } note: if the scripts property already has a command inside it, put a comma at the end of it. keep the json valid. you should now be able to run the following command in the root of your project directory to run the production build step (first quit the running process with ctrl + c if you need to): npm run build this should give you an output like the following, showing you the production files that were created, how big they are, and how long they took to build: dist/src.99d8a31a.js.map ...
Theme concepts
distracting for a practical theme. you can also animate themes programmatically, which we discuss in dynamic themes. updating static themes if your static theme is hosted on amo, you can upload a new version using the developer hub with the following steps: visit the product page for your theme through the developer hub select "upload new version" on the left upload your packaged file for validation or modify it using the theme generator for self-hosted static themes, a new version can be updated through amo by following the above steps or be handled by you through an updateurl or external application updates. a new version will need to be signed through the developer hub. if you are uploading a packaged file, the version number must be higher than the current version number dyna...
Adding a new event
rnal event class of a dom event class, it should be internal. aname defines its event class specific name and it must end with "event" or "eventbase". the latter is used only for abstruct super event class whose instance will never be created. please note that aname must not be same as other event classes even if aprefix is different. i.e., defining both widgetfooevent and internalfooevent is invalid. define and implement an event class then, you need to define and implement an event class. you should choose a good header file from what your event class represents. basicevents.h this header file should be used only for defining generic purpose event class such as a common super class of various event classes. probably, you shouldn't use this for your class. contentevents.h this header...
Application cache implementation overview
ncy limit of 15 loads. when concurrency limit is reached, the processnexturi self-invocation cycle is stopped. from now on processnexturi can only be called from loadcompleted() again. note: the processnexturi method early returns when state of the update is different then downloading. on downloading state loadcompleted checks whether load of the item succeeded. if so, its marked as valid in the new cache version and processnexturi() is called. otherwise, the update invokes onerror and 'finishes'. when processnexturi discovers there are no more items to download it starts a “manifest check” implemented by nsmanifestcheck. nsmanifestcheck downloads the manifest from the server one more time and checks its content has not changed again. the results is...
Testopia
on releasing new features often and early rather than back porting. however, this means that most major feature will not be back ported to earlier versions unless and until we have time to do so. anyone wishing to help in this effort is more than welcome. bugzilla 4.x mysql 5.0 or postgresql 8.3 mozilla compatible browser ;-) additional perl modules: text::csv xml::schema validator xml::schema::parser (for importer) and json 2.10 todo user preferences notification emails more reports see the roadmap and bug list for more details. links faq wiki docs bugs (please read the bug reporting guide) official testopia blog irc: #testopia or #bugzilla user help support-webtools@lists.mozilla.org developers...
Building SpiderMonkey with UBSan
e-by-zero, which jesse doesn't think is actually undefined behavior (aside from the question of whether cpu overflow flags are set) vptr, a check that requires rtti, which is disabled by default in spidermonkey 4. when you hit a bug and want a stack trace, run under gdb with a breakpoint at the end of __ubsan::diag::~diag(). the stack trace should show a function such as __ubsan_handle_load_invalid_value or __ubsan_handle_type_mismatch being called by the buggy c++ code. (for automated testing outside of gdb, you can instead build with -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error, but then you lose ubsan's diagnostics and the ability to continue past errors.) known bugs. please file new bugs with e.g. [-fsanitize=float-cast-overflow] in the status whiteboard. ...
Choosing the right memory allocator
es extensions with binary components. see the xpcom string guide for additional information. ns_alloc() == nsimemory::alloc() ns_realloc() == nsimemory::realloc() ns_free() == nsimemory::free() nsmemory::clone() (note: not part of nsimemory) see infallible memory allocation for information about how to allocate memory infallibly; that is, how to use memory allocators that will only return valid memory buffers, and never return null. allocating strings in xpcom code see "callee-allocated parameters" in the xpcom strings guide; use tonewcstring() or tonewunicode() to allocate strings that will be passed out. these methods convert ns*string to nsimemory allocated, unowned [pruni]char* buffers. do not use nscrt::strdup for returning values from an xpcom object, as that uses a different a...
Cookies Preferences in Mozilla
f network.cookie.lifetimepolicy is set to 1 true = accepts session cookies without prompting false = prompts for session cookies network.cookie.thirdparty.sessiononly default value: false true = restrict third party cookies to the session only false = no restrictions on third party cookies network.cookie.maxnumber default value: 1000 configures the maximum amount of cookies to be stored valid range is from 0-65535, rfc 2109 and 2965 require this to be at least 300 network.cookie.maxperhost default value: 50 configures the maximum amount of cookies to be stored per host valid range is from 0-65535, rfc 2109 and 2965 require this to be at least 20 network.cookie.disablecookieformailnews default value: true true = do not accept any cookies from within mailnews or from mail-style u...
Debugging OpenGL
after every opengl call. this can help make it much easier to debug crashes and hangs that make the computer unusable (thereby stymieing attempts to debug). the moz_gl_debug_abort_on_error environment variable, if set, causes firefox to abort as soon as an opengl error occurs. this is generally only useful in cases where you know that no error should occur, since there are cases where perfectly valid webgl code may generate opengl errors. you don't have to define more than one of these; for example, if you set moz_gl_debug_abort_on_error, the moz_gl_debug setting is assumed. ...
Makefile - variables
test variable description enable_tests boolean value that should wrapper all unit tests to allow disabling on demand[1]. python_unit_tests list of python scripts to check exit status for make check xpc_shell_tests no_xpcshell_manifest_check inhibit validating manifest files when running xpcshell tests. compiler variable description gnu_cc defined if the gnu gcc compiler is available. module_optimize_flags additional flags for enabling or overriding compiler optimizations(-o2). solaris_sunpro_cc sun studio compiler export v...
Makefiles - Best practices and suggestions
dencies change or have been removed. incorrect dependencies will contribute to wasted cycles and can contribute to circular dependencies. directory dependencies do not use directories as a dependency for generated targets, ever. any activity within a directory will alter inodes forcing targets to always be stale. for ex, individual unit tests would invalidate all prior test activity whenever a test touched a timestamp file in the directory to signal success. parallel make: add an explicit timestamp dependency (.done) that make can synchronize threaded calls on to avoid a race condition. # transient directory for storing timestamps ts=.ts ##################################################### ## extra dep needed to syn...
Windows SDK versions
may require the "amd" version of the sdk even if you have an intel processor, and you may need to deselect the documentation component in the installer in order to avoid an installation error. (this was certainly the case for 64 bit windows 7 on a late 2008 macbook pro.) warning: due to a bug in windows 7 sdk, if you get "sdksetup encountered an error: expecting path %systemroot% to represent a valid system volume" error you may require to set environmental variable %windir% to something like "c:\windows" instead of "%systemroot%". older sdks these are no longer supported, further information is available at obsolete build caveats and tips [en-us] under the windows sdk article. troubleshooting help! i know i have the correct sdk, but configure.in's still failing! try the following things in o...
Eclipse CDT Manual Setup
ly it can only produce good results if it has a sensible set of preprocessor defines, include paths and pre-include files for each source file. since eclipse doesn't initially have any of this information, the code assistance that it's able to provide out of the box is pretty broken. for projects the size and complexity of mozilla, it's impractical to manually configure eclipse when there is a valid set of defines and includes paths for each of the different parts of the source code. happily, eclipse makes manual configuration unnecessary. like some other ides, that are used with projects like mozilla that have their own build system. eclipse provides a tool that can collect the options that are passed to the compiler for each file that's compiled during an actual build. this process is some...
Commenting IDL for better documentation
the cookie monster. * @param cookietoeat the nsicookie to eat. */ void eatcookie(in nsicookie cookietoeat); /** * sings the song "c is for cookie." */ void sing(); /** * returns a string containing a funny quote the cookie monster might say. * * @param number the saying number to return. * * @returns an astring containing the requested funny quote. if the specified * quote number is invalid, an exception is thrown. * * @throws ns_error_failure unable to locate the requested quote. */ astring getfunnysaying(in integer number); /** * says something appreciative of the tastiness of the cookie in the specified * language. * * @param language the localization identification indicating the language in * which the cookie monster is to express his love of cookies. */ [noscript] vo...
Obsolete Build Caveats and Tips
our .mozconfig. for mozilla-1.9.1 and mozilla-1.9.0, you need to add ac_add_options --disable-vista-sdk-requirements to your .mozconfig instead. unsupported sdks the windows sdk for windows server 2008 is not supported, and has been found to cause the following problems: breaks the vcvars32.bat file from visual studio 2008 no longer sets the correct path for the .net framework causes an invalid path which breaks the mozilla build if you have the windows server 2008 sdk installed, uninstall it. the sdk will break builds even if you try to use other sdks. other possible workarounds: use another sdk (the one shipped with visual studio 9). delete the vcvars32.bat file and repair your visual studio installation with the setup program. edit vcvars32.bat to correct the problem (see htt...
Reviewer Checklist
actices will lead to a smoother, more rapid process of review and acceptance. good web citizenship make sure new web-exposed apis actually make sense and are either standards track or preffed off by default. in c++, wrapper-cache as needed. if your object can be gotten from somewhere without creating it in the process, it needs to be wrapper-cached. correctness the bug being fixed is a valid bug and should be fixed. the patch fixes the issue. the patch is not unnecessarily complicated. the patch does not add duplicates of existing code ('almost duplicates' could mean a refactor is needed). commonly this results in "part 0" of a bug, which is "tidy things up to make the fix easier to write and review". if qa needs to verify the fix, you should provide steps to reproduce (str). q...
Performance best practices for Firefox front-end engineers
ations occur off of the main thread, and have a much higher probability of running at 60 fps (see the section below called use the compositor for animations for further details). perhaps you’re touching some dom nodes in such a way that unexpected repaints are occurring in an area that don’t need it. best to investigate and try to remove those as best you can. sometimes, our graphics layer invalidates regions in ways that might not be clear to you, and a section outside of the thing that just repainted will also repaint. sometimes this can be addressed by ensuring that the thing changing is on its own layer (though this comes at a memory cost). you can put something on its own layer by setting its z-index, or by setting the will-change on the node, though this should be used sparingly. if...
Storage access policy: Block cookies from trackers
a third-party storage permission on origins that have already been granted access. each time the heuristic is activated, or a success call to the storage access api is made, the pre-existing storage access expiration will be extended by 30 days, counting from the time the previous access was granted. please note that in the future we expect to make changes to how long storage access will remain valid for. as mentioned before, the way to know that you will be able to use storage as a third-party going forward will be using the storage access api. debugging we encourage site owners to test their sites, particularly those that rely on third-party content integrations. we’ve added several new features to firefox to make testing easier. developer tools notifications the network monitor in f...
mozbrowsersecuritychange
ing_content: indicates that the tracking content has been blocked from loading. mixedstate a domstring representing the current loading state of mixed active content. possible values are: loaded_mixed_active_content: indicates that the mixed active content has been loaded. blocked_mixed_active_content: indicates that the mixed active content has been blocked from loading. extendedvalidation a boolean indicating if the current ssl certificate is an extended validation certificate (true) or not (false). trackingcontent a boolean indicating if tracking content is present on the current page (true) or not (false). mixedcontent a boolean indicating if mixed content is present on the current page (true) or not (false). example var browser = document.queryselector("iframe"); ...
HTMLIFrameElement.reload()
there may also be large incompatibilities between implementations and the behavior may change in the future. the reload() method of the htmliframeelement interface is used to reload the content of the <iframe>. syntax instanceofhtmliframeelement.reload(hardreload); returns void. parameters hardreload optional a boolean that indicates whether all the resources to reload must be revalidated (true) or may be taken directly from the browser cache (false). examples stopreload.addeventlistener('touchend',function() { if(stopreload.textcontent === 'x') { browser.stop(); } else { browser.reload(); } }); specification not part of any specification. ...
HTML parser threading
d-safely refcounted appropriately when the nsstring goes away. (aside: it would make more sense to make the parser deal with nsstringbuffers directly without having heap-allocated nsstrings involved.) element names, attribute names and the doctype name are represented as nsiatoms. pre-interned attribute and element names hold atoms that are actually app-wide nsstaticatoms. since nsstaticatoms are valid app-wide, these atoms work right app-wide on the main thread. for other atoms, the parser uses nshtml5atom objects that are atomic only within the scope of an nshtml5atomtable. there is one nshtml5atomtable per each nshtml5parser and one per each nshtml5streamparser. thus, each tokenizer/tree builder pair sees atoms that are atomic (pointer-comparable) within the tokenizer/tree builder pair. howe...
Gecko's "Almost Standards" Mode
l4/loose.dtd" thus any html 4.01 transitional or frameset doctype with a uri (system identifier) will trigger "almost standards" mode, as will any xhtml 1.0 transitional or frameset doctype, with or without the uri. authors outside of ibm do not need to worry about the custom doctype that will also trigger "almost standards" mode. recommendations for authors who are attempting to migrate to validated markup using either html 4.01 or xhtml 1.0, and who are still using image-in-table design concepts, make sure to use a doctype that will trigger "almost standards" mode. also on mdc images, tables, and mysterious gaps mozilla's doctype sniffing mozilla's quirks mode original document information author(s): eric a. meyer, netscape communications last updated date: published 08 no...
IPDL Best Practices
ontrol when ipdl functions can be called; see phttpchannelparent/child for an example. ...
Infallible memory allocation
ing objects, the new operator creates them infallibly by default. if you want to allocate them fallibly, use the syntax new (fallible) foo(). when in doubt, use the infallible allocator and don't null check. ns_alloc() is also infallible. explicitly infallible memory allocators the following memory allocators are explicitly infallible, and will remain so; they are guaranteed to return a valid memory pointer. p = moz_xmalloc(); p = moz_xcalloc(); p = moz_xrealloc(); p = moz_xstrdup(); f = new foo(); farray = new foo[]; n = ::operator new(...); narray = ::operator new[](...); explicitly fallible memory allocators these memory allocators are explicitly fallible, and will remain so. when using these, you must check to ensure the resulting value isn't null before attempting to use ...
Download
ed. you should use the individual state properties (for example, the succeeded property) instead. saver read only downloadsaver saver object associated with this download. source read only downloadsource source of this download. starttime read only date indicates the start time of the download. when the download starts, this property is set to a valid date object. the default value is null before the download starts. stopped read only boolean indicates that the download never started, has been completed successfully, failed, or has been canceled. this property becomes false when a download is started for the first time, or when a failed or canceled download is restarted. succeeded read only boolean this propery ...
JavaScript OS.Constants
available on all platforms, although some constants are not defined everywhere. before using a constant, you should check that it is defined. 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. emfile too many open files in the process enametoolong name too long enfile too many open files on the system enoent no such file or directory enomem cannot alloc...
Sqlite.jsm
ceeds, all the statements contained within it are committed as one unit. if the transaction fails, the database is rolled back to its state before the transaction started. this function receives the following arguments: func the function defining the transaction body. type the type of transaction to perform. this must be one of the transaction_* constants on the opened connection instance. valid values are transaction_deferred, transaction_immediate, transaction_exclusive. see the sqlite documentation for their meaning. the default is transaction_deferred. the passed function is a task.jsm compatible generator function. when called, the function receives as its argument the current connection instance. this generator function is expected to yield promises, likely those returned by call...
WebChannel.jsm
vents apis to create a two-way communication channel between chrome and content code for specific origins (using a specific origin passed to the constructor or a lookup with nsipermissionmanager while also ensuring the scheme is https). components.utils.import("resource://gre/modules/webchannel.jsm"); constructor webchannel(string webchannelid, nsiuri originorpermission); 2nd argument is a valid origin that should be part of requests for this channel. webchannel(string webchannelid, string originorpermission); 2nd argument is a permission for which the permission manager will be checked to determine if the request is allowed. note that in addition to the permission manager check, the request must be made over https. method overview listen(function callback); stopli...
Application Translation with Mercurial
this example: c:\mozilla\). proof-reading and altering the patch now proof-read the patch. this detects often more than 90 percent of the possible reasons for the reviewer to not accept the patch. if you find that changes have to be done, edit the real aboutprivatebrowsing.dtd file from the localization repository, save it and follow the steps from exporting the changes as patch (see above). validating the translation in the product this guide hasn't yet a section about the validation of the translation. please follow the instructions from the qa phase section of the localization quick start guide. submitting the patch for review now the patch has to be shared so the people currently trusted to change the official translation can review the suggested changes. file a bug ("ticket") in...
Localizing XLIFF files for iOS
te> tags contain localizer notes from developers and should not be translated. <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>agregar a marcadores</target> <note>no comment provided by engineer.</note> </trans-unit> save your translations along the way. once you've completed translation, it's important to make sure the xml in your xliff file is valid (e.g., no broken tag sets). open the file in firefox to have it run a validity check and correct any errors it might yell about. commiting your xliff file using this command, commit your translated xliff file into your locale's directory: git commit -m "commit message here" . push your commit into the github repo: git push kick up your feet, pop open a cold beer (or soda), and pat yourself...
Creating localizable web applications
app logic detect the locale correctly be smart about detecting the user's locale correctly. you can use one or more of the following techniques: http accept-language headers, the ua string, ip geolocation. see examples of the addons.mozillaorg code at /addons/trunk/site/app/config/language.php and /addons/trunk/site/app/config/language.inc.php. the language_config class expects arrays of valid languages & supported languages. always give the user a possibility to change the locale (e.g. by adding locale dropdown menu at bottom of page) and remember this choice for the future visits. use the locale code in the urls depending on how you detect user's locale, you may want to provide a way of overriding the autodetection. you can achieve this by setting a cookie when the user changes th...
Localization formats
with this arrangement, content for localization is presented in the following manner: msgid "coming soon" msgstr "bientôt dispon...
Profiling with the Firefox Profiler
ler has rudimentary support for profiling multiple threads. to enable it, check the 'multi-thread' box then enter one or more thread names into the textbox beside it. thread names are the strings passed to the base::thread class at initialization. at present there is no central list of these thread names, but you can find them by grepping the source. examples: 1 2 if the filter you entered is invalid, no threads will be profiled. you can identify this by hitting analyze (cleopatra will show you an error message). if the filter is left empty, only the main thread is captured (as if you had not enabled multi-thread.) profiler features the profiler supports several features. these are options to gather additional data in your profiles. each option will increase the performance overhead of prof...
Performance
the articles linked to from here will help you improve performance, whether you're developing core mozilla code or an add-on. documentation reporting a performance problem a user friendly guide to reporting a performance problem. a development environment is not required. benchmarking tips on generating valid performance metrics. performance best practices in extensions a performance "best practices" guide for extension developers. measuring add-on startup performance a guide for add-on developers on how to set up a performance testing environment. xul school: add-on performance tips for add-on developers to help them avoid impairing application performance. gpu performance tips for profiling and improving ...
L20n Javascript API
ously by the negotiator registered by registerlocalenegotiator. ctx.requestlocales('pl'); ctx.requestlocales('fr-ca', 'fr'); if requestedlocales argument list is empty or undefined, the default locale from registerlocales will be used. ctx.requestlocales('pl'); if registerlocales hasn't been called, the special i-default locale is used, which means that the following minimal code is valid and will result in a fully operational context instance. var ctx = l20n.getcontext(); ctx.addresource('<hello "hello, world!">'); ctx.requestlocales(); requestlocales can be called multiple times after the context instance emitted the ready event, in order to change the current language fallback chain, for instance if requested by the user. ctx.supportedlocales a read-only property which h...
McCoy
...
Optimizing Applications For NSPR
see the faq article for more info. there is no current workaround. you must write your program with this restriction in mind. pr_interrupt is implemented except for <tt>pr_connect()</tt>. irix the irix (classic) implementation has a known race condition in creating new threads. if the spawned thread establishes and exits before the parent thread is resumed, the parent will be left with an invalid pointer to the child. the problem has a solution that will be available soon. digital unix digital unix (aka, osf1) requires the latest patches for the pthreads library. the changes are not evident until one tries to do thread suspension (<tt>pr_suspendall()</tt>) which is in preparation for garbage collection. digital unix is the main platform used for nspr's prototype use of ipv6. there ar...
I/O Functions
ible to scan the chain of layers and find a layer that one recognizes and therefore predict that it will implement a desired protocol. a layer can be pushed onto or popped from an existing stack of layers. the file descriptor of the top layer can be passed to nspr i/o functions, which invoke the appropriate version of the i/o methods polymorphically. nspr defines three identities: #define pr_invalid_io_layer (prdescidentity)-1 #define pr_top_io_layer (prdescidentity)-2 #define pr_nspr_io_layer (prdescidentity)0 pr_invalid_io_layer: an invalid layer identify (for error return). pr_top_io_layer: the identity of the top of the stack. pr_nspr_io_layer: the identity for the layer implemented by nspr. pr_top_io_layer may be used as a shorthand for identifying the topmost layer of an existi...
Introduction to NSPR
an execution entity that is scheduled independently from other threads in the same process. a thread has a limited number of resources that it truly owns. these resources include the thread stack and the cpu register set (including pc). to an nspr client, a thread is represented by a pointer to an opaque structure of type prthread. a thread is created by an explicit client request and remains a valid, independent execution entity until it returns from its root function or the process abnormally terminates. (prthread and functions for creating and manipulating threads are described in detail in threads.) nspr threads are lightweight in the sense that they are cheaper than full-blown processes, but they are not free. they achieve the cost reduction by relying on their containing process to man...
NSPR Types
ystems that treat long long values directly. print64 pruint64 floating-point number type the nspr floating-point type is always 64 bits. prfloat64 native os integer types these types are most appropriate for automatic variables. they are guaranteed to be at least 16 bits, though various architectures may define them to be wider (for example, 32 or even 64 bits). these types are never valid for fields of a structure. printn pruintn miscellaneous types size type pointer difference types boolean types status type for return values size type prsize pointer difference types types for pointer difference. variables of these types are suitable for storing a pointer or pointer subtraction. these are the same as the corresponding types in libc. prptrdiff pruptrdiff ...
PRDescIdentity
escription file descriptors may be layered. each layer has it own identity. identities are allocated by the runtime and are to be associated (by the layer implementor) with all file descriptors of that layer. it is then possible to scan the chain of layers and find a layer that one recognizes, then predict that it will implement a desired protocol. there are three well-known identities: pr_invalid_io_layer, an invalid layer identity, for error return pr_top_io_layer, the identity of the top of the stack pr_nspr_io_layer, the identity used by nspr proper layers are created by pr_getuniqueidentity. a string may be associated with a layer when the layer is created. the string is copied by the runtime, and pr_getnameforidentity returns a reference to that copy. there is no way to delete a ...
PRHostEnt
char **h_aliases; #if defined(_win32) print16 h_addrtype; print16 h_length; #else print32 h_addrtype; print32 h_length; #endif char **h_addr_list; } prhostent; fields the structure has the following fields: h_name pointer to the official name of host. h_aliases pointer to a pointer to list of aliases. the list is terminated with a null entry. h_addrtype host address type. for valid nspr usage, this field must have a value indicating either an ipv4 or an ipv6 address. h_length length of internal representation of the address in bytes. all of the addresses in the list are of the same type and therefore of the same length. h_addr_list pointer to a pointer to a list of addresses from name server (in network byte order). the list is terminated with a null entry. descriptio...
PRIOMethods
...
PRIntn
this type is one of the most appropriate for automatic variables. it is guaranteed to be at least 16 bits, though various architectures may define it to be wider (for example, 32 or even 64 bits). this types is never valid for fields of a structure. syntax #include <prtypes.h> typedef int printn; ...
PRSockOption
_sockopt_dropmember leave an ip multicast group. pr_sockopt_mcastinterface ip multicast interface address. pr_sockopt_mcasttimetolive ip multicast time-to-live. pr_sockopt_mcastloopback ip multicast loopback. pr_sockopt_nodelay disable nagle algorithm. don't delay send to coalesce packets. pr_sockopt_maxsegment maximum segment size. pr_sockopt_last always one greater than the maximum valid socket option numerator. description the prsockoption enumeration consists of all the socket options supported by nspr. the option field of prsocketoptiondata should be set to an enumerator of type prsockoption. ...
PRThread
an nspr thread. syntax #include <prthread.h> typedef struct prthread prthread; description in nspr, a thread is represented by a pointer to an opaque structure of type prthread. this pointer is a required parameter for most of the functions that operate on threads. a prthread* is the successful result of creating a new thread. the identifier remains valid until it returns from its root function and, if the thread was created joinable, is joined. ...
PRThreadState
inable_thread } prthreadstate; enumerators pr_unjoinable_thread thread termination happens implicitly when the thread returns from the root function. the time of release of the resources assigned to the thread cannot be determined in advance. threads created with a pr_unjoinable_thread state cannot be used as arguments to pr_jointhread. pr_joinable_thread joinable thread references remain valid after they have returned from their root function until pr_jointhread is called. this approach facilitates management of the process' critical resources. description a thread is a critical resource and must be managed. the lifetime of a thread extends from the time it is created to the time it returns from its root function. what happens when it returns from its root function depends on the t...
PRUintn
this (unsigned) type is one of the most appropriate for automatic variables. it is guaranteed to be at least 16 bits, though various architectures may define it to be wider (for example, 32 or even 64 bits). this types is never valid for fields of a structure. syntax #include <prtypes.h> typedef unsigned int pruintn; ...
PR_ASSERT
returns nothing description this macro evaluates the specified expression. when the result is zero (false) the application terminates; otherwise the application continues. ...
PR_AcceptRead
out); parameters the function has the following parameters: listensock a pointer to a prfiledesc object representing a socket descriptor that has been called with the pr_listen function, also known as the rendezvous socket. acceptedsock a pointer to a pointer to a prfiledesc object. on return, *acceptedsock points to the prfiledesc object for the newly connected socket. this parameter is valid only if the function return does not indicate failure. peeraddr a pointer a pointer to a prnetaddr object. on return, peeraddr points to the address of the remote socket. the prnetaddr object that peeraddr points to will be in the buffer pointed to by buf. this parameter is valid only if the function return does not indicate failure. buf a pointer to a buffer to hold data sent by the peer and...
PR_CEnterMonitor
enters the lock associated with a cached monitor. syntax #include <prcmon.h> prmonitor* pr_centermonitor(void *address); parameter the function has the following parameter: address a reference to the data that is to be protected by the monitor. this reference must remain valid as long as there are monitoring operations being performed. returns the function returns one of the following values: if successful, the function returns a pointer to the prmonitor associated with the value specified in the address parameter. if unsuccessful (the monitor cache needs to be expanded and the system is out of memory), the function returns null. description pr_centermonitor uses the value specified in the address parameter to find a monitor in the monitor cache, then enters the lock associ...
PR_CExitMonitor
tax #include <prcmon.h> prstatus pr_cexitmonitor(void *address); parameters the function has the following parameters: address the address of the protected object--the same address previously passed to pr_centermonitor. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may indicate that the address parameter is invalid or that the calling thread is not in the monitor. description using the value specified in the address parameter to find a monitor in the monitor cache, pr_cexitmonitor decrements the entry count associated with the monitor. if the decremented entry count is zero, the monitor is exited. ...
PR_CloseDir
ctory to be closed. returns if successful, pr_success. if unsuccessful, pr_failure. the reason for the failure can be retrieved via pr_geterror. description when a prdir object is no longer needed, it must be closed and freed with a call to pr_closedir call. note that after a pr_closedir call, any prdirentry object returned by a previous pr_readdir call on the same prdir object becomes invalid. see also pr_opendir ...
PR EnumerateAddrInfo
an enumeration (thereby getting successive addresses from the praddrinfo structure), the value should be set to the function's last returned value. the enumeration is complete when a value of null is returned. addrinfo a pointer to a praddrinfo structure returned by pr_getaddrinfobyname. port the port number to be assigned as part of the prnetaddr structure. this parameter is not checked for validity. result on input, a pointer to a prnetaddr structure. on output, this structure is filled in by the runtime if the result of the call is not null. returns the function returns the value you should specify in the enumptr parameter for the next call of the enumerator. if the function returns null, the enumeration is ended. description pr_enumerateaddrinfo is a stateless enumerator. the pr...
PR_EnumerateHostEnt
(thereby getting successive addresses from the host entry structure), the value should be set to the function's last returned value. the enumeration is complete when a value of zero is returned. hostent a pointer to a prhostent structure obtained from pr_gethostbyname or pr_gethostbyaddr. port the port number to be assigned as part of the prnetaddr structure. this parameter is not checked for validity. address on input, a pointer to a prnetaddr structure. on output, this structure is filled in by the runtime if the result of the call is greater than 0. returns the function returns one of the following values: if successful, the function returns the value you should specify in the enumindex parameter for the next call of the enumerator. if the function returns 0, the enumeration is e...
PR GetCanonNameFromAddrInfo
ame. syntax #include <prnetdb.h> const char *pr_getcanonnamefromaddrinfo(const praddrinfo *addrinfo); parameters the function has the following parameters: addrinfo a pointer to a praddrinfo structure returned by a successful call to pr_getaddrinfobyname. returns the function returns a const pointer to the canonical hostname stored in the given praddrinfo structure. this pointer is invalidated once the praddrinfo structure is destroyed by a call to pr_freeaddrinfo. ...
PR_GetCurrentThread
returns the current thread object for the currently running code. syntax #include <prthread.h> prthread* pr_getcurrentthread(void); returns always returns a valid reference to the calling thread--a self-identity. description the currently running thread may discover its own identity by calling pr_getcurrentthread. note: this is the only safe way to establish the identity of a thread. creation and enumeration are both subject to race conditions. ...
PR_GetHostByAddr
by the caller. on output, this structure is filled in by the runtime if the function returns pr_success. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. you can retrieve the reason for the failure by calling pr_geterror. description pr_gethostbyaddr is used to perform reverse lookups of network addresses. that is, given a valid network address (of type prnetaddr), pr_gethostbyaddr discovers the address' primary name, any aliases, and any other network addresses for the same host. ...
PR_GetSpecialFD
the file descriptor that represents the standard input, output, or error stream. syntax #include <prio.h> prfiledesc* pr_getspecialfd(prspecialfd id); parameter the function has the following parameter: id a pointer to an enumerator of type prspecialfd, indicating the type of i/o stream desired: pr_standardinput, pr_standardoutput, or pr_standarderror. returns if the id parameter is valid, pr_getspecialfd returns a file descriptor that represents the corresponding standard i/o stream. otherwise, pr_getspecialfd returns null and sets the error to pr_invalid_argument_error. description type prspecialfd is defined as follows: typedef enum prspecialfd{ pr_standardinput, pr_standardoutput, pr_standarderror } prspecialfd; #define pr_stdin pr_getspecialfd(pr_standardinput) ...
PR_GetThreadPriority
returns the priority of a specified thread. syntax #include <prthread.h> prthreadpriority pr_getthreadpriority(prthread *thread); parameter pr_getthreadpriority has the following parameter: thread a valid identifier for the thread whose priority you want to know. ...
PR_GetUniqueIdentity
ameter the function has the following parameter: layer_name the string associated with the creation of a layer's identity. returns the function returns one of the following values: if successful, the prdescidentity for the layer associated with the string specified in the layer named layer_name. if the function cannot allocate enough dynamic memory, it fails and returns the value pr_invalid_io_layer with the error code pr_out_of_memory_error. description a string may be associated with a layer when the layer is created. pr_getuniqueidentity allocates a unique layer identity and associates it with the string. the string can be subsequently passed to pr_createiolayerstub to create a new file descriptor of that layer. call pr_getuniqueidentity only once for any particular layer nam...
PR_Interrupt
tly once or explicitly canceled. the interrupted thread returns pr_failure (-1) with an error code (see pr_geterror) for blocking operations that return a prstatus (such as i/o operations, monitor waits, or waiting on a condition). to check whether the thread was interrupted, compare the result of pr_geterror with pr_pending_interrupt_error. pr_interrupt may itself fail if the target thread is invalid. bugs pr_interrupt has the following limitations and known bugs: there can be a delay for a thread to be interrupted from a blocking i/o function. in all nspr implementations, the maximum delay is at most five seconds. in the pthreads-based implementation on unix, the maximum delay is 0.1 seconds. file i/o is considered instantaneous, so file i/o functions cannot be interrupted. unfortunate...
PR_JoinThread
returns the function returns one of the following values: if successful, pr_success if unsuccessful--for example, if no joinable thread can be found that corresponds to the specified target thread, or if the target thread is unjoinable--pr_failure. description pr_jointhread is used to synchronize the termination of a thread. ...
PR_NewThreadPrivateIndex
returns a new index for a per-thread private data table and optionally associates a destructor with the data that will be assigned to the index. syntax #include <prthread.h> prstatus pr_newthreadprivateindex( pruintn *newindex, prthreadprivatedtor destructor); parameters pr_newthreadprivateindex has the following parameters: newindex on output, an index that is valid for all threads in the process. you use this index with pr_setthreadprivate and pr_getthreadprivate. destructor specifies a destructor function prthreadprivatedtor for the private data associated with the index. this function can be specified as null. returns the function returns one of the following values: if successful, pr_success. if the total number of indices exceeds 128, pr_failure. description i...
PR_ReadDir
if the end of the directory is reached, pr_readdir returns null, and pr_geterror returns pr_no_more_files_error. see also pr_opendir ...
PR_STATIC_ASSERT
an expression which cannot be evaluated at compile time will cause a compiler error; see pr_assert for a runtime alternative. returns nothing description this macro evaluates the specified expression. ...
PR_SetError
sets error information within a thread context. syntax #include <prerror.h> void pr_seterror(prerrorcode errorcode, print32 oserr) parameters the function has these parameters: errorcode the nspr (platform-independent) translation of the error. oserr the platform-specific error. if there is no appropriate os error number, a zero may be supplied. description nspr does not validate the value of the error number or os error number being specified. the runtime merely stores the value and returns it when requested. ...
PR_SetThreadPriority
priority the priority you want to set. description modifying the priority of a thread other than the calling thread is risky. ...
PR_SetThreadPrivate
a. syntax #include <prthread.h> prstatus pr_setthreadprivate(pruintn index, void *priv); parameters pr_setthreadprivate has the following parameters: index an index into the per-thread private data table. priv the per-thread private data, or more likely, a pointer to the data. returns the function returns one of the following values: if successful, pr_success. if the index is invalid, pr_failure. description if the thread already has non-null private data associated with it, and if the destructor function for the index is known (not null), nspr calls the destructor function associated with the index before setting the new data value. the pointer at the index is swapped with null. if the swapped out value is not null, the destructor function is called. on return, the privat...
PR_UnloadLibrary
...
PR_Wait
ts) that the thread is willing to wait for an explicit notification before being rescheduled. returns the function returns one of the following values: pr_success means the thread is being resumed from the pr_wait call either because it was explicitly notified or because the time specified by the parameter ticks has expired. pr_failure means pr_wait encountered a system error (such as an invalid monitor reference) or the thread was interrupted by another thread. description a call to pr_wait causes the thread to release the monitor's lock, just as if it had called pr_exitmonitor as many times as it had called pr_entermonitor. this has the effect of making the monitor available to other threads. when the wait is over, the thread regains control of the monitor's lock with the same entry...
Building NSS
nvironment variables. the scripts will attempt to infer values for host and domsuf, but can fail. replace localhost and localdomain with the hostname and domain suffix for your host. you need to be able to connect to $host.$domsuf. if you don't have a domain suffix you can add an entry to /etc/hosts (on windows, c:\windows\system32\drivers\etc\hosts) as follows: 127.0.0.1 localhost.localdomain validate this opening a command shell and typing: ping localhost.localdomain. remove the use_64=1 override if using a 32-bit build. test results running all tests can take a considerable amount of time. test output is stored in tests_results/security/$host.$number/. the file results.html summarizes the results, output.log captures all the test output. other subdirectories of nss/tests contain scr...
NSS CERTVerify Log
the log tells you what the problem was with the chain and what certificate in the chain failed. to create a log: #include "secport.h" #include "certt.h" certverifylog *log; arena = port_newarena(512); log = port_arenaznew(arena,log); log->arena = arena; you can then pass this log into your favorite cert verify function. on return: log->count is the number of entries. ...
NSS Certificate Download Specification
servers it will depend upon the options selected in the server's administration interface. subsequent certificates are all treated the same. if the certificates contain a basicconstraints certificate extension that indicates they are ca certificates, and do not already exist in the local certificate database, they are added as untrusted cas. in this way they may be used for certificate chain validation, as long as there is a trusted ca somewhere along the chain. importing certificates into mozilla browsers mozilla browsers import certificates found in http protocol responses. there are several mime content types that are used to indicate to the browser what type of certificate is being imported. these mime types are: application/x-x509-user-cert the certificate being downloaded is a ...
HTTP delegation
the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies.) the logical http server session object is expected to remain valid until explicitly destroyed (sec_httpserver_freesessionfcn). should the application be unable to keep a physical connection alive all the time, the application is expected to create new connections automatically. nss may choose to repeatedly call a "network connection keep alive" function (sec_httpserver_keepalivesessionfcn) on the server session object, giving application code a chance to do what...
HTTP delegation
the object may be used by the application to associate it with a physical network connection. (nss might choose to be smart, and only create a single http server session object for each server encountered. nss might also choose to be simple, and request multiple objects for the same server. the application must support both strategies.) the logical http server session object is expected to remain valid until explicitly destroyed (sec_httpserver_freesessionfcn). should the application be unable to keep a physical connection alive all the time, the application is expected to create new connections automatically. nss may choose to repeatedly call a "network connection keep alive" function (sec_httpserver_keepalivesessionfcn) on the server session object, giving application code a chance to do what...
JSS Provider Notes
jss class is loaded that implements a jce algorithm. the verification is transparent to the application (unless it fails and throws an exception). if you are curious, you can verify the signature on the jar file using the jarsigner tool, which is distributed with the jdk. if you build jss yourself from source instead of using binaries downloaded from mozilla.org, your jar file will not have a valid signature. this means you will not be able to use the jss provider for jce algorithms. you have two choices. use the binary release of jss from mozilla.org. apply for your own jce code-signing certificate following the procedure at how to implement a provider for the javatm cryptography extension. then you can sign your own jss jar file. installing the provider in order...
Mozilla-JSS JCA Provider notes
r a jss class is loaded that implements a jce algorithm. the verification is transparent to the application (unless it fails and throws an exception). if you are curious, you can verify the signature on the jar file using the jarsigner tool, which is distributed with the jdk. if you build jss yourself from source instead of using binaries downloaded from mozilla.org, your jar file will not have a valid signature. this means you will not be able to use the jss provider for jce algorithms. you have two choices. use the binary release of jss from mozilla.org. apply for your own jce code-signing certificate following the procedure at how to implement a provider for the javatm cryptography extension. then you can sign your own jss jar file. installing the provider in order to use any part of jss...
NSS_3.11.10_release_notes.html
he nspr 4.7.1 header files and shared libraries, which nss 3.11.10 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. bugs fixed the following bugs have been fixed in nss 3.11.10. bug 291384: certutil -k behavior doesn't match usage bug 374247: modutil -disable command not disabling modules' slots bug 384459: certification path validation fails when authority key identifier extension contains key identifier bug 385946: can't import certificate into cert database in fips mode (certutil). bug 387892: add entrust root ca certificate(s) to nss bug 396999: pk11_authenticate bug 397478: lock from ssl_initsymwrapkeyslock not freed on selfserv shutdown. bug 397486: session cache locks not freed on strsclnt shutdown. bug 3...
NSS 3.14.3 release notes
nd has been referred to as "lucky thirteen". nss 3.14.3 includes changes to the softoken and ssl libraries to address and mitigate these attacks, contributed by adam langley of google. this attack is mitigated when using nss 3.14.3 with an nss cryptographic module ("softoken") version 3.14.3 or later. however, this attack is only partially mitigated if nss 3.14.3 is used with the current fips validated nss cryptographic module, version 3.12.9.1. bug 840714 - "certutil -a" was not correctly producing ascii output as requested. bug 837799 - nss 3.14.2 broke compilation with older versions of sqlite that lacked the sqlite_fcntl_tempfilename file control. nss 3.14.3 now properly compiles when used with older versions of sqlite. acknowledgements the nss development team would like to tha...
NSS 3.14.5 release notes
s nspr 4.9.5 or newer. nss 3.14.5 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_5_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.14.5. users are encouraged to upgrade immediately. bug 934016 - (cve-2013-5605) handle invalid handshake packets new in nss 3.14.5 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-5605. bugs fixed in nss 3.14.5 https://bugzilla.mozilla.org/buglist.cgi?bug_id=934016&bug_id_type=anyexact&resolution=fixed&classification=components&query_format=advanced&product=nss compatibility nss 3.14.5 shared libraries ar...
NSS 3.14 release notes
cm support for aes-gcm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30. warning: because of ambiguity in the current draft text, applications should only use gcm in single-part mode (c_encrypt/c_decrypt). they should not use multi-part apis (c_encryptupdate/c_decryptupdate). support for application-defined certificate chain validation callback when using libpkix to better support per-application security policies, a new callback has been added for applications that use libpkix to verify certificates. applications may use this callback to inform libpkix whether or not candidate certificate chains meet application-specific security policies, allowing libpkix to continue discovering certificate paths until it can ...
NSS 3.15.3 release notes
lla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_3_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.15.3. users are encouraged to upgrade immediately. bug 925100 - (cve-2013-1741) ensure a size is <= half of the maximum pruint32 value bug 934016 - (cve-2013-5605) handle invalid handshake packets bug 910438 - (cve-2013-5606) return the correct result in cert_verifycert on failure, if a verifylog isn't used new in nss 3.15.3 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1741, cve-2013-5605 and cve-2013-5606. bugs fixed in nss 3.15.3 bug 850478 - list rc4_128 cipher suites after aes_128 c...
NSS 3.15.5 release notes
extension type value is 35655, which may change when an official extension type value is assigned by iana. nss automatically adds the padding extension to clienthello when necessary. added a new macro cert_list_tail, defined in certt.h, for getting the tail of a certcertlist. 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). applications should still take care when converting struct iov to priovec because the iov_len members of the two structures have different types (size_t vs. int). size_t is unsigned and may be larger than int. bugs fixed in nss 3.15.5 a complete list of all bugs resolved in this release can be obtain...
NSS 3.15 release notes
tapled by the tls server to the ocsp cache. applications that use ssl_authcertificatehook to override the default handler should add appropriate calls to ssl_peerstapledocspresponse and cert_cacheocspresponsefromsidechannel. bug 554369: fixed correctness of cert_cacheocspresponsefromsidechannel and other ocsp caching behaviour. bug 853285: fixed bugs in aes gcm. bug 341127: fix the invalid read in rc4_wordconv. faster nist curve p-256 implementation. dropped (32-bit) sparc v8 processor support on solaris. the shared library libfreebl_32int_3.so is no longer produced. bugs fixed in nss 3.15 this bugzilla query returns all the bugs fixed in nss 3.15: https://bugzilla.mozilla.org/buglist.cgi?list_id=6278317&resolution=fixed&classification=components&query_format=advanced&product=...
NSS 3.16.3 release notes
e changes in nss 3.16.3 the following 1024-bit ca certificates were removed cn = entrust.net secure server certification authority sha1 fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39 cn = gte cybertrust global root sha1 fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74 ou = valicert class 1 policy validation authority sha1 fingerprint: e5:df:74:3c:b6:01:c4:9b:98:43:dc:ab:8c:e8:6a:81:10:9f:e4:8e ou = valicert class 2 policy validation authority sha1 fingerprint: 31:7a:2a:d0:7f:2b:33:5e:f5:a1:c3:4e:4b:57:e8:b7:d8:f1:fc:a6 ou = valicert class 3 policy validation authority sha1 fingerprint: 69:bd:8c:f4:9c:d3:00:fb:59:2e:17:93:ca:55:6a:f3:ec:aa:35...
NSS 3.16 release notes
building nss. bug 903885: (cve-2014-1492) in a wildcard certificate, the wildcard character should not be embedded within the u-label of an internationalized domain name. see the last bullet point in rfc 6125, section 7.2. bug 962760: libpkix should not include the common name of ca as dns names when evaluating name constraints. bug 981170: aeskeywrap_decrypt should not return secsuccess for invalid keys. bug 974693: fix a memory corruption in sec_pkcs12_new_asafe. bug 956082: if the nss_sdb_use_cache environment variable is set, skip the runtime test sdb_measureaccess. the built-in roots module has been updated to version 1.97, which adds, removes, and distrusts several certificates. the atob utility has been improved to automatically ignore lines of text that aren't in base64 format. ...
NSS 3.17.2 release notes
release. this is a patch release to fix a regression and other bugs. notable changes in nss 3.17.2 bug 1049435: change rsa_privatekeycheck to not require p > q. this fixes a regression introduced in nss 3.16.2 that prevented nss from importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries. bug 1057161: check that an imported elliptic curve public key is valid. previously nss would only validate the peer's public key before performing ecdh key agreement. now ec public keys are validated at import time. bug 1078669: certutil crashes when an argument is passed to the --certversion option. bugs fixed in nss 3.17.2 this bugzilla query returns all the bugs fixed in nss 3.17.2: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=compon...
NSS 3.18 release notes
cally found and trusted issuer certificates, to diagnose server side configuration issues. it is possible to run tstclnt without providing a database (-d). a pkcs#11 library that contains root ca certificates can be loaded by tstclnt, which may either be the nssckbi library provided by nss (-b) or another compatible library (-r). new functions in certdb.h sec_checkcrltimes - check the validity of a crl at the given time. sec_getcrltimes - extract the validity times from a crl. in p12.h sec_pkcs12decoderrenamecertnicknames - call an application provided callback for each certificate found in a sec_pkcs12decodercontext. in pk11pub.h __pk11_setcertificatenickname - this is an internal symbol for nss use only, as with all exported nss symbols that have a leadi...
NSS 3.19 release notes
y (sqlite_lib_dir) in which the nss build system will look for the sqlite library. new functions in cert.h cert_getimposednameconstraints - check if any imposed constraints exist for the given certificate, and if found, return the constraints as encoded certificate extensions. notable changes in nss 3.19 the ssl 3 protocol has been disabled by default. nss now more strictly validates tls extensions and will fail a handshake that contains malformed extensions (bug 753136). in tls 1.2 handshakes, nss advertises support for the sha512 hash algorithm in order to be compatible with tls servers that use certificates with a sha512 signature (bug 1155922). bugs fixed in nss 3.19 this bugzilla query returns all the bugs fixed in nss 3.19: https://bugzilla.mozilla.org/buglist.
NSS 3.21.3 release notes
/nss/releases/nss_3_21_3_rtm/src/ new in nss 3.21.3 new functionality no new functionality is introduced in this release. security fixes in nss 3.21.3 bug 1306103 / cve-2016-5285 - fixed a possible dos on nss servers due to a missing null check. bug 1221620 - fixed a possible left-shift of a negative integer value when parsing der. bug 1206283 - fixed an out-of-bound read when parsing invalid utf-16. bug 1241034 - fixed an out-of-bounds write when parsing invalid utf-16. bug 1241037 - fixed bogus surrogate detection when parsing invalid utf-16. compatibility nss 3.21.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.21.3 shared libraries without recompiling or relinking. fu...
NSS 3.21 release notes
for tls 1.2 that are currently unused in nss. ...
NSS 3.28 release notes
atureschemeprefget. the old ssl_signatureprefset and ssl_signatureprefset functions are now deprecated. nss will now no longer assume that default signature schemes are supported by a peer if there was no commonly supported signature scheme. nss will now check if rsa-pss signing is supported by the token that holds the private key prior to using it for tls (bug 1311950). the certificate validation code contains checks to no longer trust certificates that are issued by old wosign and startcom cas, after october 21, 2016. this is equivalent to the behavior that mozilla will release with firefox 51. background information can be found in mozilla's blog post. bugs fixed in nss 3.28 this bugzilla query returns all the bugs fixed in nss 3.28: https://bugzilla.mozilla.org/buglist.cgi?res...
NSS 3.29.2 release notes
source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/security/nss/releases/nss_3_29_2_rtm/src/ new in nss 3.29.2 new functionality no new functionality is introduced in this release. bugs fixed in nss 3.29.2 nss 3.29 and 3.29.1 included a change that reduced the time that nss considered a tls session ticket to be valid. this release restores the session ticket lifetime to the intended value. see bug 1340841 for details. compatibility nss 3.29.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.29.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss ...
NSS 3.41 release notes
sha-256 fingerprint: a6c51e0da5ca0a9309d2e4c0e40c2af9107aae8203857fe198e3e769e343085c cn = certplus root ca g1 sha-256 fingerprint: 152a402bfcdf2cd548054d2275b39c7fca3ec0978078b0f0ea76e5...
NSS 3.42 release notes
none added support for some of the testcases from the wycheproof project: bug 1508666 - added aes-gcm test cases bug 1508673 - added chacha20-poly1305 test cases bug 1514999 - added the curve25519 test cases thanks to jonas allmann for adapting these tests. bugs fixed in nss 3.42 bug 1490006 - reject invalid ch.legacy_version in tls 1.3 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. note: this was mistakenly not in release 3.42, and is instead in nss 3.42.1. bug 1513913 - a fix for solaris where firefox 60 core dumps during start when using profile from versi...
NSS 3.44.1 release notes
a program linked with older nss 3.x shared libraries will work with nss 3.44.1 shared libraries without recompiling or relinking. furthermo...
NSS 3.46 release notes
ed warning in tls13esni.c bug 1561332 - ec.c:28 warning: comparison of integers of different signs: 'int' and 'unsigned long' bug 1564714 - print certutil commands during setup bug 1565013 - hacl image builder times out while fetching gpg key bug 1563786 - update hacl-star docker image to pull specific commit bug 1559012 - improve gcm perfomance using pmull2 bug 1528666 - correct resumption validation checks bug 1568803 - more tests for client certificate authentication bug 1564284 - support profile mobility across windows and linux bug 1573942 - gtest for pkcs11.txt with different breaking line formats bug 1575968 - add strsclnt option to enforce the use of either ipv4 or ipv6 bug 1549847 - fix nss builds on ios bug 1485533 - enable nss_ssl_tests on taskcluster this bugzilla quer...
NSS 3.52 release notes
s 1.3 does not work in fips mode. bug 1531906 - fix overzealous assertion when evicting a cached sessionid or using external cache. bug 1465613 - fix issue where testlib makefile build produced extraneous object files. bug 1619959 - properly handle multi-block seed ecb inputs. bug 1630925 - guard all instances of nsscmssigneddata.signerinfo to avoid a cms crash bug 1571677 - name constraints validation: cn treated as dns name even when syntactically invalid as dns name this bugzilla query returns all the bugs fixed in nss 3.52: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.52 compatibility nss 3.52 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked...
NSS 3.56 release notes
otable changes in nss 3.56 nspr dependency updated to 4.28. the known issue where makefile builds failed to locate seccomon.h was fixed in bug 1653975. bugs fixed in nss 3.56 bug 1650702 - support sha-1 hw acceleration on armv8 bug 1656981 - use mpi comba and mulq optimizations on x86-64 macos. bug 1654142 - add cpu feature detection for intel sha extension. bug 1648822 - add stricter validation of dh keys in fips mode. bug 1656986 - properly detect arm64 during gyp build architecture detection. bug 1652729 - add build flag to disable rc2 and relocate to lib/freebl/deprecated. bug 1656429 - correct rtt estimate used in 0-rtt anti-replay. bug 1588941 - send empty certificate message when scheme selection fails. bug 1652032 - fix failure to build in windows arm64 makefile cross-c...
NSS Sample Code Sample1
lso be used for // storage of the keys, since nss does not support permanent symmetric // keys at the current time.) // 3. the secondary host sends its rsa public key to the primary host as // part of a request for a particular key, or to be added to a list // of secondary hosts. // 4. the administrator of the primary host verifies that the rsa key // that was received belongs to a valid secondary host. the adminstrator // may do this by checking that the key was received in a signed email // message, or by checking a digest value with the adminstrator of the // secondary host. [need support for digest check values] // 5. the primary host exports (wraps) the symmetric key using the // secondary host's rsa key. the wrapped value is sent back to // the secondary h...
NSS Sample Code Sample_1_Hashing
mmand line arguments */ optstate = pl_createoptstate(argc, argv, "t:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 't': require_arg(optstate->option, optstate->value); hashname = strdup(optstate->value); break; } } if (!hashname) usage(progname); /* convert and validate */ hashoidtag = hashnametooidtag(hashname); if (hashoidtag == sec_oid_unknown) { fprintf(stderr, "%s: invalid digest type - %s\n", progname, hashname); usage(progname); } /* digest it and print the result */ rv = digestfile(pr_stdout, pr_stdin, hashoidtag); if (rv != secsuccess) { fprintf(stderr, "%s: problem digesting data (%d)\n", ...
NSS Sample Code Sample_2_Initialization of NSS
11_needuserinit(slot)) { newpw = initslotpassword(slot, pr_false, &pwdata); rv = pk11_initpin(slot, (char*)null, newpw); } else { for (;;) { oldpw = getmodulepassword(slot, pr_false, &pwdata); if (pk11_checkuserpassword(slot, oldpw) != secsuccess) { if (pwdata.source == pw_none) { pr_fprintf(pr_stderr, "invalid password. try again.\n"); } else { pr_fprintf(pr_stderr, "invalid password.\n"); port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); return secfailure; } } else { break; } port_free(oldpw); } newpw = initslotpas...
NSS Sample Code Utilities_1
for (;;) { /* prompt for password */ if (istty) { fprintf(output, "%s", prompt); fflush (output); echooff(infd); } fgets(phrase, sizeof(phrase), input); if (istty) { fprintf(output, "\n"); echoon(infd); } /* stomp on newline */ phrase[port_strlen(phrase)-1] = 0; /* validate password */ if (!(*ok)(phrase)) { if (!istty) return 0; fprintf(output, "password must be at least 8 characters long with one or more\n"); fprintf(output, "non-alphabetic characters\n"); continue; } return (char*) port_strdup(phrase); } } /* * filepasswd extracts the password from a text file * * storing passwords ...
NSS Sample Code sample6
== null) { fprintf(stderr, "unable to find security device (err %d)\n", pr_geterror()); return; } keyid[0] = id; keyiditem.type = sibuffer; keyiditem.data = (void *)keyid; keyiditem.len = sizeof(keyid[0]); /* note: keysize must be 0 for fixed key-length algorithms like des. ...
Hashing - sample 1
mmand line arguments */ optstate = pl_createoptstate(argc, argv, "t:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 't': require_arg(optstate->option, optstate->value); hashname = strdup(optstate->value); break; } } if (!hashname) usage(progname); /* convert and validate */ hashoidtag = hashnametooidtag(hashname); if (hashoidtag == sec_oid_unknown) { fprintf(stderr, "%s: invalid digest type - %s\n", progname, hashname); usage(progname); } /* digest it and print the result */ rv = digestfile(pr_stdout, pr_stdin, hashoidtag); if (rv != secsuccess) { fprintf(stderr, "%s: problem digesting data (%d)\n", ...
Initialize NSS database - sample 2
); if (rv == secsuccess) { pr_fprintf(pr_stderr, "pk11_initpin failed.\n"); return secfailure; } } else { for (;;) { oldpw = getmodulepassword(slot, pr_false, &pwdata); if (pk11_checkuserpassword(slot, oldpw) != secsuccess) { if (pwdata.source == pw_none) { pr_fprintf(pr_stderr, "invalid password. try again.\n"); } else { pr_fprintf(pr_stderr, "invalid password.\n"); port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); return secfailure; } } else { break; } port_free(oldpw); } newpw = initslotpas...
Utilities for nss samples
for (;;) { /* prompt for password */ if (istty) { fprintf(output, "%s", prompt); fflush (output); echooff(infd); } fgets(phrase, sizeof(phrase), input); if (istty) { fprintf(output, "\n"); echoon(infd); } /* stomp on newline */ phrase[port_strlen(phrase)-1] = 0; /* validate password */ if (!(*ok)(phrase)) { if (!istty) return 0; fprintf(output, "password must be at least 8 characters long with one or more\n"); fprintf(output, "non-alphabetic characters\n"); continue; } return (char*) port_strdup(phrase); } } /* * filepasswd extracts the password from a text file * * storing passwords ...
sample1
uments */ optstate = pl_createoptstate(argc, argv, "t:"); while ((status = pl_getnextopt(optstate)) == pl_opt_ok) { switch (optstate->option) { case 't': require_arg(optstate->option, optstate->value); hashname = strdup(optstate->value); break; } } if (!hashname) usage(progname); /* convert and validate */ hashoidtag = hashnametooidtag(hashname); if (hashoidtag == sec_oid_unknown) { fprintf(stderr, "%s: invalid digest type - %s\n", progname, hashname); usage(progname); } /* digest it and print the result */ rv = digestfile(pr_stdout, pr_stdin, hashoidtag); if (rv != secsuccess) { fprintf(stderr, "%s: problem digesting data (%d)\n", pr...
nss tech note1
decoder modifiers : these modifiers are also specified in the kind field of the template structure. all the values are in the 9 - 31 bit range. sec_asn1_optional: tells the decoder that this component is optional. if the component in the input data does not match this template, the decoder will continue processing the input data using the next availab...
nss tech note6
use nss binaries that are the output of the regular nss build process. if your application modifies nss binaries for any reason after they were built, then : the fips 140 mode of operation will no longer work, because the chk files will no longer match the softoken and freebl shared libraries . the softoken and freebl binaries won't match any nss binaries that may have been submitted to nist for validation, and thus may not be verified as being the actual fips 140 validated cryptographic module . the only way to meet this requirement is for your application never to modify the nss binaries. any offer of binary support that may have been previously made to you by nss developers is null and void. if your build process modifies nss libraries in any way (for example, to strip the symbols), it sh...
NSS PKCS11 Functions
his token returned in the ck_slot_info structure with an internationalize string (utf8). this value will be truncated at 64 bytes (no null, partialutf8 characters dropped). this name will not change after thedatabase is closed. it should have some number to make this unique. minpwlen then minimum password length for this token. flags a comma separated list of flag values, parsed case-insensitive. valid flags are: readonly - databases should be opened read only. nocertdb - don't try to open a certificate database. nokeydb - don't try to open a key database. forceopen - don't fail to initialize the token if thedatabases could not be opened. passwordrequired - zero length passwords are not acceptable(valid only if there is a keydb). optimizespace - allocate smaller hash tables and lock tables.whe...
PKCS11 Implement
ssion for saves and restores. c_closesession the nss calls c_closesession to close sessions created for bulk encryption. c_closeallsessions the nss may call c_closeallsessions when it closes down a slot. c_getsessioninfo the nss calls c_getsessioninfo frequently. if a token has been removed during a session, c_getsessioninfo should return either ckr_session_closed or ckr_session_handle_invalid. if a token has been removed and then the same or another token is inserted, c_getsessioninfo should return ckr_session_handle_invalid. c_login the nss calls c_login on a token's initial session whenever ckf_login_required is true and the user state indicates that the user isn't logged in. c_logout the nss calls c_logout on a token's initial session when the password is timed out when pe...
PKCS 12 functions
sec_pkcs12decoderiterateinit mxr 3.10 and later sec_pkcs12decoderiteratenext mxr 3.10 and later sec_pkcs12decodersettargettokencas mxr 3.8 and later sec_pkcs12decoderstart mxr 3.2 and later sec_pkcs12decoderupdate mxr 3.2 and later sec_pkcs12decodervalidatebags mxr 3.2 and later sec_pkcs12decoderverify mxr 3.2 and later sec_pkcs12destroyexportcontext mxr 3.2 and later sec_pkcs12enablecipher mxr 3.2 and later sec_pkcs12encode mxr 3.2 and later sec_pkcs12isencryptionallowed mxr 3.2 and later ...
Migration to HG
in the top directory of the nspr repository. likewise for nss and jss, "mozilla/security" has been removed and files now live at the top level. in addition for nss, we have merged the contents of directories mozilla/dbm and mozilla/security/dbm into the new directory lib/dbm. besides the new layout, the build system hasn't changed. most parts of the nss build instructions remain valid, especially the instructions about setting environment variables. updated instructions for building nss with nspr can be found at: /docs/nss_reference/building_and_installing_nss/build_instructions it's best to refer to the above document to learn about the various environment variables that you might have to set to build on your platform (this part hasn't changed). however, be...
FC_EncryptInit
on. pmechanism[in] pointer to the mechanism to be used for subsequent encryption. hkey[in] handle of the encryption key. description fc_encryptinit initializes an encryption operation with the mechanism and key to be used. a user must log into the token (to assume the nss user role) before calling fc_encryptinit. return value ckr_ok slot information was successfully copied. ckr_slot_id_invalid the specified slot number is out of the defined range of values. examples see also nsc_encryptinit ...
FC_GetSlotInfo
fc_getslotinfo takes two parameters: slotid [in] pinfo [out] the address of a ck_slot_info structure. description fc_getslotinfo stores the information about the slot in the ck_slot_info structure that pinfo points to. a user may call fc_getslotinfo without logging into the token (to assume the nss user role). return value ckr_ok slot information was successfully copied. ckr_slot_id_invalid the specified slot number is out of the defined range of values. examples see also nsc_getslotinfo ...
FC_GetTokenInfo
version numbers of the certificate and key databases, respectively. firmwareversion: firmware version number, 0.0 (major=0x00, minor=0x00). a user may call fc_gettokeninfo without logging into the token (to assume the nss user role). return value ckr_ok token information was successfully copied. ckr_cryptoki_not_initialized the pkcs #11 module library is not initialized. ckr_slot_id_invalid the specified slot number is out of the defined range of values. fc_gettokeninfo should return ckr_arguments_bad if pinfo is null. examples note the use of the %.32s format string to print the label and manufacturerid members of the ck_token_info structure. see also fc_getslotinfo, nsc_gettokeninfo ...
FC_InitPIN
and to initialize the normal user's pin. in the nss cryptographic module, one uses the empty string password ("") to log in as the pkcs #11 so. the module only allows the pkcs #11 so to log in if the normal user's pin has not yet been set or has been reset. return value fc_initpin() returns the following return codes. ckr_ok: normal user's pin initialization succeeded. ckr_session_handle_invalid: the session handle is invalid. ckr_user_not_logged_in: the session is not in the "r/w so functions" state. ckr_pin_invalid: the pin has an invalid utf-8 character. ckr_pin_len_range: the pin is too short, too long, or too weak (doesn't have enough character types). ckr_device_error: normal user's pin is already initialized. see also nsc_initpin, fc_setpin ...
FC_InitToken
sword hasn't been set yet or the user forgets the password and needs to blow away the password-encrypted private key database and start over. note: the so password should be the empty string, i.e., ulpinlen argument should be 0. fc_inittoken() ignores the plabel argument. return value fc_inittoken() returns the following return codes. ckr_ok: token initialization succeeded. ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected we don't have a reference to the key database (we failed to open the key database or we have released our reference). ckr_device_error: failed to reset the key database. application usage fc_inittoken() is used to reset the password for the key database when the user forgets the password. the "reset password" button of the mozilla applicatio...
FC_Login
return value fc_login() returns the following return codes. ckr_ok: the user logged in successfully. ckr_device_error: the token is in the error state. ckr_host_memory: memory allocation failed. ckr_pin_incorrect: the pin is incorrect. ckr_pin_len_range: the pin is too long (ulpinlen is greater than 255). the function should return ckr_pin_incorrect in this case. ckr_session_handle_invalid: the session handle is invalid. ckr_user_already_logged_in: the user is already logged in. ckr_user_type_invalid the token can't authenticate the user because there is no key database or the user's password isn't initialized. usertype is cku_so and the normal user's pin is already initialized. see also nsc_login ...
FC_Verify
n] length of the data in bytes. psignature [in] pointer to the signature. ussignaturelen [in] length of the signature in bytes. description fc_verify verifies a signature in a single-part operation, where the signature is an appendix to the data. a user must log into the token (to assume the nss user role) before calling fc_verify. return value ckr_ok is returned on success. ckr_signature_invalid is returned for signature mismatch. examples see also fc_verifyinit, nsc_verify ...
NSC_InitToken
the certificate database as non-user certs. (user certs are the certificates that have their associated private keys in the key database.) note: the so password should be the empty string, i.e., ulpinlen argument should be 0. nsc_inittoken() ignores the plabel argument. return value nsc_inittoken() returns the following return codes. ckr_ok: token initialization succeeded. ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected slot id is 1. (the non-fips mode has two slots: 1 and 2. the key database is in slot 2. slot 1 doesn't have a key database.) we don't have a reference to the key database (we failed to open the key database or we have released our reference). ckr_device_error: failed to reset the key database. examples application usage nsc_inittoken() is u...
NSC_Login
d. return value nsc_login() returns the following return codes. ckr_ok: the user logged in successfully. ckr_device_error: the token is in the error state. ckr_host_memory: memory allocation failed. ckr_pin_incorrect: the pin is incorrect. ckr_pin_len_range: the pin is too long (ulpinlen is greater than 255).the function should return ckr_pin_incorrect in this case. ckr_session_handle_invalid: the session handle is invalid. ckr_user_already_logged_in: the user is already logged in. ckr_user_type_invalid the token can't authenticate the user because there is no key database or the user's password isn't initialized. usertype is cku_so and the normal user's pin is already initialized. see also fc_login ...
NSPR functions
o get the error code of the last failed nss or nspr function. call pr_seterror to set the error code, which can be retrieved with pr_geterror later. the nss functions port_geterror and port_seterror are simply wrappers of pr_geterror and pr_seterror. pr_geterror pr_seterror calendar time nss certificate verification functions take a prtime parameter that specifies the time instant at which the validity of the certificate should verified. the nspr function pr_now returns the current time in prtime. pr_now interval time the nspr socket i/o functions pr_recv and pr_send (used by the nss ssl functions) take a printervaltime timeout parameter. printervaltime has an abstract, platform-dependent time unit. call pr_secondstointerval or pr_millisecondstointerval to convert a time interval in sec...
NSS tools : pk12util
ncelled o 2 - usage error o 6 - nls init error o 8 - certificate db open error o 9 - key db open error o 10 - file initialization error o 11 - unicode conversion error o 12 - temporary file creation error o 13 - pkcs11 get slot error o 14 - pkcs12 decoder start error o 15 - error read from import file o 16 - pkcs12 decode error o 17 - pkcs12 decoder verify error o 18 - pkcs12 decoder validate bags error o 19 - pkcs12 decoder import bags error o 20 - key db conversion version 3 to version 2 error o 21 - cert db conversion version 7 to version 5 error o 22 - cert and key dbs 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...
NSS tools : vfychain
disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overr...
SSL functions
er ssl_getclientauthdatahook mxr 3.2 and later ssl_getmaxservercachelocks mxr 3.4 and later ssl_getsessionid mxr 3.2 and later ssl_getstatistics mxr 3.2 and later ssl_handshakecallback mxr 3.2 and later ssl_importfd mxr 3.2 and later ssl_inheritmpserversidcache mxr 3.2 and later ssl_invalidatesession mxr 3.2 and later ssl_localcertificate mxr 3.4 and later ssl_optionget mxr 3.2 and later ssl_optiongetdefault mxr 3.2 and later ssl_optionset mxr 3.2 and later ssl_optionsetdefault mxr 3.2 and later ssl_peercertificate mxr 3.2 and later ssl_preencryptedfiletostream mxr 3.2 and ...
NSS Tools modutil
per-platform keys these keys have meaning only within the value list of an entry in the platforms list. modulename (required) gives the common name for the module. this name will be used to reference the module from netscape communicator, the security module database tool (modutil), servers, or any other progra...
NSS Tools pk12util
lowing values: 0 - no error 1 - user cancelled 2 - usage error 6 - nls init error 8 - certificate db open error 9 - key db open error 10 - file initialization error 11 - unicode conversion error 12 - temporary file creation error 13 - pkcs11 get slot error 14 - pkcs12 decoder start error 15 - error read from import file 16 - pkcs12 decode error 17 - pkcs12 decoder verify error 18 - pkcs12 decoder validate bags error 19 - pkcs12 decoder import bags error 20 - key db conversion version 3 to version 2 error 21 - cert db conversion version 7 to version 5 error 22 - cert and key dbs patch error 23 - get default cert db error 24 - find cert by nickname error 25 - create export context error 26 - pkcs12 add password itegrity error 27 - cert and key safes creation error 28 - pkcs12 add cert and key err...
NSS tools : pk12util
o 8 - certificate db open error o 9 - key db open error o 10 - file initialization error o 11 - unicode conversion error o 12 - temporary file creation error o 13 - pkcs11 get slot error o 14 - pkcs12 decoder start error o 15 - error read from import file o 16 - pkcs12 decode error o 17 - pkcs12 decoder verify error o 18 - pkcs12 decoder validate bags error o 19 - pkcs12 decoder import bags error o 20 - key db conversion version 3 to version 2 error o 21 - cert db conversion version 7 to version 5 error o 22 - cert and key dbs 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...
NSS tools : signver
Mozilla › Projects › NSS › tools › signver
le gives the input file for the object with signed data. -o output_file gives the output file to which to write the results. -s signature_file gives the input file for the digital signature. -v enables verbose output. 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). signver -v -s signature_file -i signed_file -d sql:/home/my/sharednssdb signaturevalid=yes printing signature data the -a option prints all of the information contained in a signature file. using the -o option prints the signature file information to the given output file rather than stdout. signver -a -s signature_file ...
NSS tools : vfychain
lt providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more. -r ...
Network Security Services
mailing list newsgroup rss feed view mozilla cryptography forums... mailing list newsgroup rss feed related topics security ...
Rhino JavaScript compiler
and must be a writable filename. -d outputdirectory writes the class file to outputdirectory. -opt optlevel optimizes at level optlevel, which must be an integer between -1 and 9. see optimization for more details. if optlevel is greater than zero, -debug may not be specified. -package packagename specifies the package to generate the class into. the string packagename must be composed of valid identifier characters optionally separated by periods. -version versionnumber specifies the language version to compile with. the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160, or 170. see javascript language versions for more information on language versions. examples $ cat test.js java.lang.system.out.println("hi, mom!"); $ java org.mozilla.javascript.tools.jsc.mai...
Invariants
to jsobjects and jsstrings must refer to live heap objects, but this is not a hard fast rule, especially for strings. some jsstrings are allocated on the stack for quick operations. some commonly used strings are allocated statically; see jsstring::isstatic(). most jscontext pointers must point to live contexts, but jstitle::ownercx may point to one that has been destroyed! so code must check js_validcontextpointer(ownercx) before dereferencing it. shape invariants the shape guarantees hold whenever the property cache is enabled. also, we never change the shape of the global object on trace. (here "the global object" refers to the object at the end of the scope chain of the function object we're executing.) requests many functions require a request. that is, they take a parameter cx of t...
JSAPI User Guide
r one of the special values null or undefined. for integers and boolean values, a jsval contains the value itself. in other cases, the jsval is a pointer to an object, string, or number. warning: like c++ pointers, and unlike javascript vars, a js::value is not automatically initialized to a safe value, and can become a dangling pointer! a dangling pointer is a pointer that used to point to a valid object, but no longer does because the object no longer exists. using a dangling pointer can crash a c++ program (or worse). in the case of js::value, the javascript garbage collector recycles objects, strings, and numbers that don't appear to be in use, and a js::value by itself does not protect its referent from the garbage collector. see garbage collection below for crucial information on how ...
JS::IsCallable
this article covers features introduced in spidermonkey 38 return whether the given function object is callable/a valid constructor. syntax bool js::iscallable(jsobject *obj); bool js::isconstructor(jsobject *obj); name type description obj jsobject * pointer to the function. description js::iscallable returns whether the given function object is callable. js::isconstructor returns whether the given function object is a valid constructor. see also mxr id search for js::iscallable mxr id search for js::isconstructor js_isconstructor js_isnativefunction bug 1065811 ...
JSClass.flags
ding to an object that emulates undefined) are unaffected by this flag. strict equality (=== and !==) comparisons are also unaffected by this flag. mxr id search for jsclass_emulates_undefined jsclass_has_reserved_slots(n) indicates that instances of this class have n reserved slots. n is an integer in the range [0..255]. the slots initially contain unspecified valid jsval values. they can be accessed using js_getreservedslot and js_setreservedslot. (the jsclass.reserveslots hook also allocates reserved slots to objects.) mxr id search for jsclass_has_reserved_slots jsclass_global_flags this flag is only relevant for the class of an object that is used as a global object. (ecmascript specifies a single global object, bu...
JSPropertyDescriptor
e following key values field name description getter the get syntax binds an object property to a function that will be called when that property is looked up. setter the set syntax binds an object property to a function to be called when there is an attempt to set that property. value describes the value of the specified property, which can be any valid javascript value (function, object, string...) configurable declare that the property can be modified and deleted enumerable declare that the property can be enumerated, and the enumerable genus can be traversed by the for...in loop. writable declare whether the specified attribute can be rewritten description a descriptor is a property that describes a...
JSProtoKey
this article covers features introduced in spidermonkey 24 possible standard object prototype types. value prototype in javascript jsproto_null a dummy key for invalid prototype. mxr search for jsproto_null jsproto_object object mxr search for jsproto_object jsproto_function function mxr search for jsproto_function jsproto_array array mxr search for jsproto_array jsproto_boolean boolean mxr search for jsproto_boolean jsproto_json json mxr search for jsproto_json jsproto_date date mxr search for jsproto_date jsproto_math math mxr search for jsproto_math jsproto_number number mxr search for jsproto_number jsproto_s...
JS_BufferIsCompilableUnit
derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the global object, or null. utf8 const char * string containing the script to compile. length size_t the length of utf8 in characters. description given a buffer, return false if the buffer might become a valid javascript statement with the addition of more lines. otherwise return true. the intent is to support interactive compilation - accumulate lines in a buffer until js_bufferiscompilableunit is true, then pass it to the compiler. see also mxr id search for js_bufferiscompilableunit js::evaluate js::compile js::compileoffthread js::compilefunction js_decompilescript ...
JS_ConstructObject
to serve as the new object's parent, or null. argc unsigned int (only in js_constructobjectwitharguments) the number of arguments to pass to the constructor. argv jsval * (only in js_constructobjectwitharguments) the array of arguments to pass to the constructor. this may be null if argc is zero. otherwise, the first argc elements of this array must be populated with valid jsval values. the caller does not need to ensure that the array elements are rooted. description js_constructobject creates a new object of the specified class, with the specified prototype and parent, then invokes a constructor function to initialize the new object. cx is a pointer to a context associated with the runtime in which to create the new object. clasp is a pointer to the class...
JS_GetFunctionName
name type description fun jsfunction * a pointer to a javascript function. description js_getfunctionname retrieves the function name associated with a function pointer, fun. the return value is either the name of a function, or the string "anonymous", which indicates that the function was not assigned a name when created. the pointer returned by this function is valid only as long as the specified function, fun, exists. see also js_getfunctionid js_getfunctiondisplayid bug 617215 ...
JS_GetNaNValue
ntext *cx); // obsolete since spidermonkey 42 jsval js_getnanvalue(jscontext *cx); name type description cx jscontext * a context. description js_getnanvalue returns a value of type js::value that represents an ieee floating-point quiet not-a-number (nan). nan is typically used in javascript as the return value of a numeric operation when an argument is invalid or conversion fails. for example, 0/0 and math.sqrt(-1) both return nan. so do number("xyzzy") and math.sin("frank"). while the ieee standard defines many nan bit-patterns, they are indistinguishable in javascript, so in effect there's only one nan. nan is not equal to any other value. in fact, it is not even equal to itself: if x is nan, then x != x. see also mxr id search for js_getnanvalu...
JS_GetStringChars
btain characters from. description js_getstringchars obsolete since javascript 1.8.5 returns a pointer to the first element of an array of jschars. warnings: the array is not necessarily null-terminated. to get the length of the string, use js_getstringlength. the program must not modify the array. if it does, the behavior is undefined. the content of a js string is not guaranteed to be valid utf-16. it may contain surrogate code units that aren't properly paired. it may also contain zeroes. the array returned by this function remains valid as long as str is valid. (eventually, str becomes unreachable, the garbage collector collects it, and the array is freed by the system.) js_getstringcharsz is the same except that it always returns either a null-terminated string or null, indicati...
JS_SetFunctionCallback
e in an indeterminate state. description js_setfunctioncallback sets a c function to be called each time a javascript function is invoked or exits. fcb is a pointer to the c function to call. note that debuggers should probably use js_setcallhook in preference to this function, because it is invoked when the javascript stack is guaranteed to be in a consistent state (and therefore it is valid to inspect and modify local variables, generate stack traces, and set breakpoints.) callback syntax typedef void (* jsfunctioncallback)(const jsfunction *fun,const jsscript *scr, const jscontext *cx, int entering); name type description fun const jsfunction * the javascript function being invoked or exited. scr const jsscript * ...
jschar
hat make up strings. jschar, a typedef for the standard c++ type char16_t, will be removed in jsapi 38. functions that use jschar will use char16_t directly. embedder code should use char16_t, too. (see bug 1063962.) as required by the ecmascript standard, ecma 262-3 §4.3.16", javascript strings are arbitrary sequences of 16-bit values. a string may contain unmatched surrogates, which are not valid utf-16. it may also contain zeroes ('\0'). to get the characters of a javascript string, use js_getstringchars. see also bug 1063962 ...
jsid
ntifier for a property or method of an object. jsid is either a 31-bit signed integer, interned string or object. a few jsapi functions use jsids instead of js::values for property names: js_nextproperty, js_enumerate, and all functions with names ending in byid. also, there is an additional jsid value, jsid_void, which does not occur in js scripts but may be used to indicate the absence of a valid jsid. a void jsid is not a valid id and only arises as an exceptional api return value, such as in js_nextproperty. embeddings must not pass jsid_void into jsapi entry points expecting a jsid and do not need to handle jsid_void in hooks receiving a jsid except when explicitly noted in the api contract. a jsid is not implicitly convertible to or from a jsval; js_valuetoid or js_idtovalue must be ...
Running Automated JavaScript Tests
s to run in the same way as the jstests shell harness. most of the options in the jstests harness are also available for this one, but a few have different names. use -h to see all the options. the --jitflags option allows you to test the js executable with different flags. the flags are used to control which features are run, such as which jits are enabled and how quickly they will kick in. the valid options are named bundles like 'all', 'interp', 'none', etc. see the full list in the -h / --help output. one helpful option specific to jit-tests is -r filename (or --retest filename). the first time this is run, it runs the suite and writes a list of tests that failed to the given filename. the next time it is run, it will run only the tests in the given filename, and then will write the list ...
Setting up CDT to work on SpiderMonkey
...
TPS Pref Lists
for a more detailed test example, see the tps prefs unit test. ...
Redis Tips
even if i have a private redis db for this app, this is descriptively useful and adds a measure of safety. if i ever have more values to store per email than just the password, i could use...
Pinning violation reports
if a site makes use of key pinning, and your browser sees a certificate chain for that site which does not match the pin, firefox will reject the connection and display an error page. ...
Handling Mozilla Security Bugs
sed by large populations of end users, many of whom may not often upgrade or check for recent security fixes. we understand and acknowledge the concerns of those who believe that too-hasty disclosure of exploit details can provide a short-term advantage to potential attackers, who can exploit a problem before most end users become aware of its existence. we believe that both sets of concerns are valid, and that both are worth addressing as best we can. we have attempted to create a compromise scheme for how the mozilla project will handle reports of security vulnerabilities. we believe that it is a compromise that can be justified to those on both sides of the question regarding disclosure. general policies mozilla.org has adopted the following general policies for handling bug reports relat...
Gecko states
es that the object is formatted as a hyperlink. the object role will usually be role_text_leaf. state_traversed the object is a hyperlink that has been visited (previously clicked) by a user. state_multiselectable supports multiple selection state_extselectable supports extended selection state_required indicates that user interaction is required. state_important isn;t used. state_invalid indicates a validation failure. ext_state_supports_autocompletion for editable areas that have any kind of autocompletion ext_state_defunct object no longer exists ext_state_selectable_text for text which is selectable, object must implement nsiaccessibletext ext_state_editable implements nsiaccessibleeditabletext ext_state_active this window is currently the active window ext_state_m...
Implementation Details
erested at api. msaa/iaccessible2 at-spi avoiding memory leaks it is the assistive technology's responsibility to watch for events that indicate when windows or content subtrees are being destroyed, and to release all accessible objects related to that window. in addition, state_defunct is set on objects that should be released by the assistive technology. mutation events should be watched to invalidate the cache. under msaa/ia2, watch for event_hide under atk/at-spi, watch for children-changed:remove to help developers in that regard, there is memory leak monitor, a firefox extension. ...
Mork
Mozilla › Tech › Mork
semantics of cells for the value, except that it cannot refer to a mid. the values of cells and aliases, when not specified by a mid reference, are one of the cases where whitespace is significant. using the '\' character quotes the next character; at the end of the line, it represents a continuation such as that found in c\c++ code. the '$' character quotes the next two characters (which must be valid hexadecimal digits) and these three in total represent an octet with the value of the digits. mids are unique identifiers represented by the tuple (scope, id); if the ids are the same but the scopes are different, the two mids are different. in many places, the mid's scope has an assumed default value; if the scope component is not present, it assumes this default value. morkreader usage morkread...
History Service Design
n a common shared database called places.sqlite. history service checks for database existance and coherence, and initializes the connection through the storage service. history management: provides basic and advanced apis to store and modify visits and page details. relevance calculation: maintain and expire frecency values for pages. history expiration: expire old visits and invalid informations from the database. queries creation: allows the creation for complex queries. queries results maintenance: allows easy access to queries results. charset for pages: allows setting and reading charset for each page. database maintenance at startup the service creates an exclusive storage connection to places.sqlite, the exclusive locking is needed for both a per...
Places utilities for JavaScript
itypes containertypes leftpanequeries queries that appear in the library's left pane. leftpanefolderid a single folder shown in the library's left pane. allbookmarksfolderid the id of the "all bookmarks" folder shown in the library's left pane. placesflavors generic_view_drop_types methods createfixeduri nsiuri createfixeduri(string aspec) takes in a spec and returns a valid uri based on it using the nsiurifixup service. parameters aspec a url string that needs fixup return type returns a correct nsiuri. getformattedstring() string getformattedstring(string key, array string params) parameters key the string name to get from the string bundle params strings to substitute into the bundle at designated points see xul:stri...
The Publicity Stream API
nerror is an error callback that will be invoked if the publicity fails. possible error codes include: denied - if the user refuses to publicize the activity permissiondenied - if the publicizing site is not allowed to post to the publicity stream networkerror - if the publicity server is unreachable activityparseerror - if the activity contains syntax errors (not proper json) invalidactivity - if the activity contains semantic errors (i.e. missing required properties) finally, the publicizeactivity() function will throw an exception if required arguments are missing, or if unsupported arguments are present. getpublicitystream( onsuccess: <function>, { [ onerror: <function> ], [ for_apps: <list> ], [ since: <date> ], [ before: <date> ], [ count: <int> ]): provides...
extIPreferenceBranch
if the preference does not exist getvalue() gets the value of a preference. returns a default value if the preference does not exist. nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) parameters aname the name of a preference adefaultvalue the default value of a preference. this will be passed back to you without any processing and can be something which would not be valid as a preference. for example, null/undefined/an object. return value the value of the preference or the given default value if preference does not exists. the use of a variant as the return value means that to javascript code the value will appear as a value of the same type as is used in the preferences file and no coercion will occur. a quoted string in the preference file will always app...
Creating a Python XPCOM component
es.nsisample # if this object needs to be registered, the following 2 are also needed. # _reg_clsid_ = "{a new clsid generated for this object}" # _reg_contractid_ = "the.object.name" def get_value( self ): # result: string pass def set_value( self, param0 ): # result: void - none # in: param0: string pass as you can see, the output is valid python code, with basic signatures and useful comments for each of the methods. testing it to see this work, you will have to start firefox from the command line, since that'll be where the stuff will be printed out. external links creating xpcom components, on which this short tutorial is based. a three-part tutorial on ibm developerworks: getting to know pyxpcom - info on buildi...
Finishing the Component
lse and blocks the load. uri caching caching the uri would make this method implementation much faster by avoiding the need to create and destroy so many objects. this points out an important drawback of xpcom, which is that you cannot create an object on the stack. creating this many objects is ok in a tight loop if the buffer of memory that holds the contents of the urls is guaranteed to be valid for the lifetime of the object. but regardless of how optimized the implementation is with respect to is memory usage, a heap allocation will be made for every xpcom object created. the string comparison with the url type "http", "https", and "ftp" looks like this: nsembedcstring scheme; contentlocation->getscheme(scheme); if (strcmp("http", scheme.get()) != 0 && strcmp("https", scheme.g...
Starting WebLock
objects that are alive to have a reference count of at least one. ignoring this fact can cause real trouble. a related warning is that you should never delete an xpcom object with delete. it can take hours to find the source of crashes that are caused when one part of a system is deleting xpcom objects instead of releasing them. note that in the implementation above, myenumerator may become invalid if another thread concurrently accesses the linked list. the enumeration represents only one way to walk the linked listed of url strings. if you require that the enumeration be a snapshot of the list of url strings, then you have to rework this implementation so that the enumerator owns a copy of the linked list. at component shutdown, you also need to write the linked list to disk and release ...
Using XPCOM Utilities to Make Things Easier
if not, it doesn't even try to continue. next, it calls another method on an object that is presumed to exist in this context. you can call a .get() method on the nscomptr and have it returned for use as a raw pointer. this raw pointer can then be assigned to a variable and have its reference updated by ns_if_addref. be very careful with the result of .get(), however. you should never ca...
Components.utils.getWeakReference
it might simply not have been garbage collected yet. you might have to check other aspects of the object (like node.parentnode() on a dom node) to verify the object is truly what you want. ...
Components.utils.importGlobalProperties
ethods to import these objects. import from jsm this method worked until blob and file were no longer apart of jsm modules. it is suspected this works up till firefox 35. this imports blob, file, along with the regular services. the reason this works is because js code modules actually have blob and file. cu.import() will return the full global of a code module. knowing that, we can just get a valid blob by importing a known module that has the objects, such as services.jsm const {blob, file, services} = cu.import("resource://gre/modules/services.jsm", {}); reference: stackoverflow :: use blob on firefox add-on hiddendomwindow the hidden domwindow has all of these objects automatically imported. the downside of using hiddendomwindow is that on startup of firefox, the hiddendomwindow obje...
XPCShell Reference
oked from the command line: clear(object) clear() removes all properties from an object. for example, if you created anobject with a property named value and then called clear(anobject), the property value would no longer exist. gc(heapdumpfilename) gc() will invoke garbage collection. it takes an optional argument that can be used to dump the heap to. if specified, it should equate to a valid filename. load(scriptfilename) load() allows you to load and run a script from the command line. for example, load("myscript.js") will execute the script myscript.js in the current directory. print(obj1, obj2, …) print() is useful to print something to the screen. it dumps whatever is passed to the screen, putting spaces between arguments and appending a newline at the end. an example...
NS_GetComponentManager
he xpcom component manager. #include "nsxpcom.h" #include "nsicomponentmanager.h" nsresult ns_getcomponentmanager( nsicomponentmanager** aresult ); parameters aresult [out] a reference to the xpcom component manager. return values the ns_getcomponentmanager function returns ns_ok if successful. otherwise, it returns an error code. remarks the object returned is a singleton that is valid until ns_shutdownxpcom is called. the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. see also nsicomponentmanager ...
NS_GetComponentRegistrar
component registrar. #include "nsxpcom.h" #include "nsicomponentregistrar.h" nsresult ns_getcomponentregistrar( nsicomponentmanager** aresult ); parameters aresult [out] a reference to the xpcom component registrar. return values the ns_getcomponentregistrar function returns ns_ok if successful. otherwise, it returns an error code. remarks the object returned is a singleton that is valid until ns_shutdownxpcom is called. the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. see also nsicomponentregistrar ...
NS_GetMemoryManager
unction returns a reference to the xpcom memory manager. #include "nsxpcom.h" #include "nsimemory.h" nsresult ns_getmemorymanager( nsimemory** aresult ); parameters aresult [out] a reference to the xpcom memory manager. return values the ns_getmemorymanager function returns ns_ok if successful. otherwise, it returns an error code. remarks the object returned is a singleton that is valid until ns_shutdownxpcom is called. the interface pointer should be release'd when it is no longer needed. any code, intended to be used exclusively with mozilla 1.8 and above, may use ns_alloc, ns_realloc, and ns_free instead to access the xpcom memory manager's methods. history this function was finalized for mozilla 0.9.7. see bug 112262 for details. see also nsimemory, ns_alloc ...
NS_GetServiceManager
ference to the xpcom service manager. #include "nsxpcom.h" #include "nsiservicemanager.h" nsresult ns_getservicemanager( nsiservicemanager** aresult ); parameters aresult [out] a reference to the xpcom service manager. return values the ns_getservicemanager function returns ns_ok if successful. otherwise, it returns an error code. remarks the object returned is a singleton that is valid until ns_shutdownxpcom is called. the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. see also nsiservicemanager ...
NS_NewLocalFile
, passing true causes shortcuts to be automatically resolved, and on macos, passing true causes finder aliases to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newlocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the specified path is invalid. this error is returned if a relative file path is passed to ns_newlocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newlocalfile(nsembedstring(l"c:\\foo.txt"), pr_false, getter_addrefs(file)); if (...
NS_NewNativeLocalFile
ing true causes shortcuts to be automatically resolved, and on macos, passing true causes finder aliases to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newnativelocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the specified path is invalid. this error is returned if a relative file path is passed to ns_newnativelocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. if you use this function on windows 2000 or later, you would not be able to handle file names containing characters outside the default code page even though the os has no problem dealing with them. do not use th...
nsDependentCSubstring
class declaration nstdependentsubstring_chart a string class which wraps an external array of string characters. it is the client code's responsibility to ensure that the external buffer remains valid for a long as the string is alive. names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method overview constructors rebind beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const ...
nsDependentSubstring
class declaration nstdependentsubstring_chart a string class which wraps an external array of string characters. it is the client code's responsibility to ensure that the external buffer remains valid for a long as the string is alive. names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method overview constructors rebind beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const ...
IAccessibleRelation
elation. [propget] hresult relationtype( [out] bstr relationtype ); parameters relationtype the strings returned are defined @ref grprelations "in this section of the documentation". return value s_ok. target() returns one accessible relation target. [propget] hresult target( [in] long targetindex, [out] iunknown target ); parameters targetindex 0 based index. target return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. targets() returns multiple accessible relation targets. [propget] hresult targets( [in] long maxtargets, [out, size_is(maxtargets), length_is( ntargets)] iunknown targets, [out] long ntargets ); parameters maxtargets maximum size of the array allocated by the client. targets the a...
IAccessibleValue
returned by method currentvalue(). [propget] hresult minimumvalue( [out] variant minimumvalue ); parameters minimumvalue returns the minimal value in an implementation dependent type. if this object has no lower bound then an empty object is returned. see the section about. return value s_ok. setcurrentvalue() sets the value of this object to the given number. the argument is clipped to the valid interval whose upper and lower bounds are returned by the methods maximumvalue() and minimumvalue(), that is if it is lower than the minimum value the new value will be the minimum and if it is greater than the maximum then the new value will be the maximum. hresult setcurrentvalue( [in] variant value ); parameters value the new value represented by this object. the set of admissible types fo...
imgIRequest
ed loading the image. status_frame_complete 0x10 the first frame has been completely decoded. status_decode_complete 0x20 the whole image has been decoded. cors_none 1 cors modes images can be loaded with. by default, all images are loaded with cors_none and cannot be used cross-origin in context like webgl. if an html img element has the crossorigin attribute set, the imgirequest will be validated for cross-origin usage with cors, and, if successful, will have its cors mode set to the relevant type. cors_anonymous 2 cors_use_credentials 3 methods cancelandforgetobserver() cancels this request as in nsirequest.cancel(); further, also nulls out decoderobserver so it gets no further notifications from us. note: you should not use this in any new code; instead, use cancel(). note...
mozIAsyncHistory
[s] containing the information to store or update. this can be a single object, or an array of objects. acallback optional a mozivisitinfocallback object to be notified for each visit addition, title change, guid change, or error. if more than one operation is performed for a given visit, only one callback will be given (i.e. title change and add visit). exceptions thrown ns_error_invalid_arg passing in null for aplaceinfo. not providing at least one valid guid or uri for all moziplaceinfo object[s]. not providing an array or nothing for the visits property of moziplaceinfo. not providing a visitdate and transitiontype for each mozivisitinfo. providing an invalid transitiontype (see nsinavbookmarksservice.constants) for a mozivisitinfo. see also mozipla...
mozIRepresentativeColorCallback
void oncomplete(in boolean success, [optional] in unsigned long color); methods oncomplete() will be called when color analysis finishes. void oncomplete( in boolean success, [optional] in unsigned long color ); parameters success true if analysis was successful, false otherwise. analysis can fail if the image is transparent, imageuri doesn't resolve to a valid image, or the image is too big. color the representative color as an integer in rgb form. e.g. 0xff0102 == rgb(255,1,2). if success is false, color is not provided. ...
mozIStorageService
enspecialdatabase() opens a connection to a named special database storage that identifies the type of storage requested. note: you should only access the profile database from the main thread since other callers may also be using it. mozistorageconnection openspecialdatabase( in string astoragekey ); parameters astoragekey a string key identifying the type of storage requested. valid values are "profile" and "memory". return value a new mozistorageconnection providing access to the requested database. exceptions thrown ns_error_invalid_arg if astoragekey is invalid. openunshareddatabase() opens a database connection to the specified file without using a shared cache. if this method throws ns_error_file_corrupted, it's recommended that you call mozistorageserv...
mozIStorageStatement
params mozistoragestatementparams the current list of named parameters, which may be set. only available to javascript code. read only. row mozistoragestatementrow the current row, with access to all data members by name. available only to javascript code. read only. state long the current state defined by mozistoragestatement.moz_storage_statement_invalid, mozistoragestatement.moz_storage_statement_ready, or mozistoragestatement.moz_storage_statement_executing. read only. statement status constants constant value description moz_storage_statement_invalid 0 the sql statement is invalid. moz_storage_statement_ready 1 the sql statement is ready to be executed. moz_storage_statement_executi...
mozIStorageStatementWrapper
agestatement astatement); void reset(); boolean step(); void execute(); attributes attribute type description statement mozistoragestatement the statement that is wrapped. row mozistoragestatementrow the current row. throws an exception if no row is currently available. useful only from script. the value of this is only valid while the statement is still executing, and is still on the appropriate row. params mozistoragestatementparams the parameters; these can be set in lieu of using the call notation on this. methods initialize() this method initializes this wrapper with astatement. void initialize( in mozistoragestatement astatement ); parameters astatement the statement to be ini...
mozIStorageVacuumParticipant
boolean onbeginvacuum(); void onendvacuum(in boolean asucceeded); attributes attribute type description databaseconnection mozistorageconnection a connection to the database file to be vacuumed. expecteddatabasepagesize long the expected page size, in bytes, for the database. the vacuum manager will try to correct the page size when the browser is idle, using this value as a target. valid page sizes are in the range 512 to 65,536. the recommended value is mozistorageconnection::default_page_size. note: if the database is using the wal journal node and the current page size is not the expected one, the journal node will be changed to truncate because wal doesn't allow page size changes. the vacuum manager will try to restore wal mode, but this will only work reliably if the partici...
DoAction
« nsiaccessible page summary this method performs the accessible action at the given zero-based index. action number 0 is the default action. void doaction( in pruint8 aindex ); parameters aindex[in] the zero-based index. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ns_error_invalid_arg indicates that the given index is our of range. see also nsiaccessible.numactions nsiaccessible.getactionname() nsiaccessible.getactiondescription() ...
GetActionDescription
mmary this method retrieves the description (localized name) of the accessible action at the given zero-based index. astring getactiondescription( in pruint8 aindex ); parameters aindex[in] the zero-based index. return value returns the description of the accessible action. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ns_error_invalid_arg indicates that the given index is our of range. see also nsiaccessible.numactions nsiaccessible.getactionname() nsiaccessible.doaction() ...
GetActionName
« nsiaccessible page summary this method retrieves the name of the accessible action at the given zero-based index. astring getactionname( in pruint8 aindex ); parameters aindex[in] the zero-based index. return value returns the name of the accessible action. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.ns_error_invalid_arg indicates that the given index is our of range. see also nsiaccessible.numactions nsiaccessible.getactiondescription() nsiaccessible.doaction() ...
GetKeyBindings
« nsiaccessible page summary this method provides array of localized string of global keyboard accelerator for the given action index supported by accessible. nsidomdomstringlist getkeybindings( in pruint8 aactionindex ); parameters aactionindex[in] index of the given action. return values returns array of localized string of global keyboard accelerator. exceptions thrown ns_error_invalid_arg the given index doesn't correspond to default action (not zero). remark key bindings are supported for default action only. see also nsiaccessible.defaultkeybinding nsiaccessible.keyboardshortcut ...
GetRelation
« nsiaccessible page summary this method returns accessible relation for this accessible object by index. nsiaccessiblerelation getrelation( in unsigned long aindex ); parameters aindex[in] the index for which relation is to be retrieved. return value returns nsiaccessiblerelation object for this accessible. exception thrown ns_error_invalid_arg indicates that the given index is invalid. remark currently we do not support multiple relations so the zero index may be valid only. refer to relations documentation for more info. see also nsiaccessible.relationscount nsiaccessible.getrelations() nsiaccessible.getaccessiblerelation() ...
GetState
refer to states documentation for more information. ...
nsIAccessibleHyperText
ssiblehyperlink object at the given link index. nsiaccessiblehyperlink getlink( in long linkindex ); parameters linkindex 0-based index of the link that is to be retrieved. this can be retrieved via getlinkindex(). return value an nsiaccessiblehyperlink object. exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree. ns_error_invalid_arg the link index is invalid. getlinkindex() the link index at the given offset (character index). long getlinkindex( in long charindex ); parameters charindex the 0-based character index. return value the index of the link if it's presented on the given character index, otherwise -1. exceptions thrown ns_error_failure indicates that the accessible is unattached from the acc...
nsIAccessibleRelation
a form/dialog with a related default button. it is used for msaa only, no for ia2 nor atk/at-spi. methods gettarget() returns accessible relation target at the given index. nsiaccessible gettarget( in unsigned long index ); parameters index zero-based index of relation target. return value returns an nsiaccessible object. exceptions thrown ns_error_invalid_arg indicates the given index is out of range. gettargets() returns an array of accessible relation targets. nsiarray gettargets(); parameters none. return value an nsiarray object, each item in the array implements an nsiaccessible. ...
nsIAccessibleStates
ion is of low priority. state_alert_medium 0x08000000 this information is of medium priority. state_alert_high 0x10000000 this information is of high priority. state_protected 0x20000000 maps to gnome's role* atk_role_passwd_text, nothing for java? state_haspopup 0x40000000 new in msaa 2.0. state_required state_alert_low state_important state_alert_medium currently unused. state_invalid state_alert_high indicates a validation failure. state_checkable state_marqueed extended state constants extended state flags (for now non-msaa, for java and gnome/atk support) constant value description ext_state_supports_autocompletion 0x00000001 for editable areas that have any kind of auto completion. ext_state_defunct 0x00000002 object no longer exists. ext_state_selectable_t...
nsIAccessibleTable
selectedrowcount unsigned long the total number of selected rows. read only. note: renamed from selectedrowscount in gecko 1.9.2 summary astring the summary description for the table. for example, @summary attribute on html:table element. read only. methods return the accessible object at the specified row and column in the table. if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently visible (on the screen). nsiaccessible getcellat( in long rowindex, in long columnindex ); parameters rowindex the row index of the cell. columnindex the column index of the cell. return value an nsiaccessible object. translate the given row and colu...
nsIAlertsService
ameter passed into the showalertnotification method. name optional a name for the notification; this is not displayed in the alert. however, certain notification systems (such as growl on mac os x) allow the user to disable alerts by name. this name is used in that configuration panel. on android the name is hashed and used as a notification id. dir optional bidi override for the title. valid values are "auto", "ltr" or "rtl". only available on supported platforms. lang optional language of title and text of the alert. only available on supported platforms. data optional the value of the cookie parameter passed to showalertnotification. principal optional the principal of the page that created the alert. used for ipc security checks, and to determine whether the alert is action...
nsIBrowserSearchService
to the list. if this value is false, the engine will be added to the list upon successful load, but it will not be selected as the current engine. callback a nsisearchinstallcallback that will be notified when the addition is complete, or if the addition fails. it will not be called if addengine throws an exception. exceptions thrown ns_error_failure if the type is invalid, or if the description file cannot be successfully loaded. addenginewithdetails() adds a new search engine, without asking the user for confirmation and without starting to use it right away. void addenginewithdetails( in astring name, in astring iconurl, in astring alias, in astring description, in astring method, in astring url ); parameters name the search engine's...
nsICategoryManager
avalue the value for the category entry. ("moz.httprulez.1") apersist no longer supported. category entries never persist across application sessions. you must pass false for this parameter. areplace a flag indicating whether or not to overwrite the value of an existing category entry. return value the previous value for the given category entry (if any). exceptions thrown ns_error_invalid_arg this error is returned if areplace is false and the category entry already has a value, or if apersist is true. deletecategory() delete a category and all entries. note: if the category does not exist, then this method does nothing. void deletecategory( in string acategory ); parameters acategory the name of the category being deleted. deletecategoryentry() delete an entry fr...
nsICookieConsent
boolean isforeign, out nscookiepolicy policy ); parameters uri the uri to find the policy for. httpchannel the channel to extract the p3p headers from. isforeign true if the cookie originates from a third-party site. this is used to decide the cookie status based on user preferences. policy the policy for the given uri, or nsicookie::policy_unknown if one cannot be found. valid values are defined in nsicookie.idl. return value returns nscookiestatus. valid values are defined in nsicookie.idl. see also nsicookie ...
nsICookieManager2
is treated as a non-domain cookie. see rfc2109 for details. the host string will be normalized to ascii or ace; any trailing dot will be stripped. to be a domain cookie, the host must have at least two subdomain parts (e.g. '.foo.com', not '.com'), otherwise an exception will be thrown. an empty string is acceptable (e.g. file:// uri's). apath the path within the domain for which the cookie is valid. aname the cookie name. avalue the cookie data. aissecure true if the cookie should only be sent over a secure connection. aishttponly true if the cookie should only be sent to, and can only be modified by, an http connection. aissession true if the cookie should exist for the current session only. aexpiry holds the expiration date, in seconds since the epoch. only relevant if aissess...
nsIDBFolderInfo
g flags long folderdate unsigned long foldername string foldersize unsigned long highwater nsmsgkey imaphierarchyseparator wchar imaptotalpendingmessages long imapuidvalidity long imapunreadpendingmessages long knownartsset string locale astring mailboxname astring nummessages long numunreadmessages long sortorder nsmsgviewsortordervalue ...
nsIDOMHTMLAudioElement
stream, in samples per second. for example, specify 44100 for 44.1khz. mozwriteaudio() writes samples to the audio stream. unsigned long mozwriteaudio( in jsval data ); parameters data the samples to write into the audio stream, specified either as a javascript array or as a numeric typed array. return value the actual number of bytes written to the stream. exceptions thrown ns_error_dom_invalid_state_err the stream has not been initialized for writing by a call to mozsetup(). ns_error_dom_type_mismatch_err the data isn't a valid data type (an array or typed array of numeric values). ns_error_dom_index_size_err the number of samples specified doesn't divide evenly across the number of channels; you must provide exactly the same number of samples for all channels. ...
nsIDOMWindowUtils
the "displayport" to be <xpx, ypx, widthpx, heightpx> in units of css pixels, regardless of the size of the enclosing widget/view. this will *not* trigger reflow. <x, y> is relative to the top-left of the css viewport. this means that the pixels rendered to the displayport take scrolling into account, for example. the displayport will be used as the window's visible region for the purposes of invalidation and painting. the displayport can approximately be thought of as a "persistent" drawwindow() (albeit with coordinates relative to the css viewport): the bounds are remembered by the platform, and layer pixels are retained and updated inside the viewport bounds. it's legal to set a displayport that extends beyond the css viewport in any direction (left/right/top/bottom). it's also legal to ...
nsIDOMXPathException
dom/interfaces/xpath/nsidomxpathexception.idlscriptable describes an exception resulting from xpath operations. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description code unsigned short the error code; see error codes for details. constants error codes constant value description invalid_expression_err 51 an invalid xpath expression was used. type_err 52 an attempt was made to reference an unavailable type. see also introduction to using xpath in javascript document object model (dom) level 3 xpath specification nsidomxpathevaluator document.evaluate nsidomxpathresult ...
nsIDOMXPathResult
ath result returned by nsidomxpathevaluator or document.evaluate inherits from: nsisupports last changed in gecko 1.7 method overview nsidomnode iteratenext(); nsidomnode snapshotitem(in unsigned long index); attributes attribute type description booleanvalue boolean if resulttype is boolean_type, the boolean value. read only. invaliditeratorstate boolean true if the iterator state has become invalid. for example, modifying a node invalidates the iterator. read only. numbervalue double if resulttype is number_type, the numeric value of the xpath value. read only. resulttype unsigned short the type of result; can be any of the type constants except any_type. read only. singlenodevalu...
nsIDirIndexParser
netwerk/streamconv/public/nsidirindexlistener.idlscriptable a parser for 'application/http-index-format' directories. inherits from: nsistreamlistener last changed in gecko 1.7 called for each directory entry. attributes attribute type description comment string the comment given, if any. this result is only valid after onstoprequest has occurred, because it can occur anywhere in the datastream. read only. encoding string the encoding to use. listener nsidirindexlistener the interface to use as a callback for new entries. ...
nsIDownload
me information, including its mime type, helper application, and whether or not the helper should be executed automatically once the download is complete. read only. optional percentcomplete long the percentage of the file transfer that has been completed, or -1 if the file's size is unknown. read only. referrer nsiuri the referrer uri of the download. this is only valid for http downloads, and can be null. read only. resumable boolean indicates if the download can be resumed after being paused or not. this is only the case if the download is over http/1.1 or ftp and if the server supports it. read only. size long long the total size of the file in bytes, or ll_maxuint if the file's size is unknown. read only. source n...
nsIDownloadManager
dependent on two user configurable prefs set in preferences: browser.download.folderlist defines the default download location for files: 0: files are downloaded to the desktop by default. 1: files are downloaded to the system's downloads folder by default. 2: files are downloaded to the local path specified by the browser.download.dir preference. if this preference is invalid, the download directory falls back to the default. read only. constants constant value description download_notstarted -1 the download has not been started yet. download_downloading 0 the download is in the process of being downloaded. download_finished 1 download completed including any processing of the target file. ...
nsIEditorSpellCheck
f the specified word is misspelled; otherwise false. checkcurrentwordnosuggest() like checkcurrentword(), checks the word you give it, returning true if it is misspelled. this is faster than checkcurrentword() because it does not compute any suggestions. note: this does not clear any suggestions left over from previous calls to checkcurrentword(), so there may be suggestions, but they will be invalid. boolean checkcurrentwordnosuggest( in wstring suggestedword ); parameters suggestedword the word to check. return value true if the word is misspelled; otherwise false. getcurrentdictionary() returns the name of the dictionary currently in use. astring getcurrentdictionary(); parameters none. return value the name of the dictionary currently in use. typically, this is an iso langua...
nsIEventTarget
antly. void dispatch( in nsirunnable event, in unsigned long flags ); parameters event the event to dispatch. flags the dispatch flags modifying the event. exceptions thrown ns_error_unexpected indicates that the thread is shutting down and has finished processing events, so this event would never run and has not been dispatched. ns_error_invalid_arg indicates that event is null. isoncurrentthread() check to see if this event target is associated with the current thread. boolean isoncurrentthread(); parameters none. return value returns true if events dispatched to this event target will run on the current thread (that is, the thread calling this method). if events dispatched to this target will be processed on another thread, re...
nsIFeedResultListener
s from the feed parser as parsing progresses. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleresult(in nsifeedresult result); methods handleresult() called when feed processing is complete. even if an error occurred during processing, there may be valid data available for feed-level data or entries processed before the error occurred. if you don't care about doing progress display or the like, this is all you need to implement in order to receive the parsed feed. void handleresult( in nsifeedresult result ); parameters result an nsifeedresult describing the parsed feed. see also nsifeedprogresslistener nsisupports interwiki link...
nsIFilePicker
de will be used as default filter when displaying the nsifilepicker dialog. if you would like to use another you must append it separately before the others you want to go into the drop down list. filtermask a combination of the filters you wish to use. you may or multiple filters together; for example filterall | filterhtml. init() initialize the file picker widget. the file picker is not valid until this method is called. void init( in nsidomwindow parent, in astring title, in short mode ); parameters parent the nsidomwindow parent. this dialog will be dependent on this parent. must be non-null. title the file picker dialog title. if this is null, the dialog will have the default title. mode one of the mode constants, indicating the type of picker to create. open() ...
nsIHttpChannel
returns true if the http response code indicates success. the value of nsirequest.status() will be ns_ok even when processing a 404 file not found response because such a response may include a message body that (in some cases) should be shown to the user. use this attribute to distinguish server error pages from normal pages, instead of comparing the response status manually against the set of valid response codes, if that is required by your application. read only. exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()). responsestatus unsigned long get the http response code (for example 200). read only. exceptions thrown ns_error_not_available if called before the re...
nsIIOService
aorigincharset, in nsiuri abaseuri ); parameters aspec the spec for the desired uri. aorigincharset the charset for the uri. may be null. abaseuri the base uri for the spec. may be null. if aspec is an absolute url, this parameter is ignored. return value an nsiuri object corresponding to aspec and abaseuri. exceptions thrown ns_error_malformed_uri if uri does not begin with a valid scheme (as defined by rfc 3986) followed by a colon. remarks note: the proper way to create a new nsiuri is with newuri() method defined above. do not create a new nsiuri with createinstance(). this was a frozen interface see bug 157131 for details. from gecko 2.0 interfaces are no longer frozen. see also rfc 3986 ...
nsIIdleService
siidleservice); method overview void addidleobserver(in nsiobserver observer, in unsigned long time); void removeidleobserver(in nsiobserver observer, in unsigned long time); attributes attribute type description idletime unsigned long the amount of time in milliseconds that has passed since the last user activity. can be 0 if there is no valid idle time to report (this can happen if the user never interacted with the browser at all, and if we are unable to poll for idle time manually). read only. methods addidleobserver() add an observer to be notified when the user idles for some period of time, and when they get back from that. the subject of the notification the observer will get is always the nsiidleservice itself. when...
nsIJSID
ther); const nsid* getid(); violates the xpcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only. native code only! obsolete since gecko 1.9 the internal nsid. name string read only. the name of the jsid, if it was set. number string read only. the string representation of the internal nsid. valid boolean read only. returns true if the jsid has been initialised. methods equals() this method determines if this nsijsid has the same nsid as another nsijsid. boolean equals( in nsijsid other ); parameters other the other nsijsid to compare to. return value true if the nsijsid's are valid and have the same nsid, otherwise false. violates the xpcom interface guidelines getid() cons...
nsIJumpListBuilder
optional ); parameters acattype the type of list to add. items optional an array of nsijumplistitem items to add to the list. catname optional for custom lists, the title of the list. return value true if the operation completed successfully. exceptions thrown ns_error_unexpected on internal errors. ns_error_illegal_value if an item is added that was removed since the last commit. ns_error_invalid_arg if incorrect parameters are passed for a particular category or item type. commitlistbuild() commits the current jump list build to the taskbar. boolean commitlistbuild(); parameters none. return value true if the operation completed successfully. deleteactivelist() deletes any currently applied taskbar jump list for this application. common uses would be the enabling of a privacy mode and ...
nsILocale
r things like sorting text strings and formatting numbers, dates and times. inherits from: nsisupports last changed in gecko 1.0 method overview astring getcategory(in astring category); methods getcategory() retrieves a string with the current locale name. astring getcategory( in astring category ); parameters category a string representing the category to retrieve the locale for. valid strings are stored in nsilocale.idl. currently those are: nsilocale_collate - collation order. how strings are sorted. nsilocale_ctype - character classification and case conversion. nsilocale_monetary - monetary formatting. nsilocale_numeric - numeric, non-monetary formatting. nsilocale_time - date and time formats. nsilocale_messages - related to fonts, character encodings and so on. return...
nsIMsgDBView
resultid the key of the result message. nsmsgkey is defined as an unsigned long in mailnewstypes2.idl. resultindex the index of the result message. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. threadindex the index of the new thread. nsmsgviewindex is defined as a unsigned long in mailnewstypes2.idl. navigatestatus() indicates if the passed motion type is currently valid. boolean navigatestatus(in nsmsgnavigationtypevalue motion); parameters motion the nsmsgnavigationtypevalue. defined in ther interface: nsmsgnavigationtype. return values true if the motion is available. false otherwise. getkeyat() gets the key for the message at a particular index. nsmsgkey getkeyat(in nsmsgviewindex index); parameters index the index of the message. nsms...
nsIMsgIdentity
boolean dobcclist astring draftfolder astring stationeryfolder astring showsavemsgdlg boolean directoryserver astring overrideglobalpref boolean autocompletetomydomain boolean if this is false, don't append the user's domain to an autocomplete address with no matches. valid boolean determines if the ui should use this identity and the wizard uses this to determine whether or not to ask the user to complete all the fields. smtpserverkey astring the preferred smtp server for this identity. if this is set, this is the smtp server that should be used for the message send. requestreturnreceipt boolean readonly: default request for retu...
nsIMsgIncomingServer
ff boolean read only. serveruri acstring read only. sockettype long spamfilterplugin nsimsgfilterplugin read only. spamsettings nsispamsettings spam settings. read only. supportsdiskspace boolean read only. type acstring protocol type, that is "pop3", "imap", "nntp", "none", and so on. used to construct urls. username acstring userid to log into the server. usesecauth boolean valid boolean constants constant value description defaultsocket 0 trytls 1 alwaysusetls 2 usessl 3 keepdups 0 deletedups 1 movedupstotrash 2 markdupsread 3 methods clearallvalues() this is really dangerous. this destroys all pref values do not call this unless you know what you're doing! void clearallvalues(); parameters none. exceptions thrown missing exception mi...
nsIMsgSearchCustomTerm
ram scope search scope (nsmsgsearchscope) * @param op search operator (nsmsgsearchop). if null, determine * if term is available for any operator. * * @return true if available */ boolean getavailable(in nsmsgsearchscopevalue scope, in nsmsgsearchopvalue op); getavailableoperators /** * list the valid operators for this term. * * @param scope search scope (nsmsgsearchscope) * @param length object to hold array length * * @return array of operators */ void getavailableoperators(in nsmsgsearchscopevalue scope, out unsigned long length, [retval, array, size_is(length)] ...
nsINavBookmarksService
read-only, otherwise returns false. getfoldertitle() obsolete since gecko 1.9 (firefox 3) note: getitemtitle() provides an alternative for this method. get the title for a bookmark folder. astring getfoldertitle( in print64 folder ); parameters folder the folder whose title should be retrieved. return value the title of the folder. exceptions thrown invalid argument exception if it can not find a folder with the given id. getfolderuri() obsolete since gecko 1.9 (firefox 3) note: getbookmarkuri() provides an alternative for this method. get the url for a bookmark folder. nsiuri getfolderuri( in print64 folder ); parameters folder the folder whose uri should be retrieved. return value the uri of the folder. ...
nsINavHistoryContainerResultNode
dex() returns the index of a direct child of this container. unsigned long getchildindex( in nsinavhistoryresultnode anode ); parameters anode the node whose index is to be returned. return value the index of the specified node into the list of immediate children of the container. exceptions thrown ns_error_not_available the container isn't open (that is, containeropen is false). ns_error_invalid_arg the specified node isn't a direct child of this container. remarks there are a number of untested methods on this interface that are not documented at present, and are disabled in the idl file. see also nsinavhistoryresultnode, nsinavhistoryservice ...
nsINavHistoryQueryResultNode
ned long querycount, [retval,array,size_is(querycount)] out nsinavhistoryquery queries); attributes attribute type description folderitemid long long for both simple folder nodes and simple-folder-query nodes, this is set to the concrete itemid of the folder. otherwise, this is set to -1. read only. queryoptions nsinavhistoryqueryoptions the options that group the node's children; only valid for result_type_query nodes. read only. methods getqueries() returns the queries that build the node's children; only valid for result_type_query nodes. void getqueries( out unsigned long querycount, optional from gecko 2.0 [retval,array,size_is(querycount)] out nsinavhistoryquery queries ); parameters querycount optional from gecko 2.0 the number of queries in the queries array. quer...
nsINavHistoryResult
void removeobserver(in nsinavhistoryresultobserver aobserver); attributes attribute type description root nsinavhistorycontainerresultnode the root of the results. this container gives you access to all the results in the tree. note: keep in mind that you need to open containers for their results to be valid. when a result goes out of scope it will continue to observe changes till it is cycle collected. while the result waits to be collected it will stay in memory, and continue to update itself, potentially causing unwanted additional work. when you close the root node the result will stop observing changes, so it is good practice to close the root node when you are done with a result, since ...
nsINavHistoryService
it redirects to somewhere else (that is you will create a visit out of here that is a redirect transition). this causes this page to be hidden in normal history views (unless it has been unhidden by visiting it with a non-redirect). asessionid the session id that this page belongs to. use "0" for no session. return value returns the id of the created visit. this will be "0" if the uri is not valid for adding to history (canadduri = false). getnewquery() this method returns a new query object that you can pass to executequery/ies methods. it will be initialized to all empty (so using it will give you all history). nsinavhistoryquery getnewquery(); parameters none. return value returns a new query object. getnewqueryoptions() this method returns a new options object that you can pa...
nsIPluginHost
lugin getpluginfactory( in string amimetype ); parameters amimetype return value native code only!getpluginname get the plugin name for the plugin instance. void getpluginname( in nsiplugininstance ainstance, [shared] out string apluginname ); parameters ainstance the plugin instance object. apluginname returns a pointer to a shared read-only string value, it's only valid for the lifetime of the plugin instance - you must copy the string value if you need it longer than that. native code only!getplugintagforinstance get the plugin tag associated with a given plugin instance. nsiplugintag getplugintagforinstance( in nsiplugininstance ainstance ); parameters ainstance the plugin instance object. return value plugin tag object. getplugintags() void...
nsIPrintingPrompt
isplayed when a new devicecontextspec specific to that platform was created. windows: the gfx layer no longer supports default toolkit behavior for displaying the native print dialog. if an embedder implemented service returns any error code (other than ns_error_abort) printing will terminate. returning ns_ok assumes that the printsettings object was correctly filled in and if it does not have valid fields for printer name, and so on. it may also terminate. defaults for platform service: showprintdialog - displays a native dialog showpagesetup() - displays a xul dialog showprogress() - displays a xul dialog summary for windows embedders: stated once again: there is no "fallback" native platform support in gfx for the displaying of the native print dialog. the current default imple...
nsIProcess
unw(in boolean blocking, [array, size_is(count)] in wstring args, in unsigned long count); void runwasync([array, size_is(count)] in wstring args, in unsigned long count, [optional] in nsiobserver observer, [optional] in boolean holdweak); attributes attribute type description exitvalue long the value returned by the process upon exit. this is only valid after the process has exited. read only. isrunning boolean true if the process is running, otherwise false. only accurate if the process was run with blocking disabled. read only. location nsifile the location of the executable file on disk. read only. gecko 1.9.1 note this attribute is no longer implemented as of gecko 1.9.1, and is removed entirely ...
nsISHistory
from loading documents from history, to erase evidence of prior page loads and so on. void purgehistory( in long numentries ); parameters numentries the number of toplevel documents to be purged from history. during purge operation, the latest documents are maintained and older numentries documents are removed from history. exceptions thrown ns_error_failure numentries is invalid or out of bounds with the size of history. ns_success_loss_of_insignificant_data purge was vetoed. reloadcurrententry() void reloadcurrententry(); parameters none. removeshistorylistener() called to remove a listener for the session history component. listeners are notified when pages are loaded from history. note: a listener object must implement nsishistorylistener and nssupportsweakr...
nsIScriptError
script" "chrome registration" "xbl" "xbl prototype handler" "xbl content sink" "xbl javascript" "frameconstructor" categories the web console displays "hudconsole" "css parser" "css loader" "content javascript" "dom events" "dom:html" "dom window" "svg" "imagemap" "html" "canvas" "dom3 load" "dom" "malformed-xml" "dom worker javascript" "mixed content blocker" "csp" "invalid hsts headers" "insecure password field" see also using the web console error console nsiconsolemessage nsiscripterror2 ...
nsISearchEngine
the value to pass. if value is "{searchterms}", it will be substituted with the user-entered data when retrieving the submission. must not be null. responsetype since an engine can have several different request urls, differentiated by response types, this parameter selects a request to add parameters to. if null, will default to "text/html" exceptions thrown ns_error_invalid_arg if name or value are null. ns_error_failure if the search engine is read-only. getsubmission() gets a nsisearchsubmission object that contains information about what to send to the search engine, including the uri and postdata, if applicable. nsisearchsubmission getsubmission( in astring data, [optional] in astring responsetype, [optional] in astring purpose ); pa...
nsISelectionController
he selection or extend it? completescroll() will move page view to the top or bottom of the document. void completescroll( in boolean forward ); parameters forward forward or backward if pr_false. getcaretenabled() gets the current state of the caret, as set by setcaretenabled(). boolean getcaretenabled(); parameters none. return value if aoutenabled==null, returns ns_error_invalid_arg else ns_ok. getdisplayselection() will get the display mode for the selection. short getdisplayselection(); parameters none. return value off, on, disabled. getselection() will return the selection that the presentation shell may implement. nsiselection getselection( in short type ); parameters type will hold the type of selection. (selectiontype) return value will hold th...
nsISelectionImageService
void reset(); parameters none. ...
nsISessionStore
ng aindex ); parameters awindow is the browser window associated with the closed tab. aindex is the index of the closed tab to be removed (fifo ordered). return value forgetclosedwindow() nsidomnode forgetclosedwindow( in unsigned long aindex ); parameters aindex is the index of the closed window to be removed (fifo ordered). return value exceptions thrown ns_error_invalid_arg when aindex does not map to a closed window. getbrowserstate() returns the current state of all of windows and all of their tabs. astring getbrowserstate(); parameters none. return value a json string representing the current state of all windows in the web browser. getclosedtabcount() returns the number of restorable tabs for a given window. unsigned long getclosedtabcount( in...
nsIStackFrame
guage errors would generally have the same location as their top stack entry. file parsers may put the location of the file they were parsing, and so forth. null indicates "no data" read only. language pruint32 see nsiprogramminglanguage for a list of language constants. read only. languagename string see nsiprogramminglanguage for a list of language constants. read only. linenumber print32 valid line numbers begin at '1'. '0' indicates unknown. read only. name string the name of the function at this point in the stack. read only. sourceline string the location of this function in filename read only. example to output the stack at a particular location: var s = components.stack; while(s) { console.log(s.name); s = s.caller; } methods tostring() a generic formatter - make it sui...
nsITaskbarProgress
state_error or state_paused. void setprogressstate( in nstaskbarprogressstate state, in unsigned long long currentvalue, optional in unsigned long long maxvalue optional ); parameters state one of the state constants. currentvalue the current progress value. maxvalue the maximum progress value. exceptions thrown ns_error_illegal_value if currentvalue is greater than maxvalue. ns_error_invalid_arg if state is state_no_progress or state_indeterminate, and either currentvalue or maxvalue is not 0. see also nsiwintaskbar windows 7 taskbar apis ...
nsIURIFixupInfo
riptable interface indicating what we found/corrected when fixing up a uri. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description consumer nsisupports consumer that asked for the fixed up uri. preferreduri nsiuri best guess of what uri consumer expects. may be null if we can't deliver (eg. the input is an invalid uri and fixup_flag_allow_keyword_lookup is not passed). read only. 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. "foo bar"!). read only. keywordprovidername astring the keyword search provider name expected to provide a keyword search; empty string if no keyword search is perf...
nsIURL
tions of a url. for example, the filepath of "http://host/foo/bar.html#baz" is "/foo/bar.html". some characters may be escaped. param autf8string parameters specified after the ; in the url. some characters may be escaped. obsolete since gecko 9.0 note: this was removed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) because the semicolon is not actually valid for this purpose and should not have been specially handled. query autf8string query portion (the part after the "?") of the url. if there isn't one, an empty string is returned. some characters may be escaped. ref autf8string reference portion (the part after the "#") of the url. if there isn't one, an empty string is returned. some characters may be escaped. ...
nsIURLParser
this makes urls with semicolons in them work correctly. ...
nsIWebNavigation
_load 16384 this flag specifies that this is the first load in this object. set with care, since setting incorrectly can cause us to assume that nothing was actually loaded in this object if the load ends up being handled by an external application. load_flags_allow_popups 32768 this flag specifies that the load should not be subject to popup blocking checks. note for valid load flag combinations look here nsdocshellloadtypes.h stop flags constant value description stop_network 1 this flag specifies that all network activity should be stopped. this includes both active network loads and pending meta-refreshes. stop_content 2 this flag specifies that all content activity should be stopped. this includes animated images, ...
nsIWebProgress
progresslistener() registers a listener to receive web progress events. void addprogresslistener( in nsiwebprogresslistener alistener, in unsigned long anotifymask ); parameters alistener the listener interface to be called when a progress event occurs. this object must also implement nsisupportsweakreference. anotifymask the types of notifications to receive. exceptions thrown ns_error_invalid_arg indicates that alistener was either null or that it does not support weak references. ns_error_failure indicates that alistener was already registered. removeprogresslistener() removes a previously registered listener of progress events. void removeprogresslistener( in nsiwebprogresslistener alistener ); parameters alistener the listener interface previously registered with a call to add...
nsIWebProgressListener
this flag indicates a medium degree of security. state_secure_low 0x00020000 this flag indicates a low degree of security. state identity flags these flags describe the level of identity verification in a call to the onsecuritychange() method. constant value description state_identity_ev_toplevel 0x00100000 state bits for ev == extended validation == high assurance. the topmost document uses an ev cert. location change flags constant value description location_change_same_document 0x00000001 this flag is on when awebprogress did not load a new document. for example, the location change is due to an anchor scroll or a pushstate/popstate/replacestate. location_change_error_page 0...
nsIWindowMediator
be called from callbacks originating in native window code. they are expected to hand us comparison values which are pulled from general storage in the native widget, and may not correspond to an nsiwidget at all. for that reason this interface requires only objects one step removed from the native window (nsiwidgets), and its implementation must be very understanding of what may be completely invalid pointers in those parameters. boolean calculatezposition( in nsixulwindow inwindow, in unsigned long inposition, in nsiwidget inbelow, out unsigned long outposition, out nsiwidget outbelow ); parameters inwindow the window in question. inposition requested position one of the zlevel constants. zleveltop send the window to the top window, zlevelbottom to the bottom. if set to zl...
nsIWindowsShellService
s attribute type description desktopbackgroundcolor unsigned long the desktop background color, visible when no background image is used, or if the background image is centered and does not fill the entire screen. a rgb value, where (r << 24 | g << 16 | b) obsolete since gecko 1.8 unreadmailcount unsigned long the number of unread mail messages for the current user. read only. constants valid starting keys for the windows registry. constant value description hkcr 0 hkey_classes_root. obsolete since gecko 1.8 hkcc 1 hkey_current_config. obsolete since gecko 1.8 hkcu 2 hkey_current_user. obsolete since gecko 1.8 hklm 3 hkey_local_machine. obsolete since gecko 1.8 hku 4 hkey_users. obsolete since gecko 1.8 methods getregistryentry() obsolete since gecko 1...
nsIXULAppInfo
the name of the application vendor. this must be ascii, and is normally mixed-case, for example "mozilla". can be an empty string if vendor is not set. read only. version acstring the xul application's version, for example "0.8.0+" or "3.7a1pre". it is different than the version of gecko or the xulrunner platform. be careful about which one you want! can be an empty string, but a valid value is required for xul applications using the extension manager or update service. read only. example display the application and the gecko version in an alert box: var info = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); alert("application version: " + info.version + "\n" + "gecko version: " + info.platformversion); e...
nsIXmlRpcClient
rverurl readonly nsiurl the url of the xml-rpc server inprogress readonly boolean whether or not a call is in progress fault readonly nsixmlrpcfault the most recent xml-rpc fault from returned from this server. null if the last call didn't return an xml-rpc fault. result readonly nsisupports the most recent xml-rpc call result returned from this server. null if the last call didn't return a valid result. responsestatus readonly unsigned long the most recent http status code returned from this server. null if the server was unreachable or not yet contacted. responsestring readonly unsigned long the most recent http status code returned from this server. null if the server was unreachable or not yet contacted. constants constant type description int unsigned long nsisupportsprin...
nsIZipWriter
for. return value true if there is an entry with the given path in the zip file, otherwise returns false. open() opens the specified zip file. void open( in nsifile afile, in print32 aioflags ); parameters afile the zip file to open. aioflags the open flags for the zip file, from prio.h. exceptions thrown ns_error_already_initialized a zip file is already open. ns_error_invalid_arg the afile parameter is null. ns_error_file_not_found the specified file was not found and the flags didn't permit creating it. or the directory for the file does not exist. ns_error_file_corrupted the specified file is not a recognizable zip file. other errors may be thrown upon failing to open the file, such as if the file is corrupt or in an unsupported format. processqueue() proce...
NS_ENSURE_ARG_POINTER
refer to xpcom/glue/nsdebug.h for details. ...
NS_CStringContainerInit2
this value is zero, then the array referenced by adata (if any) will be copied. flag values are defined below. flag values the aflags parameter is a bit-wise combination of the following values: ns_cstring_container_init_depend data passed into ns_cstringcontainerinit2 is not copied. instead, the string references the passed in data pointer directly. the caller must ensure that the data is valid for the lifetime of the string container. this flag should not be combined with ns_cstring_container_init_adopt. ns_cstring_container_init_adopt data passed into ns_cstringcontainerinit2 is not copied. instead, the string takes ownership over the data pointer. the caller must have allocated the data array using the xpcom memory allocator. this flag should not be combined with ns_cstring_contain...
NS_CStringGetMutableData
umber of characters contained in the string's internal buffer (excluding any null-terminator). this value will be zero if the function failed to resize its internal buffer to the size requested. remarks this function provides mutable access to a string's internal buffer. it returns a pointer to the first element of an array of characters that may be modified in-place. the returned pointer remains valid until the string object is passed to some other string function. this function does not necessarily null-terminate astring's internal buffer after resizing it. that behavior depends on the implementation of astring. if astring is a reference to a nscstringcontainer, then its data will be null-terminated by this function. the caller is not responsible for writing a null-terminator. example // conv...
Reference Manual
nscomptr<nsifoo> foo; nsresult rv=getfoo(getter_addrefs(foo)); // ...as construction alone. nsifoo* temp; nsresult rv=getfoo(&temp); nscomptr<nsifoo> foo=dont_addref(temp); // remember this `raw-pointer, call // getter, assign |dont_addref|' // pattern. it crops up in many // efficiency discussions. in both cases you end up with foo, a valid nscomptr whose value was set with the product of getfoo, and rv the status returned by getfoo. the case using the temporary, however, uses construction to put the value into the nscomptr, which (though slightly more complicated in source) is more efficient than default construction followed by assignment, the course of events followed by the simpler example. prefer destruction to assignment prefe...
Working with Multiple Versions of Interfaces
getter_addrefs(accdocnode)); if(ns_failed(rv)){ return self; } rv = accdocnode->getwindowhandle(&wh); if(ns_succeeded(rv)){ self = static_cast<hwnd>(wh); } return self; } there is good news and bad news. first the good news. plan b inside firefox 2 happily runs to completion. all the xpcom calls succeed, or at least think they succeed. the bad news is that the thing we get back is not a valid hwnd. the problem now is not just interface identifier mismatch, but class declaration mismatch. getwindowhandle is the tenth method declared in the nsiaccessibledocument.h that firefox 2 was built with, but actually the eighth method in the sdk that i used to build my extension (and hence xpcom component). since these classes don't use vtables this means i'm probably, no i can be more positive...
XPCOM ownership guidelines
is is terrific for factory functions, but can be problematic for mere getters. it's unfortunate if you just needed access to it for a moment. in the latter case, caching the pointer you got back makes you a de facto owner. this may not be appropriate; and it may be hard to remedy without knowing if the object in question was truly created in response to your query. needing it isn't, by itself, a valid reason for owning it. you don't own an object because you need it. in fact often you own it because it needs you. if you own it, it shouldn't own you. even transitively. or put another way: the ownership graph for any system should be acyclic. anytime there is a cycle of ownership, there is a situation that isn't automatically handled by destructors. special code must be provided and called to...
Xptcall Porting Guide
mentation for win32 and linux x86, netbsd x86, and freebsd. these implementations use the basic strategy of: figure out how much stack space is needed for the params, make the space in a new frame, copy the params to that space, invoke the method, cleanup and return. c++ is used where appropriate, assembly language is used where necessary. inline assembly language is used here, but it is equally valid to use separate assembly language source files. porters can decide how best to do this for their platforms. the stubs functionality is more complex. the goal here is a class whose vtbl can look like the vtbl of any arbitrary xpcom interface. objects of this class can then be built to impersonate any xpcom object. the base interface for this is (from xptcall/public/xptcall.h): class nsxptcstubbase...
Filelink Providers
turn false;". 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. the button to set up the account will only become enabled once the checkvalidity method for the form returns true. saving custom settings in preferences custom settings for a provider are saved using the preferences api. saving the preferences is handled automatically by the dialog code. providers need on...
Mail composition back end
message that needs to be replaced nsimsgsendlistener **alistenerarray) = 0; - an array of listeners for the send operation. this can be nsnull if you want to do the delivery operation "blind" sendwebpage the sendwebpage method is a convenience function that will let the caller send a web page by specifying a uri. note: this can be any valid uri so one can send local disk files by specifying a file:// uri. ns_imethod sendwebpage( nsimsgidentity *auseridentity, - the user identity for the person doing the send operation. this will be needed to determine the appropriate folder for copy operations. nsimsgcompfields *fields, - the message comp...
Adding items to the Folder Pane
s "all folders" mode. that container will have 3 child-items, the numbers 1, 2, and 3. clicking on those items will display the number in the main viewing pane of thunderbird. first, some necessary background on how the folder pane constructs the data it displays. the folder pane tracks modifications to a user's folders and accounts. each time the folder pane determines that it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka view) has changed), a "rebuild" occurs. when this happens, the folder pane consults the map-generator for the current mode, and that generator returns the necessary data for the folder pane's display. this data is returned in the form of an array of folder-tree-items. listening for folder pane re...
Finding the code for a feature
ure out the code that implements a specific feature of the user interface. how do you find that out? as an example, i received the following inquiry, and i decided to follow my usual path and document what i do: hello i would like to add colours and tags to specific emails...by using nsimsgtagservice, can this be done? here is my (edited) response: nsimsgtagservice is used to store the list of valid tags, so it is not the correct way to tag messages. tags are applied using the message database property "keyword". i know the underlying code, but i don't remember the user interface level function to do it. but here is how i find out. there are two key tools that you need. the first is the dom inspector extension which i have routinely installed in all of my thunderbird installations. (for deb...
Toolkit version format
the older version format used in firefox/thunderbird 1.0. version format a version string consists of one or more version parts, separated with dots. each version part is itself parsed as a sequence of four parts: <number-a><string-b><number-c><string-d>. each of the parts is optional. numbers are integers base 10 (may be negative), strings are non-numeric ascii characters. ...
Memory Management
pointers to that memory must be carefully managed to make sure the underlying memory is still referenced. when binary code hands back a pointer/handle to allocated memory, the js code must make sure to free that memory with the correct allocator. it is usually best to expose a freeing function from the binary. keeping objects alive the following js-ctypes objects will hold references to objects, keeping them alive. ...
CType
s these properties are available on all ctype objects. property type description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for other function, pointer, and array types, this should be a valid c type expression. ptr ctype returns a ctype representing the data type "pointer to this type". this is the result of calling ctypes.pointertype(the_type). read only. size number the size of the type, in bytes. this is the same value as the c sizeof. read only. note: ctypes.void_t.size is undefined. methods available on all ctype objects arr...
PointerType
e these properties are available on all ctype objects. property type description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for other function, pointer, and array types, this should be a valid c type expression. ptr ctype returns a ctype representing the data type "pointer to this type". this is the result of calling ctypes.pointertype(the_type). read only. size number the size of the type, in bytes. this is the same value as the c sizeof. read only. note: ctypes.void_t.size is undefined. method overview methods inherited from cty...
StructType
e these properties are available on all ctype objects. property type description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for other function, pointer, and array types, this should be a valid c type expression. ptr ctype returns a ctype representing the data type "pointer to this type". this is the result of calling ctypes.pointertype(the_type). read only. size number the size of the type, in bytes. this is the same value as the c sizeof. read only. note: ctypes.void_t.size is undefined. method overview define(fields) ...
UInt64
type is "' + ccon + '"'); } } } } function uint64_add(...uint64) { ensureuint64(uint64); var hi = uint64.hi(uint64[0]); var lo = uint64.lo(uint64[0]);; for (var i=1; i<uint64.length; i++) { hi += uint64.hi(uint64[i]); ...
Browser Side Plug-in API - Plugins
ks the browser to create a stream for the specified url. npn_geturlnotify requests creation of a new stream with the contents of the specified url; gets notification of the result. npn_getvalue allows the plug-in to query the browser for information. npn_getvalueforurl provides information to a plug-in which is associated with a given url, for example the cookies or preferred proxy. npn_invalidaterect invalidates specified drawing area prior to repainting or refreshing a windowless plug-in. npn_invalidateregion invalidates specified drawing region prior to repainting or refreshing a windowless plug-in. npn_memalloc allocates memory from the browser's memory space. npn_memflush requests that the browser free a specified amount of memory. npn_memfree deallocates a block of alloca...
Initialization and Destruction - Plugins
estroyed with npp_destroy. the browser calls npp_destroy when a plug-in instance is deleted, usually because the user has left the page containing the instance, closed the window, or quit the application. if this is the last instance created by a plug-in, np_shutdown is called. you should not perform any graphics operations in npp_destroy because the instance window is no longer guaranteed to be valid. also, be sure to delete any private instance-specific information stored in the plug-in's instance->pdata. nperror npp_destroy(npp instance, npsaveddata **save); the instance parameter represents the plug-in instance to delete. the plug-in can use the optional save parameter to save data for reuse by a new instance with the same url. the data is passed to npp_new through its saved parameter.
Plug-in Development Overview - Plugins
rent from the name of the file on disk. drawing a plug-in instance before drawing itself on the page, the plug-in must provide information about itself, set the window or other target in which it draws, arrange for redrawing, and handle events. a windowless plug-in can call the following netscape methods to draw itself: npn_forceredraw: force a paint message for windowless plug-ins. npn_invalidaterect: invalidate an area in a windowless plug-in before repainting or refreshing. npn_invalidateregion: invalidate an area in a windowless plug-in before repainting or refreshing. the browser calls these plug-in methods: npp_getvalue: query the plug-in for information. npp_print: request a platform-specific print operation for the instance. npp_setvalue: set the browser information. np...
Streams - Plugins
nt for a data file for a full-page instance the npp_newstream method has the following syntax: nperror npp_newstream(npp instance, npmimetype type, npstream *stream, npbool seekable, uint16* stype); the instance parameter refers to the plug-in instance receiving the stream; the type parameter represents the stream's mime type. the stream parameter is a pointer to the new stream, which is valid until the stream is destroyed. the seekable parameter specifies whether the stream is seekable (true) or not (false). seekable streams support random access (for example, local files or http servers that support byte-range requests). the plug-in can set the output parameter type to one of these transmission modes: np_normal: (default): the plug-in can process the data progressively as it arr...
URLs - Plugins
ydata); the instance, url, and target parameters have the same definitions as those of npn_geturl. the notifydata parameter contains private plug-in data that can be used to associate the request with the subsequent npp_urlnotify call (which returns this value) and/or to pass a pointer to some request-related payload. if a request is not completed successfully (for example, because the url is invalid or an http server is down), the browser should call npp_urlnotify as soon as possible. if a request completes successfully, and the target is non-null, the browser calls npp_urlnotify after it has finished loading the url. if the target is null, it calls npp_urlnotify after calling npp_destroystream to close the stream. both the npn_geturlnotify and npn_posturlnotify functions call the npp_urlno...
Inspecting web app manifests - Firefox Developer Tools
ef="/manifest.webmanifest"> the .webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json). you also need to make sure the json inside the file is of the correct format. you can test this using the web manifest validator. inspecting your manifest if your manifest is deployed successfully, you should end up with a display like the following on the manifest view: from here, you can inspect all the information in the manifest in an easy-to-digest way, making sure that it is all correct. it provides a link to the manifest file at the top which when clicked on brings up the json in a new tab. it also loads a...
Source map errors - Firefox Developer Tools
the resource). the error tells us that the source map is not json data — so we're serving the wrong file. there are a few common ways that source maps can go wrong; they are detailed in the following sections. source map missing or inaccessible the source map resource can be missing or inaccessible. the fix here is to make sure the file is being served and is accessible to the browser invalid source map the source map data can be invalid — either simply not a json file at all, or with an incorrect structure. typical error messages here are: syntaxerror: json.parse: unexpected character at line 1 column 1 of the json data error: "version" is a required argument original source missing an original source may be missing. you may encounter this when trying to open one of the ...
Debugger.Source - Firefox Developer Tools
case. binary if the instance refers to webassembly code and the debugger has the allowwasmbinarysource property set, a uint8array that contains the webassembly bytecode. url if the instance refers to javascript source, the filename or url from which this script’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by information tracking how the code was introduced into the system; the entire string is not a valid url. for function.prototype’s script, this is null. source may be loaded from a url in the following ways: the url may appear as the src attribute of a <script> element in markup text. the url may be passed to the worker web worker constructor, or the web work...
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
re safe for chrome code to use, so we must tell it // so explicitly. site = components.utils.waivexrays(site.frame); if (!counts.has(site)) counts.set(site, 0); counts.set(site, counts.get(site) + 1); } // walk from each site that allocated something up to the // root, computing allocation totals that include // children. remember that 'null' is a valid site, // representing the root. var totals = new map; for (let [site, count] of counts) { for(;;) { if (!totals.has(site)) totals.set(site, 0); totals.set(site, totals.get(site) + count); if (!site) break; site = site.parent; } } // compute parent-to-child links, since saved stack frames // have only parent l...
DevTools API - Firefox Developer Tools
olpanel} - the toolpanel for the tool. toolbox {toolbox} - the toolbox for the shortcut was triggered for. return value: undefined. properties the tooldefinition object can contain following properties. most of them are optional and can be used to customize the presense of the tool in the browser and the toolbox. id string, required. an unique identifier for the tool. it must be a valid id for an html element. url string, required. an url of the panel document. label string, optional. the tool's name. if undefined the icon should be specified. tooltip string, optional. the tooltip for the tool's tab. panellabel string, optional. an accessibility label for the panel. ordinal integer, optional. the position of the tool's tab within the toolbox. defaul...
Index - Firefox Developer Tools
ing, tools, web developer the web developer menu is the main way to access the developer tools that are built into firefox. on os x and linux, it's under the "tools" menu: 141 tips dev tools, tools, web development screenshots: 142 toolbox the toolbox provides a single home for most of the developer tools that are built into firefox. 143 validators tools, website validator, html5 validator, validator this document lists different resources for developers to validate web pages. 144 view source devtools, firefox, view page source view source lets you look at the html or xml source for the page you're viewing. to activate view source: 145 web audio editor firefox, mozilla, tools, web audio api...
Migrating from Firebug - Firefox Developer Tools
tyle sheets. the default one is to edit them inline like within the style side panel. furthermore it has a source and a live edit mode, which allow to edit the selected style sheet like within a text editor. the style editor of the devtools only has one way to edit style sheets, which corresponds to firebug's live edit mode. try out css selectors firebug's selectors side panel provides a way to validate a css selector. it lists all elements matching the entered selector. the devtools don't have this feature yet, but it's requested in bug 1323746. searching within the style sheets firebug allows to search within the style sheets via the search field. the style editor in the devtools also provides a way to search within a style sheet, though there is currently no option to search within multi...
Network request list - Firefox Developer Tools
timeline the request list also displays a timeline for the different parts of each request. each timeline is given a horizontal position in its row relative to the other network requests, so you can see the total time taken to loa...
Edit Shape Paths in CSS - Firefox Developer Tools
using clip-path and also the css shape-outside property and <basic-shape> values. this guide walks you through all of the available options. activate / deactivate the shape path editor the shape path editor is accessed via the css rules panel, which can be opened as described in the guide to opening the inspector. once you have selected your element, you should see the shape icon alongside any valid value, e.g. one for shape-outside. clicking the icon will cause the editor to highlight the shape. to deactivate the shape path editor click on the icon again, or select another element or a different editor. note that the shape path editor does not persist between page reloads — if you reload your page you will need to select the element again. understanding the lines drawn by the edito...
Examine and edit HTML - Firefox Developer Tools
edit the new node's content and styling just as you would any other node in the document. you can access the same functionality using the "create new node" popup menu item. note that this button is disabled if the selected element's type is such that adding a last-child would have no effect (for example, if is is an <html> or <iframe> element). however, it is enabled in places where it is not valid to insert a <div>, such as <style> or <link>. in these cases the element is added as text. ...
View Source - Firefox Developer Tools
at behaves just like "view page source", except you only see the source for the selection. view mathml source if you context-click while the mouse is over some mathml, you'll see a context menu item labeled "view mathml source": click it to see the mathml source. limitations of view source there are limitations to what view source does for you that you need to be aware of. error reporter ≠ validator view source only reports parsing errors, not html validity errors. for example, putting a <div> element as a child of a <ul> element isn't a parse error, but it is not valid html. therefore, this error will not be flagged in view source. if you want to check that html is valid, you should use an html validator, such as the one offered by w3c. not all parse errors are reported even though a...
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
le_fan gl.triangles: draws a triangle for a group of three vertices. first a glint specifying the starting index in the array of vector points. count a glsizei specifying the number of indices to be rendered. primcount a glsizei specifying the number of instances of the range of elements to execute. return value none. exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if first, count or primcount are negative, a gl.invalid_value error is thrown. if gl.current_program is null, a gl.invalid_operation error is thrown. examples var ext = gl.getextension('angle_instanced_arrays'); ext.drawarraysinstancedangle(gl.points, 0, 8, 4); specifications specification status comment angle_instanced_arraysthe definition of...
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
p of three vertices. count a glsizei specifying the number of elements to be rendered. type a glenum specifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying an offset in the element array buffer. must be a valid multiple of the size of the given type. primcount a glsizei specifying the number of instances of the set of elements to execute. return value none. exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if offset is a invalid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count or primcount are negative, a gl.invali...
AddressErrors.city - Web APIs
an object based on addresserrors includes a city property when validation of the address fails for the value given for the address's city property. the returned string explains the error and should offer suggestions for how to correct it. syntax var cityerror = addresserrors.city; value if the value specified in the paymentaddress object's city property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the city value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.city' in that specification. candidate recommendat...
AddressErrors.country - Web APIs
an object based on addresserrors includes a country property if during validation of the address the specified value of country was determined to be invalid. the value is a string describing the error and should offer suggestions for how to correct it. syntax var countryerror = addresserrors.country; value if an error occurred during validation of the address due to the country property having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error. the text should also include, when possible, advice about how to go about correcting the error. if the paymentaddress object's country property was determined to be valid, this property is not included in the dictionary. specifications specification status ...
AddressErrors.dependentLocality - Web APIs
an object based on addresserrors includes a dependentlocality property when the address's dependentlocality property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var localityerror = addresserrors.dependentlocality; value if the value specified in the paymentaddress object's dependentlocality property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the dependentlocality value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.dependentlocality'...
AddressErrors.phone - Web APIs
an object based on addresserrors includes a phone property when the address's phone property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var phoneerror = addresserrors.phone; value if the value specified in the paymentaddress object's phone property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the phone value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.phone' in that specification. candidate recommendation initial definition. ...
AddressErrors.postalCode - Web APIs
an object based on addresserrors includes a postalcode property when the address's postalcode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var postcodeerror = addresserrors.postcode; value if the value specified in the paymentaddress object's postalcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the postalcode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.postalcode' in that specification. candidate recomme...
AddressErrors.recipient - Web APIs
an object based on addresserrors includes a recipient property when the address's recipient property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var recipienterror = addresserrors.recipient; value if the value specified in the paymentaddress object's recipient property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the recipient value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.recipient' in that specification. candidate recommenda...
AddressErrors.region - Web APIs
an object based on addresserrors includes a region property when the address's region property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var regionerror = addresserrors.region; value if the value specified in the paymentaddress object's region property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the region value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.region' in that specification. candidate recommendation initial defin...
AddressErrors.regionCode - Web APIs
an object based on addresserrors includes a regioncode property when the address's regioncode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var regioncodeerror = addresserrors.regioncode; value if the value specified in the paymentaddress object's regioncode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the regioncode value was validated successfully, this property is not included in the addresserrors object. usage notes the region code is derived from the iso 3166-2 country subdivision name standard. specifications specification status comment payment...
AddressErrors.sortingCode - Web APIs
an object based on addresserrors includes a sortingcode property when the address's sortingcode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var sortingcodeerror = addresserrors.sortingcode; value if the value specified in the paymentaddress object's sortingcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the sortingcode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.sortingcode' in that specification. candid...
Animation.pause() - Web APIs
Web › API › Animation › pause
the pause() method of the web animations api's animation interface suspends playback of the animation. syntax animation.pause(); parameters none. return value none. exceptions invalidstateerror the animation's currenttime is unresolved (for example, if it's never been played or isn't currently playing) and the end time of the animation is positive infinity. throws an invalidstateerror if the animation's currenttime is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity. example animation.pause() is used many times in the alice in web animations api land growing/shrinking alice game, largely because animations created with the element.animate() method immediately start playing and must be paused manually if you want to avoi...
Attr.namespaceURI - Web APIs
Web › API › Attr › namespaceURI
https://www.w3.org/1999/xhtml as in xhtml. you can create an attribute with the specified namespaceuri using the dom level 2 method element.setattributens. per the namespaces in xml specification, an attribute does not inherit its namespace from the element it is attached to. if an attribute is not explicitly given a namespace, it has no namespace. the dom does not handle or enforce namespace validation per se. it is up to the dom application to do any validation necessary. note too that the namespace prefix, once it is associated with a particular node, cannot be changed. specifications specification status comment domthe definition of 'attr: namespaceuri' in that specification. living standard ...
AudioBuffer() - Web APIs
object. user agents are required to support sample rates from 8,000 hz to 96,000 hz (but are allowed to go farther outside this range). deprecated parameters context a reference to an audiocontext. this parameter was removed from the spec. return value a new audiobuffer object instance. exceptions notsupportederror one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range). rangeerror there isn't enough memory available to allocate the buffer. specifications specification status comment web audio apithe definition of 'audiobuffer' in that specification. working draft initial definition. browser compatibility the compati...
AudioBufferSourceNode.start() - Web APIs
plays until it reaches its natural conclusion or is stopped using the stop() method. using this parameter is functionally identical to calling start(when, offset) and then calling stop(when+duration). return value undefined. exceptions typeerror a negative value was specified for one or more of the three time parameters. please don't attempt to tamper with the laws of temporal physics. invalidstateerror start() has already been called. you can only call this function once during the lifetime of an audiobuffersourcenode. examples the most simple example just starts the audio buffer playing from the beginning — you don't need to specify any parameters in this case: source.start(); the following more complex example will, 1 second from now, start playing 10 seconds worth of sound ...
AudioContext() - Web APIs
indicate a maximum or minimum number of audio contexts that must be able to be open at the same time, so this is left up to the browser implementations to decide. google chrome per-tab audio context limitation in chrome prior to version 66 google chrome only supported up to six audio contexts per tab at a time. non-standard exceptions in chrome if the value of the latencyhint property isn't valid, chrome throws a typeerror exception with the message "the provided value '...' is not a valid enum value of type audiocontextlatencycategory". example this example creates a new audiocontext for interactive audio (optimizing for latency) and a sample rate of 44.1khz. var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext({ latencyhint: 'interac...
AudioContext.close() - Web APIs
less other references have been released as well; however, it will forcibly release any system audio resources that might prevent additional audiocontexts from being created and used, suspend the progression of audio time in the audio context, and stop processing audio data. the returned promise resolves when all audiocontext-creation-blocking resources have been released. this method throws an invalid_state_err exception if called on an offlineaudiocontext. syntax var audioctx = new audiocontext(); audioctx.close().then(function() { ... }); await audioctx.close(); returns a promise that resolves with void. example the following snippet is taken from our audiocontext states demo (see it running live.) when the stop button is clicked, close() is called. when the promise resolves, the exam...
AudioContext.resume() - Web APIs
syntax completepromise = audiocontext.resume(); parameters none. return value a promise that resolves when the context has resumed. the promise is rejected if the context has already been closed. ...
AudioContext.suspend() - Web APIs
the suspend() method of the audiocontext interface suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing cpu/battery usage in the process — this is useful if you want an application to power down the audio hardware when it will not be using an audio context for a while. this method will cause an invalid_state_err exception to be thrown if called on an offlineaudiocontext. syntax var audioctx = new audiocontext(); audioctx.suspend().then(function() { ... }); returns a promise that resolves with void. the promise is rejected if the context has already been closed. example the following snippet is taken from our audiocontext states demo (see it running live.) when the suspend/resume button is clicked, the audiocontext.state is quer...
AudioNode.connect() - Web APIs
Web › API › AudioNode › connect
a node, connect() returns a reference to the destination audionode object, allowing you to chain multiple connect() calls. in some browsers, older implementations of this interface return undefined. if the destination is an audioparam, connect() returns undefined. exceptions indexsizeerror the value specified as outputindex or inputindex doesn't correspond to an existing input or output. invalidaccesserror the destination node is not part of the same audio context as the source node. notsupportederror the specified connection would create a cycle (in which the audio loops back through the same nodes repeatedly) and there are no delaynodes in the cycle to prevent the resulting waveform from getting stuck constructing the same audio frame indefinitely. examples connecting to an audio...
AudioParam.exponentialRampToValueAtTime() - Web APIs
specifications specification status comment web audio apithe definition of 'exponentialramptovalueattime' in that specification. working draft ...
AudioParam.setValueCurveAtTime() - Web APIs
an audiocontext.currenttime, it is clamped to currenttime. duration a double representing the total time (in seconds) over which the parameter's value will change following the specified curve. the specified values are spaced equally along this duration. return value a reference to this audioparam object. some older browser implementations of this interface return undefined. exceptions invalidstateerror the specified array of values has fewer than 2 items in it. rangeerror the specified starttime is either negative or a non-finite value, or duration is not a finite, strictly positive number. typeerror one or more of the values in the values array is non-finite. non-finite values are nan, infinity, and -infinity. usage notes when the parameter's value finishes following the curv...
AudioProcessingEvent - Web APIs
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, numberofinputchannels, of the factory method audiocontext.createscriptprocessor(). note the the returned audiobuffer is only valid in the scope of the onaudioprocess function. outputbuffer read only audiobuffer the buffer where the output audio data should be written. the number of channels is defined as a parameter, numberofoutputchannels, of the factory method audiocontext.createscriptprocessor(). note the the returned audiobuffer is only valid in the scope of the onaudioprocess function. ex...
AudioScheduledSourceNode.start() - Web APIs
indicating the offset, in seconds, into the audio buffer where playback should begin. if 0 is passed then the playback will start from the beginning. duration optional a floating-point number indicating the duration, in seconds, to be played. if no value is passed then the duration will be equal to the length of the audio buffer minus the offset value return value undefined exceptions invalidstatenode the node has already been started. this error occurs even if the node is no longer running because of a prior call to stop(). rangeerror the value specified for when is negative. example this example demonstrates how to create an oscillatornode which is scheduled to start playing in 2 seconds and stop playing 1 second after that. the times are calculated by adding the desired numbe...
AudioScheduledSourceNode.stop() - Web APIs
enode.stop([when]); parameters when optional the time, in seconds, at which the sound should stop playing. this value is specified in the same time coordinate system as the audiocontext is using for its currenttime attribute. omitting this parameter, specifying a value of 0, or passing a negative value causes the sound to stop playback immediately. return value undefined exceptions invalidstatenode the node has not been started by calling start(). rangeerror the value specified for when is negative. example this example demonstrates starting an oscillator node, scheduled to begin playing at once and to stop playing in one second. the stop time is determined by taking the audio context's current time from audiocontext.currenttime and adding 1 second. context = new audiocontex...
AuthenticatorAssertionResponse.authenticatorData - Web APIs
hes a hash of its own origin in order to prevent phishing or other man-in-the-middle attacks. flags (1 bytes) - a bitfield that indicates various attributes that were asserted by the authenticator. the bits are as follows, where "bit 0" is the least significant bit and all bits not specifically mentioned below are "reserved for future use": bit 0, user presence (up) - if set, authenticator validated that the user was present through some test of user presence (tup), such as touching a button on the authenticator. bit 2, user verification (uv) - if set, authenticator verified the actual user, through a biometric, pin, or other authentication method. bit 6, attested credential data (at) - if set, attestedcredentialdata will immediately follow the first 37 bytes of this authenticatord...
AuthenticatorAssertionResponse - Web APIs
this interface inherites from authenticatorresponse. note: this interface is restricted to top-level contexts. use from within an <iframe> element will not have any effect. ...
BaseAudioContext.createBuffer() - Web APIs
a specific number of seconds of audio, use numseconds * samplerate. samplerate the sample rate of the linear audio data in sample-frames per second. all browsers must support sample rates in at least the range 8,000 hz to 96,000 hz. returns an audiobuffer configured based on the specified options. exceptions notsupportederror one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range). rangeerror there isn't enough memory available to allocate the buffer. examples first, a couple of simple trivial examples, to help explain how the parameters are used: var audioctx = new audiocontext(); var buffer = audioctx.createbuffer(2, 22050, 44100); if you use this call, you will...
BaseAudioContext.createIIRFilter() - Web APIs
s 20, and at least one value must be nonzero. feedback an array of floating-point values specifying the feedback (denominator) coefficients for the transfer function of the iir filter. this array may have up to 20 members, the first of which must not be zero. return value an iirfilternode implementing the filter with the specified feedback and feedforward coefficient arrays. exceptions invalidstateerror all of the feedforward coefficients are 0, and/or the first feedback coefficient is 0. notsupportederror one or both of the input arrays exceeds 20 members. specifications specification status comment web audio apithe definition of 'createiirfilter()' in that specification. working draft ...
BaseAudioContext.createScriptProcessor() - Web APIs
ood buffer size to balance between latency and audio quality. numberofinputchannels integer specifying the number of channels for this node's input, defaults to 2. values of up to 32 are supported. numberofoutputchannels integer specifying the number of channels for this node's output, defaults to 2. values of up to 32 are supported. important: webkit currently (version 31) requires that a valid buffersize be passed when calling this method. note: it is invalid for both numberofinputchannels and numberofoutputchannels to be zero. returns a scriptprocessornode. 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) an...
BiquadFilterNode.getFrequencyResponse() - Web APIs
itless values. phaseresponseoutput a float32array to receive the computed phase response values in radians for each frequency value in the input frequencyarray. for any frequency in frequencyarray whose value is outside the range 0.0 to samplerate/2 (where samplerate is the sample rate of the audiocontext), the corresponding value in this array is nan. return value undefined exceptions invalidaccesserror the three arrays provided are not all of the same length. example in the following example we are using a biquad filter on a media stream (for the full demo, see our stream-source-buffer demo live, or read the source.) as part of this demo, we get the frequency responses for this biquad filter, for five sample frequencies. we first create the float32arrays we need, one containing t...
BluetoothCharacteristicProperties - Web APIs
this interface is returned by calling bluetoothremotegattcharacteristic.properties. properties authenticatedsignedwritesread only returns a boolean that is true if signed writing to the characteristic value is permitted. broadcastread only returns a boolean that is true if the broadcast of the characteristic value is permitted using the server characteristic configuration descriptor. ...
BudgetState.time - Web APIs
Web › API › BudgetState › time
syntax var time = budgetstate.time value a timestamp. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
BudgetState - Web APIs
methods none. browser compatibility the compatibility table on this page is generated from structured data. ...
CSS.registerProperty() - Web APIs
the property being defined. syntax optional a domstring representing the expected syntax of the defined property. defaults to "*". inherits a boolean value defining whether the defined property should be inherited (true), or not (false). defaults to false. initialvalue optional a domstring representing the initial value of the defined property. return value undefined. exceptions invalidmodificationerror the given name has already been registered. syntaxerror the given name isn't a valid custom property name (starts with two dashes, e.g. --foo). typeerror the required name and/or inherits dictionary members were not provided. examples the following will register a custom property, --my-color, using registerproperty(), as a color, give it a default value, and have it not i...
CSSNumericValue.add() - Web APIs
the add() method of the cssnumericvalue interface adds a supplied number to the cssnumericvalue. syntax var cssmathsum = cssnumericvalue.add(double | cssnumericvalue); parameters number either a number or a cssnumericvalue. return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. examples let mathsum = css.px("23").add(css.percent("4")).add(css.cm("3")).add(css.in("9")); // prints "calc(23px + 4% + 3cm + 9in)" console.log(mathsum.tostring()); specifications specification status comment css typed om level 1the definition of 'add' in that specification. working draft initial definition. ...
CSSNumericValue.div() - Web APIs
the div() method of the cssnumericvalue interface divides the cssnumericvalue by the supplied value. syntax var cssnumericvalue = cssnumericvalue.div(number); parameters number either a number or a cssnumericvalue. return value a cssmathproduct. exceptions typeerror indicates that an invalid type was passed to the method. examples let mathproduct = css.px("24").div(css.percent("4")); // prints "calc(24px / 4%)" mathproduct.tostring(); specifications specification status comment css typed om level 1the definition of 'div' in that specification. working draft initial definition. ...
CSSNumericValue.max() - Web APIs
the max() method of the cssnumericvalue interface returns the highest value from among the values passed. the passed values must be of the same type. syntax var cssunitvalue = cssnumericvalue.man(number1 ... numbern); parameters number either a number or a cssnumericvalue. return value a cssunitvalue. exceptions typeerror indicates that an invalid type was passed to the method. examples as stated earlier, all passed values must be of the same type and value. some of the following examples illustrate what happens when they are not. // prints "2cm" console.log(css.cm("1").max(css.cm("2")).tostring()); // prints "max(1cm, 0.393701in)" console.log(css.cm("1").max(css.in("0.393701")).tostring()); specifications specification status comment css typed ...
CSSNumericValue.min() - Web APIs
the min() method of the cssnumericvalue interface returns the lowest value from among those values passed. the passed values must be of the same type. syntax var cssunitvalue = cssnumericvalue.min(number1 ... numbern); parameters number either a number or a cssnumericvalue. return value a cssunitvalue. exceptions typeerror indicates that an invalid type was passed to the method. examples as stated earlier, all passed values must be of the same type and value. some of the following examples illustrate what happens when they are not. // prints "1cm" console.log(css.cm("1").min(css.cm("2")).tostring()); // prints "max(1cm, 0.393701in)" console.log(css.cm("1").max(css.in("0.393701")).tostring()); specifications specification status comment css typed...
CSSNumericValue.mul() - Web APIs
the mul() method of the cssnumericvalue interface multiplies the cssnumericvalue by the supplied value. syntax var cssmathproduct = cssnumericvalue.mul(number); parameters number either a number or a cssnumericvalue. return value a cssmathproduct exceptions typeerror indicates that an invalid type was passed to the method. examples let mathsum = css.px("23").mul(css.percent("4")).mul(css.cm("3")).mul(css.in("9")); // prints "calc(23px * 4% * 3cm * 9in)" console.log(mathsum.tostring()); specifications specification status comment css typed om level 1the definition of 'mul' in that specification. working draft initial definition. ...
CSSNumericValue.sub() - Web APIs
the sub() method of the cssnumericvalue interface subtracts a supplied number from the cssnumericvalue. syntax var cssmathsum = cssnumericvalue.sub(number); parameters number either a number or a cssmathsum. return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. examples let mathsum = css.px("23").sum(css.percent("4")).sum(css.cm("3")).sum(css.in("9")); // prints "calc(23px - 4% - 3cm - 9in)" console.log(mathsum.tostring()); and/or include a list of links to useful code samples that live elsewhere: specifications specification status comment css typed om level 1the definition of 'sub' in that specification. working draft initial definition. ...
CSSNumericValue.sum() - Web APIs
the sub() method of the cssnumericvalue interface subtracts a supplied number from the cssnumericvalue. syntax var cssmathsum = cssnumericvalue.sub(number); parameters number either a number or a cssmathsum return value a cssmathsum exceptions typeerror indicates that an invalid type was passed to the method. examples let mathsum = css.px("23").sum(css.percent("4")).sum(css.cm("3")).sum(css.in("9")); // prints "calc(23px - 4% - 3cm - 9in)" console.log(mathsum.tostring()); and/or include a list of links to useful code samples that live elsewhere: specifications specification status comment css typed om level 1the definition of 'sub' in that specification. working draft initial definition. ...
CSSNumericValue.to() - Web APIs
the to() method of the cssnumericvalue interface converts a numberic value from one unit to another. syntax var cssunitvalue = cssnumericvalue.to(unit); parameters unit the unit to which you want to convert. return value a cssmathsum. exceptions syntaxerror indicates that an invalid type was passed to the method. typeerror indicates that the passed values cannot be summed. examples // prints "0.608542cm" console.log(css.px("23").to("com").tostring()); specifications specification status comment css typed om level 1the definition of 'to' in that specification. working draft initial definition. ...
CSSNumericValue.toSum() - Web APIs
the tosum() method of the cssnumericvalue interface converts the object's value to a cssmathsum object to values of the specified unit. syntax var cssmathsum = cssnumericvalue.tosum(units); parameters units the units to convert to. return value a cssnumericvalue. exceptions syntaxerror undefined typeerror indicates that an invalid type was passed to the method. examples let v = css.px("23").add(css.percent("4")).add(css.cm("3")).add(css.in("9")); v.tostring() // => "calc(23px + 4% + 3cm + 9in)" v.tosum("px", "percent").tostring() // => "calc(1000.39px + 4%)" specifications specification status comment css typed om level 1the definition of 'tosum' in that specification. working draft initial definition. ...
CSSPrimitiveValue.getCounterValue() - Web APIs
get the counter value. if this css value doesn't contain a counter value, a domexception is raised. modification to the corresponding style property can be achieved using the counter interface. syntax var countervalue = cssprimitivevalue.getcountervalue(); return value a counter object representing the counter value. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a counter value (e.g. this is not css_counter). specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getcountervalue' in that specification. obsolete initial definition ...
CSSPrimitiveValue.getRGBColorValue() - Web APIs
n rgb color value. if this css value doesn't contain a rgb color value, a domexception is raised. modification to the corresponding style property can be achieved using the rgbcolor interface. syntax var rgbcolorvalue = cssprimitivevalue.getrgbcolorvalue(); return value an rgbcolor object representing the color value. exceptions type description domexception an invalid_access_err is raised if the attached property can't return an rgb color value (i.e. this is not css_rgbcolor). example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("color"); console.log(cssvalue.getrgbcolorvalue()); specifications specification status comment document object model (dom) level 2 style specificationthe defi...
CSSPrimitiveValue.getRectValue() - Web APIs
ue interface is used to get a rect value. if this css value doesn't contain a rect value, a domexception is raised. modification to the corresponding style property can be achieved using the rect interface. syntax var rectvalue = cssprimitivevalue.getrectvalue(); return value a rect object representing the rect value. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a rect value. (i.e. this is not css_rect). example var cs = window.getcomputedstyle(document.getelementbyid("clippeddiv")); var cssvalue = cs.getpropertycssvalue("clip"); console.log(cssvalue.getrectvalue()); specifications specification status comment document object model (dom) level 2 style specificationthe...
CSSPrimitiveValue.getStringValue() - Web APIs
the getstringvalue() method of the cssprimitivevalue interface is used to get a string value. if this css value doesn't contain a string value, a domexception is raised. syntax var stringvalue = cssprimitivevalue.getstringvalue(); return value a string value. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a string value. example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("display"); console.log(cssvalue.getstringvalue()); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getstringvalue' in that specification. obsolete initial definitio...
CSSPrimitiveValue.setStringValue() - Web APIs
ant description css_attr the value is an attr() function. css_ident the value is an identifier. css_string the value is a <string>. css_uri the value is a <uri>. stringvalue a domstring representing the new string value. return value void. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a string value or if the string value can't be converted into the specified unit. an no_modification_allowed_err is raised if this property is read-only. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.setstringvalue' in ...
CSSStyleSheet.insertRule() - Web APIs
e css constraint, the method aborts with a hierarchyrequesterror. if more than one rule is given in the rule parameter, the method aborts with a syntaxerror. if trying to insert an @import at-rule after a style rule, the method aborts with a hierarchyrequesterror. if rule is @namespace and the rule-list has more than just @import at-rules and/or @namespace at-rules, the method aborts with an invalidstateerror. examples inserting a new rule this snippet pushes a new rule onto the top of my stylesheet. mystyle.insertrule('#blanc { color: white }', 0); function to add a stylesheet rule /** * add a stylesheet rule to the document (it may be better practice * to dynamically change classes, so style information can be kept in * genuine stylesheets and avoid adding extra elements to the ...
CSSValueList.item() - Web APIs
Web › API › CSSValueList › item
der of the values in the css style property. if the index is greater than or equal to the number of values in the list, this method returns null. syntax var cssvalue = cssvaluelist.item(index); parameters index an unsigned long representing the index of the css value within the collection. return value a cssvalue object at the index position in the cssvaluelist, or null if that is not a valid index. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvaluelist.item' in that specification. obsolete initial definition ...
CSSValueList.length - Web APIs
syntax var length = cssvaluelist.length; value an unsigned long representing the number of cssvalues. ...
Using the CSS properties and values API - Web APIs
it should expect, and because it knows that, it can then set up the transitions properly. gotchas there are two gotchas when registering a property. the first is that, once a property is registered, there's no way to update it, and trying to re-register it with javascript will throw an error indicating it's already been defined. second, unlike standard properties, registered properties aren't validated when they're parsed. rather, they're validated when they're computed. that means both that invalid values won't appear as invalid when inspecting the element's properties, and that including an invalid property after a valid one won't fall back to the valid property. an invalid property will, however, fall back to its registered default. ...
Cache.delete() - Web APIs
Web › API › Cache › delete
w matching is done in the delete operation. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. cachename: a domstring that represents a specific...
Cache.keys() - Web APIs
Web › API › Cache › keys
how matching is done in the keys operation. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header. it defaults to false. cachename: a domstring that represents a specific...
Cache.matchAll() - Web APIs
Web › API › Cache › matchAll
control options for the matching performed. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e. if the url matches you will get a match regardless of the response object having a vary header or not. it defaults to false. return value a promise that resolves to an array of al...
CacheStorage.match() - Web APIs
s done in the match operation. the available options are: ignoresearch: a boolean that specifies whether the matching process should ignore the query string in the url. for example, if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match. it defaults to false. ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false. ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header or not. it defaults to false. cachename: a domstring that represents a spe...
CanvasRenderingContext2D.drawImage() - Web APIs
tination canvas. this allows scaling of the drawn image. if not specified, the image is not scaled in width when drawn. dheight optional the height to draw the image in the destination canvas. this allows scaling of the drawn image. if not specified, the image is not scaled in height when drawn. exceptions thrown index_size_err if the canvas or source rectangle width or height is zero. invalid_state_err the image has no image data. type_mismatch_err the specified source element isn't supported. ns_error_not_available the image is not loaded yet. use .complete === true and .onload to determine when it is ready. examples drawing an image to the canvas this example draws an image to the canvas using the drawimage() method. html <canvas id="canvas"></canvas> <div style="display:...
CanvasRenderingContext2D.putImageData() - Web APIs
al position (y coordinate) of the top-left corner from which the image data will be extracted. defaults to 0. dirtywidth optional width of the rectangle to be painted. defaults to the width of the image data. dirtyheight optional height of the rectangle to be painted. defaults to the height of the image data. errors thrown notsupportederror thrown if any of the arguments is infinite. invalidstateerror thrown if the imagedata object's data has been detached. examples understanding putimagedata to understand what this algorithm does under the hood, here is an implementation on top of canvasrenderingcontext2d.fillrect(). html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); function putimagedata(ctx, i...
ChannelMergerNode() - Web APIs
s optional a channelmergeroptions dictionary object defining the properties you want the channelmergernode to have (also inherits parameters from the audionodeoptions dictionary): numberofinputs: a number defining the number of inputs the channelmergernode should have. if not specified, the default value used is 6. return value a new channelmergernode object instance. exceptions invalidstateerror an option such as channelcount or channelcountmode has been given an invalid value. example var ac = new audiocontext(); var options = { numberofinputs : 2 } var mymerger = new channelmergernode(ac, options); specifications specification status comment web audio apithe definition of 'channelmergernode' in that specification. working draft ...
Clients.openWindow() - Web APIs
in firefox, the method is allowed to show popups only when called as the result of a notification click event. in chrome for android, the method may instead open the url in an existing browsing context provided by a standalone web app previously added to the user's home screen. as of recently, this also works on chrome for windows. ...
ClipboardItem.getType() - Web APIs
return value a promise that resolves with a blob object. exceptions domexception the type does not match a known mime type. typeerror no parameter is specified or the type is not that of the clipboarditem. ...
Credential.type - Web APIs
Web › API › Credential › type
syntax var credtype = credential.type; value a domstring contains a credential's given name. ...
Credential - Web APIs
the credential interface of the the credential management api provides information about an entity as a prerequisite to a trust decision. properties credential.id read only returns a domstring containing the credential's identifier. this might be any one of a guid, username, or email address. credential.type read only returns a domstring containing the credential's type. valid values are password, federated and public-key. (for passwordcredential, federatedcredential and publickeycredential) event handlers none. methods none. examples // tbd specifications specification status comment credential management level 1 working draft initial definition. ...
CredentialsContainer.get() - Web APIs
providers: an array of domstring instances of identity providers to search for. protocols an array of domstring instances of federation protocols to search for. publickey: an publickeycredentialrequestoptions object containing requirements for returned webauthn credentials. mediation: a string indicating whether the user will be required to log on for every visit to the website. valid values are "silent", "optional", or "required". unmediated: a boolean indicating the returned credential instance should not require user mediation. signal: an instance of abortsignal that can indicate that an ongoing get() operation should be halted. an aborted operation may complete normally (generally if the abort was received after the operation finished) or reject with an "aborterror" ...
CredentialsContainer.store() - Web APIs
the store() method of the credentialscontainer stores a set of credentials for the user inside a credential instance, returning this in a promise. this method is restricted to top-level contexts. calls to it within an <iframe> element will resolve without effect. syntax credentialscontainer.store(credential).then(function(credential) { ... } ) parameters credentials a valid credential instance. returns a promise, resolving to the passed credential instance. example // tbd specifications specification status comment credential management level 1 working draft initial definition. ...
CustomElementRegistry.whenDefined() - Web APIs
he named element is defined. syntax promise<> customelements.whendefined(name); parameters name custom element name. return value a promise that resolves to undefined when the custom element is defined. if the custom element is already defined, the promise is resolved immediately. exceptions exception description syntaxerror if the provided name is not a valid custom element name, the promise rejects with a syntaxerror. examples this example uses whendefined() to detect when the custom elements that make up a menu are defined. the menu displays placeholder content until the actual menu content is ready to display. <nav id="menu-container"> <div class="menu-placeholder">loading...</div> <nav-menu> <menu-item>item 1</menu-item> <menu...
DOMMatrixReadOnly - Web APIs
s on this syntax. for a 2d matrix, the elements a through f are listed, for a total of six values and the form matrix(a, b, c, d, e, f). for a 3d matrix, the returned string contains all 16 elements and takes the form matrix3d(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44). see the css matrix3d() function for details on the 3d notation's syntax. throws an invalidstateerror exception if any of the elements in the matrix are non-finite (even if, in the case of a 2d matrix, the non-finite values are in elements not used by the 2d matrix representation). dommatrixreadonly.transformpoint() transforms the specified point using the matrix, returning a new dompoint object containing the transformed point. neither the matrix nor the original point are altered.
DOMPoint.w - Web APIs
Web › API › DOMPoint › w
the dompoint interface's w property holds the point's perspective value, w, for a point in space. syntax var perspective = dompoint.w; value a double-precision floating-point value indicating the w perspective value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). the default is 1.0. specifications specification status comment geometry interfaces module level 1the definition of 'w' in that specification. candidate recommendation initial definition ...
DOMPoint.x - Web APIs
Web › API › DOMPoint › x
, x, for a point in space. in general, positive values x mean to the right, and negative values of x means to the left, barring any transforms that may have altered the orientation of the axes. syntax var xpos = dompoint.x; value a double-precision floating-point value indicating the x coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification. candidate recommendation initial definition ...
DOMPoint.y - Web APIs
Web › API › DOMPoint › y
erface's y property holds the vertical coordinate, y, for a point in space. unless transforms have been applied to alter the orientation, the value of y increases downward and decreases upward. syntax var ypos = dompoint.y; value a double-precision floating-point value indicating the y coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification. candidate recommendation initial definition ...
DOMPoint.z - Web APIs
Web › API › DOMPoint › z
d the orientation, a z of 0 is the plane of the screen, with positive values extending outward toward the user from the screen, and negative values receding into the distance behind the screen. syntax var zpos = dompoint.z; value a double-precision floating-point value indicating the z coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'z' in that specification. candidate recommendation initial definition ...
DOMPointInit.w - Web APIs
Web › API › DOMPointInit › w
tive value of a point in space when either creating or serializing to json a dompoint or dompointreadonly object. syntax var dompointinit = { w: wperspective }; dompointinit.w = wperspective; var wperspective = dompointinit.w; value a double-precision floating-point value indicating the point's w perspective value. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). 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. this method is, by inheritance, also available as dompoint.frompoint(). the dompointreadonly.t...
DOMPointInit.x - Web APIs
Web › API › DOMPointInit › x
e values x mean to the right, and negative values of x means to the left, assuming that transforms have not altered the orientation of the axes. syntax var dompointinit = { x: xpos }; dompointinit.x = xpos; var xpos = dompointinit.x; value a double-precision floating-point value indicating the point's x coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). if this property is missing when the dompointinit object is passed into frompoint(), the value is assumed to be 0 by default. 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. specifications specificati...
DOMPointInit.y - Web APIs
Web › API › DOMPointInit › y
the left, becoming negative to the left of the origin. this may change if transforms have been applied causing the axes' orientation to change. syntax var dompointinit = { y: ypos }; dompointinit.y = ypos; var ypos = dompointinit.y; value a double-precision floating-point value indicating the point's y-coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). if this property is missing when the dompointinit object is passed into frompoint(), the value is assumed to be 0 by default. 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 ...
DOMPointInit.z - Web APIs
Web › API › DOMPointInit › z
values being behind the screen, receding into the distance. of course, if transforms have been applied, the axes may have changed orientation. syntax var dompointinit = { z: zpos }; dompointinit.z = zpos; var zpos = dompointinit.z; value a double-precision floating-point value indicating the point's z-coordinate. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). 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. this method is, by inheritance, also available as dompoint.frompoint(). the dompointreadonly.t...
DOMPointReadOnly.w - Web APIs
oint's perspective value, w, for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. syntax const perspective = somedompointreadonly.w value a double-precision floating-point value indicating the w perspective value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). the default is 1.0. specifications specification status comment geometry interfaces module level 1the definition of 'w' in that specification. candidate recommendation initial definition ...
DOMPointReadOnly.x - Web APIs
y version of the dompoint object. in general, positive values x mean to the right, and negative values of x means to the left, assuming no transforms have resulted in a reversal. syntax const xpos = somedompointreadonly.x; value a double-precision floating-point value indicating the x coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'x' in that specification. candidate recommendation initial definition ...
DOMPointReadOnly.y - Web APIs
should instead use the dompoint object. in general, positive values of y mean downward, and negative values of y mean upward, assuming no transforms have resulted in a reversal. syntax const ypos = somedompointreadonly.y; value a double-precision floating-point value indicating the y coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'y' in that specification. candidate recommendation initial definition ...
DOMPointReadOnly.z - Web APIs
ive values of z mean toward the user (out from the screen), and negative values of z mean away from the user (into the screen), assuming no transforms have resulted in a reversal. syntax const zpos = somedompointreadonly.z; value a double-precision floating-point value indicating the z coordinate's value for the point. this value is unrestricted, meaning that it is allowed to be infinite or invalid (that is, its value may be nan or ±infinity). specifications specification status comment geometry interfaces module level 1the definition of 'z' in that specification. candidate recommendation initial definition ...
DataTransfer - Web APIs
to initiate the drag operation. this value is null for external drags or if the caller can't access the node. datatransfer.mozusercancelled read only this property applies only to the dragend event, and is true if the user canceled the drag operation by pressing escape. it will be false in all other cases, including if the drag failed for any other reason, for instance due to a drop over an invalid location. deprecated properties datatransfer.mozitemcount read only gives the number of items in the drag operation. removed in firefox 71. methods standard methods datatransfer.cleardata() remove the data associated with a given type. the type argument is optional. if the type is empty or not specified, the data associated with all types is removed. if data for the specified type...
DataTransferItemList.remove() - Web APIs
list. if the index is less than zero or greater than one less than the length of the list, the list will not be changed. syntax datatransferitemlist.remove(index); parameters index the zero-based index number of the item in the drag data list to remove. if the index doesn't correspond to an existing item in the list, the list is left unchanged. return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.ta...
DirectoryReaderSync - Web APIs
ion); method readentries() returns a lost of entries from a specific directory. call this method until an empty array is returned. entrysync readentries ( ) raises (fileexception); returns parameter none exceptions this method can raise a fileexception with the following codes: exception description not_found_err the directory does not exist. invalid_state_err the directory has been modified since the first call to readentries was processed. security_err the browser determined that it was not safe to look up the metadata. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and se...
Document.cookie - Web APIs
Web › API › Document › cookie
omain must match the domain of the javascript origin. setting cookies to foreign domains will be silently ignored. ;max-age=max-age-in-seconds (e.g., 60*60*24*365 or 31536000 for a year) ;expires=date-in-gmtstring-format if neither expires nor max-age specified it will expire at the end of session. when user privacy is a concern, it's important that any web app implementation invalidate cookie data after a certain timeout instead of relying on the browser to do it. many browsers let users specify that cookies should never expire, which is not necessarily safe. see date.toutcstring() for help formatting this value. ;secure cookie to only be transmitted over secure protocol as https. before chrome 52, this flag could appear with cookies from http dom...
Document.createAttribute() - Web APIs
turns it. the object created a node implementing the attr interface. the dom does not enforce what sort of attributes can be added to a particular element in this manner. the string given in parameter is converted to lowercase. syntax attribute = document.createattribute(name) parameters name is a string containing the name of the attribute. return value a attr node. exceptions invalid_character_err if the parameter contains invalid characters for xml attribute. example var node = document.getelementbyid("div1"); var a = document.createattribute("my_attrib"); a.value = "newval"; node.setattributenode(a); console.log(node.getattribute("my_attrib")); // "newval" specifications specification status comment domthe definition of 'document.createattribut...
Document.createCDATASection() - Web APIs
data & then some'); docu.getelementsbytagname('xml')[0].appendchild(cdata); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><![cdata[some <cdata> data & then some]]></xml> notes this will only work with xml, not html documents (as html documents do not support cdata sections); attempting it on an html document will throw not_supported_err. will throw a ns_error_dom_invalid_character_err exception if one tries to submit the closing cdata sequence ("]]>") as part of the data, so unescaped user-provided data cannot be safely used without with this method getting this exception (createtextnode() can often be used in its place). specifications specification status comment domthe definition of 'document.createcdatasection' in that specifica...
Document.createElementNS() - Web APIs
d qualified name. to create an element without specifying a namespace uri, use the createelement() method. syntax var element = document.createelementns(namespaceuri, qualifiedname[, options]); parameters namespaceuri a string that specifies the namespace uri to associate with the element. the namespaceuri property of the created element is initialized with the value of namespaceuri. see valid namespace uris. qualifiedname a string that specifies the type of element to be created. the nodename property of the created element is initialized with the value of qualifiedname. optionsoptional an optional elementcreationoptions object containing a single property named is, whose value is the tag name for a custom element previously defined using customelements.define(). for backwards com...
Document.designMode - Web APIs
document.designmode controls whether the entire document is editable. valid values are "on" and "off". according to the specification, this property is meant to default to "off". firefox follows this standard. the earlier versions of chrome and ie default to "inherit". starting in chrome 43, the default is "off" and "inherit" is no longer supported. in ie6-10, the value is capitalized. syntax var mode = document.designmode; document.designmode = value; value a string indicating whether designmode is (or should be) set to on or off. valid values are on and off. example make an <iframe>'s document editable: iframenode.contentdocument.designmode = "on"; specifications specification status comment html living standardthe definition of 'designmode' in that spec...
Document: dragenter event - Web APIs
the target object is the immediate user selection (the element directly indicated by the user as the drop target), or the <body> element. bubbles yes cancelable yes default action reject immediate user selection as potential target element. interface dragevent event handler property ondragenter examples see the drag event for example code or this jsfiddle demo. ...
Document: dragleave event - Web APIs
bubbles yes cancelable no default action none. interface dragevent event handler property ondragleave examples see the drag event for example code or this jsfiddle demo. ...
Document: dragover event - Web APIs
the event is fired on the drop target(s). bubbles yes cancelable yes default action reset the current drag operation to "none". interface dragevent event handler property ondragover examples see the drag event for example code or this jsfiddle demo. ...
Document: drop event - Web APIs
bubbles yes cancelable yes default action varies interface dragevent event handler property ondrop examples see the drag event for example code or this jsfiddle demo. ...
Document.execCommand() - Web APIs
nted lines in the selection will be indented. insertbronreturn controls whether the enter key inserts a <br> element, or splits the current block element into two. (not supported by internet explorer.) inserthorizontalrule inserts a <hr> element at the insertion point, or replaces the selection with it. inserthtml inserts an html string at the insertion point (deletes selection). requires a valid html string as a value argument. (not supported by internet explorer.) insertimage inserts an image at the insertion point (deletes selection). requires a url string for the image's src as a value argument. the requirements for this string are the same as createlink. insertorderedlist creates a numbered ordered list for the selection or at the insertion point. insertunorderedlist creates a ...
Document.getElementById() - Web APIs
unlike some other element-lookup methods such as document.queryselector() and document.queryselectorall(), getelementbyid() is only available as a method of the global document object, and not available as a method on all element objects in the dom. because id values must be unique throughout the entire document, there is no need for "local" versio...
DocumentFragment.querySelector() - Web APIs
eryselector() method returns the first element, or null if no matches are found, within the documentfragment (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors. if the selector matches an id and this id is erroneously used several times in the document, it returns the first matching element. if the selectors specified in parameter are invalid a domexception with a syntax_err value is raised. syntax element = documentfragment.queryselector(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas. examples basic example in this basic example, the first element in the documentfragment with the class "myclass" is returned: var el = documentfragment.queryselector(".myclass"); c...
DocumentFragment.querySelectorAll() - Web APIs
note: the definition of this api was moved to the parentnode interface. ...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
next, we get all the p elements that are descendants of the body: mybodyelements = mybody.getelementsbytagname("p"); finally, we get the second item from the list of p elements via myp = mybodyelements[1]; once you have gotten the dom object for an html element,...
EffectTiming.easing - Web APIs
e cubic-bezier(0.42, 0, 0.58, 1). defaults to linear. available values include: linear a constant rate of change, neither accelerating nor deccelerating. cubic-bezier(<number>, <number>, <number>, <number>) specifies a cubic bézier timing function. the four numbers specify points p1 and p2 of the curve as (x1, y1, x2, y2). both x values must be in the range [0, 1] or the definition is invalid. ease a decelerated rate of change, going from fast to slow. equivalent to cubic-bezier(0.25, 0.1, 0.25, 1). ease-in an accelerated rate of change, going from slow to fast. equivalent to cubic-bezier(0.42, 0, 1, 1). ease-out another decelerated rate of change, going from fast to slow. equivalent to cubic-bezier(0, 0, 0.58, 1). ease-in-out this rate of change speeds up in the middle. equiv...
Element.closest() - Web APIs
Web › API › Element › closest
hing ancestor. if no such element exists, it returns null. syntax var closestelement = targetelement.closest(selectors); parameters selectors is a domstring containing a selector list. ex: p:hover, .toto + q return value closestelement is the element which is the closest ancestor of the selected element. it may be null. exceptions syntaxerror is thrown if the selectors is not a valid selector list string. example html <article> <div id="div-01">here is div-01 <div id="div-02">here is div-02 <div id="div-03">here is div-03</div> </div> </div> </article> javascript var el = document.getelementbyid('div-03'); var r1 = el.closest("#div-02"); // returns the element with the id=div-02 var r2 = el.closest("div div"); // returns the closest ancestor which is...
Element: error event - Web APIs
bubbles no cancelable no interface event or uievent event handler property onerror the event object is a uievent instance if it was generated from a user interface element, or an event instance otherwise. ...
Element.insertAdjacentElement() - Web APIs
e targetelement, after its last child. 'afterend': after the targetelement itself. element the element to be inserted into the tree. return value the element that was inserted, or null, if the insertion failed. exceptions exception explanation syntaxerror the position specified is not a recognised value. typeerror the element specified is not a valid element. visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent. example beforebtn.addeventlistener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = rando...
Element.matches() - Web APIs
Web › API › Element › matches
the matches() method checks to see if the element would be selected by the provided selectorstring -- in other words -- checks if the element "is" the selector. syntax var result = element.matches(selectorstring); parameters selectorstring is a string representing the selector to test. return value result is a boolean. exceptions syntax_err the specified selector string is invalid. example <ul id="birds"> <li>orange-winged parrot</li> <li class="endangered">philippine eagle</li> <li>great white pelican</li> </ul> <script type="text/javascript"> var birds = document.getelementsbytagname('li'); for (var i = 0; i < birds.length; i++) { if (birds[i].matches('.endangered')) { console.log('the ' + birds[i].textcontent + ' is endangered!'); } } </script> t...
Element.namespaceURI - Web APIs
ce uri of a node is frozen at the node creation time. in firefox 3.5 and earlier, the namespace uri for html elements in html documents is null. in later versions, in compliance with html5, it is http://www.w3.org/1999/xhtml as in xhtml. you can create an element with the specified namespaceuri using the dom level 2 method document.createelementns. the dom does not handle or enforce namespace validation per se. it is up to the dom application to do any validation necessary. also note that the namespace prefix, once it is associated with a particular element, cannot be changed. specifications specification status comment domthe definition of 'element: namespaceuri' in that specification. living standard ...
Element.outerHTML - Web APIs
Web › API › Element › outerHTML
outerhtml = htmlstring; value reading the value of outerhtml returns a domstring containing an html serialization of the element and its descendants. setting the value of outerhtml replaces the element and all of its descendants with a new dom tree constructed by parsing the specified htmlstring. exceptions syntaxerror an attempt was made to set outerhtml using an html string which is not valid. nomodificationallowederror an attempt was made to set outerhtml on an element which is a direct child of a document, such as document.documentelement. examples getting the value of an element's outerhtml property: html <div id="d"> <p>content</p> <p>further elaborated</p> </div> javascript var d = document.getelementbyid("d"); console.log(d.outerhtml); // the string '<div id="d"><p...
Element.releasePointerCapture() - Web APIs
et for a specific (pointerevent) pointer. see the element.setpointercapture() method for a description of pointer capture and how to set it for a particular element. syntax targetelement.releasepointercapture(pointerid); parameters pointerid the pointerid of a pointerevent object. return value this method returns undefined. exceptions exception explanation invalidpointerid pointerid does not match any of the active pointers. example this example sets pointer capture on a <div> when you press down on it. this lets you slide the element horizontally, even when you pointer moves outside of its boundaries. html <div id="slider">slide me</div> css div { width: 140px; height: 50px; display: flex; align-items: center; justify-content: cen...
Element.setAttribute() - Web APIs
d). see the example below for a practical demonstration. since the specified value gets converted into a string, specifying null doesn't necessarily do what you expect. instead of removing the attribute or setting its value to be null, it instead sets the attribute's value to the string "null". if you wish to remove an attribute, call removeattribute(). return value undefined. exceptions invalidcharactererror the specified attribute name contains one or more characters which are not valid in attribute names. example in the following example, setattribute() is used to set attributes on a <button>. html <button>hello world</button> javascript var b = document.queryselector("button"); b.setattribute("name", "hellobutton"); b.setattribute("disabled", ""); this demonstrates two thi...
Element.setPointerCapture() - Web APIs
is can be used to ensure that an element continues to receive pointer events even if the pointer device's contact moves off the element (such as by scrolling or panning). syntax targetelement.setpointercapture(pointerid); parameters pointerid the pointerid of a pointerevent object. return value this method returns undefined. exceptions exception explanation invalidpointerid pointerid does not match any of the active pointers. example this example sets pointer capture on a <div> when you press down on it. this lets you slide the element horizontally, even when you pointer moves outside of its boundaries. html <div id="slider">slide me</div> css div { width: 140px; height: 50px; display: flex; align-items: center; justify-content: cen...
Element.toggleAttribute() - Web APIs
. the attribute name is automatically converted to all lower-case when toggleattribute() is called on an html element in an html document. force optional a boolean value to determine whether the attribute should be added or removed, no matter whether the attribute is present or not at the moment. return value true if attribute name is eventually present, and false otherwise. exceptions invalidcharactererror the specified attribute name contains one or more characters which are not valid in attribute names. 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("inpu...
Element - Web APIs
Web › API › Element
browser that they wish to dismiss the current open dialog. for example, the browser might fire this event when the user presses the esc key or clicks a "close dialog" button which is part of the browser's ui. also available via the oncancel property. error fired when a resource failed to load, or can't be used. for example, if a script has an execution error or an image can't be found or is invalid. also available via the onerror property. scroll fired when the document view or an element has been scrolled. also available via the onscroll property. select fired when some text has been selected. also available via the onselect property. show fired when a contextmenu event was fired on/bubbled to an element that has a contextmenu attribute. also available via the onshow property. ...
ExtendableEvent - Web APIs
tendableevent interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. this ensures that any functional events (like fetchevent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. if waituntil() is called outside of the extendableevent handler, the browser should throw an invalidstateerror; note also that multiple calls will stack up, and the resulting promises will be added to the list of extend lifetime promises. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274.) this interface inherits from the event interface. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: ...
FetchEvent.respondWith() - Web APIs
to a response. ​); parameters a response or a promise that resolves to a response. otherwise, a network error is returned to fetch. return value undefined. exceptions exception notes networkerror a network error is triggered on certain combinations of fetchevent.request.mode and response.type values, as hinted at in the "global rules" listed above. invalidstateerror the event has not been dispatched or respondwithwith() has already been invoked. examples this fetch event tries to return a response from the cache api, falling back to the network otherwise. addeventlistener('fetch', event => { // prevent the default, and handle the request ourselves. event.respondwith(async function() { // try to get the response from a cache. ...
Using Fetch - Web APIs
; // 11 console.log(myheaders.get('x-custom-header')); // ['processthisimmediately', 'anothervalue'] myheaders.delete('x-custom-header'); console.log(myheaders.get('x-custom-header')); // [ ] some of these operations are only useful in serviceworkers, but they provide a much nicer api for manipulating headers. all of the headers methods throw a typeerror if a header name is used that is not a valid http header name. the mutation operations will throw a typeerror if there is an immutable guard (see below). otherwise, they fail silently. for example: const myresponse = response.error(); try { myresponse.headers.set('origin', 'http://mybank.com'); } catch (e) { console.log('cannot pretend to be a bank!'); } a good use case for headers is checking whether the content type is correct befo...
File.type - Web APIs
Web › API › File › type
d to .txt would give "text/plain" and not "image/png". moreover, file.type is generally reliable only for common file types like images, html documents, audio and video. uncommon file extensions would return an empty string. client configuration (for instance, the windows registry) may result in unexpected values even for common types. developers are advised not to rely on this property as a sole validation scheme. specifications specification status comment file apithe definition of 'type' in that specification. working draft initial definition. ...
FileError - Web APIs
Web › API › FileError
ort the most appropriate error code for the condition. see error codes for possible values. error codes note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. constant value description encoding_err 5 the url is malformed. make sure that the url is complete and valid. invalid_modification_err 9 the modification requested is not allowed. for example, the app might be trying to move a directory into its own child or moving a file into its parent directory without changing its name. invalid_state_err 7 the operation cannot be performed on the current state of the interface object. for example, the state that was cached in an interfa...
FileException - Web APIs
iption code unsigned short the most appropriate error code for the condition. constants note: do not rely on the numeric values of the constants, which might change as the specifications continue to change. use the constant names instead. constant value description encoding_err 5 the url is malformed. make sure that the url is complete and valid. invalid_modification_err 9 the modification requested is not allowed. examples of invalid modifications include moving a directory into its own child or moving a file into its parent directory without changing its name. invalid_state_err 7 the operation cannot be performed on the current state of the interface object. for example, the state that was cached in an int...
FileReader.result - Web APIs
Web › API › FileReader › result
syntax var file = instanceoffilereader.result value an appropiate string or arraybuffer based on which of the reading methods was used to initiate the read operation. the value is null if the reading is not yet complete or was unsuccessful. the result types are described below. method description readasarraybuffer() the result is a javascript arraybuffer containing binary data. ...
FileReader - Web APIs
the file. filereader.readystate read only a number indicating the state of the filereader. this is one of the following: empty 0 no data has been loaded yet. loading 1 data is currently being loaded. done 2 the entire read request has been completed. filereader.result read only the file's contents. this property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation. event handlers filereader.onabort a handler for the abort event. this event is triggered each time the reading operation is aborted. filereader.onerror a handler for the error event. this event is triggered each time the reading operation encounter an e...
FileSystemDirectoryEntry.removeRecursively() - Web APIs
called if an error occurs while attempting to remove the directory subtree. receives a fileerror describing the error which occurred as input. return value undefined. errors if an error occurs and an errorcallback was specified, it gets called with a single parameter: a fileerror object describing the error. the fileerror.code specifies what type of error occurred, as follows: fileerror.invalid_modification_err an attempt was made to remove the root directory; this is not permitted. fileerror.no_modification_allowed_err the file system's state doesn't permit modification. fileerror.not_found_err the directory represented by the filesystemdirectoryentry no longer exists. fileerror.not_readable_err the directory is not accessible; perhaps it's in use by another application or is lo...
FileSystemEntry.copyTo() - Web APIs
which is called when the copy operation is succesfully completed. receives a single input parameter: a filesystementry based object providing the copied item's new details. errorcallback optional an optional callback which is executed if an error occurs while copying the items. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it. fileerror.quota_exceeded_err the operation exceeded the user's storage quota, or there isn't enough storage space left to complete the operation. example this example shows how ...
FileSystemEntry.getParent() - Web APIs
input parameter: a filesystemdirectoryentry object representing the parent directory. the parent of the root directory is considered to be the root directory, itself, so be sure to watch for that. errorcallback optional an optional callback which is executed if an error occurs. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_state_err the operation failed because the file system's state doesn't permit it. this can happen, for example, if the file system's cached state differs from the actual state of the file system. fileerror.not_found_err the specified path could not be found. fileerror.security_err security restrictions prohibit obtaining the parent directory's information. example this example renames th...
FileSystemEntry.moveTo() - Web APIs
on which is called when the move operation is succesfully completed. receives a single input parameter: a filesystementry based object providing the moved item's new details. errorcallback optional an optional callback which is executed if an error occurs while moving the items. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it. fileerror.quota_exceeded_err the operation exceeded the user's storage quota, or there isn't enough storage space left to complete the operation. example this example shows how ...
FileSystemEntry.remove() - Web APIs
subdirectories, call filesystemdirectoryentry.removerecursively() instead. syntax filesystementry.remove(successcallback[, errorcallback]); parameters successcallback a function which is called once the file has been successfully removed. errorcallback optional an optional callback which is called if the attempt to remove the file fails. return value undefined. errors fileerror.invalid_modification_err the specified entry was the file system's root directory, or the specified entry is a directory which isn't empty. fileerror.invalid_state_err the file system's cached state is inconsistent with its state on disk, so the file could not be deleted for safety reasons. fileerror.no_modification_allowed_err the file system's state doesn't permit removing the file or directory. ...
GlobalEventHandlers - Web APIs
nthandler for processing formdata events, fired after the entry list representing the form's data is constructed. globaleventhandlers.ongotpointercapture is an eventhandler representing the code to be called when the gotpointercapture event type is raised. globaleventhandlers.oninput is an eventhandler representing the code to be called when the input event is raised. globaleventhandlers.oninvalid is an eventhandler representing the code to be called when the invalid event is raised. globaleventhandlers.onkeydown is an eventhandler representing the code to be called when the keydown event is raised. globaleventhandlers.onkeypress is an eventhandler representing the code to be called when the keypress event is raised. globaleventhandlers.onkeyup is an eventhandler representing the co...
HTMLAnchorElement.download - Web APIs
note: this value might not be used for download. ...
HTMLCanvasElement.height - Web APIs
this is one of the two properties, the other being htmlcanvaselement.width, that controls the size of the canvas. ...
HTMLCanvasElement: webglcontextrestored event - Web APIs
you need to reinitialize the state of your webgl application and recreate resources. ...
HTMLCanvasElement.width - Web APIs
this is one of the two properties, the other being htmlcanvaselement.height, that controls the size of the canvas. ...
HTMLCollection - Web APIs
ed element supports the name attribute. returns null if no node exists by the given name. an alternative to accessing collection[name] (which instead returns undefined when name does not exist). this is mostly useful for non-javascript dom implementations. usage in javascript htmlcollection also exposes its members directly as properties by both name and index. html ids may contain : and . as valid characters, which would necessitate using bracket notation for property access. currently htmlcollections does not recognize purely numeric ids, which would cause conflict with the array-style access, though html5 does permit these. for example, assuming there is one <form> element in the document and its id is myform: var elem1, elem2; // document.forms is an htmlcollection elem1 = document.
HTMLDialogElement.showModal() - Web APIs
p of any other dialogs that might be present. it displays into the top layer, along with a ::backdrop pseudo-element. interaction outside the dialog is blocked and the content outside it is rendered inert. syntax dialoginstance.showmodal(); parameters none. return value void. exceptions if the dialog is already open (i.e. if the open attribute is already set on the <dialog> element), an invalidstateerror is thrown. examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form via the showmodal() method. from there you can click the cancel button to close the dialog (via the htmldialogelement.close() method), or submit the form via the submit button. <!-- simple pop-up dialog box, containing a form --> <dialog id="favdialog"> <form...
HTMLElement.lang - Web APIs
Web › API › HTMLElement › lang
the htmlelement.lang property gets or sets the base language of an element's attribute values and text content. the language code returned by this property is defined in the tags for identifying languages (bcp47) ietf document. common examples include "en" for english, "ja" for japanese, "es" for spanish and so on. the default value of this attribute is unknown. note that this attribute, though valid at the individual element level described here, is most often specified for the root element of the document. this also only works with the lang attribute and not with xml:lang. syntax var languageused = elementnodereference.lang; // get the value of lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the t...
HTMLElement - Web APIs
the currently focused element. htmlelement.click() sends a mouse click event to the element. htmlorforeignelement.focus() makes the element the current keyboard focus. htmlelement.forcespellcheck() runs the spell checker on the element's contents. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. invalid fired when an element does not satisfy its constraints during constraint validation. also available via the oninvalid property. animation events animationcancel fired when an animation unexpectedly aborts. also available via the onanimationcancel property. animationend fired when an animation has completed normally. also available via the onanimationend property. animationiteration ...
HTMLFontElement.face - Web APIs
t text, in the default style, is rendered as the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. ...
HTMLFontElement.size - Web APIs
the obsolete htmlfontelement.size property is a domstring that reflects the size html attribute. it contains either an integer number in the range of 1-7 or a relative value to increase/decrease the value of the size attribute of the <basefont> element. ...
HTMLFormElement.requestSubmit() - Web APIs
st be either a descendant of the form element or must have an form attribute referring to the form. usage notes the obvious question is: why does this method exist, when we've had the submit() method since the dawn of time? the answer is simple. submit() submits the form, but that's all it does. requestsubmit(), on the other hand, acts as if a submit button were clicked. the form's content is validated, and the form is submitted only if validation succeeds. once the form has been submitted, the submit event is sent back to the form object. examples in the example below, the form is submitted by attempting to send the request using requestsubmit() if it's available. if a submit button with the id main-submit is found, that's used to submit the form. otherwise, the form is submitted with no...
HTMLFormElement.submit() - Web APIs
the htmlformelement.requestsubmit() method is identical to activating a form's submit <button> and does not have these differences. ...
HTMLFormElement: submit event - Web APIs
es a submitter property, which is the button that was invoked to trigger the submit request. 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. the event is not sent to the form when calling the form.submit() method directly. note: trying to submit a form that does not pass validation triggers an invalid event. in this case, the validation prevents form submission, and thus there is no submit event. examples this example uses eventtarget.addeventlistener() to listen for form submit, and logs the current event.timestamp whenever that occurs, then prevents the default action of submitting the form. html <form id="form"> <label>test field: <input type="text"></label> ...
HTMLImageElement.useMap - Web APIs
mapanchor; let imagemapanchor = htmlimageelement.usemap; value a usvstring providing the page-local url (that is, a url that begins with the hash or pound symbol, "#") of the <map> element which defines the image map to apply to the image. you can learn more about client-side image maps in our learning article add a hitmap on top of an image. usage notes the string value of usemap must be a valid anchor for a <map> element. in other words, this string should be the value of the appropriate <map>'s name attribute with a pound or hash symbol prepended to it. consider a <map> that looks like this: <map name="mainmenu-map"> <area shape="circle" coords="25, 25, 75, 75" href="/index.html" alt="return to home page"> <area shape="rect" coords="25, 25, 100, 150" href="/index.html" alt="shop"...
HTMLMediaElement.defaultPlaybackRate - Web APIs
the htmlmediaelement.defaultplaybackrate property indicates the default playback rate for the media. syntax var dspeed = video.defaultplaybackrate; audio.defaultplaybackrate = 1.0; value a double. 1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. the value 0.0 is invalid and throws a not_supported_err exception. example var obj = document.createelement('video'); console.log(obj.defaultplaybackrate); // 1 specifications specification status comment html living standardthe definition of 'htmlmediaelement.defaultplaybackrate' in that specification. living standard no change from html5 html5the definition of 'htmlmediaelement.defaultplaybackrate' in that specification. recommen...
HTMLTableElement.insertRow() - Web APIs
row is appended as the last row. if index is greater than the number of rows, an indexsizeerror exception will result. if index is omitted it defaults to -1. return value newrow is an htmltablerowelement that references the new row. example this example uses insertrow(-1) to append a new row to a table. we then use htmltablerowelement.insertcell() to insert a new cell in the new row. (to be valid html, a <tr> must have at least one <td> element.) finally, we add some text to the cell using document.createtextnode() and node.appendchild(). html <table id="my-table"> <tr><td>row 1</td></tr> <tr><td>row 2</td></tr> <tr><td>row 3</td></tr> </table> javascript function addrow(tableid) { // get a reference to the table let tableref = document.getelementbyid(tableid); // insert ...
HTMLTableRowElement.insertCell() - Web APIs
ded as the last cell in the row. if index is greater than the number of cells, an indexsizeerror exception will result. if index is omitted it defaults to -1. return value newcell is an htmltablecellelement that references the new cell. example this example uses htmltableelement.insertrow() to append a new row to a table. we then use insertcell(0) to insert a new cell in the new row. (to be valid html, a <tr> must have at least one <td> element.) finally, we add some text to the cell using document.createtextnode() and node.appendchild(). html <table id="my-table"> <tr><td>row 1</td></tr> <tr><td>row 2</td></tr> <tr><td>row 3</td></tr> </table> javascript function addrow(tableid) { // get a reference to the table let tableref = document.getelementbyid(tableid); // insert ...
HTMLUnknownElement - Web APIs
the htmlunknownelement interface represents an invalid html element and derives from the htmlelement interface, but without implementing any additional properties or methods. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline poi...
HTMLVideoElement.videoHeight - Web APIs
es the <video> element to match the intrinsic size of its contents. let v = document.getelementbyid("myvideo"); v.addeventlistener("resize", ev => { let w = v.videowidth; let h = v.videoheight; if (w && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero. this avoids applying invalid changes when there's no true information available yet for dimensions. specifications specification status comment html living standardthe definition of 'htmlvideoelement.videoheight' in that specification. living standard html5the definition of 'htmlvideoelement.videoheight' in that specification. recommendation initial definition. ...
HTMLVideoElement.videoWidth - Web APIs
es the <video> element to match the intrinsic size of its contents. let v = document.getelementbyid("myvideo"); v.addeventlistener("resize", ev => { let w = v.videowidth; let h = v.videoheight; if (w && h) { v.style.width = w; v.style.height = h; } }, false); note that this only applies the change if both the videowidth and the videoheight are non-zero. this avoids applying invalid changes when there's no true information available yet for dimensions. specifications specification status comment html living standardthe definition of 'htmlvideoelement.videowidth' in that specification. living standard html5the definition of 'htmlvideoelement.videowidth' in that specification. recommendation initial definition. ...
Recommended Drag Types - Web APIs
/plain fallback for multiple links should include all urls, but no comments. for example, this sample text/uri-list data contains two links and a comment: http://www.mozilla.org #a second link http://www.example.com when retrieving a dropped link, ensure you handle when multiple links are dragged, including any comments. for convenience, the special type url may be used to refer to the first valid link within data for the text/uri-list type. do not add data with the url type — attempting to do so will set the value of the text/uri-list type instead. var url = event.datatransfer.getdata("url"); you may also see data with the mozilla-specific type text/x-moz-url. if it appears, it should appear before the text/uri-list type. it holds the urls of links followed by their titles, separa...
Headers.has() - Web APIs
Web › API › Headers › has
thod of the headers interface returns a boolean stating whether a headers object contains a certain header. for security reasons, some headers can only be controlled by the user agent. these headers include the forbidden header names and forbidden response header names. syntax myheaders.has(name); parameters name the name of the http header you want to test for. if the given name is not a valid http header name, this method throws a typeerror. returns a boolean. example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append, then test for the existence of it using has(): myheaders.append('content-type', 'image/jpeg'); myheaders.has('content-type'); // returns true myheaders.has('accept-enc...
Headers - Web APIs
Web › API › Headers
d() is that if the specified header does already exist and does accept multiple values, headers.set() will overwrite the existing value with the new one, whereas headers.append() will append the new value onto the end of the set of values. see their dedicated pages for example code. note: all of the headers methods will throw a typeerror if you try to pass in a reference to a name that isn't a valid http header name. the mutation operations will throw a typeerror if the header has an immutable guard. in any other failure case they fail silently. note: when header values are iterated over, they are automatically sorted in lexicographical order, and values from duplicate header names are combined. obsolete methods headers.getall() used to return an array of all the values of a header ...
IDBCursor.advance() - Web APIs
Web › API › IDBCursor › advance
cursor.advance(count); parameters count the number of times to move the cursor forward. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. typeerror the value passed into the count parameter was zero or a negative number. invalidstateerror the cursor is currently being iterated or has iterated past its end. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through the records in the object store. here we use cursor.advance(2) to jump 2 places forward each time, meaning that only every other result will be displayed. advance() works in a similar...
IDBCursor.continue() - Web APIs
ursor.continue(key); parameters key optional the key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. dataerror the key parameter may have any of the following conditions: the key is not a valid key. the key is less than or equal to this cursor's position and the cursor's direction is next or nextunique. the key is greater than or equal to this cursor's position and this cursor's direction is prev or prevunique. invalidstateerror the cursor is currently being iterated or has iterated past its end. example in this simple fragment we create a transact...
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
an idbrequest object on which subsequent events related to this operation are fired. the result attribute is set to undefined. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read-only. invalidstateerror the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. if the albumtitle of the current cursor is "grace under pressure", we delete that entire record using var req...
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
ed at the current position. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. readonlyerror the transaction mode is read only. invalidstateerror the cursor was created using idbindex.openkeycursor, is currently being iterated, or has iterated past its end. dataerror the underlying object store uses in-line keys and the property in the value at the object store's key path does not match the key in this cursor's position. datacloneerror the data being stored could not be cloned by the internal s...
IDBFactorySync - Web APIs
basesync open ( in domstring name, in domstring description ) raises (idbdatabaseexception); parameters name the name for the database. description the description for the database. returns idbdatabasesync an object to access the open database. exceptions this method can raise an idbdatabaseexception with the following codes: non_transient_err if the name parameter is not valid. a valid name is any string including the empty string. unknown_err if an error occurs while the database is being opened. ...
IDBIndex.count() - Web APIs
Web › API › IDBIndex › count
fies the record to be counted. return value a idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except...
IDBIndex.get() - Web APIs
Web › API › IDBIndex › get
ill use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except...
IDBIndex.getAll() - Web APIs
Web › API › IDBIndex › getAll
he first item. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. invalidstateerror the idbindex has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var myindex = objectstore.index('index'); var getallrequest = myindex.getall(); getallrequest.onsuccess = function() { console.log(getallrequest.result); } specification specification status comment indexed ...
IDBIndex.getAllKeys() - Web APIs
he first item. if it is lower than 0 or greater than 232-1 a typeerror exception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. invalidstateerror the idbindex has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var myindex = objectstore.index('index'); var getallkeysrequest = myindex.getallkeys(); getallkeysrequest.onsuccess = function() { console.log(getallkeysrequest.result); } specification specification status co...
IDBIndex.getKey() - Web APIs
Web › API › IDBIndex › getKey
ill use an unbound key range. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except...
IDBIndex.name - Web APIs
Web › API › IDBIndex › name
the name property of the idbindex interface contains a string which names the index. note: this feature is available in web workers. syntax var indexname = idbindex.name; idbindex.name = indexname; value a domstring specifying a name for the index. exceptions there are a several exceptions which can occur when you attempt to change an index's name. invalidstateerror the index, or its object store, has been deleted; or the current transaction is not an upgrade transaction. you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an index is already using the specified name. example in the following example we open a transaction and an object store, then ...
IDBIndex.openCursor() - Web APIs
rsor constants for possible values. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. typeerror the value for the direction parameter is invalid. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using opencursor() — this works the same as opening a c...
IDBIndex.openKeyCursor() - Web APIs
rsor constants for possible values. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive. typeerror the value for the direction parameter is invalid. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbindex has been deleted or removed. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a key cursor on the index using openkeycursor() — this works the same as opening ...
IDBKeyRange.bound() - Web APIs
Web › API › IDBKeyRange › bound
en optional indicates whether the upper bound excludes the endpoint value. the default is false. return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following type: exception description dataerror the following conditions raise an exception: the lower or upper parameters were not passed a valid key. the lower key is greater than the upper key. the lower key and upper key match and either of the bounds are open. example the following example illustrates how you'd use a bound key range. here we declare a keyrangevalue = idbkeyrange.bound("a", "f"); — a range between values of "a" and "f". we open a transaction (using idbtransaction) and an object store, and op...
IDBKeyRange.includes() - Web APIs
ey is inside the key range. note: this feature is available in web workers. syntax var isincluded = mykeyrange.includes(key) parameters key the key you want to check for in your key range. this can be any type. return value a boolean. exceptions this method may raise a domexception of the following type: attribute description dataerror the supplied key was not a valid key. example var keyrangevalue = idbkeyrange.bound('a', 'k', false, false); var myresult = keyrangevalue.includes('f'); // returns true var myresult = keyrangevalue.includes('w'); // returns false polyfill the includes() method was added in the second edition of the indexed db specification. for browsers that do not support it, the following polyfill can be used. idbkeyrange.prototy...
IDBKeyRange.lowerBound() - Web APIs
ers lower specifies the lower bound of the new key range. open optional indicates whether the lower bound excludes the endpoint value. the default is false. return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use a lower bound key range. here we declare keyrangevalue = idbkeyrange.lowerbound("f", false); — a range that includes the value "f" and everthing after it. we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key ra...
IDBKeyRange.only() - Web APIs
Web › API › IDBKeyRange › only
value. note: this feature is available in web workers. syntax var myidbkeyrange = idbkeyrange.only(value); parameters value is the value for the new key range. return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following types: exception description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use an only key range. here we declare a keyrangevalue = idbkeyrange.only("a"); — a range that only includes the value "a". we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. this means that the curs...
IDBKeyRange.upperBound() - Web APIs
rameters bound specifies the upper bound of the new key range. open indicates whether the upper bound excludes the endpoint value. the default is false. optional return value idbkeyrange: the newly created key range. exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key. example the following example illustrates how you'd use an upper bound key range. here we declare keyrangevalue = idbkeyrange.upperbound("f"); — a range that includes the value "f" and everything before it. we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. ...
IDBObjectStore.add() - Web APIs
is inactive. dataerror any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was provided. the object store uses out-of-line keys and has no key generator, and no key parameter was provided. the object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key. the key parameter was provided but does not contain a valid key. invalidstateerror the idbobjectstore has been deleted or removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. constrainterror an insert operation failed because the primary key constraint was violated (due to an al...
IDBObjectStore.count() - Web APIs
store.count(); var request = objectstore.count(query); parameters query optional a key or idbkeyrange object that specifies a range of records you want to count. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then count the number of records in the store using count() — when the success handler fires, we log the c...
IDBObjectStore.delete() - Web APIs
ect on which subsequent events related to this operation are fired. the request.result attribute is set to undefined. exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this object store's transaction is inactive. readonlyerror the object store's transaction mode is read-only. invalidstateerror the object store has been deleted. dataerror the key is not a valid key or a key range. example in the following code snippet, we open a read/write transaction on our database and delete one specific record out of our object store using delete() — a sample record with the key "walk dog". for a full working example, see our to-do notifications app (view ...
IDBObjectStore.get() - Web APIs
record to be retrieved. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. example in the following code snippet, we open a read/write transaction on our database and get one specific record from object store using get() — a sample record with the key "walk dog". once this data object is retrieved, you could then update it using normal javascript, then put it back into...
IDBObjectStore.getAll() - Web APIs
ception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key or is null. invalidstateerror the idbobjectstore has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. specifications specification status comment indexed database api draftthe definition of 'getall()' in that specification. recommendation initial definition ...
IDBObjectStore.getAllKeys() - Web APIs
ception will be thrown. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key or is null. invalidstateerror the idbobjectstore has been deleted or removed. specifications specification status comment indexed database api draftthe definition of 'getallkeys()' in that specification. recommendation initial definition ...
IDBObjectStore.getKey() - Web APIs
record to be retrieved. return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key. invalidstateerror the idbobjectstore has been deleted or removed. example let openrequest = indexeddb.open("telemetry"); openrequest.onsuccess = (event) => { let db = event.target.result; let store = db.transaction("netlogs").objectstore("netlogs"); let today = new date(); let yesterday = new date(today); yesterday.setdate(today.getdate() - 1); let ...
IDBObjectStore.index() - Web APIs
rn a series of records sorted by that index using a cursor. note: this feature is available in web workers. syntax var index = objectstore.index(name); parameters name the name of the index to open. return value an idbindex object for accessing the index. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished. notfounderror there is no index with the given name (case-sensitive) in the database. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index usi...
IDBObjectStore.name - Web APIs
he name property of the idbobjectstore interface indicates the name of this object store. note: this feature is available in web workers. syntax idbobjectstore.name = mynewname; var myobjectstorename = idbobjectstore.name; value a domstring containing the object store's name. exceptions there are a several exceptions which can occur when you attempt to change an object store's name. invalidstateerror either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an object store is already using the specified name. example in the following code snippet, we open a ...
IDBObjectStore.put() - Web APIs
is inactive. dataerror any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was provided. the object store uses out-of-line keys and has no key generator, and no key parameter was provided. the object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key. the key parameter was provided but does not contain a valid key. invalidstateerror the idbobjectstore has been deleted or removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. parameters value the value to be stored. key the key to use to identify the record. if unspecified, it ...
IDBRequest.error - Web APIs
Web › API › IDBRequest › error
a version lower than the one it already has. in addition to the error codes sent to the idbrequest object, asynchronous operations can also raise exceptions. the list describes problems that could occur when the request is being executed, but you might also encounter other problems when the request is being made. for example, if the the request failed and the result is not available, the invalidstateerror exception is thrown. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the reque...
IDBRequest.result - Web APIs
Web › API › IDBRequest › result
note: this feature is available in web workers. syntax var myresult = request.result; value any example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
IDBTransaction.abort() - Web APIs
all the changes to objects in the database associated with this transaction. all pending idbrequest objects created during this transaction have their idbrequest.error attribute set to aborterror. note: this feature is available in web workers. syntax transaction.abort(); exceptions this method may raise a domexception of the following type: exception description invalidstateerror the transaction has already been committed or aborted. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply abort any activity done ...
IDBTransaction.commit() - Web APIs
on an active transaction. note that commit() doesn't normally have to be called — a transaction will automatically commit when all outstanding requests have been satisfied and no new requests have been made. commit() can be used to start the commit process without waiting for events from outstanding requests to be dispatched. if it is called on a transaction that is not active, it throws an invalidstateerror domexception. note: this feature is available in web workers. syntax transaction.commit(); parameters none. return value void. exceptions exception description invalidstateerror the transaction state is not active. examples // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["mydb"], "readwrite"); ...
IDBTransaction.objectStore() - Web APIs
rs. syntax idbtransaction.objectstore(name); parameters name the name of the requested object store. return value an idbobjectstore object for accessing an object store. exceptions this method may raise a domexception of one of the following types: exception description notfounderror the requested object store is not in this transaction's scope. invalidstateerror the request was made on a source object that has been deleted or removed, or if the transaction has finished. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or ...
ImageCapture - Web APIs
constructor imagecapture() creates a new imagecapture object which can be used to capture still frames (photos) from a given mediastreamtrack which represents a video stream. ...
IntersectionObserver.IntersectionObserver() - Web APIs
sholds are used. the default is a threshold of 0.0. return value a new intersectionobserver which can be used to watch for the visibility of a target element within the specified root crossing through any of the specified visibility thresholds. call its observe() method to begin watching for the visibility changes on a given target. exceptions syntaxerror the specified rootmargin is invalid. rangeerror one or more of the values in threshold is outside the range 0.0 to 1.0. example this example creates a new intersection observer which calls the function myobservercallback every time the visible area of the element being observed changes by at least 10%. let observer = new intersectionobserver(myobservercallback, {threshold: 0.1}); specifications s...
Keyboard.lock() - Web APIs
Web › API › Keyboard › lock
ce returns a promise after enabling the capture of keypresses for any or all of the keys on the physical keyboard. this method can only capture keys that are granted access by the underlying operating system. syntax var promise = keyboard.lock([keycodes[]]) parameters keycodes optional an array of one or more key codes to lock. if no keycodes are provided all keys will be locked. a list of valid code values is found in the ui events keyboardevent code values spec. return value a promise. examples capturing all keys the following example captures all keypresses. navigator.keyboard.lock(); capturing specific keys the following example captures the "w", "a", "s", and "d" keys. it captures these keys regardless of which modifiers are used with the key press. assuming a standard us q...
Keyboard - Web APIs
Web › API › Keyboard
properties none. methods keyboard.getlayoutmap() returns a promise that resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrieving the strings associated with specific physical keys. ...
Key Values - Web APIs
8c) function keys while various platforms support different numbers of the general-purpose function keys, such as f1–f12 (or f1–f10, or f1–f15, etc.), the first few are specifically defined as follows. if more function keys are available, their names continue the pattern here by continuing to increment the numeric portion of each key's name, so that, for example, "f24" is a valid key value. keyboardevent.key value description virtual keycode windows mac linux android "f1" the first general-purpose function key, f1. vk_f1 (0x70) kvk_f1 (0x7a) gdk_key_f1 (0xffbe) gdk_key_kp_f1 (0xff91) qt::key_f1 (0x01000030) keycode_f1 (131) "f2" the f2 key. vk_f2 (0x71) kvk_f2 (0x78) gdk_key_f2 (0xffbf)...
KeyboardLayoutMap.get() - Web APIs
syntax var value = keyboardlayoutmap.get(key) parameters key the key of the item to return from the map. return value the value of the specified key. example the following example demonstrates how to get the location- or layout-specific string associated with the key that corresponds to the 'w' key on an english qwerty keyboard. ...
KeyboardLayoutMap.has() - Web APIs
syntax var aboolean = keyboardlayoutmap.has(key) parameters key the key of an element to search for in the map. return value a boolean indicating whether the specifed key was found. ...
KeyboardLayoutMap - Web APIs
properties keyboardlayoutmap.entries read only returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well). ...
Keyboard API - Web APIs
d map api provides a way to retrieve the string generated by a particular key press, through the keyboard interface and the keyboardlayoutmap interface. the keyboard interface is accessed through navigator.keyboard. keyboard provides the keyboard.getlayoutmap method, which returns a promise that resolves with a keyboardlayoutmap object that contains members for converting codes to keys. a list of valid code values is found in the writing system keys section of the ui events keyboardevent code values spec. the following example demonstrates how to get the location-specific or layout-specific string associated with the key labeled w on an english qwerty keyboard. if (navigator.keyboard) { var keyboard = navigator.keyboard; keyboard.getlayoutmap() .then(keyboardlayoutmap => { var upkey...
LocalFileSystem - Web APIs
allback that is called when the browser provides the file or directory for the supplied url. errorcallback the error callback that is called when errors happen or when the request to obtain the entry object is denied. returns void exceptions this method can raise an fileerror with the following code: exception description encoding_err the syntax of the url was invalid. not_found_err the url was structurally correct, but refers to a resource that does not exist. security_err the application does not have permission to access the file system interface. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/br...
LocalFileSystemSync - Web APIs
directory referred to by a local url. void resolvelocalfilesystemurl( in domstring url ); parameter url the url of a local file in the file system. returns entrysync an object that represents entries in the file system. exceptions this method can raise a fileexception with the following codes: exception description encoding_err the syntax of the url was invalid. not_found_err the url was structurally correct, but refers to a resource that does not exist. security_err the application does not have permission to access the file system interface. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/br...
Location: assign() - Web APIs
Web › API › Location › assign
ed location.assign() by pressing the "back" button. if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown. this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain. if the provided url is not valid, a domexception of the syntax_error type is thrown. syntax location.assign(url); parameters url is a domstring containing the url of the page to navigate to. example // navigate to the location.reload article window.location.assign('/docs/web/api/location/reload'); specifications specification status comment html living standardthe definition of 'location.assi...
Location: replace() - Web APIs
Web › API › Location › replace
t be able to use the back button to navigate to it. if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown. this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain. if the provided url is not valid, a domexception of the syntax_error type is thrown. syntax object.replace(url); parameters url is a domstring containing the url of the page to navigate to. examples // navigate to the location.reload article by replacing this page window.location.replace('/docs/web/api/location.reload'); specifications specification status comment html living standardthe defi...
LockManager.request() - Web APIs
usive" lock). this is known as the readers-writer pattern. in the indexeddb api, this is exposed as "readonly" and "readwrite" transactions which have the same semantics. syntax lockmanager.request(var promise = name[, {options}], callback) parameters name an identifier for the lock you want to request. options optional an object describing characteristics of the lock you want to create. valid values are: mode optional: either "exclusive" or "shared". the default value is "exclusive". ifavailable optional: if true, the lock request will only be granted if it is not already held. if it cannot be granted, the callback will be invoked with null instead of a lock instance. the default value is false. steal optional: if true, then any held locks with the same name will be released, ...
MSCandidateWindowHide - Web APIs
see also microsoft api extensions ime handling guide for gecko ...
MSCandidateWindowShow - Web APIs
ace for the current event. this event fires after the positioning information of the ime candidate window has been determined. you can obtain the positioning information using the getcandidatewindowclientrect method, and adjust your layout as needed to avoid any occlusions with the ime candidate window. web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). 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").msgetinputcontext(); context.addeventlistener("m...
MSCandidateWindowUpdate - Web APIs
, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. tan ime candidate window may be identified as needing to change size for any of the following reasons: as a result of displaying new / changed alternatives or predictions web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). see also microsoft api extensions ime handling guide for gecko ...
MediaCapabilities - Web APIs
he browser about the decoding abilities of the device based on codecs, profile, resolution, and bitrates. the information can be used to serve optimal media streams to the user and determine if playback should be smooth and power efficient. the information is accessed through the mediacapabilities property of the navigator interface. methods mediacapabilities.encodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether encoding such media would be smooth and power efficient. mediacapabilities.decodinginfo() when passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether decoding such media would be smooth and power efficient. ...
MediaDecodingConfiguration - Web APIs
used for a plain file playback. media-source: represents a configuration that is meant to be used for playback of a mediasource. a media configuration — a videoconfiguration or audioconfiguration dictionary. examples //create media configuration to be tested const mediaconfig = { type : 'file', // or 'media-source' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' +...
MediaDevices.getDisplayMedia() - Web APIs
y the media recorder and in terms of the which audio source or sourcoes are supported. check the compatibility table for details for each browser. exceptions rejections of the returned promise are made by passing a domexception error object to the promise's failure handler. possible errors are: aborterror an error or failure that doesn't match any of the other exceptions below occurred. invalidstateerror the call to getdisplaymedia() was not made from code running due to a user action, such as an event handler. another potential cause for this event: the document in whose context getdisplaymedia() was called is not fully active; for example, perhaps it is not the frontmost tab. notallowederror permission to access a screen area was denied by the user, or the current browsing instance...
MediaDevices.getUserMedia() - Web APIs
which can only be used in secure contexts; in insecure contexts, navigator.mediadevices is undefined, preventing access to getusermedia(). a secure context is, in short, a page loaded using https or the file:/// url scheme, or a page loaded from localhost. in addition, user permission is always required to access the user's audio and video inputs. only a window's top-level document context for a valid origin can even request permission to use getusermedia(), unless the top-level context expressly grants permission for a given <iframe> to do so using feature policy. otherwise, the user will never even be asked for permission to use the input devices. for additional details on these requirements and rules, how they are reflected in the context in which your code is running, and about how browse...
MediaEncodingConfiguration - Web APIs
ecorder. transmission — represents a configuration meant to be transmitted over electronic means (e.g. using rtcpeerconnection). a media configuration — a videoconfiguration audioconfiguration dictionary. examples //create media configuration to be tested const mediaconfig = { type : 'record', // or 'transmission' video : { contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; // check support and performance navigator.mediacapabilities.encodinginfo(mediaconfig).then(result => { console.log('this configuration is ' +...
MediaKeySession.closed - Web APIs
the mediakeysession.closed read-only property returns a promise signaling when a mediakeysession closes. this promise can only be fulfilled and is never rejected. closing a session means that licenses and keys associated with it are no longer valid for decrypting media data. syntax var promise = mediakeysessionobj.closed; value a promise. specifications specification status comment encrypted media extensionsthe definition of 'closed' in that specification. recommendation initial definition ...
MediaKeySession - Web APIs
the mediakeysession interface of the encryptedmediaextensions api represents a context for message exchange with a content decryption module (cdm). properties mediakeysession.closed read only returns a promise signaling when a mediakeysession closes. this promise can only be fulfilled and is never rejected. closing a session means that licenses and keys associated with it are no longer valid for decrypting media data. mediakeysession.expiration read only the time after which the keys in the current session can no longer be used to decrypt media data, or nan if no such time exists. this value is determined by the cdm and measured in milliseconds since january 1, 1970, utc. this value may change during a session lifetime, such as when an action triggers the start of a window. mediak...
MediaRecorder.pause() - Web APIs
the media.pause() method (part of the mediarecorder api) is used to pause recording of media streams. when a mediarecorder object’s pause()method is called, the browser queues a task that runs the below steps: if mediarecorder.state is "inactive", raise a dom invalidstate error and terminate these steps. if not, continue to the next step. set mediarecorder.state to "paused". stop gathering data into the current blob, but keep it available so that recording can be resumed later on. raise a pause event. syntax mediarecorder.pause() return value undefined. exceptions invalidstateerror the mediarecorder is currently "inactive"; you can't pause recording if it's not active. if you call pause() while already paused, it silently does nothing. example ... pause.onclick = functi...
MediaRecorder.start() - Web APIs
ata() method is called to obtain the blob and trigger the creation of a new blob into which the media continues to be recorded. return value undefined. exceptions errors that can be detected immediately are thrown as dom exceptions. all other errors are reported through error events sent to the mediarecorder object. you can implement the onerror event handler to respond to these errors. invalidmodificationerror the number of tracks on the stream being recorded has changed. you can't add or remove tracks while recording media. invalidstateerror the mediarecorder is not in the inactive state; you can't start recording media if it's already being recorded. see the state property. notsupportederror the media stream you're attempting to record is inactive, or one or more of the stream's...
MediaRecorder.stop() - Web APIs
the mediarecorder.stop() method (part of the mediarecorder api) is used to stop media capture. when the stop() method is invoked, the ua queues a task that runs the following steps: if mediarecorder.state is "inactive", raise a dom invalidstate error and terminate these steps. if the mediarecorder.state is not "inactive", continue on to the next step. set the mediarecorder.state to "inactive" and stop capturing media. raise a dataavailable event containing the blob of data that has been gathered. raise a stop event. syntax mediarecorder.stop() errors an invalidstate error is raised if the stop() method is called while the mediarecorder object’s mediarecorder.state is "inactive" — it makes no sense to stop media capture if it is already stopped. example ... stop.onclick = ...
MediaRecorderErrorEvent.error - Web APIs
e a domexception describing the error represented by the event. the error's name property's value may be any exception that makes sense during the handling of media recording, including these specifically identified by the specification. the descriptions here are generic ones; you'll find more specific ones to various scenarios in which they may occur in the corresponding method references. invalidstateerror an operation was attempted in a context in which it isn't allowed, or a request has been made on an object that's deleted or removed. notsupportederror a mediarecorder couldn't be created because the specified options weren't valid. the message atttribute should provide additional information, if it exists. securityerror the mediastream is configured to disallow recording. this may...
MediaSession - Web APIs
creen that provides controls for media. a browser on that device might deliver the metadata provided by calling mediasession to the device in order to be controllable using the global user interface. properties metadata returns an instance of mediametadata which contains rich media metadata, for display in a platform ui. playbackstate indicates whether the current media session is playing. valid values are none, paused, or playing. methods setactionhandler() sets an event handler for a media session action, such as play or pause. see the method page for a full list. setpositionstate() sets the current playback position and speed of the media currently being presented. examples the following example creates a new media session and assigns action handlers to it: if ('mediasessi...
MediaSource.addSourceBuffer() - Web APIs
iasource's sourcebuffers list. the new sourcebuffer is also returned. syntax var sourcebuffer = mediasource.addsourcebuffer(mimetype); parameters mimetype a domstring specifying the mime type of the sourcebuffer to create and add to the mediasource. return value a sourcebuffer object representing the new source buffer that has been created and added to the media source. exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type. invalidstateerror the mediasource is not in the "open" readystate. notsupportederror the specified mimetype isn't supported by the user agent, or is not compatible with the mime types of other sourcebuffer objects that are already included in the media source's sourcebuffers list. quotaexceedederro...
MediaSource.duration - Web APIs
duration property of the mediasource interface gets and sets the duration of the current media being presented. syntax mediasource.duration = 5.5; // 5.5 seconds var myduration = mediasource.duration; value a double. a value in seconds is expected. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set a duration value that was negative, or nan. invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is true.) example the following snippet is based on a simple example written by nick desaulniers (...
MediaSource.endOfStream() - Web APIs
rk is back up (via some kind of polling.) decode: terminates playback and signals that a decoding error has occured. this can be used to indicate that a parsing error has occured while fetching media data; maybe the data is corrupt, or is encoded using a codec that the browser doesn't know how to decode. return value undefined exceptions exception explanation invalidstateerror mediasource.readystate is not equal to open, or one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is true.) example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp...
MediaStreamAudioSourceNode() - Web APIs
th. options a mediastreamaudiosourceoptions object defining the properties you want the mediastreamaudiosourcenode to have: mediastream a required property which specifies the mediastream from which to obtain audio for the node. return value a new mediastreamaudiosourcenode object representing the audio node whose media is obtained from the specified source stream. exceptions invalidstateerror the specified mediastream doesn't have any audio tracks. examples this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from its mediastream. // define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // getusermedia block - grab stream // put it into a mediastreamaudiosourcenode if (...
MediaStreamAudioSourceNode - Web APIs
rcenode() creates a new mediastreamaudiosourcenode object instance with the specified options. properties in addition to the following properties, mediastreamaudiosourcenode inherits the properties of its parent, audionode. mediastream read only the mediastream used when constructing this mediastreamaudiosourcenode. methods inherits methods from its parent, audionode. exceptions invalidstateerror the stream specified by the mediastream parameter does not contain any audio tracks. usage notes typically, you should probably not use this type of node. it has been replaced with the more predictable mediastreamtrackaudiosourcenode, which has better-defined rules for how it chooses the track to output. if you do chooose to use mediastreamaudiosourcenode, you should keep the follo...
MediaStreamTrackAudioSourceNode() - Web APIs
ng the properties you want the mediastreamtrackaudiosourcenode to have: mediastreamtrack the mediastreamtrack from which to take audio data for this node's output. return value a new mediastreamtrackaudiosourcenode object representing the audio node whose media is obtained from the specified media track. exceptions notsupportederror the specified context is not an audiocontext. invalidstateerror the specified mediastreamtrack isn't an audio track (that is, its kind property isn't audio. example this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from the first audio track provided by the device. let audioctx = new (window.audiocontext || window.webkitaudiocontext)(); if (navigator.mediadevices.getusermedia)...
MediaStream Image Capture API - Web APIs
ure() constructor. though a mediastream holds several types of tracks and provides multiple methods for retrieving them, the imagecapture constructor will throw a domexception of type notsupportederror if mediastreamtrack.kind is not "video". let imagecapture = new imagecapture(track); interfaces imagecapture an interface for capturing images from a photographic device referenced through a valid mediastreamtrack. photocapabilities provides available configuration options for an attached photographic device. retrieve a photocapabilities object by calling imagecapture.getphotocapabilities(). specifications specification status comment mediastream image capture working draft initial definition. ...
MediaTrackSettings.deviceId - Web APIs
). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var deviceid = mediatracksettings.deviceid; value a domstring whose value is an origin-unique identifier for the track's source. this id is valid across multiple browsing sessions for the same origin and is guaranteed to be different for all other origins, so you can safely use it to request the same source be used for multiple sessions, for example. the actual value of the string, however, is determined by the source of the track, and there is no guarantee what form it will take, although the specification does recommend it be a guid. s...
Transcoding assets for Media Source Extensions - Web APIs
e (video) video_01625.mp4 splitting media file (video) video_02000.mp4 $ tree -l 2 output output ├── audio │ └── und ├── stream.mpd └── video ├── 1 ├── 2 ├── 3 ├── 4 └── 5 8 directories, 1 file note: mp4-dash-encode.py does not display ffmpeg error messages. you can see it by specifying the -d option. note: if "invalid duration specification for force_key_frames: 'expr:eq(mod(n" is displayed as an error message, modify mp4-dash-encode.py and remove two "'" from "-force_key_frames 'expr:eq(mod(n,%d),0)'". summary with your video properly encoded and adaptive bitrate media generated, you're now ready to begin adaptive bitrate streaming on the web using dash and mse. ...
Microdata DOM API - Web APIs
in with the same argument, the user agent may return the same object as the object returned by the earlier call. in other cases, a new nodelist object must be returned. properties element . itemvalue [ = value ] returns the element's value. can be set, to change the element's value. setting the value when the element has no itemprop attribute or when the element's value is an item throws an invalidaccesserror exception. element . properties if the element has an itemscope attribute, returns an htmlpropertiescollection object with all the element's properties. otherwise, an empty htmlpropertiescollection object. code example this sample shows how the getitems() method can be used to obtain a list of all the top-level microdata items of a particular type given in the document: var cats =...
MimeType - Web APIs
Web › API › MimeType
the mimetype interface provides contains information about a mime type associated with a particular plugin. navigatorplugins.mimetypes returns an array of this object. properties mimetype.type returns the mime type of the associated plugin. mimetype.description returns a description of the associated plugin or an empty string if there is none. mimetype.suffixes a string containing valid file extensions for the data displayed by the plugin, or an empty string if an extension is not valid for the particular module. for example, a browser's content decryption module may appear in the plugin list but support more file extensions than can be anticipated. it might therefore return an empty string. mimetype.enabledplugin returns an instance of plugin containing information about the plug...
Navigator.registerProtocolHandler() - Web APIs
ved from the spec due to spoofing concerns, but all current browsers still require it. it is recommended to always set the title, since browsers that support the updated spec most likely will be backwards-compatible and still accept the title (but not use it). exceptions securityerror the user agent blocked the registration. this might happen if: the registered scheme (protocol) is invalid, such as a scheme the browser handles itself (https:, about:, etc.) the handler url’s origin does not match the origin of the page calling this api. the browser requires that this function is called from a secure context. the browser requires that the handler's url be over https. syntaxerror the %s placeholder is missing from the handler url. permitted schemes for security reasons, r...
Navigator.vibrate() - Web APIs
Web › API › Navigator › vibrate
the navigator.vibrate() method pulses the vibration hardware on the device, if such hardware exists. if the device doesn't support vibration, this method has no effect. if a vibration pattern is already in progress when this method is called, the previous pattern is halted and the new one begins instead. if the method was unable to vibrate because of invalid parameters, it will return false, else it returns true. if the pattern leads to a too long vibration, it is truncated: the max length depends on the implementation. syntax var successbool = window.navigator.vibrate(pattern); pattern provides a pattern of vibration and pause intervals. each value indicates a number of milliseconds to vibrate or pause, in alternation. you may provide either a single value (to vibrate once for that ma...
NavigatorLanguage.language - Web APIs
note that in safari on ios prior to 10.2, the country code returned is lowercase: "en-us", "fr-fr" etc. ...
Node.namespaceURI - Web APIs
Web › API › Node › namespaceURI
reate an element with the specified namespaceuri using the dom level 2 method document.createelementns and attributes with the method element.setattributens. per the namespaces in xml specification, an attribute does not inherit its namespace from the element it is attached to. if an attribute is not explicitly given a namespace, it has no namespace. the dom does not handle or enforce namespace validation per se. it is up to the dom application to do any validation necessary. note too that the namespace prefix, once it is associated with a particular node, cannot be changed. specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.namespaceuri' in that specification. obsolete specifies the beh...
NodeIterator.nextNode() - Web APIs
the nodeiterator.nextnode() method returns the next node in the set represented by the nodeiterator and advances the position of the iterator within the set. the first call to nextnode() returns the first node in the set. this method returns null when there are no nodes left in the set. in old browsers, as specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method. recent browsers never throw. syntax node = nodeiterator.nextnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false // this optional argument is not used any more ); currentnode =...
NodeIterator.previousNode() - Web APIs
the nodeiterator.previousnode() method returns the previous node in the set represented by the nodeiterator and moves the position of the iterator backwards within the set. this method returns null when the current node is the first node in the set. in old browsers, as specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method. recent browsers never throw. syntax node = nodeiterator.previousnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false // this optional argument is not used any more ); currentnode = nodeiterator.nextnode(); // return...
Notification.close() - Web APIs
vailable in web workers. the close() method of the notification interface is used to close/remove a previously displayed notification. note: this api shouldn't be used just to have the notification removed from the screen after a fixed delay since this method will also remove the notification from any notification tray, preventing users from interacting with it after it was initially shown. a valid use for this api would be to remove a notification that is no longer relevant (e.g. the user already read the notification on the webpage in the case of a messaging app or the following song is already playing in a music app). syntax notification.close(); parameters none. returns void. examples in the following snippet, we have a simple function that when called creates an options object...
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
data storage. texture a webgltexture object whose image to attach. level a glint specifying the mipmap level of the texture image to be attached. must be 0. baseviewindex a glint specifying the base view index of the framebuffer object attachment. numviews a glsizei specifying the number of views of the framebuffer object attachment. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer. attachment is not one of the accepted attachment points. a gl.invalid_value error is thrown if level is not 0. if numviews is less than one or more than max_views_ovr. a gl.invalid_operation error is thrown if texture isn't 0 or the name of an existing texture object. examples ext.framebuffertexturemultiviewo...
OfflineAudioContext.resume() - Web APIs
the resume() method of the offlineaudiocontext interface resumes the progression of time in an audio context that has been suspended. the promise resolves immediately because the offlineaudiocontext does not require the audio hardware. if the context is not currently suspended or the rendering has not started, the promise is rejected with invalidstateerror. syntax offlineaudiocontext.resume().then(function() { ... }); parameters none. returns a promise resolving to void. exceptions the promise is rejected when the following exception is encountered. invalidstateerror if the context is not currently suspended or the rendering has not started. specifications specification status comment web audio apithe definition of 'resume()' in that specification. wo...
OfflineAudioContext.suspend() - Web APIs
nds at the same quantized frame. also scheduling should be done while the context is not running to ensure the precise suspension. syntax offlineaudiocontext.suspend(suspendtime).then(function() { ... }); parameters suspendtime a double specifying the suspend time, in seconds. returns a promise resolving to void. exceptions the promise is rejected when any exception is encountered. invalidstateerror if the quantized frame number is one of the following: a negative number is less than or equal to the current time is greater than or equal to the total render duration is scheduled by another suspend for the same time specifications specification status comment web audio apithe definition of 'suspend()' in that specification. working draft initial...
OscillatorNode.OscillatorNode() - Web APIs
oscillatornode(context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. options optional an object whose properties specify the initial values for the oscillator node's properties. any properties omitted from the object will take on the default value as documented. type the shape of the wave produced by the node. valid values are 'sine', 'square', 'sawtooth', 'triangle' and 'custom'. the default is 'sine'. detune a detuning value (in cents) which will offset the frequency by the given amount. its default is 0. frequency the frequency (in hertz) of the periodic waveform. its default is 440. periodicwave an arbitrary period waveform described by a periodicwave object. return value a new oscilla...
OscillatorNode.type - Web APIs
he default value. square a square wave with a duty cycle of 0.5; that is, the signal is "high" for half of each period. sawtooth a sawtooth wave. triangle a triangle wave. custom a custom waveform. you never set type to custom manually; instead, use the setperiodicwave() method to provide the data representing the waveform. doing so automatically sets the type to custom. exceptions invalidstateerror the value custom was specified. to set a custom waveform, just call setperiodicwave(). doing so automatically sets the type for you. example the following example shows basic usage of an audiocontext to create an oscillator node. for an applied example, check out our violent theremin demo (see app.js for relevant code). // create web audio api context var audioctx = new (window.aud...
PannerNode.PannerNode() - Web APIs
angle you want the pannernode to have (the default is 360.) coneoutergain: the pannernode.coneoutergain you want the pannernode to have. the default is 0, and its value can be in the range 0–1. return value a new pannernode object instance. exceptions rangeerror the refdistance, maxdistance, or rollofffactor properties have been given a value that is outside the accepted range. invalidstateerror the coneoutergain property has been given a value outside the accepted range (0–1). example var ctx = new audiocontext(); var options = { positionx : 1, maxdistance: 5000 } var mypanner = new pannernode(ctx, options); specifications specification status comment web audio apithe definition of 'pannernode()' in that specification. working draft ...
PannerNode.coneOuterGain - Web APIs
ing the amount of volume reduction outside the cone, defined by the coneouterangle attribute. the coneoutergain property's default value is 0, meaning that no sound can be heard outside the cone. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.coneoutergain = 0; value a double. the default is 0, and its value can be in the range 0–1. exceptions invalidstateerror the property has been given a value outside the accepted range (0–1). example in this example, we'll demonstrate how changing the orientation parameters of a pannernode in combination with coneinnerangle and coneouterangle affects volume. to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to ...
PaymentAddress - Web APIs
es by country or location and can include, for example, a street name, house number, apartment number, rural delivery route, descriptive instructions, or post office box number. paymentaddress.country read only a domstring specifying the country in which the address is located, using the iso-3166-1 alpha-2 standard. the string is always given in its canonical upper-case form. some examples of valid country values: "us", "gb", "cn", or "jp". paymentaddress.city read only a domstring which contains the city or town portion of the address. paymentaddress.dependentlocality read only a domstring giving the dependent locality or sublocality within a city, for example, a neighborhood, borough, district, or uk dependent locality. paymentaddress.organization read only a domstring specifying...
PaymentCurrencyAmount - Web APIs
describes an amount of money in terms of both a number of units and the currency (us dollars, euro, yen, etc.), and is part of the payment request api. this is used to specify the prices of both line items on a payment, using paymentitem objects, and to provide the cost of a shipping option, using paymentshippingoption. properties all properties are required. currency a string containing a valid 3-letter iso 4217 currency identifier (iso 4217) indicating the currency used for the payment value. value a string containing a valid decimal value representing the mount of currency constituting the payment amount. this string must only contain an optional leading "-" to indicate a negative value, then one or more digits from 0 to 9, and an optional decimal point (".", regardless of locale) f...
PaymentDetailsUpdate.error - Web APIs
the paymentdetailsupdate dictionary's error property is a human-readable domstring which provides an error message to be displayed if the specified information doesn't offer any valid shipping options. syntax errorstring = paymentdetailsupdate.error; paymentdetailsupdate.error = errorstring; value a domstring specifying the string to display to the user if the information specified in the paymentdetailsupdate doesn't provide any valid shipping options. this happens if both of the following are true: the paymentrequest specifies using its requestshipping property that shipping information is required. the paymentdetailsupdate object specifies no valid shipping options in its shippingoptions list. this message can be used to explain to the user why they cannot submit their payment ...
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
r one or more of the values in the paymentaddress specified as paymentrequest.shippingaddress. syntax var addresserrors = paymentdetailsupdate.shippingaddresserrors; value an addresserrors object, which contains domstrings describing errors in the properties of a paymentaddress. for each property in paymentaddress, a property by the same name is found in shippingaddresserrors if and only if a validation error occurred for that property. in that case, the property in shippingaddresserrors is a string describing the validation error, ideally including suggestions about fixing the error. specifications specification status comment payment request apithe definition of 'paymentdetailsupdate.shippingaddresserrors' in that specification. candidate recommendation ini...
PaymentDetailsUpdate - Web APIs
rs optional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers. for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!"). shippingaddresserrors optional an addresserrors object which includes an error message for each property of the shipping address that could not be validated. shippingoptions optional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose. total optional a paymentitem providing an updated total for the payment. make sure this equals the sum of all of the items in displayitems. this is not calculated automatically. you must update this value yourself anytime the total amount due c...
PaymentMethodChangeEvent - Web APIs
tion available or required. this is null by default. return value a newly-created paymentmethodchangeevent object describing a change to the options specified for the payment method given in the methodname property. the type of the methoddetails property depends on the payment method. for example, if methodname is basic-card, indicating that the basic card payment method is being used for validation, the methoddetails field must be a basiccardchangedetails object. specifications specification status comment payment request apithe definition of 'paymentmethodchangeevent()' in that specification. candidate recommendation initial definition. ...
PaymentRequest: paymentmethodchange event - Web APIs
o service the apple pay request, and compute and return an paymentdetailsupdate object that specifies changes to be applied to the paymentrequest in order to add any service fees that the payment method might require. before the event handler returns, it calls the event's paymentmethodchangeevent.updatewith.updatewith() method to integrate the changes into the request. related events merchantvalidation, shippingaddresschange, shippingoptionchange, and payerdetailchange specifications specification status comment payment request apithe definition of 'paymentmethodchange' in that specification. candidate recommendation ...
PaymentRequest: shippingaddresschange event - Web APIs
ed for privacy reasons. that is, the paymentaddress which contains the shipping address may have some portions of its content altered, obscured, or left out entirely in order to prevent identifying the user without their consent (since if they choose to have you ship products to them, you'll need their address). example in this example, a handler for the shippingaddresschange event is set up to validate that the address meets requirements set by the web application. const paymentrequest = new paymentrequest(methoddata, details, options); paymentrequest.addeventlistener("shippingaddresschange", event => { let detailsupdate = checkaddress(paymentrequest.shippingaddress); event.updatewith(detailsupate); }, false); const checkaddress = theaddress => { let detailsupdate = {}; // check ...
PaymentRequest - Web APIs
anmakepayment() secure context indicates whether the paymentrequest object can make a payment before calling show(). paymentrequest.show() secure context causes the user agent to begin the user interaction for the payment request. paymentrequest.abort() secure context causes the user agent to end the payment request and to remove any user interface that might be shown. events merchantvalidation secure context with some payment handlers (e.g., apple pay), this event handler is called to handle the merchantvalidation event, which is dispatched when the user agent requires that the merchant validate that the merchant or vendor requesting payment is legitimate. also available using the onmerchantvalidation event handler property. paymentmethodchange secure context with some payment...
PaymentRequestUpdateEvent.updateWith() - Web APIs
rs optional an array of paymentdetailsmodifier objects, each describing a modifier for particular payment method identifiers. for example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!"). shippingaddresserrors optional an addresserrors object which includes an error message for each property of the shipping address that could not be validated. shippingoptions optional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose. total optional a paymentitem providing an updated total for the payment. make sure this equals the sum of all of the items in displayitems. this is not calculated automatically. you must update this value yourself anytime the total amount due c...
PaymentResponse.complete() - Web APIs
browser compatibility section below for details. return value a promise which resolves with no input value once the payment interface has been fully closed. if an error occurs, the promise instead rejects, returning one of the exceptions listed below. exceptions aborterror the document in which the payment request is taking place became inactive while the user interface was shown. invalidstateerror the payment has already completed, or complete() was called while a request to retry the payment is pending. you can't treat a payment as complete after requesting that the payment be tried again. examples the following example sends payment information to a secure server using the fetch api. it calls complete() with an answer appropriate to the status in the response. // initializ...
PaymentResponse.methodName - Web APIs
s string may be either one of the standardized payment method identifiers or a url used by the payment handler to process payments. syntax var methodname = paymentresponse.methodname; value a domstring uniquely identifying the payment handler being used to process the payment. this may be either a standardized identifier, or a url used by the payment processor to handle payments. see merchant validation in payment processing concepts for more information. example the following example extracts the method name from the paymentresponse object to the promise returned from paymentrequest.show(). in a real-world implementation this data would then be sent to a payment server. payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentrespons...
PaymentResponse - Web APIs
ly be called after the promise returned by the paymentrequest.show() method. events listen to this event using addeventlistener() or by assigning an event listener to the oneventname property of this interface. payerdetailchange secure context fired during a retry when the user makes changes to their personal information while filling out a payment request form. allows the developer to revalidate any requested user data (e.g., the phone number or the email address) if it changes. also available via the onpayerdetailchange property. specifications specification status comment payment request apithe definition of 'paymentresponse' in that specification. candidate recommendation initial definition. ...
performance.getEntriesByName() - Web APIs
type. the list's members (entries) can be created by making performance marks or measures (for example by calling the mark() method) at explicit points in time. note: this feature is available in web workers. syntax entries = window.performance.getentriesbyname(name, type); arguments name the name of the entry to retrieve. type optional the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value entries a list of performanceentry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list is returned...
performance.getEntriesByType() - Web APIs
d returns a list of performanceentry objects for a given type. the list's members (entries) can be created by making performance marks or measures (for example by calling the mark() method) at explicit points in time. note: this feature is available in web workers. syntax entries = window.performance.getentriesbytype(type); arguments type the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value entries a list of performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function useperformanceentrymethods() { log("performanceentry tests .
PerformanceEntry - Web APIs
performancemark performancemeasure performanceframetiming performancenavigationtiming performanceresourcetiming performancepainttiming note: this feature is available in web workers. properties performanceentry.name read only a value that further specifies the value returned by the performanceentry.entrytype property. the value of both depends on the subtype. see property page for valid values. performanceentry.entrytype read only a domstring representing the type of performance metric such as, for example, "mark". see property page for valid values. performanceentry.starttime read only a domhighrestimestamp representing the starting time for the performance metric. performanceentry.duration read only a domhighrestimestamp representing the time value of the duration of ...
PerformanceObserver.observe() - Web APIs
not be used together with the "type" or "buffered" options. type: a single domstring specifying exactly one performance entry type to observe. may not be used together with the entrytypes option. buffered: a boolean flag to indicate whether buffered entries should be queued into the observer's buffer. must be used only with the "type" option. see performanceentry.entrytype for a list of valid performance entry type names. unrecognized types are ignored, though the browser may output a warning message to the console to help developers debug their code. if no valid types are found, observe() has no effect. examples this example creates and configures two performanceobservers; one watches for "mark" and "frame" events, and the other watches for "measure" events. var observer = new ...
PerformanceObserverEntryList.getEntries() - Web APIs
l syntax: entries = list.getentries(); entries = list.getentries(performanceentryfilteroptions); specific usage: entries = list.getentries({name: "entry_name", entrytype: "mark"}); parameters performanceentryfilteroptionsoptional is a performanceentryfilteroptions dictionary, having the following fields: "name", the name of a performance entry. "entrytype", the entry type. the valid entry types are listed in the performanceentry.entrytype method. "initiatortype", the type of the initiating resource (for example an html element). the values are defined by the performanceresourcetiming.initiatortype interface. this parameter is currently not supported on chrome or opera. return value a list of explicitly observed performanceentry objects that meets the criteria of the ...
PerformanceObserverEntryList.getEntriesByName() - Web APIs
serve() method. the list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve. type optional a domstring representing the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performance entry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty list i...
PerformanceObserverEntryList.getEntriesByType() - Web APIs
ce entry type. the list's members are determined by the set of entry types specified in the call to the observe() method. the list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbytype(type); parameters type the type of entry to retrieve such as "frame". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty list is returned. example function print_perf_entry(pe) { console.log("name: " + pe...
Permissions.revoke() - Web APIs
is called on the global permissions object navigator.permissions. var revokepromise = navigator.permissions.revoke(descriptor); parameters descriptor an object based on the permissiondescriptor dictionary that sets options for the operation consisting of a comma-separated list of name-value pairs. the available options are: name: the name of the api whose permissions you want to query. valid values are 'geolocation', 'midi', 'notifications', and 'push'. uservisibleonly: (push only, not supported in firefox — see the browser compatibility section below) indicates whether you want to show a notification for every message or be able to send silent push notifications. the default is false. sysex: (midi only) indicates whether you need and/or receive system exclusive messages. the d...
Pointer Lock API - Web APIs
e is not moving. the movementx and movementy properties continue to provide the mouse's change in position. there is no limit to movementx and movementy values if the mouse is continuously moving in a single direction. the concept of the mouse cursor does not exist and the cursor cannot move off the window or be clamped by a screen edge. unlocked state the parameters movementx and movementy are valid regardless of the mouse lock state, and are available even when unlocked for convenience. when the mouse is unlocked, the system cursor can exit and re-enter the browser window. if that happens, movementx and movementy could be set to zero. simple example walkthrough we've written a simple pointer lock demo to show you how to use it to set up a simple control system (see source code). the demo...
Push API - Web APIs
Web › API › Push API
nd accessing push permission status. this is the entry point into using push messaging. serviceworkerglobalscope.onpush an event handler fired whenever a push event occurs; that is, whenever a server push message is received. serviceworkerglobalscope.onpushsubscriptionchange an event handler fired whenever a pushsubscriptionchange event occurs; for example, when a push subscription has been invalidated, or is about to be invalidated (e.g. when a push service sets an expiration time.) examples mozilla's serviceworker cookbook contains many useful push examples. specifications specification status comment push api working draft initial definition ...
RTCDTMFSender.insertDTMF() - Web APIs
conds, that each dtmf tone should last. this value must be between 40 ms and 6000 ms (6 seconds), inclusive. the default is 100 ms. intertonegap optional the length of time, in milliseconds, to wait between tones. the browser will enforce a minimum value of 30 ms (that is, if you specify a lower value, 30 ms will be used instead); the default is 70 ms. return value undefined exceptions invalidstateerror the dtmf tones couldn't be sent because the track has been stopped, or is in a read-only or inactive state. invalidcharactererror one or more of the characters in tones is not valid dtmf. example tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdtmfsender.insertdtmf()' in that specif...
RTCDTMFSender.toneBuffer - Web APIs
ted to upper-case. the pound/hash sign ("#") and the asterisk ("*") these correspond to the similarly-labeled keys which are typically on the bottom row of the telephone keypad. the comma (",") this character instructs the dialing process to pause for two seconds before sending the next character in the buffer. all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exception. using tone buffer strings for example, if you're writing code to control a voicemail system by sending dtmf codes, you might use a string such as "*,1,5555". in this example, we would send "*" to request access to the vm system, then, after a pause, send a "1" to start playback of voicemail messages, then after a pause, dial "5555" as a pin number to open the messages.
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
ted to upper-case. the pound/hash sign ("#") and the asterisk ("*") these correspond to the similarly-labeled keys which are typically on the bottom row of the telephone keypad. the comma (",") this character instructs the dialing process to pause for two seconds before sending the next character in the buffer. all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exception. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdtmftonechangeevent()' in that specification. candidate recommendation initial definition. ...
RTCDataChannel.send() - Web APIs
various additional restrictions. this will get less complicated over time, but for now, if you have questions, see understanding message size limits in using webrtc data channels. syntax rtcdatachannel.send(data); parameters data the data to transmit across the connection. this may be a usvstring, a blob, an arraybuffer, or an arraybufferview. return value undefined. exceptions invalidstateerror since the data channel uses a separate transport channel from the media content, it must establish its own connection; if it hasn't finished doing so (that is, its readystate is "connecting"), this error occurs without sending or buffering the data. networkerror the specified data would need to be buffered, and there isn't room for it in the buffer. in this scenario, the underlying t...
RTCDtlsTransport.state - Web APIs
nnection and verifying the remote fingerprint. connected dtls has completed negotiation of a secure connection and verified the remote fingerprint. closed the transport has been closed intentionally as the result of receipt of a close_notify alert, or calling rtcpeerconnection.close(). failed the transport has failed as the result of an error (such as receipt of an error alert or failure to validate the remote fingerprint). examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnection's rtcrtpsenders, tallying up how many of them are in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. let pc = new rtcpeerconnection({ bundlepolicy: "max-bundle" }); /* ... */ func...
RTCError - Web APIs
Web › API › RTCError
erty. properties in addition to the properties defined by the parent interface, domexception, rtcerror includes the following properties: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred. receivedalert read only an unsigned long integer value indicating the fatal dtls error which was received from the network. only valid if the errordetail string is dtls-failure. if null, no dtls error was received. sctpcausecode read only if errordetail is sctp-failure, this property is a long integer specifying the sctp cause code indicating the cause of the failed sctp negotiation. null if the error isn't an sctp error. sdplinenumber read only if errordetail is sdp-syntax-error, this property is a long integer identifyin...
RTCErrorEvent.error - Web APIs
f a webrtc operation. since rtcerror is based upon domexception, it includes those properties. additional properties defined by rtcerror are: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred. receivedalert read only an unsigned long integer value indicating the fatal dtls error which was received from the network. only valid if the errordetail string is dtls-failure. if null, no dtls error was received. sctpcausecode read only if errordetail is sctp-failure, this property is a long integer specifying the sctp cause code indicating the cause of the failed sctp negotiation. null if the error isn't an sctp error. sdplinenumber read only if errordetail is sdp-syntax-error, this property is a long integer identifyin...
RTCIceCandidatePairStats.readable - Web APIs
the obsolete rtcicecandidatepairstats property readable reports whether or not the connection described by the candidate pair has received at least one valid incoming ice request. syntax isreadable = rtcicecandidatepairstats.readable; value a boolean value which is true if the connection described by this candidate pair has received at least one valid ice request, and is therefore ready to be read from. note: this property was removed from the specification in early 2017 because you can determine whether or not the connection is readable by checking to see if requestsreceived is greater than 0: if (icpstats.requestsreceived > 0) { /* at least one ice request has been received */ } ...
RTCIceCandidatePairStats - Web APIs
cp connection: source ip address, source port number, destination ip address, destination port number, and protocol). the circuit breaker is triggered whenever a connection times out or otherwise needs to be automatically aborted. consentexpiredtimestamp optional a domhighrestimestamp value indicating the time at which the most recent stun binding response expired. this value is undefined if no valid stun binding responses have been sent on the candidate pair; this can only happen if responsesreceived is 0. consentrequestssent optional the total number of consent requests that have been sent on this candidate pair. currentroundtriptime optional a floating-point value indicating the total time, in seconds, that elapsed elapsed between the most recently-sent stun request and the response be...
RTCIceCandidateStats - Web APIs
sent for local candidates. port optional the network port number used by the candidate. priority optional the candidate's priority, corresponding to rtcicecandidate.priority. protocol optional a string specifying the protocol (tcp or udp) used to transmit data on the port. relayprotocol optional a string identifying the protocol used by the endpoint for communicating with the turn server; valid values are tcp, udp, and tls. only present for local candidates. transportid optional a string uniquely identifiying the transport object that was inspected in order to obtain the rtctransportstats associated with the candidate correspondin to these statistics. url optional for local candidates, the url property is the url of the ice server from which the candidate was received. this url matc...
RTCIceTransport.state - Web APIs
broken the connection, but that should resolve itself automatically without your code having to take any action. see the disconnected state for additional details. "failed" the rtcicetransport has finished the gathering process, has received the "no more candidates" notification from the remote peer, and has finished checking pairs of candidates, without successfully finding a pair that is both valid and for which consent can be obtained. this is a terminal state, indicating that the connection cannot be achieved or maintained. "closed" the transport has shut down and is no longer responding to stun requests. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetransportstate' in that specificatio...
RTCIceTransport: statechange event - Web APIs
bubbles no cancelable no interface event event handler property rtcicetransport.onstatechange examples given an rtcpeerconnection, pc, the following code creates an event handler that calls a function named handlefailure() if the ice transport enters a failure state. ...
RTCIdentityErrorEvent - Web APIs
firefox implements this interface under the following name: rtcpeerconnectionidentityerrorevent. it is likely that it will correct this name when it will unprefix rtcpeerconnection, once spec and implementation will have been stabilized. properties a rtcidentityerrorevent being an event, this event also implements these properties. ...
RTCOutboundRtpStreamStats.framesEncoded - Web APIs
the framesencoded property of the rtcoutboundrtpstreamstats dictionary indicates the total number of frames that have been encoded by this rtcrtpsender for this media source. syntax var framesencoded = rtcoutboundrtpstreamstats.framesencoded; value an integer value indicating the total number of video frames that this sender has encoded so far for this stream. note: this property is only valid for video streams. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcoutboundrtpstreamstats.framesencoded' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.addStream() - Web APIs
if the signalingstate is set to stable, the event negotiationneeded is sent on the rtcpeerconnection to indicate that ice negotiation must be repeated to consider the new stream. ...
RTCPeerConnection.addTrack() - Web APIs
the same stream on the remote end. return value the rtcrtpsender object which will be used to transmit the media data. note: every rtcrtpsender is paired with an rtcrtpreceiver to make up an rtcrtptransceiver. the associated receiver is muted (indicating that it is not able to deliver packets) until and unless one or more streams are added to the receiver by the remote peer. exceptions invalidaccesserror the specified track (or all of its underlying streams) is already part of the rtcpeerconnection. invalidstateerror the rtcpeerconnection is closed. usage notes adding tracks to multiple streams after the track parameter, you can optionally specify one or more mediastream objects to add the track to. only tracks are sent from one peer to another, not streams. since streams are sp...
RTCPeerConnection.addTransceiver() - Web APIs
to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. streams optional a list of mediastream objects to add to the transceiver'srtcrtpreceiver; when the remote peer's rtcpeerconnection's track event occurs, these are the streams that will be specified by that event. exceptions typeerror a string was specified as trackorkind which is not valid. the string must be either "audio" or "video". specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.addtransceiver()' in that specification. candidate recommendation ...
RTCPeerConnection.createDataChannel() - Web APIs
d for you. the options which can be configured using the rtcdatachannelinit dictionary represent the script-settable subset of the properties on the rtcdatachannel interface. return value a new rtcdatachannel object with the specified label, configured using the options specified by options if that parameter is included; otherwise, the defaults listed above are established. exceptions invalidstateerror the rtcpeerconnection is closed. typeerror this can happen in a couple of situations: the label and/or protocol string is too long; these cannot be longer than 65,535 bytes (bytes, rather than characters). the id is 65535. while this is a valid unsigned 16-bit value, it's not a permitted value for id. syntaxerror values were specified for both the maxpacketlifetime and ma...
RTCPeerConnection.createOffer() - Web APIs
andler will receive an object conforming to the rtcsessiondescriptioninit dictionary which contains the sdp describing the generated offer. that received offer should be delivered through the signaling server to a remote peer. exceptions these exceptions are returned by rejecting the returned promise. your rejection handler should examine the received exception to determine which occurred. invalidstateerror the rtcpeerconnection is closed. notreadableerror no certificate or set of certificates was provided for securing the connection, and createoffer() was unable to create a new one. since all webrtc connections are required to be secured, that results in an error. operationerror examining the state of the system to determine resource availability in order to generate the offer failed...
RTCPeerConnection.getStats() - Web APIs
ue), statistics will be gathered for the entire rtcpeerconnection. return value a promise which resolves with an rtcstatsreport object providing connection statistics. the contents of the report depend on the selector as well as other details of the connection. exceptions this method does not throw exceptions; instead, it rejects the returned promise with one of the following errors: invalidaccesserror there is no rtcrtpsender or rtcrtpreceiver whose track matches the specified selector, or selector matches more than one sender or receiver. obsolete syntax previously, getstats() used success and failure callbacks to report the results to you, instead of using a promise. this version of getstats() is obsolete; in addition, the data it returns is entirely different from the curre...
RTCPeerConnection: icecandidateerror event - Web APIs
rmation describing the error in some amount of detail. bubbles no cancelable no interface rtcpeerconnectioniceerrorevent event handler property rtcpeerconnection.onicecandidateerror description the error object's errorcode property is one of the numeric stun error codes. there is one additional, webrtc-specific, error which lies outside the valid stun error code range: 701. error 701 indicates that none of the ice candidates were able to successfully make contact with the stun or turn server. the 701 error is fired only once per server url from the list of available stun or turn servers provided when creating the rtcpeerconnection. these errors occur only when the connection's ice gathering state is gathering. example the following exa...
RTCPeerConnection: identityresult event - Web APIs
on has been generated by an associated identity provider (idp) during the process of creating an sdp offer or answer. note: while older versions of the webrtc specification used events to report assertions, this has been deprecated and removed from the specification. instead, the peeridentity property returns a promise that resolves with an identity or rejects if an error occurs or if unable to validate the identity. bubbles no cancelable no interface rtcidentityevent event handler property onidentityresult specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'identityresult' in that specification. candidate recommendation ...
RTCPeerConnection.onpeeridentity - Web APIs
the rtcpeerconnection.onpeeridentity event handler is a property containing the code to execute whent the peeridentity event, of type event, is received by this rtcpeerconnection. such an event is sent when an identity assertion, received from a peer, has been successfully validated. this event handler is obsolete. to detect successful validation of the identity, wait for the promise returned by peeridentity to resolve successfully with the peer's identity. syntax peerconnection.onpeeridentity = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type event. example pc.onpeerident...
RTCPeerConnection.removeStream() - Web APIs
the rtcpeerconnection.removestream() method removes a mediastream as a local source of audio or video. if the negotiation already happened, a new one will be needed for the remote peer to be able to use it. because this method has been deprecated, you should instead use removetrack() if your target browser versions have implemented it. if the signalingstate is set to "closed", an invalidstateerror is raised. if the signalingstate is set to "stable", the event negotiationneeded is sent on the rtcpeerconnection. syntax rtcpeerconnection.removestream(mediastream); parameters mediastream a mediastream specifying the stream to remove from the connection. return value undefined. example var pc, videostream; navigator.getusermedia({video: true}, function(stream) { pc = new ...
RTCPeerConnection.removeTrack() - Web APIs
ed as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. syntax pc.removetrack(sender); parameters mediatrack a rtcrtpsender specifying the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button. var pc, sender; navigator.getusermedia({video: true}, function(stream) { pc = new rtcpeerconnection(); var track = stream.getvideotracks()[0]; sender = pc.addtrack(track, stream); }); document.ge...
RTCPeerConnection.setIdentityProvider() - Web APIs
syntax pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method. ...
RTCPeerConnection.setLocalDescription() - Web APIs
ct explaining why the request failed. this deprecated form of the method returns instantaneously without waiting for the actual setting to be done: in case of success, the successcallback will be called; in case of failure, the errorcallback will be called. deprecated exceptions when using the deprecated callback-based version of setlocaldescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indicating that the connection is not currently open, so negotiation cannot take place. invalidsessiondescriptionerror the rtcsessiondescription specified by the sessiondescription parameter is invalid. examples implicit descriptions one of the advantages of the parameter-free form of setlocaldescription() is that it lets you simpl...
RTCPeerConnectionIceErrorEvent - Web APIs
cate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been exposed as part of a local ice candidate. errorcode read only an unsigned integer value stating the numeric stun error code returned by the stun or turn server. if no host candidate can reach the server, this property is set to the number 701, which is outside the range of valid stun error codes. the 701 error is fired only once per server url, and only while the is icegatheringstate is gathering. errortext read only a domstring containing the stun reason text returned by the stun or turn server. if communication with the stun or turn server couldn't be established at all, this string will be a browser-specific string explaining the error. port read only an unsigne...
RTCRtpCodecParameters - Web APIs
d and maintained by the internet assigned numbers authority (iana). references to relevant iana documents are provided in the see also section at the end of this article. properties payloadtype optional the rtp payload type used to identify this codec. mimetype optional the codec's mime media type and subtype specified as a domstring of the form "type/subtype". iana maintains a registry of valid mime types. clockrate optional an unsigned long integer value specifying the codec's clock rate in hertz (hz). the clock rate is the rate at which the codec's rtp timestamp advances. most codecs have specific values or ranges of values they permit; see the iana payload format media type registry for details. channels optional an unsigned short integer indicating the number of channels the cod...
RTCRtpSender.replaceTrack() - Web APIs
e codec, which is not allowed (see things that require negotiation). if newtrack was omitted or was null, replacetrack() simply stops the sender. no negotiation is required in this case. when the promise is fulfilled, the fulfillment handler receives a value of undefined. exceptions if the returned promise is rejected, one of the following exceptions is provided to the rejection handler: invalidmodificationerror replacing the rtcrtpsender's current track with the new one would require negotiation. invalidstateerror the track on which this method was called is stopped rather than running. typeerror the new track's kind doesn't match the original track. usage notes things that trigger negotiation not all track replacements require renegotiation. in fact, even changes that seem hug...
RTCRtpSender.setStreams() - Web APIs
rtcrtpsender.setstreams(mediastream); rtcrtpsender.setstreams([mediastream...]); parameters mediastream or [mediastream...] optional an mediastream object—or an array of multiple mediastream objects—identifying the streams to which the rtcrtpsender's track belongs. if this parameter isn't specified, no new streams will be associated with the track. return value none. exceptions invalidstateerror the sender's connection is closed. description setstreams() is purely additive. it doesn't remove the track from any streams; it simply adds it to new ones. if you specify streams to which the track already belongs, that stream is unaffected. once the track has been added to all of the streams, renegotiation of the connection will be triggered by the negotiationneeded event being d...
RTCRtpStreamStats - Web APIs
t by sending a negative acknowledgement (nack, also called "generic nack") packet to the sender. this value is only available to the receiver. plicount the number of times the receiving end of the stream sent a picture loss indiciation (pli) packet to the sender, indicating that it has lost some amount of encoded video data for one or more frames. only the receiver has this value, and it's only valid for video tracks. qpsum the sum of the quantization parameter (qp) values associated with every frame received to date on the video track described by this rtcrtpstreamstats object. in general, the higher this number is, the more heavily compressed the video track was. combined with rtcreceivedrtpstreamstats.framesdecoded or rtcsentrtpstreamstats.framesencoded, you can approximate the average q...
RTCRtpTransceiver.direction - Web APIs
ill not do so. [1] to determine if a sender has at least one active encoding, the user agent gets its parameters using rtcrtpsender.getparameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding. exceptions when setting the value of direction, the following exceptions can occur: invalidstateerror either the receiver's rtcpeerconnection is closed or the rtcrtpreceiver is stopped. usage notes setting the direction when you change the value of direction, an invalidstateerror exception will occur if the connection is closed or the receiver is stopped. if the new value of direction is in fact different from the existing value, renegotiation of the connection is required, so a n...
RTCRtpTransceiver.stop() - Web APIs
topped property was provided to return true if the connection is stopped. that property has been deprecated and will be removed at some point. instead, check the value of currentdirection. if it's stopped, the transceiver has been stopped. this method does nothing if the transceiver is already stopped. syntax rtcrtptransceiver.stop() paramters none. return value undefined exceptions invalidstateerror the rtcpeerconnection of which the transceiver is a member is closed. usage notes when you call stop() on a transceiver, the sender immediately stops sending media and each of its rtp streams are closed using the rtcp "bye" message. the receiver then stops receiving media; the receiver's track is stopped, and the transceiver's direction is changed to stopped, and renegotiation is tr...
Range.cloneContents() - Web APIs
the range.clonecontents() returns a documentfragment copying the objects of type node included in the range. event listeners added using dom events are not copied during cloning. html attribute events are duplicated as they are for the dom core clonenode method. html id attributes are also cloned, which can lead to an invalid document through cloning. partially selected nodes include the parent tags necessary to make the document fragment valid. syntax documentfragment = range.clonecontents(); example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); documentfragment = range.clonecontents(); document.body.appendchild(documentfragment); specifications specification status comment domthe definition of 'range.clonecon...
Range.compareBoundaryPoints() - Web APIs
ge to the end boundary-point of range. range.end_to_start compares the end boundary-point of sourcerange to the start boundary-point of range. range.start_to_end compares the start boundary-point of sourcerange to the end boundary-point of range. range.start_to_start compares the start boundary-point of sourcerange to the start boundary-point of range. if the value of the parameter is invalid, a domexception with a notsupportederror code is thrown. sourcerange a range to compare boundary points with the range. example var range, sourcerange, compare; range = document.createrange(); range.selectnode(document.getelementsbytagname("div")[0]); sourcerange = document.createrange(); sourcerange.selectnode(document.getelementsbytagname("div")[1]); compare = range.compareboundarypoint...
Range.extractContents() - Web APIs
the range.extractcontents() method moves contents of the range from the document tree into a documentfragment. event listeners added using dom events are not retained during extraction. html attribute events are retained or duplicated as they are for the node.clonenode() method. html id attributes are also cloned, which can lead to an invalid document if a partially-selected node is extracted and appended to the document. partially selected nodes are cloned to include the parent tags necessary to make the document fragment valid. syntax documentfragment = range.extractcontents(); example basic example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragm...
Range.setEnd() - Web APIs
Web › API › Range › setEnd
nts both set to the specified end position. syntax range.setend(endnode, endoffset); parameters endnode the node inside which the range should end. endoffset an integer greater than or equal to zero representing the offset for the end of the range from the start of endnode. return value undefined. exceptions exceptions are thrown as domexception objects of the following types: invalidnodetypeerror the node specified by endnode is a doctype node; range endpoints cannot be located inside a doctype node. indexsizeerror the value specified by endoffset is either greater than or equal to the length of the node or is less than zero. usage notes if the endnode is a node of type text, comment, or cdatasection, then endoffset is the number of characters from the start of endnode.
Request.cache - Web APIs
Web › API › Request › cache
the http // cache with the downloaded resource. fetch("some.json", {cache: "reload"}) .then(function(response) { /* consume the response */ }); // download a resource with cache busting when dealing with a // properly configured server that will send the correct etag // and date headers and properly handle if-modified-since and // if-none-match request headers, therefore we can rely on the // validation to guarantee a fresh response. fetch("some.json", {cache: "no-cache"}) .then(function(response) { /* consume the response */ }); // download a resource with economics in mind! prefer a cached // albeit stale response to conserve as much bandwidth as possible. fetch("some.json", {cache: "force-cache"}) .then(function(response) { /* consume the response */ }); // naive stale-while-reval...
Request.mode - Web APIs
Web › API › Request › mode
syntax var mymode = request.mode; value a requestmode value. the associated mode, available values of which are: same-origin — if a request is made to another origin with this mode set, the result is simply an error. you could use this to ensure that a request is always being made to your origin. ...
Response.redirect() - Web APIs
Web › API › Response › redirect
syntax var response = response.redirect(url, status); parameters url the url that the new response is to originate from. status optional an optional status code for the response (e.g., 302.) return value a response object. exceptions exception explanation rangeerror the specified status is not a redirect status. typeerror the specified url is invalid. example responseobj.redirect('https://www.example.com', 302); specifications specification status comment fetchthe definition of 'redirect()' in that specification. living standard ...
Response.type - Web APIs
Web › API › Response › type
certain headers and the body may be accessed. error: network error. no useful information describing the error is available. the response’s status is 0, headers are empty and immutable. ...
SVGAnimationElement - Web APIs
es an unknown element) the value returned is null. methods this interface also inherits methods from its parent, svgelement. svganimationelement.getstarttime() returns a float representing the begin time, in seconds, for this animation element's current interval, if it exists, regardless of whether the interval has begun yet. if there is no current interval, then a domexception with code invalid_state_err is thrown. svganimationelement.getcurrenttime() returns a float representing the current time in seconds relative to time zero for the given time container. svganimationelement.getsimpleduration() returns a float representing the number of seconds for the simple duration for this animation. if the simple duration is undefined (e.g., the end time is indefinite), then a domexception w...
SVGComponentTransferFunctionElement - Web APIs
ize="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgcomponenttransferfunctionelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecomponenttransfer_type_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_fecomponenttransfer_type_identity 1 corresponds to the value identity. svg_fecomponenttransfer_type_table 2 corresponds to the value table. svg_fecomponenttransfer_type_discrete 3 corresponds to the value discrete. svg_fecomponenttransfer_...
SVGFEBlendElement - Web APIs
/><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeblendelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_feblend_mode_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_feblend_mode_normal 1 corresponds to the value normal. svg_feblend_mode_multiply 2 corresponds to the value multiply. svg_feblend_mode_screen 3 corresponds to the value screen. svg_feblend_mode_darken 4 corresponds to the value darke...
SVGFEColorMatrixElement - Web APIs
366" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfecolormatrixelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecolormatrix_type_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_fecolormatrix_type_matrix 1 corresponds to the matrix value. svg_fecolormatrix_type_saturate 2 corresponds to the saturate value. svg_fecolormatrix_type_huerotate 3 corresponds to huerotate value. svg_fecolormatrix_type_luminancetoalpha ...
SVGFECompositeElement - Web APIs
376" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfecompositeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_fecomposite_operator_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_fecomposite_operator_over 1 corresponds to the over value. svg_fecomposite_operator_in 2 corresponds to the in value. svg_fecomposite_operator_out 3 corresponds to out value. svg_fecomposite_operator_atop 4 corresponds to atop value.
SVGFEConvolveMatrixElement - Web APIs
xt x="351" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeconvolvematrixelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_edgemode_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_edgemode_duplicate 1 corresponds to the duplicate value. svg_edgemode_wrap 2 corresponds to the wrap value. svg_edgemode_none 3 corresponds to none value. properties this interface also inherits properties from its parent interface, svgelem...
SVGFEDisplacementMapElement - Web APIs
xt x="346" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfedisplacementmapelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_channel_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_channel_r 1 corresponds to the r value. svg_channel_g 2 corresponds to the g value. svg_channel_b 3 corresponds to the b value. svg_channel_a 4 corresponds to the a value. properties this interface also inherits properties fr...
SVGFEGaussianBlurElement - Web APIs
text x="361" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfegaussianblurelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_edgemode_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_edgemode_duplicate 1 corresponds to the duplicate value. svg_edgemode_wrap 2 corresponds to the wrap value. svg_edgemode_none 3 corresponds to none value. properties this interface also inherits properties from its parent interface, svgelem...
SVGFEMorphologyElement - Web APIs
371" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfemorphologyelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_morphology_operator_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_morphology_operator_erode 1 corresponds to the erode value. svg_morphology_operator_dilate 2 corresponds to dilate value. properties this interface also inherits properties from its parent interface, svgelement, and also implements properties of svgfilter...
SVGGradientElement - Web APIs
><text x="391" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svggradientelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_spreadmethod_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_spreadmethod_pad 1 corresponds to value pad. svg_spreadmethod_reflect 2 corresponds to value reflect. svg_spreadmethod_repeat 3 corresponds to value repeat. properties this interface also inherits properties from its parent, svgelement, and...
SVGPathSeg - Web APIs
eto_quadratic_smooth_rel = 19 normative document svg 1.1 (2nd edition) constants name value description pathseg_unknown 0 the unit type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. pathseg_closepath 1 corresponds to a "closepath" (z) path data command. pathseg_moveto_abs 2 corresponds to an "absolute moveto" (m) path data command. pathseg_moveto_...
SVGRenderingIntent - Web APIs
o,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgrenderingintent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. constants name value description rendering_intent_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. rendering_intent_auto 1 corresponds to the value auto. rendering_intent_perceptual 2 corresponds to the value perceptual. rendering_intent_relative_colorimetric 3 corresponds to the value relative-colorimetric. rendering_intent_saturation 4...
SVGTransform - Web APIs
= 0 svg_transform_matrix = 1 svg_transform_translate = 2 svg_transform_scale = 3 svg_transform_rotate = 4 svg_transform_skewx = 5 svg_transform_skewy = 6 normative document svg 1.1 (2nd edition) constants name value description svg_transform_unknown 0 the unit type is not one of predefined unit types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_transform_matrix 1 a matrix(…) transformation svg_transform_translate 2 a translate(…) transformation svg_transform_scale 3 a scale(…) transformation svg_transform_rotate 4 a rotate(…) transformation svg_transform_sk...
SVGUnitTypes - Web APIs
th="2px" /><text x="61" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgunittypes</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_unit_type_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_unit_type_userspaceonuse 1 corresponds to the value userspaceonuse. svg_unit_type_objectboundingbox 2 corresponds to the value objectboundingbox. properties this interface doesn't implement any specific properties. methods this interface doesn't impleme...
SVGZoomAndPan - Web APIs
="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgzoomandpan</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constants name value description svg_zoomandpan_unknown 0 the type is not one of predefined types. it is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. svg_zoomandpan_disable 1 corresponds to the value disable. svg_zoomandpan_magnify 2 corresponds to the value magnify. properties svgzoomandpan.zoomandpan an unsigned short representing the value of the zoomandpan attribute. methods this interface doesn'...
Screen Capture API - Web APIs
cursor property for the settings and constraints. the possible values are always, motion, and never. displaycapturesurfacetype an enumerated string type which is used to identify the kind of display surface to capture. this type is used for the displaysurface property in the constraints and settings objects, and has the possible values application, browser, monitor, and window. feature policy validation user agents that support feature policy (either using http's feature-policy header or the <iframe> attribute allow) can specify a desire to use the screen capture api using the policy control directive display-capture: <iframe allow="display-capture" src="/some-other-document.html"> the default allow list is self, which lets the any content within the document use screen capture. see usi...
ServiceWorkerContainer.register() - Web APIs
use of scope. since a service worker can't have a scope broader than its own location, only use the scope option when you need a scope that is narrower than the default. syntax serviceworkercontainer.register(scripturl, options) .then(function(serviceworkerregistration) { ... }); parameters scripturl the url of the service worker script. the registered service worker file needs to have a valid javascript mime type. options optional an object containing registration options. currently available options are: scope: a usvstring representing a url that defines a service worker's registration scope; that is, what range of urls a service worker can control. this is usually a relative url. it is relative to the base url of the application. by default, the scope value for a service worke...
ServiceWorkerGlobalScope.onpushsubscriptionchange - Web APIs
the serviceworkerglobalscope.onpushsubscriptionchange event of the serviceworkerglobalscope interface is fired to indicate a change in push subscription that was triggered outside the application's control, e.g. when browser refresh the push subscription. previously, it was defined as the event interface that is fired whenever a push subscription has been invalidated (or is about to become so). this offers an opportunity to resubscribe in order to continue receiving push messages, if desired. this might happen if, for example, the push service sets an expiration time a subscription. syntax serviceworkerglobalscope.onpushsubscriptionchange = function() { ... } self.addeventlistener('pushsubscriptionchange', function() { ... }) example self.addeventlistener('pushsubscriptionchange', functi...
ServiceWorkerGlobalScope - Web APIs
viceworkerglobalscope.onnotificationclick property. notificationclose occurs — when a user closes a displayed notification. also available via the serviceworkerglobalscope.onnotificationclose property. push occurs when a server push notification is received. also available via the serviceworkerglobalscope.onpush property. pushsubscriptionchange occurs when a push subscription has been invalidated, or is about to be invalidated (e.g. when a push service sets an expiration time). also available via the serviceworkerglobalscope.onpushsubscriptionchange property. sync triggered when a call to syncmanager.register is made from a service worker client page. the attempt to sync is made either immediately if the network is available or as soon as the network becomes available. also availa...
ServiceWorkerRegistration.showNotification() - Web APIs
o be associated with the notification. this can be of any data type. dir : the direction of the notification; it can be auto, ltr or rtl icon: a usvstring containing the url of an image to be used as an icon by the notification. image: a usvstring containing the url of an image to be displayed in the notification. lang: specify the lang used within the notification. this string must be a valid bcp 47 language tag. renotify: a boolean that indicates whether to suppress vibrations and audible alerts when reusing a tag value. if options’s renotify is true and options’s tag is the empty string a typeerror will be thrown. the default is false. requireinteraction: indicates that on devices with sufficiently large screens, a notification should remain active until the user clicks or d...
SharedWorker() - Web APIs
type is classic, the default used is omit (no credentials required). name: a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes. return value the created worker. exceptions a securityerror is raised if the document is not allowed to start workers, for example if the url has an invalid syntax or if the same-origin policy is violated. a networkerror is raised if the mime type of the worker script is incorrect. it should always be text/javascript. a syntaxerror is raised if aurl cannot be parsed. examples the following code snippet shows creation of a sharedworker object using the sharedworker() constructor and subsequent usage of the object: var myworker = new sharedworker...
SourceBuffer.abort() - Web APIs
example the spec description of abort() is somewhat confusing — consider for example step 1 of reset parser state. ...
SourceBuffer.appendWindowEnd - Web APIs
filtered out. the default value of appendwindowend is positive infinity. syntax var myappendwindowend = sourcebuffer.appendwindowend; sourcebuffer.appendwindowend = 120.0; value a double, indicating the end time of the append window, in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to less than or equal to sourcebuffer.appendwindowstart, or nan. invalidstateerror this sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), or this sourcebuffer has been removed from the mediasource. example tbd specifications specification status comment ...
SourceBuffer.appendWindowStart - Web APIs
ation start time, which is the beginning time of the playable media. syntax var myappendwindowstart = sourcebuffer.appendwindowstart; sourcebuffer.appendwindowstart = 2.0; value a double, indicating the start time of the append window, in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to less than 0, or a value greater than or equal to sourcebuffer.appendwindowend. invalidstateerror this sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), or this sourcebuffer has been removed from the mediasource. example tbd specifications specification status ...
SourceBuffer.changeType() - Web APIs
pful is to support adapting the media source to changing bandwidth availability, by transitioning from one codec to another as resource constraints change. syntax sourcebuffer.changetype(type); parameters type a domstring specifying the mime type that future buffers will conform to. return value undefined. exceptions typeerror the specified string is empty, rather than indicating a valid mime type. invalidstateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer's updating property indicates that a previously queued appendbuffer() or remove() is still being processed. notsupportederror the specified mime type is not supported, or is not supported with the types of sourcebuffer objects present in the mediasource.sourcebuffers li...
SourceBuffer.mode - Web APIs
Web › API › SourceBuffer › mode
timestamps generated to reflect this. this property cannot be changed during while the sourcebuffer is processing either an appendbuffer() or remove() call. syntax var mymode = sourcebuffer.mode; sourcebuffer.mode = 'sequence'; value a domstring. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidaccesserror an attempt was made to set the value to segments when the initial value is sequence. invalidstateerror the sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), the last media segment appended to this sourcebuffer is incomplete, or this sourcebuffer has been removed from the mediasource. example this snippet sets the so...
SourceBuffer.remove() - Web APIs
when sourcebuffer.updating equals false. if sourcebuffer.updating is not equal to false, call sourcebuffer.abort(). syntax sourcebuffer.remove(start, end); parameters start a double representing the start of the time range, in seconds. end a double representing the end of the time range, in seconds. return value undefined. exceptions exception explanation invalidaccesserror the mediasource.duration property is equal to nan, the start parameter is negative or greater than mediasource.duration, or the end parameter is less than or equal to start or equal to nan. invalidstateerror the sourcebuffer.updating property is equal to true, or this sourcebuffer has been removed from the mediasource. example tbd. specifications speci...
SourceBuffer.timestampOffset - Web APIs
media segments that are appended to the sourcebuffer. the initial value of timestampoffset is 0. syntax var myoffset = sourcebuffer.timestampoffset; sourcebuffer.timestampoffset = 2.5; value a double, with the offset amount expressed in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidstateerror one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is currently true), a media segment inside the sourcebuffer is currently being parsed, or this sourcebuffer has been removed from the mediasource. example tbd specifications specification status comment media source extens...
SourceBuffer.trackDefaults - Web APIs
information is not available in the initialization segment of the media to be appended to the sourcebuffer. syntax var mytrackdefaults = sourcebuffer.trackdefaults; sourcebuffer.trackdefaults = mytrackdefaultlist; value a trackdefaultlist object. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidstateerror one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is currently true), or this sourcebuffer has been removed from the mediasource. example tbd ...
SpeechRecognitionEvent.emma - Web APIs
the emma read-only property of the speechrecognitionevent interface returns an extensible multimodal annotation markup language (emma) — xml — representation of the result. note: emma is defined in the specification emma: extensible multimodal annotation markup language. you can see muliple emma examples in the spec. syntax var myemma = event.emma; value a valid xml document. the exact contents can vary across user agents and recognition engines, but all supporting implementations will expose a valid xml document complete with an emma namespace. if the speech recognition system does not supply emma data then the user agent will return null. examples recognition.onresult = function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received...
SpeechSynthesisErrorEvent.error - Web APIs
gine.) synthesis-failed the operation failed because the synthesis engine raised an error. language-unavailable no appropriate voice was available for the language set in speechsynthesisutterance.lang. voice-unavailable the voice set in speechsynthesisutterance.voice was not available. text-too-long the contents of the speechsynthesisutterance.text attribute was too long to synthesize. invalid-argument the content of the speechsynthesisutterance.rate, speechsynthesisutterance.pitch or speechsynthesisutterance.volume property was not valid. 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.o...
StaticRange.StaticRange() - Web APIs
t the offset into the starting node at which the first character of the range is found. endcontainer the node in which the end point of the range is located. endoffset the offset into the node indicated by endoffset at which the last character in the range is located. return value a new staticrange object initialized with the values given in the rangespec object. exceptions invalidnodetypeerror a domexception fired if either or both of the startcontainer and/or endcontainer are a type of node which you can't include in a range. those node types are node.document_type_node (representing the documenttype node derived from the dtd identified using the doctype preamble in the html, for example) and the attr node describing an attribute of an element on the dom.. specificatio...
SubmitEvent - Web APIs
the submitevent interface defines the object used to represent an html form's submit event. this event is fired at the <form> when the form's submit action is invoked. constructor submitevent() creates and returns a new submitevent object whose type and other options are configured as specified. note that currently, the only valid type for a submitevent is submit. properties in addition to the properties listed below, this interface inherits the properties of its parent interface, event. submitter read only an htmlelement object which identifies the button or other element which was invoked to trigger the form being submitted. methods while submitevent offers no methods of its own, it inherits any specified by its parent interface, event. examples in this example, a shopping ...
SubtleCrypto.decrypt() - Web APIs
ntaining the key to be used for decryption. if using rsa-oaep, this is the privatekey property of the cryptokeypair object. data is a buffersource containing the data to be decrypted (also known as ciphertext). return value result is a promise that fulfills with an arraybuffer containing the plaintext. exceptions the promise is rejected when the following exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the specified encryption algorithm). operationerror raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or there was an error decrypting the ciphertext). supported algorithms the decrypt() method su...
SubtleCrypto.deriveBits() - Web APIs
erial for the derivation function: for example, for pbkdf2 it might be a password, imported as a cryptokey using subtlecrypto.importkey(). length is a number representing the number of bits to derive. return value result is a promise that fulfills with an arraybuffer containing the derived bits. exceptions the promise is rejected when one of the following exceptions are encountered: invalidaccesserror raised when the base key is not a key for the requested derivation algorithm or if the cryptokey.usages value of that key doesn't contain derivekey. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for derivation, or if the algorithm requested for the derived key doesn't define a key length. supported algorithms see the supported algori...
SubtleCrypto.deriveKey() - Web APIs
y signatures. derivekey: the key may be used in deriving a new key. "derivebits": the key may be used in deriving bits. "wrapkey": the key may be used to wrap a key. "unwrapkey": the key may be used to unwrap a key. return value result is a promise that fulfills with a cryptokey. exceptions the promise is rejected when one of the following exceptions are encountered: invalidaccesserror raised when the master key is not a key for the requested derivation algorithm or if the cryptokey.usages value of that key doesn't contain derivekey. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for derivation, or if the algorithm requested for the derived key doesn't define a key length. syntaxerror raised when keyusages is empty b...
SubtleCrypto.encrypt() - Web APIs
to use aes-gcm, pass an aesgcmparams object. key is a cryptokey containing the key to be used for encryption. data is a buffersource containing the data to be encrypted (also known as the plaintext). return value result is a promise that fulfills with an arraybuffer containing the "ciphertext". exceptions the promise is rejected when the following exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the specified encryption algorithm). operationerror raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or aes-gcm plaintext longer than 2³⁹−256 bytes). supported algorithms the web crypto a...
SubtleCrypto.exportKey() - Web APIs
bjectpublickeyinfo format. jwk: json web key format. key is the cryptokey to export. return value result is a promise. if format was jwk, then the promise fulfills with a json object containing the key. otherwise the promise fulfills with an arraybuffer containing the key. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when trying to export a non-extractable key. notsupported raised when trying to export in an unknown format. typeerror raised when trying to use an invalid format. examples note: you can try the working examples out on github. raw export this example exports an aes key as an arraybuffer containing the bytes for the key. see the complete code on github. /* export the...
SubtleCrypto.importKey() - Web APIs
o wrap a key. unwrapkey: the key may be used to unwrap a key. return value result is a promise that fulfills with the imported key as a cryptokey object. exceptions the promise is rejected when one of the following exceptions is encountered: syntaxerror raised when keyusages is empty but the unwrapped key is of type secret or private. typeerror raised when trying to use an invalid format or if the keydata is not suited for that format. supported formats this api supports four different key import/export formats: raw, pkcs #8, subjectpublickeyinfo, and json web key. raw you can use this format to import or export aes or hmac secret keys, or elliptic curve public keys. in this format the key is supplied as an arraybuffer containing the raw bytes for the key. pkcs #8 ...
SubtleCrypto.sign() - Web APIs
Web › API › SubtleCrypto › sign
object containing the key to be used for signing. if algorithm identifies a public-key cryptosystem, this is the private key. data is an arraybuffer or arraybufferview object containing the data to be signed. return value signature is a promise that fulfills with an arraybuffer containing the signature. exceptions the promise is rejected when the following exception is encountered: invalidaccesserror raised when the signing key is not a key for the request signing algorithm or when trying to use an algorithm that is either unknown or isn't suitable for signing. supported algorithms the web crypto api provides four algorithms that can be used for signing and signature verification. three of these algorithms — rsassa-pkcs1-v1_5, rsa-pss, and ecdsa — are public-key cryptosyst...
SubtleCrypto.wrapKey() - Web APIs
. to use aes-cbc, pass an aescbcparams object. to use aes-gcm, pass an aesgcmparams object. to use aes-kw, pass the string "aes-kw", or an object of the form { "name": "aes-kw }. return value result is a promise that fulfills with an arraybuffer containing the encrypted exported key. exceptions the promise is rejected when one of the following exceptions is encountered: invalidaccesserror raised when the wrapping key is not a key for the requested wrap algorithm. notsupported raised when trying to use an algorithm that is either unknown or isn't suitable for encryption or wrapping. typeerror raised when trying to use an invalid format. supported algorithms all algorithms that are usable for encryption are also usable for key wrapping, as long as the key has the ...
SyncManager.register() - Web APIs
is 0, meaning there is no maximum delay. mindelay: the minimum delay in milliseconds before the next sync event (or the first sync event if it is periodic). the default is 0. minperiod: the minimum time in milliseconds between periodic sync events. the default is 0, meaning events are not periodic. minrequirednetwork: the network condition under which background synchronization will occur. valid values are 'network-any', 'network-offline', 'network-online', 'network-non-mobile'. the default value is 'network-online'. ...
TextEncoder - Web APIs
are not already precomputed because they serve to aesthetically illustrate how the polyfill works. if (typeof textencoder === "undefined") { textencoder=function textencoder(){}; textencoder.prototype.encode = function encode(str) { "use strict"; var len = str.length, respos = -1; // the uint8array's length must be at least 3x the length of the string because an invalid utf-16 // takes up the equivelent space of 3 utf-8 characters to encode it properly. however, array's // have an auto expanding length and 1.5x should be just the right balance for most uses. var resarr = typeof uint8array === "undefined" ? new array(len * 1.5) : new uint8array(len * 3); for (var point=0, nextcode=0, i = 0; i !== len; ) { point = str.
TrackDefault.TrackDefault() - Web APIs
ain kind information for a new track. bytestreamtrackid optional a domstring specifying the id of the specific track that the sourcebuffer should apply to. if not specified, this value will be an empty string and the sourcebuffer can contain any tracks of the specified type. errors when this constructor is invoked, the following errors can occur: error explanation invalidaccesserror the supplied language is not a valid language code, e.g. en-us. typeerror there are values specified in the kinds array that do not apply to the specified type. example tbd ...
TrackDefault.language - Web APIs
en-us. syntax var mylanguage = trackdefault.language; value a domstring. example tbd ...
URL API - Web APIs
Web › API › URL API
the url standard also defines concepts such as domains, hosts, and ip addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded mime type used to submit web forms' contents as a set of key/value pairs. url concepts and usage the majority of the url standard is taken up by the definition of a url and how it is structured and parsed. also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. ...
USBDevice.clearHalt() - Web APIs
olves when a halt condition is cleared. a halt condition is when a data tranfer to or from the device has a status of 'stall', which requires the web page (the host system, in usb terminology) to clear that condition. see the for details. syntax var promise = usbdevice.clearhalt(direction, endpointnumber) parameters direction indicates whether the devices input or output should be cleared. valid values are 'in' or 'out'. endpointnumber indicates the number of the endpoint to clear. the promise will reject if an invalid endpoint is supplied. return value a promise. example the following example shows how to test for and clear a 'stall' condition in the result of a data transfer. what data can be passed to a usb device and how it is passed is particular and unique to each device...
WEBGL_lose_context.restoreContext() - Web APIs
the webgl_lose_context.restorecontext() method is part of the webgl api and allows you to simulate restoring the context of a webglrenderingcontext object. syntax gl.getextension('webgl_lose_context').restorecontext(); errors thrown invalid_operation if the context was not lost. examples with this method, you can simulate the webglcontextrestored event: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextrestored', function(e) { console.log(e); }, false); gl.getextension('webgl_lose_context').restorecontext(); specifications specification status comment webgl_lose_contextthe definition of 'webgl_lose_context.losecontext' in that specification. recommendation initial definition. ...
WaveShaperNode.WaveShaperNode() - Web APIs
context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. options optional options are as follows: curve: the shaping curve used for the waveshaping effect. the input signal is nominally within the range [-1;1]. oversample: specifies what type of oversampling (if any) should be used when applying the shaping curve. valid values are 'none', '2x', or '4x'. the default is 'none'. return value a new waveshapernode object instance. specifications specification status comment web audio apithe definition of 'waveshapernode()' in that specification. working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data...
WebGL2RenderingContext.drawBuffers() - Web APIs
be written. possible values are: gl.none: fragment shader output is not written into any color buffer. gl.back: fragment shader output is written into the back color buffer. gl.color_attachment{0-15}: fragment shader output is written in the nth color attachment of the current framebuffer. return value none. exceptions if buffers contains not one of the accepted values, a gl.invalid_enum error is thrown. examples gl.drawbuffers([gl.none, gl.color_attachment1]); specifications specification status comment webgl 2.0the definition of 'drawbuffers' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'gldrawbuffers' in that specification. standard man page of the (similar) opengl api...
WebGL2RenderingContext.drawRangeElements() - Web APIs
tained in offset. end a gluint specifying the maximum array index contained in offset. count a glsizei specifying the number of elements to be rendered. type a glenum specifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_short gl.unsigned_int offset a glintptr specifying an offset in the element array buffer. must be a valid multiple of the size of the given type. return value none. exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count is negative, a gl.invalid_value error is thrown. examples gl.drawrangeelements(gl.points, 0, 7, 8, gl.unsigned_byte, 0); specif...
WebGL2RenderingContext.getBufferSubData() - Web APIs
for pixel transfer operations. srcbyteoffset a glintptr specifying the byte offset from which to start reading from the buffer. dstdata an arraybuffer or sharedarraybuffer to which to write the buffer data. srcoffset optional a gluint specifying the element index offset where to start reading the buffer. length optional a gluint defaulting to 0. return value none. exceptions an invalid_value error is generated if: offset + returneddata.bytelength would extend beyond the end of the buffer returneddata is null offset is less than zero. an invalid_operation error is generated if: zero is bound to target target is transform_feedback_buffer, and any transform feedback object is currently active. examples var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, bu...
WebGL2RenderingContext.isQuery() - Web APIs
examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); // ... gl.isquery(query); specifications specification status comment webgl 2.0the definition of 'isquery' in that specification. editor's draft initial definition. ...
WebGL2RenderingContext.isSync() - Web APIs
examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); // ... gl.issync(sync); specifications specification status comment webgl 2.0the definition of 'issync' in that specification. editor's draft initial definition. ...
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
see the syntax table below. ...
WebGLRenderingContext.activeTexture() - Web APIs
which texture unit to make active. syntax void gl.activetexture(texture); parameters texture the texture unit to make active. the value is a gl.texturei where i is within the range from 0 to gl.max_combined_texture_image_units - 1. return value none. exceptions if texture is not one of gl.texturei, where i is within the range from 0 to gl.max_combined_texture_image_units - 1, a gl.invalid_enum error is thrown. examples the following call selects gl.texture1 as the current texture. subsequent calls that modify the texture state will affect this texture. gl.activetexture(gl.texture1); the number of texture units is implementation dependent, you can get this number with the help of the max_combined_texture_image_units constant. it is, per specification, at least 8. gl.getparame...
WebGLRenderingContext.bindBuffer() - Web APIs
. gl.uniform_buffer: buffer used for storing uniform blocks. gl.pixel_pack_buffer: buffer used for pixel transfer operations. gl.pixel_unpack_buffer: buffer used for pixel transfer operations. buffer a webglbuffer to bind. return value none. exceptions only one target can be bound to a given webglbuffer. an attempt to bind the buffer to another target will throw an invalid_operation error and the current buffer binding will remain the same. a webglbuffer which has been marked for deletion with deletebuffer cannot be (re-)bound. an attempt to do so will generate an invalid_operation error, and the current binding will remain untouched. examples binding a buffer to a target var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var b...
WebGLRenderingContext.bindFramebuffer() - Web APIs
r an image. when using a webgl 2 context, the following values are available additionally: gl.draw_framebuffer: equivalent to gl.framebuffer. used as a destination for drawing, rendering, clearing, and writing operations. gl.read_framebuffer: used as a source for reading operations. framebuffer a webglframebuffer object to bind. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, or gl.read_framebuffer. examples binding a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); gl.bindframebuffer(gl.framebuffer, framebuffer); getting current bindings to check the current frame buffer binding, query the framebu...
WebGLRenderingContext.bindRenderbuffer() - Web APIs
en webglrenderbuffer to a target, which must be gl.renderbuffer. syntax void gl.bindrenderbuffer(target, renderbuffer); parameters target a glenum specifying the binding point (target). possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal format. renderbuffer a webglrenderbuffer object to bind. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.renderbuffer. examples binding a renderbuffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); gl.bindrenderbuffer(gl.renderbuffer, renderbuffer); getting current bindings to check the current renderbuffer binding, query the renderbuffer_binding constant. gl.getparamete...
WebGLRenderingContext.bindTexture() - Web APIs
get). possible values: gl.texture_2d: a two-dimensional texture. gl.texture_cube_map: a cube-mapped texture. when using a webgl 2 context, the following values are available additionally: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. texture a webgltexture object to bind. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.texture_2d, gl.texture_cube_map, gl.texture_3d, or gl.texture_2d_array. examples binding a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); getting current bindings to check the current texture binding, query the gl.texture_binding_2...
WebGLRenderingContext.blendEquation() - Web APIs
ext.min_ext: minimum of source and destination, ext.max_ext: maximum of source and destination. when using a webgl 2 context, the following values are available additionally: gl.min: minimum of source and destination, gl.max: maximum of source and destination. default value: gl.func_add exception if mode is not one of the three possible values, a gl.invalid_enum error is thrown. return value none. examples to set the blend equation, use: gl.blendequation(gl.func_add); gl.blendequation(gl.func_subtract); gl.blendequation(gl.func_reverse_subtract); to get the blend equations, query the blend_equation, blend_equation_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_m...
WebGLRenderingContext.blendEquationSeparate() - Web APIs
on: ext.min_ext: minimum of source and destination, ext.max_ext: maximum of source and destination. when using a webgl 2 context, the following values are available additionally: gl.min: minimum of source and destination, gl.max: maximum of source and destination. return value none. exceptions if mode is not one of the three possible values, a gl.invalid_enum error is thrown. examples to set the blend equations, use: gl.blendequationseparate(gl.func_add, gl.func_subtract); to get the current blend equations, query the blend_equation, blend_equation_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext. gl.getparameter(gl.
WebGLRenderingContext.blendFunc() - Web APIs
arameters sfactor a glenum specifying a multiplier for the source blending factors. the default value is gl.one. for possible values, see below. dfactor a glenum specifying a multiplier for the destination blending factors. the default value is gl.zero. for possible values, see below. return value none. exceptions if sfactor or dfactor is not one of the listed possible values, a gl.invalid_enum error is thrown. if a constant color and a constant alpha value are used together as source and destination factors, a gl.invalid_enum error is thrown. constants the following constants can be used for sfactor and dfactor. the formula for the blending color can be described like this: color(rgba) = (sourcecolor * sfactor) + (destinationcolor * dfactor). the rbga values are between 0 and...
WebGLRenderingContext.blendFuncSeparate() - Web APIs
specifying a multiplier for the alpha source blending factor. the default value is gl.one. for possible values, see below. dstalpha a glenum specifying a multiplier for the alpha destination blending factor. the default value is gl.zero. for possible values, see below. return value none. exceptions if srcrgb, dstrgb, srcalpha, or dstalpha is not one of the listed possible values, a gl.invalid_enum error is thrown. if a constant color and a constant alpha value are used together as source (srcrgb) and destination (dstrgb) factors, a gl.invalid_enum error is thrown. constants the following constants can be used for srcrgb, dstrgb, srcalpha, and dstalpha the formulas for the blending factors can be described like this (all rgba values are between 0 and 1): color(rgb) = (sourcecol...
WebGLRenderingContext.bufferData() - Web APIs
om webgl, and used at most a few times as the source for webgl drawing and image specification commands. srcoffset a gluint specifying the element index offset where to start reading the buffer. length optional a gluint defaulting to 0. return value none. exceptions a gl.out_of_memory error is thrown if the context is unable to create a data store with the given size. a gl.invalid_value error is thrown if size is negative. a gl.invalid_enum error is thrown if target or usage are not one of the allowed enums. examples using bufferdata var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 1024, gl.static_draw); getting buffer informatio...
WebGLRenderingContext.bufferSubData() - Web APIs
glintptr specifying an offset in bytes where the data replacement will start. srcdata optional an arraybuffer, sharedarraybuffer or one of the arraybufferview typed array types that will be copied into the data store. srcoffset a gluint specifying the element index offset where to start reading the buffer. length optional a gluint defaulting to 0. return value none. exceptions a gl.invalid_value error is thrown if the data would be written past the end of the buffer or if data is null. a gl.invalid_enum error is thrown if target is not one of the allowed enums. examples using buffersubdata var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 10...
WebGLRenderingContext.clear() - Web APIs
ncil(). the scissor box, dithering, and buffer writemasks can affect the clear() method. syntax void gl.clear(mask); parameters mask a glbitfield bitwise or mask that indicates the buffers to be cleared. possible values are: gl.color_buffer_bit gl.depth_buffer_bit gl.stencil_buffer_bit return value none. exceptions if mask is not one of the listed possible values, a gl.invalid_enum error is thrown. examples the clear() method accepts multiple values. gl.clear(gl.depth_buffer_bit); gl.clear(gl.depth_buffer_bit | gl.color_buffer_bit); to get the current clear values, query the color_clear_value, depth_clear_value, and stencil_clear_value constants. gl.getparameter(gl.color_clear_value); gl.getparameter(gl.depth_clear_value); gl.getparameter(gl.stencil_clear_value);...
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
rray gl.texture_3d level a glint specifying the level of detail. level 0 is the base image level and level n is the nth mipmap reduction level. internalformat a glenum specifying the compressed image format. compressed image formats must be enabled by webgl extensions before using this method. all values are possible for compressedteximage2d. see compressed texture formats for which are valid for compressedteximage3d. possible values: when using the webgl_compressed_texture_s3tc extension: ext.compressed_rgb_s3tc_dxt1_ext ext.compressed_rgba_s3tc_dxt1_ext ext.compressed_rgba_s3tc_dxt3_ext ext.compressed_rgba_s3tc_dxt5_ext when using the webgl_compressed_texture_s3tc_srgb extension: ext.compressed_srgb_s3tc_dxt1_ext ext.compressed_srgb_alpha...
WebGLRenderingContext.drawArrays() - Web APIs
he first. gl.lines: draws a line between a pair of vertices. gl.triangle_strip gl.triangle_fan gl.triangles: draws a triangle for a group of three vertices. first a glint specifying the starting index in the array of vector points. count a glsizei specifying the number of indices to be rendered. return value none. exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if first or count are negative, a gl.invalid_value error is thrown. if gl.current_program is null, a gl.invalid_operation error is thrown. examples gl.drawarrays(gl.points, 0, 8); specifications specification status comment webgl 1.0the definition of 'drawarrays' in that specification. recommendation initial definition. opengl e...
WebGLRenderingContext.drawElements() - Web APIs
three vertices. count a glsizei specifying the number of elements to be rendered. type a glenum specifying the type of the values in the element array buffer. possible values are: gl.unsigned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying a byte offset in the element array buffer. must be a valid multiple of the size of the given type. return value none. exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if offset is not a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count is negative, a gl.invalid_value error is thrown. examples gl.drawelements(gl.points, 8, gl.unsigned_byte, 0); specification...
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
nablevertexattribarray(index); parameters index a gluint specifying the index number that uniquely identifies the vertex attribute to enable. if you know the name of the attribute but not its index, you can get the index by calling getattriblocation(). return value undefined. errors to check for errors after calling enablevertexattribarray(), call geterror(). webglrenderingcontext.invalid_value the specified index is invalid; that is, it's greater than or equal to the maximum number of entries permitted in the context's vertex attribute list, as indicated by the value of webglrenderingcontext.max_vertex_attribs. example this code — a snippet taken from the full example a basic 2d webgl animation example — shows the use of enablevertexarray() to activate the attribute that ...
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
_attachment13_webgl ext.color_attachment14_webgl ext.color_attachment15_webgl renderbuffertarget a glenum specifying the binding point (target) for the render buffer. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal format. renderbuffer a webglrenderbuffer object to attach. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, or gl.read_framebuffer. a gl.invalid_enum error is thrown if renderbuffertarget is not gl.renderbuffer. a gl.invalid_enum error is thrown if attachment is not one of the allowed enums. examples gl.framebufferrenderbuffer(gl.framebuffer, gl.color_attachment0, gl.renderbuffer, renderbuffer); specifications s...
WebGLRenderingContext.framebufferTexture2D() - Web APIs
tive_y: image for the negative y face of the cube. gl.texture_cube_map_positive_z: image for the positive z face of the cube. gl.texture_cube_map_negative_z: image for the negative z face of the cube. texture a webgltexture object whose image to attach. level a glint specifying the mipmap level of the texture image to be attached. must be 0. return value none. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer. attachment is not one of the accepted attachment points. textarget is not one of the accepted texture targets. a gl.invalid_value error is thrown if level is not 0. a gl.invalid_operation error is thrown if texture isn't 0 or the name of an existing texture object. examples gl.framebuffertexture2d(gl.framebuffer, gl.colo...
WebGLRenderingContext.getActiveUniform() - Web APIs
er. if the uniform block has an instance name, the block name is prefixed. e.g. uniform block { float foo; }; will result in foo, and uniform block { float bar; } e; will result in block.bar. the size attribute of the return value corresponds to the length of the array for uniforms declared as arrays. otherwise, it is 1 (this includes interface blocks instanced with arrays). exceptions gl.invalid_value is generated if the program webglprogram is invalid (not linked, deleted, etc.). gl.invalid_value is generated if index is not in the range [0, gl.getprogramparameter(program, gl.active_uniforms) - 1]. examples const numuniforms = gl.getprogramparameter(program, gl.active_uniforms); for (let i = 0; i < numuniforms; ++i) { const info = gl.getactiveuniform(program, i); console.log('na...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
a glenum indicating the framebuffer color encoding. either gl.linear or ext.srgb_ext. ext.framebuffer_attachment_texture_num_views_ovr a glsizei indicating the number of views of the framebuffer object attachment. ext.framebuffer_attachment_texture_base_view_index_ovr a glint indicating the base view index of the framebuffer object attachment. exceptions a gl.invalid_enum error is thrown if target is not gl.framebuffer, gl.draw_framebuffer, gl.read_framebuffer or if attachment is not one of the accepted attachment points. examples gl.getframebufferattachmentparameter(gl.framebuffer, gl.color_attachment0, gl.framebuffer_attachment_object_type); specifications specification status comment webgl ...
WebGLRenderingContext.getProgramParameter() - Web APIs
gl.getprogramparameter(program, pname); parameters program a webglprogram to get parameter information from. pname a glenum specifying the information to query. possible values: gl.delete_status: returns a glboolean indicating whether or not the program is flagged for deletion. gl.link_status: returns a glboolean indicating whether or not the last link operation was successful. gl.validate_status: returns a glboolean indicating whether or not the last validation operation was successful. gl.attached_shaders: returns a glint indicating the number of attached shaders to a program. gl.active_attributes: returns a glint indicating the number of active attribute variables to a program. gl.active_uniforms: returns a glint indicating the number of active uniform variables to a pr...
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
webglshaderprecisionformat gl.getshaderprecisionformat(shadertype, precisiontype); parameters shadertype either a gl.fragment_shader or a gl.vertex_shader. precisiontype a precision type value. either gl.low_float, gl.medium_float, gl.high_float, gl.low_int, gl.medium_int, or gl.high_int. return value a webglshaderprecisionformat object or null, if an error occurs. exceptions gl.invalid_enum if the shader or precision types aren't recognized. gl.invalid_operation if the shader compiler isn't supported. examples the following code gets the precision format of a gl.vertex_shader with a gl.medium_float precision type. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecisionformat(gl.vertex_shader, gl.medium_float); // webglsha...
WebGLRenderingContext.isBuffer() - Web APIs
examples creating a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.isbuffer(buffer); specifications specification status comment webgl 1.0the definition of 'isbuffer' in that specification. recommendation initial definition. ...
WebGLRenderingContext.isFramebuffer() - Web APIs
examples checking a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); gl.isframebuffer(framebuffer); specifications specification status comment webgl 1.0the definition of 'isframebuffer' in that specification. ...
WebGLRenderingContext.isProgram() - Web APIs
examples checking a program var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var program = gl.createprogram(); // ... gl.isprogram(program); specifications specification status comment webgl 1.0the definition of 'isprogram' in that specification. recommendation initial definition. ...
WebGLRenderingContext.isRenderbuffer() - Web APIs
examples checking a renderbuffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); gl.isrenderbuffer(renderbuffer); specifications specification status comment webgl 1.0the definition of 'isrenderbuffer' in that specification. ...
WebGLRenderingContext.isShader() - Web APIs
examples checking a shader var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var shader = gl.createshader(gl.vertex_shader); // ... gl.isshader(shader); specifications specification status comment webgl 1.0the definition of 'isshader' in that specification. recommendation initial definition. ...
WebGLRenderingContext.isTexture() - Web APIs
examples checking a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); gl.istexture(texture); specifications specification status comment webgl 1.0the definition of 'istexture' in that specification. recommendation initial definition. ...
WebGLRenderingContext.scissor() - Web APIs
specifying the vertical coordinate for the lower left corner of the box. default value: 0. width a non-negative glsizei specifying the width of the scissor box. default value: width of the canvas. height a non-negative glsizei specifying the height of the scissor box. default value: height of the canvas. return value none. exceptions if either width or height is a negative value, a gl.invalid_value error is thrown. examples when the scissor test is enabled, only pixels within the scissor box can be modified by drawing commands. // turn on scissor test gl.enable(gl.scissor_test); // set the scissor rectangle gl.scissor(x, y, width, height); // execute drawing commands in the scissor box (e.g. clear) // turn off scissor test again gl.disable(gl.scissor_test); to get the current ...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
tribute is assumed to be tightly packed, that is, the attributes are not interleaved but each attribute is in a separate block, and the next vertex' attribute follows immediately after the current vertex. offset a glintptr specifying an offset in bytes of the first component in the vertex attribute array. must be a multiple of the byte length of type. return value none. exceptions a gl.invalid_value error is thrown if offset is negative. a gl.invalid_operation error is thrown if stride and offset are not multiples of the size of the data type. a gl.invalid_operation error is thrown if no webglbuffer is bound to the array_buffer target. when using a webgl 2 context, a gl.invalid_operation error is thrown if this vertex attribute is defined as a integer in the vertex shader (e.g. uvec...
WebGLRenderingContext.viewport() - Web APIs
ng the vertical coordinate for the lower left corner of the viewport origin. default value: 0. width a non-negative glsizei specifying the width of the viewport. default value: width of the canvas. height a non-negative glsizei specifying the height of the viewport. default value: height of the canvas. return value none. errors thrown if either width or height is a negative value, a gl.invalid_value error is thrown. examples when you first create a webgl context, the size of the viewport will match the size of the canvas. however, if you resize the canvas, you will need to tell the webgl context a new viewport setting. in this situation, you can use gl.viewport. gl.viewport(0, 0, canvas.width, canvas.height); the viewport width and height are clamped to a range that is implementat...
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
...
Signaling and video calling - Web APIs
y calling mypeerconnection.createoffer(). when createoffer() succeeds (fulfilling the promise), we pass the created offer information into mypeerconnection.setlocaldescription(), which configures the connection and media configuration state for the caller's end of the connection. note: technically speaking, the string returned by createoffer() is an rfc 3264 offer. we know the description is valid, and has been set, when the promise returned by setlocaldescription() is fulfilled. this is when we send our offer to the other peer by creating a new "video-offer" message containing the local description (now the same as the offer), then sending it through our signaling server to the callee. the offer has the following members: type the message type: "video-offer". name the caller's usern...
WebSocket() - Web APIs
hat a single server can implement multiple websocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol). if you don't specify a protocol string, an empty string is assumed. exceptions thrown security_err the port to which the connection is being attempted is being blocked. syntaxerror the url is invalid. specifications specification status comment html living standardthe definition of 'the websocket constructor' in that specification. living standard ...
WebSocket.close() - Web APIs
Web › API › WebSocket › close
ue indicating the status code explaining why the connection is being closed. if this parameter is not specified, a default value of 1005 is assumed. see the list of status codes of closeevent for permitted values. reason optional a human-readable string explaining why the connection is closing. this string must be no longer than 123 bytes of utf-8 text (not characters). exceptions thrown invalid_access_err an invalid code was specified. syntax_err the reason string is too long or contains unpaired surrogates. note: in gecko, this method didn't support any parameters prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5). specifications specification status comment html living standard the definition of 'websocket.close()' in that specifica...
WebSocket.send() - Web APIs
Web › API › WebSocket › send
specifying a blob enqueues the blob's raw data to be transmitted in a binary frame. the value of bufferedamount is increased by the byte size of that raw data. arraybufferview you can send any javascript typed array object as a binary frame; its binary data contents are queued in the buffer, increasing the value of bufferedamount by the requisite number of bytes. exceptions thrown invalid_state_err the connection is not currently open. syntax_err the data is a string that has unpaired surrogates. note: gecko's implementation of the send() method differs somewhat from the specification in gecko 6.0; gecko returns a boolean indicating whether or not the connection is still open (and, by extension, that the data was successfully queued or transmitted); this is corrected in geck...
Writing WebSocket servers - Web APIs
sages), read the next 4 octets (32 bits); this is the masking key. once the payload length and masking key is decoded, you can read that number of bytes from the socket. let's call the data encoded, and the key mask. to get decoded, loop through the octets (bytes a.k.a. characters for text data) of encoded and xor the octet with the (i modulo 4)th octet of mask. in pseudo-code (that happens to be valid javascript): var decoded = ""; for (var i = 0; i < encoded.length; i++) { decoded[i] = encoded[i] ^ mask[i % 4]; } now you can figure out what decoded means depending on your application. message fragmentation the fin and opcode fields work together to send a message split up into separate frames. this is called message fragmentation. fragmentation is only available on opcodes 0x0 to 0x2...
Migrating from webkitAudioContext - Web APIs
where the audioparam object is coming from in your code if you need this information. the minvalue and maxvalue attributes are read-only values representing the nominal range for the audioparam. for example, for gainnode, these values are 0 and 1, respectively. note that these bounds are not enforced by the engine, and are merely used for informational purposes. as an example, it's perfectly valid to set a gain value to 2, or even -1. in order to find out these nominal values, you can consult the specification. the units attribute as implemented in webkitaudiocontext implementations is unused, and always returns 0. there is no reason why you should need this attribute. removal of mediaelementaudiosourcenode.mediaelement the mediaelement attribute of mediaelementaudiosourcenode has be...
Background audio processing using AudioWorklet - Web APIs
ontaining the processor to the worklet. once that's done, it instantiates and returns a new audioworkletnode. once you have that in hand, you connect it to other nodes and otherwise use it just like any other node. you can then create a new audio processor node by simply doing this: let newprocessornode = createmyaudioprocessor(); if the returned value, newprocessornode, is non-null, we have a valid audio context with its hiss processor node in place and ready to use. supporting audio parameters just like any other web audio node, audioworkletnode supports parameters, which are shared with the audioworkletprocessor that does the actual work. adding parameter support to the processor to add parameters to an audioworkletnode, you need to define them within your audioworkletprocessor-based ...
Attestation and Assertion - Web APIs
newly generated key pair came from a specific device. this provides a root of trust for a newly generated key pair as well as being able to identify the attributes of a device being used (how the private key is protected; if / what kind of biometric is being used; whether a device has been certified; etc.). it should be noted that while attestation provides the capability for a root of trust, validating the root of trust is frequently not necessary. when registering an authenticator for a new account, typically a trust on first use (tofu) model applies; and when adding an authenticator to an existing account, a user has already been authenticated and has established a secure session. assertion when a user chooses to log into a service, the server sends a challenge and the authenticator si...
Using Web Workers - Web APIs
resolved relative to the parent worker's location rather than that of the owning page. this makes it easier for workers to keep track of where their dependencies are. importing scripts and libraries worker threads have access to a global function, importscripts(), which lets them import scripts. it accepts zero or more uris as parameters to resources to import; all of the following examples are valid: importscripts(); /* imports nothing */ importscripts('foo.js'); /* imports just "foo.js" */ importscripts('foo.js', 'bar.js'); /* imports two scripts */ importscripts('//example.com/hello.js'); /* you can import scripts from other origins */ the browser loads each listed script and executes it. any global objects from each script may then be used b...
Window.getComputedStyle() - Web APIs
ent [, pseudoelt]); element the element for which to get the computed style. pseudoeltoptional a string specifying the pseudo-element to match. omitted (or null) for real elements. the returned style is a live cssstyledeclaration object, which updates automatically when the element's styles are changed. throws typeerror if the passed object is not an element or the pseudoelt is not a valid pseudo-element selector or is ::part() or ::slotted(). note: valid pseudo-element selector refers to syntactic validity, e.g. ::unsupported is considered valid, even though the pseudo-element itself is not supported. examples in this example we style a <p> element, then retrieve those styles using getcomputedstyle(), and print them into the text content of the <p>. html <p>hello</p>...
Window.localStorage - Web APIs
keys and the values are always in the utf-16 domstring format, which uses two bytes per character. as with objects, integer keys are automatically converted to strings. syntax mystorage = window.localstorage; value a storage object which can be used to access the current origin's local storage space. exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). for example, the user may have their browser configured to deny permission to persist data for the specified origin. example the following snippet accesses the current domain's local storage object and adds a data item to it using storage.setitem(). localstorage.setitem('mycat', 'tom'); the sy...
Window.sessionStorage - Web APIs
and the values are always in the utf-16 domstring format, which uses two bytes per character. as with objects, integer keys are automatically converted to strings. syntax mystorage = window.sessionstorage; value a storage object which can be used to access the current origin's session storage space. exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). for example, the user may have their browser configured to deny permission to persist data for the specified origin. example the following snippet accesses the current origin's session storage object and adds data to it with storage.setitem(). sessionstorage.setitem('mycat', 'tom'); the follow...
Window - Web APIs
Web › API › Window
led promise rejection events. windoweventhandlers.onunload called when the user navigates away from the page. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. error fired when a resource failed to load, or can't be used. for example, if a script has an execution error or an image can't be found or is invalid. also available via the onerror property. languagechange fired at the global scope object when the user's preferred language changes. also available via the onlanguagechange property. orientationchange fired when the orientation of the device has changed. also available via the onorientationchange property. devicemotion fired at a regular interval, indicating the amount of physical force...
WindowOrWorkerGlobalScope.atob() - Web APIs
decode control characters such as ascii values 0 through 31. for use with unicode or utf-8 strings, see the note on "unicode strings" in the page for btoa(). syntax var decodeddata = scope.atob(encodeddata); parameters encodeddata a binary string contains an base64 encoded data. return value an ascii string containing decoded data from encodeddata. exceptions domexception (name: invalidcharactererror) throws if encodeddata is not valid base64. example const encodeddata = window.btoa('hello, world'); // encode a string const decodeddata = window.atob(encodeddata); // decode the string polyfill you can use a polifill from https://github.com/maxart2501/base64-js/blob/master/base64.js for browsers that don't support it. specifications specification status comm...
WindowOrWorkerGlobalScope.btoa() - Web APIs
e cause communication problems, transmit it, then use the atob() method to decode the data again. for example, you can encode control characters such as ascii values 0 through 31. syntax var encodeddata = scope.btoa(stringtoencode); parameters stringtoencode the binary string to encode. return value an ascii string containing the base64 representation of stringtoencode. exceptions invalidcharactererror the string contained a character that did not fit in a single byte. see "unicode strings" below for more detail. example const encodeddata = window.btoa('hello, world'); // encode a string const decodeddata = window.atob(encodeddata); // decode the string unicode strings the btoa() function takes a javascript string as a parameter. in javascript strings are represented using ...
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
this id was returned by the corresponding call to setinterval(). it's worth noting that the pool of ids used by setinterval() and settimeout() are shared, which means you can technically use clearinterval() and cleartimeout() interchangeably. however, for clarity, you should avoid doing so. ...
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
specifications specification status comment html living standardthe definition of 'windoworworkerglobalscope.cleartimeout()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. html living standardthe definition of 'cleartimeou...
Worker() - Web APIs
Web › API › Worker › Worker
in, or include. if not specified, or if type is classic, the default used is omit (no credentials required). name: a domstring specifying an identifying name for the dedicatedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes. exceptions a securityerror is raised if the document is not allowed to start workers, e.g. if the url has an invalid syntax or if the same-origin policy is violated. a networkerror is raised if the mime type of the worker script is incorrect. it should always be text/javascript. a syntaxerror is raised if aurl cannot be parsed. examples the following code snippet shows creation of a worker object using the worker() constructor and subsequent usage of the object: var myworker = new worker('worker.js'); fi...
WorkerGlobalScope.importScripts() - Web APIs
nterface synchronously imports one or more scripts into the worker's scope. syntax self.importscripts('foo.js'); self.importscripts('foo.js', 'bar.js', ...); parameters a comma-separated list of domstring objects representing the scripts to be imported. these paths are relative to html document base url. return value none. exceptions networkerror imported scripts were not served with a valid javascript mime type (i.e. text/javascript). example if you had some functionality written in a separate script called foo.js that you wanted to use inside worker.js, you could import it using the following line: importscripts('foo.js'); importscripts() and self.importscripts() are effectively equivalent — both represent importscripts() being called from inside the worker's inner scope. s...
Worklet.addModule() - Web APIs
Web › API › Worklet › addModule
one of "omit", "same-origin", or "include". defaults to "same-origin". see also request.credentials. return value a promise that resolves once the module from the given url has been added. the promise doesn't return any value. exceptions if addmodule() fails, it rejects the promise, delivering one of the following errors to the rejection handler. aborterror the specified script is invalid or could not be loaded. syntaxerror the specified moduleurl is invalid. examples audioworklet example const audioctx = new audiocontext(); const audioworklet = audioctx.audioworklet; await audioworklet.addmodule('modules/bypassfilter.js', { credentials: 'omit', }); paintworklet example css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklets/hilite.js'...
XDomainRequest.responseText - Web APIs
returns the response body of an xdomainrequest as a string. note: this property is valid during the xdomainrequest.onprogress and xdomainrequest.onload events. syntax var response = xdr.responsetext; this sets response to contain the response body of the request, as a string. example var response = xdr.responsetext; specification not part of any specification. ...
Sending and Receiving Binary Data - Web APIs
rides the mime type, forcing the browser to treat it as plain text, using a user-defined character set. this tells the browser not to parse it, and to let the bytes pass through unprocessed. var filestream = load_binary_resource(url); var abyte = filestream.charcodeat(x) & 0xff; // throw away high-order byte (f7) the example above fetches the byte at offset x within the loaded binary data. the valid range for x is from 0 to filestream.length-1. see downloading binary streams with xmlhttprequest for a detailed explanation. see also downloading files. sending binary data the send method of the xmlhttprequest has been extended to enable easy transmission of binary data by accepting an arraybuffer, blob, or file object. the following example creates a text file on-the-fly and uses the post m...
Synchronous and asynchronous requests - Web APIs
y don't notice the problem because the hang only manifests with poor network conditions or when the remote server is slow to respond. synchronous xhr is now in deprecation state. the recommendation is that developers move away from the synchronous api and instead use asynchronous requests. all new xhr features such as timeout or abort are not allowed for synchronous xhr. doing so will raise an invalidaccesserror. example: http synchronous request this example demonstrates how to make a simple synchronous request. var request = new xmlhttprequest(); request.open('get', '/bar/foo.txt', false); // `false` makes the request synchronous request.send(null); if (request.status === 200) { console.log(request.responsetext); } line 3 sends the request. the null parameter indicates that no body ...
XMLHttpRequest.overrideMimeType() - Web APIs
the one specified by the server. if the server doesn't specify a type, xmlhttprequest assumes "text/xml". return value undefined. example this example specifies a mime type of "text/plain", overriding the server's stated type for the data being received. note: if the server doesn't provide a content-type header, xmlhttprequest assumes that the mime type is "text/xml". if the content isn't valid xml, an "xml parsing error: not well-formed" error occurs. you can avoid this by calling overridemimetype() to specify a different type. // interpret the received data as plain text req = new xmlhttprequest(); req.overridemimetype("text/plain"); req.addeventlistener("load", callback, false); req.open("get", url); req.send(); specifications specification status comment ...
XMLHttpRequest.responseText - Web APIs
as not yet been sent by calling send(). while handling an asynchronous request, the value of responsetext always has the current content received from the server, even if it's incomplete because the data has not been completely received yet. you know the entire content has been received when the value of readystate becomes xmlhttprequest.done (4), and status becomes 200 ("ok"). exceptions invalidstateerror the xmlhttprequest.responsetype is not set to either the empty string or "text". since the responsetext property is only valid for text content, any other value is an error condition. example var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); // if specified, responsetype must be empty string or "text" xhr.responsetype = 'text'; xhr.onload = function () { if (xh...
XMLHttpRequest.responseType - Web APIs
lhttprequest to learn more about using xhr to fetch html content. json the response is a javascript object created by parsing the contents of received data as json. text the response is a text in a domstring object. ms-stream the response is part of a streaming download; this response type is only allowed for download requests, and is only supported by internet explorer. exceptions invalidaccesserror an attempt was made to change the value of responsetype on anxmlhttprequest which is in synchronous mode but not in a worker. for additional details, see synchronous xhr restrictions below. usage notes synchronous xhr restrictions you cannot change the value of responsetype in a synchronous xmlhttprequest except when the request belongs to a worker. this restriction is designed in...
XMLHttpRequest.responseXML - Web APIs
erver doesn't specify the content-type as "text/xml" or "application/xml", you can use xmlhttprequest.overridemimetype() to parse it as xml anyway. this property isn't available to workers. syntax var data = xmlhttprequest.responsexml; value a document from parsing the xml or html received using xmlhttprequest, or null if no data was received or if the data is not xml/html. exceptions invalidstateerror the responsetype isn't either "document" or an empty string. example var xhr = new xmlhttprequest; xhr.open('get', '/server'); // if specified, responsetype must be empty string or "document" xhr.responsetype = 'document'; // force the response to be parsed as xml xhr.overridemimetype('text/xml'); xhr.onload = function () { if (xhr.readystate === xhr.done && xhr.status === 200)...
XMLHttpRequest.send() - Web APIs
he fetch spec can be a blob, buffersource, formdata, urlsearchparams, or usvstring object. null if no value is specified for the body, a default value of null is used. the best way to send binary content (e.g. in file uploads) is by using an arraybufferview or blob in conjunction with the send() method. return value undefined. exceptions exception description invalidstateerror send() has already been invoked for the request, and/or the request is complete. networkerror the resource type to be fetched is a blob, and the method is not get. example: get var xhr = new xmlhttprequest(); xhr.open('get', '/server', true); xhr.onload = function () { // request finished. do processing here. }; xhr.send(null); // xhr.send('string'); // xhr.se...
XMLHttpRequest.timeout - Web APIs
when a timeout happens, a timeout event is fired. ...
XMLSerializer.serializeToString() - Web APIs
xmlstring = anxmlserializer.serializetostring(rootnode); parameters rootnode the node to use as the root of the dom tree or subtree for which to construct an xml representation. return value a domstring containing the xml representation of the specified dom tree. exceptions typeerror the specified rootnode is not a compatible node type. the root node must be either node or attr. invalidstateerror the tree could not be successfully serialized, probably due to issues with the content's compatibility with xml serialization. syntaxerror a serialization of html was requested but could not succeed due to the content not being well-formed. usage notes compatible node types the specified root node—and all of its descendants—must be compatible with the xml serialization algori...
XPathEvaluator.createExpression() - Web APIs
reateexpression(expression, resolver); parameters expression a domstring representing representing the xpath expression to be created. resolver optional permits translation of all prefixes, including the xml namespace prefix, within the xpath expression into appropriate namespace uris. return value a xpathexpression representing the compiled form of the xpath expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexception of type namespace_error is raised. example the following example shows the use of the evaluate() method. ht...
XPathEvaluator.evaluate() - Web APIs
expression. this must be one of the xpathresult.constants. result optional allows to specify a result object which may be reused and returned by this method. if this is specified as null or the implementation does not reuse the specified result, a new result object will be returned. return value an xpathresult object representing the result of evaluating the xpath expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised. type_err in case result cannot be converted to the specified type, an xpathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexcep...
XPathException - Web APIs
in the dom xpath api the xpathexception interface represents exception conditions that can be encountered while performing xpath operations. properties xpathexception.code read only returns a short that contains one of the error code constants. constants constant value description invalid_expression_err 51 if the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific xpathevaluator or contains specialized extension functions or variables not supported by this implementation. type_err 52 if the expression cannot be converted to return the specified type. specifications specification status comment document object model (dom) level 3 xpath specificationth...
XPathExpression.evaluate() - Web APIs
expression. this must be one of the xpathresult.constants. result optional allows to specify a result object which may be reused and returned by this method. if this is specified as null or the implementation does not reuse the specified result, a new result object will be returned. return value an xpathresult object representing the result of evaluating the xpath expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised. type_err in case result cannot be converted to the specified type, an xpathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexcep...
XPathResult.iterateNext() - Web APIs
esult interface iterates over a node set result and returns the next node from it or null if there are no more nodes. syntax var node = result.iteratenext(); return value the next node within the node set of the xpathresult. exceptions type_err in case xpathresult.resulttype is not unordered_node_iterator_type or ordered_node_iterator_type, an xpathexception of type type_err is thrown. invalid_state_err if the document is mutated since the result was returned, an xpathexception of type invalid_state_err is thrown. example the following example shows the use of the iteratenext() method. html <div>xpath example</div> <div>tag names of the matched nodes: <output></output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_ty...
XPathResult.snapshotItem() - Web APIs
syntax var node = result.snapshotitem(i); return value the node at the given index within the node set of the xpathresult. exceptions type_err in case xpathresult.resulttype is not unordered_node_snapshot_type or ordered_node_snapshot_type, an xpathexception of type type_err is thrown. ...
XRFrame.getViewerPose() - Web APIs
rence between two spaces. syntax var xrviewerpose = xrframe.getviewerpose(referencespace); parameters referencespace an xrreferencespace object specifying the space to use as the reference point or base for the computation of the viewer's current pose. return value a xrviewerpose describing the viewer's position and orientation relative to the specified reference space. exceptions invalidstateerror a domexception indicating that getviewerpose() was not called within the context of a callback to a session's xrsession.requestanimationframe(). examples in this callback function for requestanimationframe(), the xrviewerpose describing the viewer's viewpoint on the world is obtained by calling getviewerpose() on the xrframe passed into the callback. viewerpose = xrframe.getviewerp...
XRHandedness - Web APIs
rformance constraints), scans the list of input sources looking for any which have a gripspace which isn't null. if a gripspace is present, that means the input source is a hand-held device of some sort, so it should be rendered visibly if possible. if gripspace is non-null, the function proceeds to get the pose for the gripspace transformed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw the appropriate model positioned and formed for the correct hand. specifications specification status comment webxr device apithe definition of 'xrhandedness' in that specification. working draft...
XRInputSource.gripSpace - Web APIs
specifications specification status comment webxr device apithe definition of 'xrinputsource.gripspace' in that specification. working draft initial definition. ...
XRInputSource.handedness - Web APIs
rformance constraints), scans the list of input sources looking for any which have a gripspace which isn't null. if a gripspace is present, that means the input source is a hand-held device of some sort, so it should be rendered visibly if possible. if gripspace is non-null, the function proceeds to get the pose for the gripspace transformed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw the appropriate model positioned and formed for the correct hand. specifications specification status comment webxr device apithe definition of 'xrinputsource.handedness' in that specification. w...
XRInputSource.targetRaySpace - Web APIs
oundedreferencespace—which represents the position and orientation of the input controller's target ray in virtual space. the native origin of the returned xrspace is located at the point from which the target ray is emitted, and the orientation of the space indicates the direction in which the target ray is pointing. usage notes all input sources—regardless of their targetraymode—have a valid targetrayspace. the exact meaning of this space varies, however, depending on the mode: every gaze input (targetraymode value of gaze), shares the same xrspace object as their target ray space, since the gaze input comes from the viewer's head. this shared space represents the same location as the space returned by the xrsession method requestreferencespace(), but is maintained as a different ...
XRReferenceSpaceEventInit - Web APIs
s. you will not usually need to use this, since these events are created by the webxr infrastructure. properties referencespace the xrreferencespace from which the event originated. transform an xrrigidtransform which maps the old coordinate system (from before the changes indicated by this event) to the new coordiante system. usage notes all of this dictionary's properties must have valid values set on them before calling the xrreferencespaceevent() constructor. examples this simple snippet calls the constructor to create a new reference space event of type reset. let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr device apithe de...
XRSession.updateRenderState() - Web APIs
es into account the output canvas's aspect ratio. this property must not be specified for immersive sessions, so the value is null by default for immersive sessions. the default value is otherwise π * 0.5 (half of the value of pi). return value none. exceptions this method may throw any of the following exceptions. these are true exceptions, since this method does not return a promise. invalidstateerror this may occur for one of the following reasons: the xrsession has already ended, so you cannot change its render state. the baselayer specified in newstate was created by an xrsession other than the one on which updaterenderstate() was called. the inlineverticalfieldofview property was set, but the session is immersive and therefore does not allow this property to be used. ...
XRSystem: requestSession() - Web APIs
new xrsession. see specifying session options for details on how to configure a webxr session. return value a promise that resolves with an xrsession object if the device and user agent support the requested mode and features. exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: invalidstateerror the requested session mode is immersive-vr but there is already an immersive vr session either currently active or in the process of being set up. there can only be one immersive vr session at a time. notsupportederror there is no webxr-compatible device available, or the device does not support the specified sessionmode; this can also be thrown if any of the required options are uns...
XRViewerPose.views - Web APIs
scene for the current viewer pose. this array's length may potentially vary over the lifetime of the xrsession (for example, if the viewer enables or disables stereo mode on their xr output device). examples in this example—part of the code to render an xrframe, getviewerpose() is called to get an xrviewerpose using the same reference space the code is using as its base reference space. if a valid pose is returned, the frame is rendered by clearing the backbuffer and then rendering each of the views in the pose; these are most likely the views for the left and right eyes. let pose = frame.getviewerpose(xrreferencespace); if (pose) { let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0, 0, 0, 1); gl.cleardepth(1);...
XRViewerPose - Web APIs
eference space in which the origin's position should be computed. the returned xrviewerpose tells you where the viewer is and what direction they're facing at the time at which the frame takes place. examples in this example—part of the code to render an xrframe, getviewerpose() is called to get an xrviewerpose using the same reference space the code is using as its base reference space. if a valid pose is returned, the frame is rendered by clearing the backbuffer and then rendering each of the views in the pose; these are most likely the views for the left and right eyes. let pose = frame.getviewerpose(xrreferencespace); if (pose) { let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); gl.clearcolor(0, 0, 0, 1); gl.cleardepth(1);...
XRVisibilityState - Web APIs
values hidden the virtual scene generated by the xrsession is not currently visible to the user, so its requestanimationframe() callbacks are not being executed until thevisibilitystate changes. input controllers are not being handled for the session. visible the virtual scene rendered by the xrsession is currently visible to the user and is the primary focus of the user's attention. ...
XRWebGLLayer() - Web APIs
equests that the new layer include a stencil buffer. otherwise, no stencil buffer is allocated. the default is false. return value a newly-created xrwebgllayer which links the specified xrsession to the webgl context given by context, which will be used as the renderer for the session. any options specified in layerinit are used to tailor the rendering system's configuration. exceptions invalidstateerror the new xrwebgllayer could not be created due to one of a number of possible state errors: the xrsession specified by session has already been stopped. the specified webgl context, context, has been lost for any reason, such as a gpu switch or reset. the specified session is immersive but the context is not webxr compatible. operationerror the resources (including memo...
XRWebGLLayer.framebuffer - Web APIs
t webgl framebuffer: opaque framebuffers may support anti-aliasing, even under webgl 1.0, which don't normally do so. opaque framebuffers' attachments (buffers and the like) can't be inspected or changed. calling functions such as framebuffertexture2d(), framebufferrenderbuffer(), deleteframebuffer(), or getframebufferattachmentparameter() on an opaque framebuffer results in the webgl error invalid_operation (0x0502). opaque framebuffers are considered incomplete and are not available for rendering other than while executing the requestanimationframe() callback. attempting to clear, draw to, or read from the framebuffer results in a webgl invalid_framebuffer_operation error (0x0506). calling checkframebufferstatus() on the webgl context from outside the animation frame callback causes the ...
XRWebGLLayer.getViewport() - Web APIs
which the scene should be rendered for the eye represented by the view. syntax let viewport = xrwebgllayer.getviewport(view); parameters view an xrview object indicating the view for which the viewport is to be returned. return value a xrviewport object representing the viewport which will restrict drawing to the portion of the layer corresponding to the specified view. exceptions invalidstateerror either the specified view is not in an active xrframe or that xrframe and the xrwebgllayer are not part of the same webxr session. example this example demonstrates in part what the callback for the requestanimationframe() function might look like, using getviewport() to get the viewport so that drawing can be constrained to the area set aside for the eye whose viewpoint is currentl...
XRWebGLLayer.ignoreDepthValues - Web APIs
depth given by the session's depthnear and a value of 1.0 corresponds to the depth given by depthfar. the depth, in tandem with the coordinates of each point being rendered, makes it possible to more accurately represent the scene in the 3d space. examples if the web application which is using wexr is rendering its content without using a depth buffer—or if the depth buffer's contents are invalid—you should disable the use of the depth buffer for webxr rendering by setting ignoredepthvalues to true when creating the xrwebgllayer. this is demonstrated in the snippet of code below: const gllayeroptions = { ignoredepthvalues: true }; let gllayer = new xrwebgllayer(xrsession, gl, gllayeroptions); specifications specification status comment webxr device apithe d...
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
, relative to the default xr device display resolution. for example, a value of 1.0 indicates that the frame buffer should be the same resolution as the actual display, while a value of 0.5 indicates that the frame buffer should be half the resolution of the display. a value of 2.0, on the other hand, creates a frame buffer whose resolution is double that of the actual display buffer. there are valid use cases for all of these kinds of scaling. see managing rendering quality in webxr performance guide for more information. you can determine the scaling factor that you would need to apply to match the default frame buffer resolution by using the xrwebgllayer.getnativeframebufferscalefactor() static function. syntax let layerinit = { framebufferscalefactor: scalefactor }; let gllayer = new...
msCapsLockWarningOff - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mscapslockwarningoff read/write property turns automatic caps lock warning on or off for validated password input fields. this proprietary property is specific to internet explorer and microsoft edge. starting with internet explorer 10, input type=password fields will automatically display a warning if the caps lock is on. this property enables this warning to be disabled. syntax document.mscapslockwarningoff = true; value type: boolean false: default. automatic caps lock warning is turne...
msGetRegionContent - Web APIs
region. this proprietary method is specific to internet explorer browser. syntax var retval = element.msgetregioncontent(); parameters retval [out, reval] type: msrangecollection the name of the property to enable. return value type: boolean returned ranges are sorted by document position and do not overlap. if an element is not a region, this method throws a domexception with the invalidaccesserror error code. this is only available to regions that are document elements and not to regions that are pseudo-elements. see also microsoft api extensions ...
ARIA live regions - Accessibility
hen using this role. status a status bar or area of the screen that provides an updated status of some kind. screen reader users have a special command to read the current status. to maximize compatibility, add a redundant aria-live="polite" when using this role. alert error or warning message that flashes on the screen. alerts are particularly important for client side validation notices to users. (tbd: link to aria form tutorial with aria info) to maximize compatibility, some people recommend adding a redundant aria-live="assertive" when using this role. however, adding both aria-live and role="alert" causes double speaking issues in voiceover on ios. progressbar a hybrid between a widget and a live region. use this with aria-valuemin, aria-valuenow a...
Using the aria-required attribute - Accessibility
"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 aria roles combobox gridcell listbox radiogroup spinbutton textbox tree related aria techniques using the aria-invalid attribute compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for aria-required wai-aria authoring practices for forms constraint validation in html5 ...
Using ARIA: Roles, states, and properties - Accessibility
xtbox toolbar tooltip landmark roles banner complementary contentinfo form main navigation region search live region roles alert log marquee status timer window roles alertdialog dialog states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-label aria-level aria-modal aria-multiline aria-multiselectable aria-orientation aria-placeholder aria-pressed aria-readonly aria-required aria-selected aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext live region attributes aria-live aria-relevant aria-atomic aria-busy drag & drop attributes aria-dropeffect aria-dragged relationship att...
ARIA: alert role - Accessibility
y trigger the screen reader to read out the content. <p role="alert" style="display: none;">the alert will trigger when the element becomes visible.</p> while triggering an alert via css alone is possible, it is better to rely on javascript because it has more browser/screen reader support and is often more appropriate as part of a larger user interaction such as inside an event handler or form validation. with javascript, developers control the adding and removing of alerts as appropriate. <button type="button" onclick="triggeralert">trigger alert</button> <p class="alert">the alert will trigger when the button is pressed.</p> function triggeralert() { var alertel = document.queryselector('.alert'); alertel.addattribute("role", "alert"); } accessibility concerns the alert role sho...
ARIA: listbox role - Accessibility
authors use different styling for the selection when the list is not focused, e.g. a non-active selection is often shown with a lighter background colour. if the listbox is not part of another widget, it should have the aria-labelledby property set. if one or more entries are not dom children of listbox, additional aria-* properties will need to be set (see aria best practices). if there is a valid reason to expand the listbox, the combobox role may be more appropriate. specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria listbox role' in that specification. recommendation wai-aria authoring practicesthe definition of 'listbox role' in that specification. working draft screen reader supp...
overview - Accessibility
e, part two, part threet (example) creating an accessible, internationalized dojo rating widget tabs enhancing tabview accessibility with wai-aria roles and states, from the yui blog enhancing the jquery ui tabs accordingly to wcag 2.0 and aria tab panel example here on codetalks lightbox wcag 2.0 and aria-conformant lightbox application http://majx-js.digissime.net/js/popin/ form validation wcag 2.0 and aria-conformant live form validation tables german tutorial on creating an accessible form simple grid example at codetalks date picker grid at codetalks wcag 2.0 and aria-conformant sortable tables ...
ARIA - Accessibility
ogressbar.setattribute("role", "progressbar"); progressbar.setattribute("aria-valuemin", 0); progressbar.setattribute("aria-valuemax", 100); // create a function that can be called at any time to update // the value of the progress bar. function updateprogress(percentcomplete) { progressbar.setattribute("aria-valuenow", percentcomplete); } note that aria was invented after html4, so does not validate in html4 or its xhtml variants. however, the accessibility gains it provides far outweigh any technical invalidity. in html5, all aria attributes validate. the new landmark elements (<main>, <header>, <nav> etc) have built-in aria roles, so there is no need to duplicate them. support like any other web technology, there are varying degrees of support for aria. support is based on the opera...
An overview of accessible web applications and widgets - Accessibility
s here</div> <div id="quizpanel" role="tabpanel" aria-labelledby="quiztab">quiz content goes here</div> </div> aria is well supported by all major browsers, including firefox, safari, opera, chrome, and internet explorer, and many assistive technologies. presentational changes dynamic presentational changes include using css to change the appearance of content (such as a red border around invalid data, or changing the background color of a checked checkbox), as well as showing or hiding content. state changes aria provides attributes for declaring the current state of a ui widget. examples include (but are certainly not limited to): aria-checked: indicates the state of a checkbox or radio button aria-disabled: indicates that an element is visible, but not editable or otherwise opera...
HTML To MSAA - Accessibility
me can be computed from aria markup or @title attribute. ...
Web accessibility for seizures and physical reactions - Accessibility
e it has been rendered. it has the values of "none", "slow", and "fast". developmental & experimental features mdn navigator​.donottrack from the documentation: "returns the user's do-not-track setting. this is "1" if the user has requested not to be tracked by web sites, content, or advertising" media queries level 5 environmentmq (planned in media queries level 5) light-level has three valid values: dim, normal, and washed. interestingly, the specification refrains from actually defining the three levels in terms of a measurment of lux, because devices with a light sensor usually adjust the brightess of the screen automatically. the specifications also note the difference in technology, such as e-ink, which remains readable in bright daylight, versus liquid crystals, which do not. e...
Operable - Accessibility
(a) for functionality with time limits (e.g. completing a hotel or flight booking often has a time limit), the user should be given controls to allow them to adjust, extend or turn off the time limit. exceptions to this are activities with time limits longer than 20 hours, real time events (e.g. live multiplayer games), and any other activity that requires a time limit and would be invalidated if it were turned off. 2.2.2 pausing, stopping, hiding (a) for moving/blinking content that starts automatically, lasts longer than 5 seconds, and is shown alongside other content, controls should be provided to pause, stop, or hide it. this does not apply to moving/blinking content that is essential to the experience. examples include scrolling text and videos. ...
Robust - Accessibility
le as possible, not only with current user agents (e.g. browsers), but also with future ones too. success criteria how to conform to the criteria practical resource 4.1.1 parsing (a) content should be well-formed so it can be parsed successfully by browsers and other user agents such as screenreaders. to pass this criterion, make sure that your html is as valid as possible. use the w3c validator to validate your markup. see debugging html for a practical guide. 4.1.2 name, role, value (a) the name and role of user interface components (e.g. form inputs, buttons, links, etc.) should be programmatically determinable. when using semantic elements correctly for their intended purpose, this criterion should be passed automaticall...
Text labels and names - Accessibility
ss. examples the title for the reference article about the <title> element is as follows: <title>&lt;title&gt;: the document title element - html: hypertext markup language</title> another example might look like so: <title>fill in your details to register — mygov services</title> to help the user, you can update the page title value to reflect significant page state changes (such as form validation problems): <title>2 errors — fill in your details to register — mygov services</title> see also <title> embedded content must be labeled make sure that elements that embed content have a title attribute that describes the embedded content. this includes the <embed> and <object> elements. these elements are often used for graphical content, much like the <img> element. a descript...
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
Web › CSS › --*
valuesee proseapplies toall elementsinheritedyescomputed valueas specified with variables substitutedanimation typediscrete syntax --somekeyword: left; --somecolor: #0000ff; --somecomplexvalue: 3px 6px rgb(20, 32, 54); <declaration-value> this value matches any sequence of one or more tokens, so long as the sequence does not contain an unallowed token. it represents the entirety of what a valid declaration can have as its value. note: custom property names are case sensitive — --my-color will be treated as a separate custom property to --my-color. formal syntax <declaration-value> example html <p id="firstparagraph">this paragraph should have a blue background and yellow text.</p> <p id="secondparagraph">this paragraph should have a yellow background and blue text.</p> <div i...
::first-line (:first-line) - CSS: Cascading Style Sheets
examples html <p>styles will only be applied to the first line of this paragraph. after that, all text will be styled like normal. see what i mean?</p> <span>the first line of this text will not receive special styling because it is not a block-level element.</span> css ::first-line { color: blue; text-transform: uppercase; /* warning: do not use these */ /* many properties are invalid in ::first-line pseudo-elements */ margin-left: 20px; text-indent: 20px; } result specifications specification status comment css pseudo-elements level 4the definition of '::first-line' in that specification. working draft defines more strictly where ::first-letter can occur. generalizes allowed properties to typesetting, text decoration, and inline ...
::placeholder - CSS: Cascading Style Sheets
irst-line pseudo-element can be used in a rule using ::placeholder in its selector. note: in most browsers, the appearance of placeholder text is a translucent or light gray color by default. 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...
:default - CSS: Cascading Style Sheets
Web › CSS › :default
selectors level 4the definition of ':default' in that specification. working draft no change. ...
:in-range - CSS: Cascading Style Sheets
Web › CSS › :in-range
is useful for giving the user a visual indication that a field's current value is within the permitted limits. note: this pseudo-class only applies to elements that have (and can take) a range limitation. in the absence of such a limitation, the element can neither be "in-range" nor "out-of-range." syntax :in-range examples html <form action="" id="form1"> <ul>values between 1 and 10 are valid. <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,...
:indeterminate - CSS: Cascading Style Sheets
selectors level 4the definition of ':indeterminate' in that specification. working draft no change. ...
:not() - CSS: Cascading Style Sheets
Web › CSS › :not
ctor> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>? ']'where <attr-matcher> = [ '~' | | | '^' | '$' | '*' ]? '='<attr-modifier> = i | s description there are several unusual effects and outcomes when using :not() that you should keep in mind when using it: the :not pseudo-class may not be nested, which means that :not(:not(...)) is invalid. since pseudo-elements are not simple selectors, they are not valid arguments to :not(); thus, selectors like :not(p::before) will not work. useless selectors can be written using this pseudo-class. for example, :not(*) matches any element which is not an element, which is obviously nonsense, so the accompanying rule will never be applied. this pseudo-class can increase the specificity of a ru...
:out-of-range - CSS: Cascading Style Sheets
useful for giving the user a visual indication that a field's current value is outside the permitted limits. note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
:read-only - CSS: Cascading Style Sheets
d-color: red; color: white; } p:read-write { background-color: lime; } specifications specification status comment html living standardthe definition of ':read-only' in that specification. living standard no change. html5the definition of ':read-only' in that specification. recommendation defines the semantics regarding html and constraint validation. selectors level 4the definition of ':read-only' in that specification. working draft defines the pseudo-class, but not the associated semantics. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. d...
:read-write - CSS: Cascading Style Sheets
color: red; color: white; } p:read-write { background-color: lime; } specifications specification status comment html living standardthe definition of ':read-write' in that specification. living standard no change. html5the definition of ':read-write' in that specification. recommendation defines the semantics regarding html and constraint validation. selectors level 4the definition of ':read-write' in that specification. working draft defines the pseudo-class, but not the associated semantics. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
fallback - CSS: Cascading Style Sheets
e fallback descriptor can be used to specify a counter style to fall back to if the current counter style cannot create a marker representation for a particular counter value. syntax /* keyword values */ fallback: lower-alpha; fallback: custom-gangnam-style; description if the specified fallback style is also unable to construct a representation, then its fallback style will be used. if a valid fallback style is not specified, it defaults to decimal. a couple of scenarios where a fallback style will be used are: when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. when the fixed system is used and there are not enough symbols to cover all the list items, the fallback style will be used for the r...
range - CSS: Cascading Style Sheets
, that means it always contains both, the lower and upper bound numbers. if infinite is used as the first value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. the range of the counter style is the union of all the ranges defined in the list. if the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and will be ignored. description the value of the range descriptor can be either auto or a comma separated list of lower and upper bounds specified as integers. if value is auto, then for cyclic, numeric, and fixed system, the range will be from negative infinity to positive infinity. for alphabetic and symbolic systems, range will be from 1 to positive infinity. for additive systems, auto wi...
font-variation-settings - CSS: Cascading Style Sheets
ault settings. <string> <number> when rendering text, the list of opentype axis names is passed to the text layout engine to enable or disable font features. each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value. if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative. formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src: url('open_type_font.woff2') format('woff2'); font-weight: normal; font-style: normal; font-v...
@keyframes - CSS: Cascading Style Sheets
e that is then used by the animation-name property to match an animation to its keyframe declaration. each @keyframes rule contains a style list of keyframe selectors, which specify percentages along the animation when the keyframe occurs, and a block containing the styles for that keyframe. you can list the keyframe percentages in any order; they will be handled in the order they should occur. valid keyframe lists if a keyframe rule doesn't specify the start or end states of the animation (that is, 0%/from and 100%/to), browsers will use the element's existing styles for the start/end states. this can be used to animate an element from its initial state and back. properties that can't be animated in keyframe rules are ignored, but supported properties will still be animated. resolving dup...
@media - CSS: Cascading Style Sheets
Web › CSS › @media
e added in media queries level 5. update how frequently the output device can modify the appearance of content added in media queries level 4. width width of the viewport including width of scrollbar accessibility concerns to best accommodate people who adjust a site's text size, use ems when you need a <length> for your media queries. both em and px are valid units, but em works better if the user changes the browser text size. also consider using level 4 media queries to improve the user's experience. for example, prefers-reduced-motion to detect if the user has requested that the system minimize the amount of animation or motion it uses. security because media queries provide insights into the capabilities—and by extension, the features and des...
Box-shadow generator - CSS: Cascading Style Sheets
= ((green - blue) / delta); } if (cmax === green ) { hue = 2 + (blue - red) / delta; } if (cmax === blue ) { hue = 4 + (red - green) / delta; } if (cmax) saturation = delta / cmax; } this.hue = 60 * hue | 0; if (this.hue < 0) this.hue += 360; this.saturation = (saturation * 100) | 0; this.value = (cmax * 100) | 0; } color.prototype.sethexa = function sethexa(value) { var valid = /(^#{0,1}[0-9a-f]{6}$)|(^#{0,1}[0-9a-f]{3}$)/i.test(value) if (valid !== true) return; if (value[0] === '#') value = value.slice(1, value.length); if (value.length === 3) value = value.replace(/([0-9a-f])([0-9a-f])([0-9a-f])/i,"$1$1$2$2$3$3"); this.r = parseint(value.substr(0, 2), 16); this.g = parseint(value.substr(2, 2), 16); this.b = parseint(value.substr(4, 2), 16);...
Using URL values for the cursor property - CSS: Cascading Style Sheets
ursor: [ <url> , ]* <keyword> this means that zero or more urls may be specified (comma-separated), which must be followed by one of the keywords defined in the css specification, such as auto or pointer. for example, the following value would be allowed: cursor: url(foo.cur), url(http://www.example.com/bar.gif), auto; this will first try loading foo.cur. if that file does not exist or is not valid for some other reason, bar.gif is tried, and if that can't be used either, auto will be used. support for the css 3 syntax for cursor values got added in gecko 1.8 (firefox 1.5): cursor: [ <uri> [ <x> <y> ]? , ]* <keyword> it allows specifying the coordinates of the cursor's hotspot, which will be clamped to the boundaries of the cursor image. if none are specified, the coordinates of the hot...
Styling Columns - CSS: Cascading Style Sheets
value for column-gap is a <length-percentage>, this means percentages are allowed. percentage values for column-gap are calculated as a percentage of the width of the multicol container. column rules the specification defines column-rule-width, column-rule-style and column-rule-color, providing a shorthand column-rule. these properties work in exactly the same way as the border properties: any valid border-style can be used as a column-rule-style. these properties are applied to the element which is the multicol container and therefore all columns will have the same rule. rules are only drawn between columns and not on the outer edges. rules should also only be drawn between columns which have content. in this next example i have created a 5px dotted rule with a color of rebeccapurple, usi...
Using feature queries - CSS: Cascading Style Sheets
r a bare property name such as display; the rule requires a property name and a value: @supports (property: value) { css rules to apply } if you want to check if a browser supports the row-gap property, for example, you would write the following feature query. it doesn't matter which value you use in a lot of cases: if all you want is to check that the browser supports this property, then any valid value will do. the value part of the property value pair matters more if you are testing for new values of a particular property. a good example would be the display property. all browsers support display, as display: block dates back to css1. however the values display: flex and display: grid are newer. there are often additional values added to properties in css, and so the fact that you hav...
The stacking context - CSS: Cascading Style Sheets
#6 it is important to note that div #4, div #5 and div #6 are children of div #3, so stacking of those elements is completely resolved within div#3. once stacking and rendering within div #3 is completed, the whole div #3 element is passed for stacking in the root element with respect to its sibling's div. notes: div #4 is rendered under div #1 because div #1's z-index (5) is valid within the stacking context of the root element, while div #4's z-index (6) is valid within the stacking context of div #3. so, div #4 is under div #1, because div #4 belongs to div #3, which has a lower z-index value. for the same reason div #2 (z-index 2) is rendered under div#5 (z-index 1) because div #5 belongs to div #3, which has an higher z-index value. div #3's z-index is 4, but this va...
Basic Shapes - CSS: Cascading Style Sheets
for ellipses, this is the closest side in the radius dimension. the keyword farthest-side uses the length from the center of the shape to the farthest side of the reference box. for circles, this is the farthest side in any dimension. for ellipses, this is the farthest side in the radius dimension. the second argument is a position. if omitted this will be set to center. however you can use any valid position here to indicate the position of the centre of the circle. our circle therefore accepts one radius value, which may be a length, a percentage or the closest-side or farthest side keyword then optionally the keyword at followed by a position value. in the below example i have created a circle on an item with a width of 100 pixels, plus a margin of 20 pixels. this gives a total width for...
Media queries - CSS: Cascading Style Sheets
dia query. use @import to conditionally apply an entire style sheet. media queries in html in html, media queries can be applied to various elements: in the <link> element's media attribute, they define the media to which a linked resource (typically css) should be applied. in the <source> element's media attribute, they define the media to which that source should be applied. (this is only valid inside <picture> elements.) in the <style> element's media attribute, they define the media to which the style should be applied. media queries in javascript in javascript, you can use the window.matchmedia() method to test the window against a media query. you can also use mediaquerylist.addlistener() to be notified whenever the state of a query changes. with this functionality, your site or...
Value definition syntax - CSS: Cascading Style Sheets
the definition syntax describes which values are allowed and the interactions between them. a component can be a keyword, some characters considered as a literal, or a value of a given css data type or of another css property. component value types keywords generic keywords a keyword with a predefined meaning appears literally, without quotation marks. for example: auto, smaller or ease-in. ...
animation-duration - CSS: Cascading Style Sheets
tions */ animation-duration: 1.64s, 15.22s; animation-duration: 10s, 35s, 230ms; values <time> the time that an animation takes to complete one cycle. this may be specified in either seconds (s) or milliseconds (ms). the value must be positive or zero and the unit is required. a value of 0s, which is the default value, indicates that no animation should occur. note: negative values are invalid, causing the declaration to be ignored. some early, prefixed, implementations may consider them as identical to 0s. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property val...
animation-iteration-count - CSS: Cascading Style Sheets
count: 2, 0, infinite; the animation-iteration-count property is specified as one or more comma-separated values. values infinite the animation will repeat forever. <number> the number of times the animation will repeat; this is 1 by default. you may specify non-integer values to play part of an animation cycle: for example, 0.5 will play half of the animation cycle. negative values are invalid. note: when you specify multiple values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal definition initial value1applies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas spe...
border-bottom-left-radius - CSS: Cascading Style Sheets
or the border in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percent...
border-bottom-right-radius - CSS: Cascading Style Sheets
or the border in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percent...
border-end-end-radius - CSS: Cascading Style Sheets
right-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percent...
border-end-start-radius - CSS: Cascading Style Sheets
right-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percent...
border-image-outset - CSS: Cascading Style Sheets
/* top | horizontal | bottom */ border-image-outset: 30px 2 45px; /* top | right | bottom | left */ border-image-outset: 7px 12px 14px 5px; /* global values */ border-image-outset: inherit; border-image-outset: initial; border-image-outset: unset; the border-image-outset property may be specified as one, two, three, or four values. each value is a <length> or <number>. negative values are invalid and will cause the border-image-outset declaration to be ignored. if one value is specified, it applies to all four sides. if two values are specified, the first applies to the top and bottom and the second to the left and right. if three values are specified, the first applies to the top, the second to the left and right, and the third to the bottom. if four values are specified, they appl...
border-image-slice - CSS: Cascading Style Sheets
top | right | bottom | left */ border-image-slice: 7 12 14 5; /* using the `fill` keyword */ border-image-slice: 10% fill 7 12; /* global values */ border-image-slice: inherit; border-image-slice: initial; border-image-slice: unset; the border-image-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. when two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right. when three positions are specified, the first value cr...
border-radius - CSS: Cascading Style Sheets
it is used only in the three- and four-value syntaxes. bottom-left is a <length> or a <percentage> denoting a radius to use for the border in the bottom-left corner of the element's box. it is used only in the four-value syntax. <length> denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipse, using length values. negative values are invalid. <percentage> denotes the size of the circle radius, or the semi-major and semi-minor axes of the ellipse, using percentage values. percentages for the horizontal axis refer to the width of the box; percentages for the vertical axis refer to the height of the box. negative values are invalid. for example: border-radius: 1em/5em; /* ... is equivalent to: */ border-top-left-radius: 1em 5e...
border-start-end-radius - CSS: Cascading Style Sheets
-left-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percent...
border-start-start-radius - CSS: Cascading Style Sheets
-left-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percent...
border-top-left-radius - CSS: Cascading Style Sheets
or the border in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percent...
border-top-right-radius - CSS: Cascading Style Sheets
or the border in that corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal definition initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percent...
border - CSS: Cascading Style Sheets
Web › CSS › border
: 0 0 0 2rem skyblue; border-radius: 12px; font: bold 1rem sans-serif; margin: 2rem; padding: 1rem; outline-offset: 0.5rem; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border' in that specification. candidate recommendation removes specific support for transparent, as it is now a valid <color>; this has no practical impact. though it cannot be set to a custom value using the shorthand, border now resets border-image to its initial value (none). css level 2 (revision 1)the definition of 'border' in that specification. recommendation accepts the inherit keyword. also accepts transparent as a valid color. css level 1the definition of 'border' in that sp...
calc() - CSS: Cascading Style Sheets
Web › CSS › calc
ust be a <number>. the operands in the expression may be any <length> syntax value. you can use different units for each value in your expression, if you wish. you may also use parentheses to establish computation order when needed. notes the + and - operators must be surrounded by whitespace. for instance, calc(50% -8px) will be parsed as a percentage followed by a negative length — an invalid expression — while calc(50% - 8px) is a percentage followed by a subtraction operator and a length. likewise, calc(8px + -50%) is treated as a length followed by an addition operator and a negative percentage. the * and / operators do not require whitespace, but adding it for consistency is both allowed and recommended. division by zero results in an error being generated by the html parser. ...
clamp() - CSS: Cascading Style Sheets
Web › CSS › clamp
ill be used as long as the result is between the minimum and maximum values. the maximum value is the largest (most positive) expression value to which the value of the property will be assigned if the preferred value is greater than this upper bound. the expressions can be math functions (see calc() for more information), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions. as math expressions, so you can use addition, subtraction, multiplication and division without using the calc() function itself. you may also use parentheses to establish computation order when needed. you can use different units for each value in your expressions, and different units in any math function making up any of the ar...
column-width - CSS: Cascading Style Sheets
-width: initial; column-width: unset; the column-width property is specified as one of the values listed below. values <length> indicates the optimal column width. the actual column width may differ from the specified value: it may be wider when necessary to fill available space, and narrower when the available space is too small. the value must be strictly positive or the declaration is invalid. percentage values are also invalid. auto the width of the column is determined by other css properties, such as column-count. formal definition initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valuethe absolute length, zero or largeranimation typea length formal syntax <length> | auto examples setting column width in pixels html <p class="conten...
cross-fade() - CSS: Cascading Style Sheets
ite, 75% black */ cross-fade(url(white.png), url(black.png), 50%); /* 50% white, 50% black */ cross-fade(url(white.png), url(black.png), 75%); /* 75% white, 25% black */ cross-fade(url(white.png), url(black.png), 100%); /* fully white */ in the implemented syntax, the two comma-separated images are declared first, followed by a comma and required percent value. omitting the comma or percent invalidates the value. the percent is the opacity of the first declared image. the included percentage is subtracted from 100%, with the difference being the opacity of the second image. the green/red example (with the percentages totalling 150%) and the yellow/red/blue example (with three images) from the specification syntax section, are not possible in this implementation. accessibility concerns br...
<dimension> - CSS: Cascading Style Sheets
Web › CSS › dimension
<dimension> css data type represents a <number> with a unit attached to it, for example 10px. css uses dimensions to specify distances (<length>), durations (<time>), frequencies (<frequency>), resolutions (<resolution>), and other quantities. syntax the syntax of <dimension> is a <number> immediately followed by a unit which is an identifier. unit identifiers are case insensitive. examples valid dimensions 12px 12 pixels 1rem 1 rem 1.2pt 1.2 points 2200ms 2200 milliseconds 5s 5 seconds 200hz 200 hertz 200hz 200 hertz (values are case insensitive) invalid dimensions 12 px the unit must come immediately after the number. 12"px" units are identifiers and therefore unquoted. 3sec the seconds unit is abbreviated "s" not "sec". specificat...
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
the single values, while allowing the spec to evolve. can i start to use the two-value syntax? as demonstrated above, there is not a lot of advantage in using the two-value version right now; if you did your page would only work in firefox! other browsers do not yet implement the two-value versions. therefore display: block flex will only get you flex layout in firefox, and will be ignored as invalid in chrome. you can see current support in the compat data for the two-value syntax: the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidop...
<display-box> - CSS: Cascading Style Sheets
they are replaced by their pseudo-box and their child boxes. please note that the css display level 3 spec defines how the contents value should affect "unusual elements" — elements that aren’t rendered purely by css box concepts such as replaced elements. see appendix b: effects of display: contents on unusual elements for more details. due to a bug in browsers this will currently remove the element from the accessibility tree — screen readers will not look at what's inside. ...
<display-inside> - CSS: Cascading Style Sheets
these keywords specify the element’s inner display type, which defines the type of formatting context that lays out its contents (assuming it is a non-replaced element). these keywords are used as values of the display property, and can be used for legacy purposes as a single keyword, or as defined in the level 3 specification alongside a value from the <display-outside> keywords. syntax valid <display-inside> values: flow the element lays out its contents using flow layout (block-and-inline layout). if its outer display type is inline or run-in, and it is participating in a block or inline formatting context, then it generates an inline box. otherwise it generates a block container box. depending on the value of other properties (such as position, float, or overflow) and whether ...
<display-internal> - CSS: Cascading Style Sheets
table-header-group these elements behave like <thead> html elements. table-footer-group these elements behave like <tfoot> html elements. ...
<display-legacy> - CSS: Cascading Style Sheets
it is equivalent to inline flow-root. inline-table the inline-table value does not have a direct mapping in html. ...
<display-outside> - CSS: Cascading Style Sheets
the <display-outside> keywords specify the element’s outer display type, which is essentially its role in flow layout. these keywords are used as values of the display property, and can be used for legacy purposes as a single keyword, or as defined in the level 3 specification alongside a value from the <display-inside> keywords. syntax valid <display-outside> values: block the element generates a block element box, generating line breaks both before and after the element when in the normal flow. inline the element generates one or more inline element boxes that do not generate line breaks before or after themselves. in normal flow, the next element will be on the same line if there is space run-in the element generates a run-in box. if the adjacent sibling of the element defined...
<filter-function> - CSS: Cascading Style Sheets
blur() blurs the image. brightness() makes the image brighter or darker. ...
filter - CSS: Cascading Style Sheets
Web › CSS › filter
cific rules. if one filter is none, it is replaced with the filter functions list of the other one using the filter function default values, then all filter functions are interpolated according to their specific rules. otherwise, discrete interpolation is used. functions the filter property is specified as none or one or more of the functions listed below. if the parameter for any function is invalid, the function returns none. except where noted, the functions that take a value expressed with a percent sign (as in 34%) also accept the value expressed as decimal (as in 0.34). when a single filter property has two or more functions it's results will be different from when two or more filter properties are separately applied with the same functions. svg filter url() takes an uri pointing to...
flex-basis - CSS: Cascading Style Sheets
* automatically size based on the flex item’s content */ flex-basis: content; /* global values */ flex-basis: inherit; flex-basis: initial; flex-basis: unset; the flex-basis property is specified as either the keyword content or a <'width'>. values <'width'> an absolute <length>, a <percentage> of the parent flex container's main size property, or the keyword auto. negative values are invalid. defaults to auto. content indicates automatic sizing, based on the flex item’s content. note: this value was not present in the initial release of flexible box layout, and thus some older implementations will not support it. the equivalent effect can be had by using auto together with a main size (width or height) of auto. history: originally, flex-basis:auto meant "look at my wi...
flex-grow - CSS: Cascading Style Sheets
Web › CSS › flex-grow
d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-grow: 3; flex-grow: 0.6; /* global values */ flex-grow: inherit; flex-grow: initial; flex-grow: unset; the flex-grow property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 0. description this property specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor). the main size is either width or height of the item which is dependent on the flex-direction value. the remaining space is the size of the flex container minus the size of all flex items' sizes together. if all sibling items have the...
flex-shrink - CSS: Cascading Style Sheets
ntribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-shrink: 2; flex-shrink: 0.6; /* global values */ flex-shrink: inherit; flex-shrink: initial; flex-shrink: unset; the flex-shrink property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 1. formal definition initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set. d and e have flex-shrink:2 set</p> <p>the...
font-feature-settings - CSS: Cascading Style Sheets
s. values normal text is laid out using default settings. <feature-tag-value> when rendering text, the list of opentype feature tag value is passed to the text layout engine to enable or disable font features. the tag is always a <string> of 4 ascii characters. if it has more or less characters, or if it contains characters outside the u+20 – u+7e codepoint range, the whole property is invalid. the value is a positive integer. the two keywords on and off are synonyms for 1 and 0 respectively. if no value is set, the default is 1. for non-boolean opentype features (e.g. stylistic alternates), the value implies a particular glyph to be selected; for boolean values, it is a switch. formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::fir...
font-style - CSS: Cascading Style Sheets
oblique <angle> selects a font classified as oblique, and additionally specifies an angle for the slant of the text. if one or more oblique faces are available in the chosen font family, the one that most closely matches the specified angle is chosen. if no oblique faces are available, the browser will synthesize an oblique version of the font by slanting a normal face by the specified amount. valid values are degree values of -90deg to 90deg inclusive. if an angle is not specified, an angle of 14 degrees is used. positive values are slanted to the end of the line, while negative values are slanted towards the beginning. in general, for a requested angle of 14 degrees or greater, larger angles are prefered; otherwise, smaller angles are preferred (see the spec's font matching section for ...
font-variation-settings - CSS: Cascading Style Sheets
dering text, the list of variable font axis names is passed to the text layout engine to enable or disable font features. each setting is always one or more pairs consisting of a <string> of 4 ascii characters followed by a <number> indicating the axis value to set. if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative, depending on the value range available in your font, as defined by the font designer. description this property is a low-level mechanism designed to set variable font features where no other way to enable or access those features exist. you should only use it when no basic properties exist to set those features (e.g. font-weight, font-style). font ...
grid-template-areas - CSS: Cascading Style Sheets
id-template-areas: unset; values none the grid container doesn’t define any named grid areas. <string>+ a row is created for every separate string listed, and a column is created for each cell in the string. multiple named cell tokens within and between rows create a single named grid area that spans the corresponding grid cells. unless those cells form a rectangle, the declaration is invalid. formal definition initial valuenoneapplies togrid containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | <string>+ examples specifying named grid areas html <section id="page"> <header>header</header> <nav>navigation</nav> <main>main area</main> <footer>footer</footer> </section> css #page { display: grid; width: 100%; height: 250px; ...
grid-template-columns - CSS: Cascading Style Sheets
tent is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) rep...
grid-template-rows - CSS: Cascading Style Sheets
nt is a keyword representing the largest minimal content contribution of the grid items occupying the grid track. minmax(min, max) is a functional notation that defines a size range, greater than or equal to min, and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) rep...
<length> - CSS: Cascading Style Sheets
Web › CSS › length
...
mask-border-outset - CSS: Cascading Style Sheets
1 1.2; /* top | horizontal | bottom */ mask-border-outset: 30px 2 45px; /* top | right | bottom | left */ mask-border-outset: 7px 12px 14px 5px; /* global values */ mask-border-outset: inherit; mask-border-outset: initial; mask-border-outset: unset; the mask-border-outset property may be specified as one, two, three, or four values. each value is a <length> or <number>. negative values are invalid. when one value is specified, it applies the same outset to all four sides. when two values are specified, the first outset applies to the top and bottom, the second to the left and right. when three values are specified, the first outset applies to the top, the second to the left and right, the third to the bottom. when four values are specified, the outsets apply to the top, right, bottom...
mask-border-slice - CSS: Cascading Style Sheets
; /* top | right | bottom | left */ mask-border-slice: 7 12 14 5; /* using the `fill` keyword */ mask-border-slice: 10% fill 7 12; /* global values */ mask-border-slice: inherit; mask-border-slice: initial; mask-border-slice: unset; the mask-border-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. when two positions are specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right. when three positions are specified, the first value cr...
max() - CSS: Cascading Style Sheets
Web › CSS › max
ue as providing the minimum value a property can have. syntax the max() function takes one or more comma-separated expressions as its parameter, with the largest (most positive) expression value used as the value of the property to which it is assigned. the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions. you can use different units for each value in your expression. you may also use parentheses to establish computation order when needed. notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables ...
min() - CSS: Cascading Style Sheets
Web › CSS › min
is 200px. think of the min() value as providing the maximum value a property can have. syntax the min() function takes one or more comma-separated expressions as its parameter, with the smallest (most negative) expression value result used as the value. the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>). you can use different units for each value in your expression, if you wish. you may also use parentheses to establish computation order when needed. notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if aut...
minmax() - CSS: Cascading Style Sheets
Web › CSS › minmax
max(min-content, 200px) minmax(max-content, 200px) minmax(auto, 300px) a function taking two parameters, min and max. each parameter can be a <length>, a <percentage>, a <flex> value, or one of the keyword values max-content, min-content, or auto. if max < min, then max is ignored and minmax(min,max) is treated as min. as a maximum, a <flex> value sets the flex factor of a grid track; it is invalid as a minimum. values <length> a non-negative length. <percentage> a non-negative percentage relative to the inline size of the grid container in column grid tracks, and the block size of the grid container in row grid tracks. if the size of the grid container depends on the size of its tracks, then the <percentage> must be treated as auto. the user agent may adjust the intrinsic size contr...
<number> - CSS: Cascading Style Sheets
Web › CSS › number
of <integer>. a fractional value is represented by a . followed by one or more decimal digits, and may be appended to an integer. there is no unit associated with numbers. interpolation when animated, values of the <number> css data type are interpolated as real, floating-point numbers. the speed of the interpolation is determined by the timing function associated with the animation. examples valid numbers 12 a raw <integer> is also a <number>. 4.01 positive fraction -456.8 negative fraction 0.0 zero +0.0 zero, with a leading + -0.0 zero, with a leading - .60 fractional number without a leading zero 10e3 scientific notation -3.4e-2 complicated scientific notation invalid numbers 12. decimal points must be followed by ...
opacity - CSS: Cascading Style Sheets
Web › CSS › opacity
d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax values <alpha-value> a <number> in the range 0.0 to 1.0, inclusive, or a <percentage> in the range 0% to 100%, inclusive, representing the opacity of the channel (that is, the value of its alpha channel). any value outside the interval, though valid, is clamped to the nearest limit in the range. value meaning 0 the element is fully transparent (that is, invisible). any <number> strictly between 0 and 1 the element is translucent (that is, content behind the element can be seen). 1 (default value) the element is fully opaque (visually solid). description opacity ap...
outline-color - CSS: Cascading Style Sheets
: inherit; outline-color: initial; outline-color: unset; the outline-color property is specified as any one of the values listed below. values <color> the color of the outline, specified as a <color>. invert to ensure the outline is visible, performs a color inversion of the background. note that browsers are not required to support this value; if they don't, this keyword is considered invalid. description an outline is a line that is drawn around an element, outside the border. unlike the element's border, the outline is drawn outside the element's frame, and may overlap other content. the border, on the other hand, will actually alter the page's layout to ensure that it fits without overlapping anything else (unless you explicitly set it to overlap). it is often more convenient t...
padding - CSS: Cascading Style Sheets
Web › CSS › padding
ides */ padding: 1em; /* vertical | horizontal */ padding: 5% 10%; /* top | horizontal | bottom */ padding: 1em 2em 2em; /* top | right | bottom | left */ padding: 5px 1em 0 2em; /* global values */ padding: inherit; padding: initial; padding: unset; the padding property may be specified using one, two, three, or four values. each value is a <length> or a <percentage>. negative values are invalid. when one value is specified, it applies the same padding to all four sides. when two values are specified, the first padding applies to the top and bottom, the second to the left and right. when three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom. when four values are specified, the paddings apply to the top, right, bo...
<percentage> - CSS: Cascading Style Sheets
n be inherited. thus, even if a percentage value is used on the parent property, a real value (such as a width in pixels for a <length> value) will be accessible on the inherited property, not the percentage value. syntax the <percentage> data type consists of a <number> followed by the percentage sign (%). optionally, it may be preceded by a single + or - sign, although negative values are not valid for all properties. as with all css dimensions, there is no space between the symbol and the number. interpolation when animated, values of the <percentage> data type are interpolated as real, floating-point numbers. the speed of the interpolation is determined by the timing function associated with the animation. examples width and margin-left <div style="background-color:navy;"> <div st...
perspective-origin - CSS: Cascading Style Sheets
erspective properties are attached to the parent of a child transformed in 3-dimensional space, unlike the perspective() transform function which is placed on the element being transformed. syntax /* one-value syntax */ perspective-origin: x-position; /* two-value syntax */ perspective-origin: x-position y-position; /* when both x-position and y-position are keywords, the following is also valid */ perspective-origin: y-position x-position; /* global values */ perspective-origin: inherit; perspective-origin: initial; perspective-origin: unset; values x-position indicates the position of the abscissa of the vanishing point. it can have one of the following values: <length-percentage> indicating the position as an absolute length value or relative to the width of the element. th...
place-content - CSS: Cascading Style Sheets
y; place-content: space-around space-evenly; place-content: space-evenly stretch; place-content: stretch space-evenly; /* global values */ place-content: inherit; place-content: initial; place-content: unset; the first value is the align-content property value, the second the justify-content one. important: if the second value is not present, the first value is used for both, provided it is a valid value for both. if it is invalid for one or the other, the whole value will be invalid. values start the items are packed flush to each other toward the start edge of the alignment container in the appropriate axis. end the items are packed flush to each other toward the end edge of the alignment container in the appropriate axis. flex-start the items are packed flush to each other towa...
<position> - CSS: Cascading Style Sheets
ote: the background-position property also accepts a three-value syntax. this is not allowed in other properties that use <position>. interpolation when animated, a point's abscissa and ordinate values are interpolated independently. however, because the speed of the interpolation is determined by a single timing function for both coordinates, the point will move in a straight line. examples valid positions center left center top right 8.5% bottom 12vmin right -6px 10% 20% 8rem 14px invalid positions left right bottom top 10px 15px 20px 15px specifications specification status comment css values and units module level 3the definition of '<position>' in that specification. candidate recommendation relists links to both definitions: if css backgroun...
<resolution> - CSS: Cascading Style Sheets
54 cm, 1dpcm ≈ 2.54dpi. dppx represents the number of dots per px unit. due to the 1:96 fixed ratio of css in to css px, 1dppx is equivalent to 96dpi, which corresponds to the default resolution of images displayed in css as defined by image-resolution. x alias for dppx. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0dpi, 0dpcm, or 0dppx. examples use in a media query @media print and (min-resolution: 300dpi) { ... } valid resolutions 96dpi 50.82dpcm 3dppx invalid resolutions 72 dpi spaces are not allowed between the number and the unit. ten dpi the number must use digits only. 0 the unit is required. specifications specification status commen...
scroll-padding-block-end - CSS: Cascading Style Sheets
auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type for...
scroll-padding-block-start - CSS: Cascading Style Sheets
auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type for...
scroll-padding-block - CSS: Cascading Style Sheets
auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type for...
scroll-padding-bottom - CSS: Cascading Style Sheets
d us a pull request. syntax /* keyword values */ scroll-padding-bottom: auto; /* <length> values */ scroll-padding-bottom: 10px; scroll-padding-bottom: 1em; scroll-padding-bottom: 10%; /* global values */ scroll-padding-bottom: inherit; scroll-padding-bottom: initial; scroll-padding-bottom: unset; values <length-percentage> an inwards offset from the bottom edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type for...
scroll-padding-inline-end - CSS: Cascading Style Sheets
auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type form...
scroll-padding-inline-start - CSS: Cascading Style Sheets
auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type for...
scroll-padding-inline - CSS: Cascading Style Sheets
auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type for...
scroll-padding-left - CSS: Cascading Style Sheets
examples and send us a pull request. syntax /* keyword values */ scroll-padding-left: auto; /* <length> values */ scroll-padding-left: 10px; scroll-padding-left: 1em; scroll-padding-left: 10%; /* global values */ scroll-padding-left: inherit; scroll-padding-left: initial; scroll-padding-left: unset; values <length-percentage> an inwards offset from the left edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type form...
scroll-padding-right - CSS: Cascading Style Sheets
es and send us a pull request. syntax /* keyword values */ scroll-padding-right: auto; /* <length> values */ scroll-padding-right: 10px; scroll-padding-right: 1em; scroll-padding-right: 10%; /* global values */ scroll-padding-right: inherit; scroll-padding-right: initial; scroll-padding-right: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type for...
scroll-padding-top - CSS: Cascading Style Sheets
ractive-examples and send us a pull request. syntax /* keyword values */ scroll-padding-top: auto; /* <length> values */ scroll-padding-top: 10px; scroll-padding-top: 1em; scroll-padding-top: 10%; /* global values */ scroll-padding-top: inherit; scroll-padding-top: initial; scroll-padding-top: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type for...
scroll-padding - CSS: Cascading Style Sheets
auto the offset is determind by the user agent. this will generally be 0px, but the user agent is free to detect and do something else if a non-zero value is more appropriate. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value typ...
scrollbar-color - CSS: Cascading Style Sheets
ack and thumb. the track refers to the background of the scrollbar, which is generally fixed regardless of the scrolling position. the thumb refers to the moving part of the scrollbar, which usually floats on top of the track. syntax /* keyword values */ scrollbar-color: auto; scrollbar-color: dark; scrollbar-color: light; /* <color> values */ scrollbar-color: rebeccapurple green; /* two valid colors. the first applies to the thumb of the scrollbar, the second to the track. */ /* global values */ scrollbar-color: inherit; scrollbar-color: initial; scrollbar-color: unset; values <scrollbar-color> defines the color of the scrollbar. auto default platform rendering for the track portion of the scrollbar, in the absence of any other related scrollbar color propertie...
shape-outside - CSS: Cascading Style Sheets
as defined by shape-image-threshold. note: user agents must use the potentially cors-enabled fetch method defined by the html5 specification for all urls in a shape-outside value. when fetching, user agents must use "anonymous" mode, set the referrer source to the stylesheet's url, and set the origin to the url of the containing document. if this results in network errors such that there is no valid fallback image, the effect is as if the value none had been specified. interpolation when animating between one <basic-shape> and a second, the rules below are applied. the values in the shape functions interpolate as a simple list. the list values interpolate as <length>, <percentage>, or calc() where possible. if list values are not one of those types but are identical (such as finding non...
<string> - CSS: Cascading Style Sheets
Web › CSS › string
either double (") or single (') quotes. most characters can be represented literally. all characters can also be represented with their respective unicode code points in hexadecimal, in which case they are preceded by a backslash (\). for example, \22 represents a double quote, \27 a single quote ('), and \a9 the copyright symbol (©). importantly, certain characters which would otherwise be invalid can be escaped with a backslash. these include double quotes when used inside a double-quoted string, single quotes when used inside a single-quoted string, and the backslash itself. for example, \\ will create a single backslash. to output new lines, you must escape them with a line feed character such as \a or \00000a. in your code, however, strings can span multiple lines, in which case each ...
text-combine-upright - CSS: Cascading Style Sheets
the space of a single character within the vertical line of the box. digits <integer>? attempts to display a sequence of consecutive ascii digits (u+0030–u+0039) that has as many or fewer characters than the specified integer, such that it takes up the space of a single character within the vertical line box. if the integer is omitted, it computes to 2. integers outside the range of 2-4 are invalid. formal definition initial valuenoneapplies tonon-replaced inline elementsinheritedyescomputed valuespecified keyword, plus integer if 'digits'animation typediscrete formal syntax none | all | [ digits <integer>? ] examples digits the digits value requires less markup than the all value when digits are being combined, but it is currently not very widely supported by browsers. html <p la...
rotate3d() - CSS: Cascading Style Sheets
he axis of rotation is defined by an [x, y, z] vector and pass by the origin (as defined by the transform-origin property). if, as specified, the vector is not normalized (i.e., if the sum of the square of its three coordinates is not 1), the user agent will normalize it internally. a non-normalizable vector, such as the null vector, [0, 0, 0], will cause the rotation to be ignored, but without invaliding the whole css property. note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotate3d() is specified by three <number>s and one <angle>. the <number>s represent the x-, y-, and z-coordinates of the vector denoting the axis o...
translate3d() - CSS: Cascading Style Sheets
on. syntax translate3d(tx, ty, tz) values tx is a <length> or <percentage> representing the abscissa of the translating vector. ty is a <length> or <percentage> representing the ordinate of the translating vector. tz is a <length> representing the z component of the translating vector. it can't be a <percentage> value; in that case the property containing the transform is considered invalid. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 this transformation applies to the 3d space and can't be represented on the plane. a translation is not a linear transformation in ℝ3 and can't be represented using a cartesian-coordinate matrix. 100tx010ty001tz0001 ...
transform-origin - CSS: Cascading Style Sheets
transform is set. x-offset-keyword is one of the left, right, or center keyword describing how far from the left edge of the box the origin of the transform is set. y-offset-keyword is one of the top, bottom, or center keyword describing how far from the top edge of the box the origin of the transform is set. z-offset is a <length> (and never a <percentage> which would make the statement invalid) describing how far from the user eye the z=0 origin is set. the keywords are convenience shorthands and match the following <percentage> values: keyword value left 0% center 50% right 100% top 0% bottom 100% formal definition initial value50% 50% 0applies totransformable elementsinheritednopercentagesrefer to ...
url() - CSS: Cascading Style Sheets
Web › CSS › url()
to the web resource to be included, or a data uri, optionally in single or double quotes. quotes are required if the url includes parentheses, whitespace, or quotes, unless these characters are escaped, or if the address includes control characters above 0x7e. double quotes cannot occur inside double quotes and single quotes cannot occur inside single quotes unless escaped. the following are all valid and equivalent: <css_property>: url("https://example.com/image.png") <css_property>: url('https://example.com/image.png') <css_property>: url(https://example.com/image.png) path references the id of an svg shape -- circle, ellipse, line, path, polygon, polyline, or rect -- using the shape's geometry as the path. <url-modifier> in the future, the url() function may support specify...
CSS: Cascading Style Sheets
Web › CSS
cookbook the css layout cookbook aims to bring together recipes for common layout patterns, things you might need to implement in your sites. in addition to providing code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer. tools for css development you can use the w3c css validation service to check if your css is valid. this is an invaluable debugging tool. firefox developer tools lets you view and edit a page's live css via the inspector and style editor tools. the web developer extension for firefox lets you track and edit live css on watched sites. the web community has created various other miscellaneous css tools for you to use. meta bugs firefox: bug 1323...
Adding captions and subtitles to HTML5 video - Developer guides
each <track> element has the following attributes set: kind is given a value of subtitles, indicating the type of content the files contain label is given a value indicating which language that subtitle set is for — for example english or deutsch — these labels will appear in the user interface to allow the user to easily select which subtitle language they want to see. src is assigned a valid url pointing to the relevant webvtt subtitle file in each case. srclang indicates what language each subtitle files' contents are in. the default attribute is set on the english <track> element, indicating to the browser that this is the default subtitle file definition to use when subtitles have been turned on and the user has not made a specific selection. in addition to adding the <track> ...
Media buffering, seeking, and time ranges - Developer guides
kableend = myaudio.seekable.end(myaudio.seekable.length - 1); note: myaudio.seekable.end(myaudio.seekable.length - 1) actually tells us the end point of the last time range that is seekable (not all seekable media). in practice this is good enough as the browser either enables range requests or it doesn't. if it doesn't then audio.seekable will be equivalent to audio.buffered, which will give a valid indication of the end of seekable media. if range requests are enabled this value usually becomes the duration of the media almost instantly. it is better perhaps to give an indication of how much media has actually downloaded — this what the browser's native players seem to display. so let's build this. the html for our player looks like this: <audio id="my-audio" preload controls> <sour...
Creating a cross-browser video player - Developer guides
created that deals with this: var altervolume = function(dir) { var currentvolume = math.floor(video.volume * 10) / 10; if (dir === '+') { if (currentvolume < 1) video.volume += 0.1; } else if (dir === '-') { if (currentvolume > 0) video.volume -= 0.1; } } this function makes use of the media api's volume attribute, which holds the current volume value of the video. valid values for this attribute are 0 and 1 and anything in between. the function checks the dir parameter, which indicates whether the volume is to be increased (+) or decreased (-) and acts accordingly. the function is defined to increase or decrease the video's volume attribute in steps of 0.1, ensuring that it doesn't go lower than 0 or higher than 1. progress when the <progress> element was defi...
Audio and Video Delivery - Developer guides
not invoke the load algorithm. if the <video> element also has <source> element descendants, those should also be removed before calling load(). note that just setting the src attribute to an empty string will actually cause the browser to treat it as though you're setting a video source to a relative path. this causes the browser to attempt another download to something that is unlikely to be a valid video. seeking through media media elements provide support for moving the current playback position to specific points in the media's content. this is done by setting the value of the currenttime property on the element; see htmlmediaelement for further details on the element's properties. simply set the value to the time, in seconds, at which you want playback to continue. you can use the el...
Content categories - Developer guides
tly contribute to the rendered output of a document. instead, they serve to support scripts, either by containing or specifying script code directly, or by specifying data that will be used by scripts. the script-supporting elements are: <script> <template> transparent content model if an element has a transparent content model, then its contents must be structured such that they would be valid html 5, even if the transparent element were removed and replaced by the child elements. for example, the <del> and <ins> elements are transparent: <p>we hold these truths to be <del><em>sacred &amp; undeniable</em></del> <ins>self-evident</ins>.</p> if those elements were removed, this fragment would still be valid html (if not correct english). <p>we hold these truths to be <em>sacred &amp...
HTML5 Parser - Developer guides
Web › Guide › HTML › HTML5 › HTML5 Parser
them from being parsed literally by expressing them as \u003cscript,\u003c/script>, and \u003c!--. the older practice of escaping the string </script> by surrounding it with comment markers, while supported by html5, is problematic in cases where the closing comment marker is omitted (see preceding point). you can avoid such problems by using the character code for the initial '<' instead. (it is valid to use an escape character, e.g., <\/script>, but this strategy does not work for <script and <!--, because \s and \! are not valid javascript escapes; the character code strategy is more general-purpose.) inline svg and mathml support as a completely new parsing feature, html5 introduced support for inline svg and mathml in text/html. this means that you can now use svg and mathml inline in t...
Writing forward-compatible websites - Developer guides
owser supports them until there's decently widespread support of the unprefixed version of something, its behavior can still change in unexpected ways. most especially, don't use the unprefixed version if no browser actually supports it. you can't assume that the syntax of the final version will be the same as the syntax of any of the prefixed versions. code hygiene avoid missing > passing a validator is one way to ensure this, but even if your website doesn't validate entirely you should make sure all your > characters are present. missing those can lead to unexpected situations due to a following tag name being treated as an attribute on a previous tag. this can work for a bit, then break if a specification attaches a meaning to that attribute. here's an example that works in browsers wi...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
is the 3-digit verification number on the back of the card. "cc-type" the type of payment instrument (such as "visa" or "master card"). "transaction-currency" the currency in which the transaction is to take place. "transaction-amount" the amount, given in the currency specified by "transaction-currency", of the transaction, for a payment form. "language" a preferred language, given as a valid bcp 47 language tag. "bday" a birth date, as a full date. "bday-day" the day of the month of a birth date. "bday-month" the month of the year of a birth date. "bday-year" the year of a birth date. "sex" a gender identity (such as "female", "fa'afafine", "male"), as freeform text without newlines. "tel" a full telephone number, including the country code. if you need to break the phone...
HTML attribute: required - HTML: Hypertext Markup Language
t required form controls with the :required pseudo-class, styling them in a way to indicate they are required. this improves usability for sited user. assistive technology should inform the user that the form control in mandatory based on the required attribute, but adding aria-required="true" doesn't hurt, in case the browser / screen reader combination does not support required yet. constraint validation if the element is required and the element's value is the empty string, then the element is suffering from valuemissing and the element will match the :invalid pseudo class. specifications specification status comment html living standardthe definition of 'required attribute' in that specification. living standard html5the definition of 'requir...
HTML attribute: size - HTML: Hypertext Markup Language
Web › HTML › Attributes › size
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. this must be an integer value 0 or higher. 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. if css targets the element with properties impacting the width, css takes precedence. the size attribute has no impact on constraint validation. examples by adding size on some input types, the width of the input can be controlled. adding size on a select changes the height, definining how many options are visible in the closed state. <label for="fruit">enter a fruit</label> <input type="text" size=...
<bgsound>: The Background Sound element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › bgsound
...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › del
cepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlmodelement attributes this element's attributes include the global attributes. cite a uri for a resource that explains the change (for example, meeting minutes). datetime this attribute indicates the time and date of the change and must be a valid date string with an optional time. if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp. for the format of the string without a time, see date strings. the format of the string if it includes both date and time is covered in local date and time strings. examples <p><del>this text has been deleted</del>, here is the rest of the...
<input type="checkbox"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › checkbox
minate = false; } else if(checkedcount === ingredients.length) { overall.checked = true; overall.indeterminate = false; } else { overall.checked = false; overall.indeterminate = true; } } note: if you submit a form with an indeterminate checkbox, the same thing happens as if the checkbox were unchecked — no data is submitted to represent the checkbox. validation checkboxes do support validation (offered to all <input>s). however, most of the validitystates will always be false. if the checkbox has the required attribute, but is not checked, then validitystate.valuemissing will be true. examples the following example is an extended version of the "multiple checkboxes" example we saw above — it has more standard options, plus an "other" checkbox ...
<input type="datetime"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › datetime
...
<input type="hidden"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › hidden
crets to prevent such attacks. as stated previously, placing the secret in a hidden input doesn't inherently make it secure. the key's composition and encoding would do that. the value of the hidden input is that it keeps the secret associated with the data and automatically includes it when the form is sent to the server. you need to use well-designed secrets to actually secure your website. validation hidden inputs don't participate in constraint validation; they have no real value to be constrained. examples let's look at how we might implement a simple version of the edit form we described earlier (see tracking edited content), using a hidden input to remember the id of the record being edited. the edit form's html might look a little bit like this: <form> <div> <label for="t...
<input type="radio"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › radio
noticed that you can select a radio button by clicking on its associated <label> element, as well as on the radio button itself. this is a really useful feature of html form labels that makes it easier for users to click the option they want, especially on small-screen devices like smartphones. beyond accessibility, this is another good reason to properly set up <label> elements on your forms. validation radio buttons don't participate in constraint validation; they have no real value to be constrained. styling radio inputs the following example shows a slightly more thorough version of the example we've seen throughout the article, with some additional styling, and with better semantics established through use of specialized elements. the html looks like this: <form> <fieldset> <l...
<input type="reset"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › reset
isable a reset button, simply specify the disabled global attribute on it, like so: <input type="reset" value="disabled" disabled> you can enable and disable buttons at run time by simply setting disabled to true or false; in javascript this looks like btn.disabled = true or btn.disabled = false. note: see the <input type="button"> page for more ideas about enabling and disabling buttons. validation buttons don't participate in constraint validation; they have no real value to be constrained. examples we've included simple examples above. there isn't really anything more to say about reset buttons. specifications specification status html living standardthe definition of '<input type="reset">' in that specification. living standard html5the definit...
<ins> - HTML: Hypertext Markup Language
Web › HTML › Element › ins
o corresponding role permitted aria roles any dom interface htmlmodelement attributes this element includes the global attributes. cite this attribute defines the uri of a resource that explains the change, such as a link to meeting minutes or a ticket in a troubleshooting system. datetime this attribute indicates the time and date of the change and must be a valid date with an optional time string. if the value cannot be parsed as a date with an optional time string, the element does not have an associated time stamp. for the format of the string without a time, see format of a valid date string. the format of the string if it includes both date and time is covered in format of a valid local date and time string. examples <ins>this text has been inserte...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
Web › HTML › Element › kbd
ctrl</kbd>+<kbd>n</kbd></kbd>.</p> this wraps the entire key sequence in an outer <kbd> element, then each individual key within its own, in order to denote the components of the sequence. note: you don't need to do all this wrapping; you can choose to simplify it by leaving out the external <kbd> element. in other words, simplifying this to just <kbd>ctrl</kbd>+<kbd>n</kbd> would be perfectly valid. depending on your style sheet, though, you may find it useful to do this kind of nesting. result the output looks like this without a style sheet applied: with custom styles we can make more sense of this by adding some css: css we add a new style for <kbd> elements, key, which we can apply when rendering keyboard keys: kbd.key { border-radius: 3px; padding: 1px 2px 0; border: 1...
<label> - HTML: Hypertext Markup Language
Web › HTML › Element › label
r a section of a form needs a title, use the <legend> element placed within a <fieldset>. don't <label for="your-name"> <h3>your name</h3> <input id="your-name" name="your-name" type="text"> </label> do <label class="large-label" for="your-name"> your name <input id="your-name" name="your-name" type="text"> </label> buttons an <input> element with a type="button" declaration and a valid value attribute does not need a label associated with it. doing so may actually interfere with how assistive technology parses the button input. the same applies for the <button> element. technical summary content categories flow content, phrasing content, interactive content, form-associated element, palpable content. permitted content phrasing content, but no descendan...
theme-color - HTML: Hypertext Markup Language
Web › HTML › Element › meta › name › theme-color
example <meta name="theme-color" content="#4285f4"> the following image shows the effect that the <meta> element above will have on a document displayed in chrome running on an android mobile device. ...
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
Web › HTML › Element › meta
alue "ie=edge". user agents are required to ignore this pragma. refresh this instruction specifies: the number of seconds until the page should be reloaded - only if the content attribute contains a positive integer. the number of seconds until the page should redirect to another - only if the content attribute contains a positive integer followed by the string ';url=', and a valid url. accessibility concerns pages set with a refresh value run the risk of having the time interval being too short. people navigating with the aid of assistive technology such as a screen reader may be unable to read through and understand the page's content before being automatically redirected. the abrupt, unannounced updating of the page content may also be disorienting for people...
<progress>: The Progress Indicator element - HTML: Hypertext Markup Language
Web › HTML › Element › progress
epts phrasing content. implicit aria role progressbar permitted aria roles no role permitted dom interface htmlprogresselement attributes this element includes the global attributes. max this attribute describes how much work the task indicated by the progress element requires. the max attribute, if present, must have a value greater than 0 and be a valid floating point number. the default value is 1. value this attribute specifies how much of the task that has been completed. it must be a valid floating point number between 0 and max, or between 0 and 1 if max is omitted. if there is no value attribute, the progress bar is indeterminate; this indicates that an activity is ongoing with no indication of how long it is expected to take. note: u...
<small>: the side comment element - HTML: Hypertext Markup Language
Web › HTML › Element › small
on. living standard html5the definition of '<small>' in that specification. recommendation html 4.01 specificationthe definition of '<small>' in that specification. recommendation notes although the <small> element, like the <b> and <i> elements, may be perceived to violate the principle of separation between structure and presentation, all three are valid in html5. authors are encouraged to use their best judgement when determining whether to use <small> or css. ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
Web › HTML › Element › source
. a width descriptor, which consists of a string containing a positive integer directly followed by "w", such as 300w. the default value, if missing, is the infinity. a pixel density descriptor, that is a positive floating number directly followed by "x". the default value, if missing, is 1x. each string in the list must have at least a width descriptor or a pixel density descriptor to be valid. among the list, there must be only one string containing the same tuple of width descriptor and pixel density descriptor. the browser chooses the most adequate image to display at a given point of time. the srcset attribute has an effect only when the <source> element is the direct child of a <picture> element. type the mime media type of the resource, optionally with a codecs parameter. ...
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
Web › HTML › Element › strong
red website. <b> and <strong> are perhaps one of the most common sources of confusion, causing developers to ask "should i use <b> or <strong>? don't they both do the same thing?" not exactly. the <strong> element is for content that is of greater importance, while the <b> element is used to draw attention to text without indicating that it's more important. it may help to realize that both are valid and semantic elements in html5 and that it's a coincidence that they both have the same default styling (boldface) in most browsers (although some older browsers actually underline <strong>). each element is meant to be used in certain types of scenarios, and if you want to bold text simply for decoration, you should instead actually use the css font-weight property. the intended meaning or purp...
<title>: The Document Title element - HTML: Hypertext Markup Language
Web › HTML › Element › title
stive technology is to read the page title and infer the content the page contains. this is because navigating into a page to determine its content can be a time consuming and potentially confusing process. example <title>menu - blue house chinese food - foodyum: online takeout today!</title> to help the user, update the page title value to reflect significant page state changes (such as form validation problems). example <title>2 errors - your order - blue house chinese food - foodyum: online takeout today!</title> mdn understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.2 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe definition of '<title>' in that specification. livin...
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
Web › HTML › Element › u
ments, the original html underline (<u>) element was deprecated in html 4; however, <u> was restored in html 5 with a new, semantic, meaning: to mark text as having some form of non-textual annotation applied. be careful to avoid using the <u> element with its default styling (of underlined text) in such a way as to be confused with a hyperlink, which is also underlined by default. use cases valid use cases for the <u> element include annotating spelling errors, applying a proper name mark to denote proper names in chinese text, and other forms of annotation. you should not use <u> to simply underline text for presentation purposes, or to denote titles of books. other elements to consider using in most cases, you should use an element other than <u>, such as: <em> to denote stress em...
contenteditable - HTML: Hypertext Markup Language
and send us a pull request. the attribute must take one of the following values: true or an empty string, which indicates that the element is editable. false, which indicates that the element is not editable. if the attribute is given without a value, like <label contenteditable>example label</label>, its value is treated as an empty string. if this attribute is missing or its value is invalid, its value is inherited from its parent element: so the element is editable if its parent is editable. note that although its allowed values include true and false, this attribute is an enumerated one and not a boolean one. you can set the color used to draw the text insertion caret with the css caret-color property. specifications specification status comment html...
itemprop - HTML: Hypertext Markup Language
img https://www.flickr.com/photos/nlireland/6992065114/ itemprop website flickr itemprop (token) (token) tokens are either strings or url's. an item is called a typed item if it is a url. otherwise, it is a string. strings cannot contain a period or a colon (see below). if the item is a typed item it must be either: a defined property name, or a valid url, which refers to the vocabulary definition, or a valid url that is used as a proprietary item property name (i.e. one not defined in a public specification), or if the item is not a typed item it must be: a string that contains no "." (u+002e full stop) characters and no ":" characters (u+003a colon) and is used as a proprietary item property name (again, one not defined in a p...
itemscope - HTML: Hypertext Markup Language
in each of the following examples, the vocabulary is from schema.org. ...
Microdata - HTML: Hypertext Markup Language
ttribute can be associated with the item using an itemref. itemref provides a list of element ids (not itemids) with additional properties elsewhere in the document. itemscope – itemscope (usually) works along with itemtype to specify that the html contained in a block is about a particular item. itemscope creates the item and defines the scope of the itemtype associated with it. itemtype is a valid url of a vocabulary (such as schema.org) that describes the item and its properties context. itemtype – specifies the url of the vocabulary that will be used to define itemprop's (item properties) in the data structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. example html <div itemscope itemtype="http://schema.org/soft...
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
<meta charset=utf-8> <title>hello world!</title> </head> <body> </body> </html> the doctype shown in the example, <!doctype html>, is the simplest possible, and the one recommended by html5. earlier versions of the html standard recommended other variants, but all existing browsers today will use full standards mode for this doctype, even the dated internet explorer 6. there are no valid reasons to use a more complicated doctype. if you do use another doctype, you may risk choosing one which triggers almost standards mode or quirks mode. make sure you put the doctype right at the beginning of your html document. anything before the doctype, like a comment or an xml declaration will trigger quirks mode in internet explorer 9 and older. in html5, the only purpose of the doctype i...
Data URLs - HTTP
ports data urls of essentially unlimited length, browsers are not required to support any particular maximum length of data. for example, the opera 11 browser limited urls to 65535 characters long which limits data urls to 65529 characters (65529 characters being the length of the encoded data, not the source, if you use the plain data:, without specifying a mime type). lack of error handling invalid parameters in media, or typos when specifying 'base64', are ignored, but no error is provided. no support for query strings, etc. the data portion of a data url is opaque, so an attempt to use a query string (page-specific parameters, with the syntax <url>?parameter-data) with a data url will just include the query string in the data the url represents. security issues a number of securit...
Browser detection using the user agent - HTTP
lue part of the browsername/versionnumber token in the user agent string. this is of course not the case for internet explorer (which puts the version number right after the msie token), and for opera after version 10, which has added a version/versionnumber token. here again, be sure to take the right token for the browser you are looking for, as there is no guarantee that others will contain a valid number. rendering engine as seen earlier, in most cases, looking for the rendering engine is a better way to go. this will help to not exclude lesser known browsers. browsers sharing a common rendering engine will display a page in the same way: it is often a fair assumption that what will work in one will work in the other. there are five major rendering engines: trident, gecko, presto, blink...
Reason: CORS request did not succeed - HTTP
est which makes use of cors failed because the http connection failed at either the network or protocol level. the error is not directly related to cors, but is a fundamental network error of some kind. in many cases, it is caused by a browser plugin (e.g. an ad blocker or privacy protector) blocking the request. other possible causes include: trying to access an https resource that has an invalid certificate will cause this error. trying to access an http resource from a page with an https origin will also cause this error. as of firefox 68, https pages are not permitted to access http://localhost, although this may be changed by bug 1488740. the server did not respond to the actual request (even if it responded to the preflight request). one scenario might be an http service being dev...
Reason: Did not find method in CORS header ‘Access-Control-Allow-Methods’ - HTTP
this error occurs. for example, if the response includes: access-control-allow-methods: get,head,post trying to use a put request will fail with this error. make sure your code only uses the permitted http methods when accessing the service. note: if the server includes any unrecognized or undefined method names in its access-control-allow-methods header, a different error occurs: reason: invalid token ‘xyz' in cors header ‘access-control-allow-methods’. ...
CORS errors - HTTP
Web › HTTP › CORS › Errors
eason: cors header ‘access-control-allow-origin’ does not match ‘xyz’ reason: credential is not supported if the cors header ‘access-control-allow-origin’ is ‘*’ reason: did not find method in cors header ‘access-control-allow-methods’ reason: expected ‘true’ in cors header ‘access-control-allow-credentials’ reason: cors preflight channel did not succeed reason: invalid token ‘xyz’ in cors header ‘access-control-allow-methods’ reason: invalid token ‘xyz’ in cors header ‘access-control-allow-headers’ reason: missing token ‘xyz’ in cors header ‘access-control-allow-headers’ from cors preflight channel reason: multiple cors header ‘access-control-allow-origin’ not allowed ...
Content Security Policy (CSP) - HTTP
Web › HTTP › CSP
wser's trust of the content received from the server. malicious scripts are executed by the victim's browser because the browser trusts the source of the content, even when it's not coming from where it seems to be coming from. csp makes it possible for server administrators to reduce or eliminate the vectors by which xss can occur by specifying the domains that the browser should consider to be valid sources of executable scripts. a csp compatible browser will then only execute scripts loaded in source files received from those allowlisted domains, ignoring all other script (including inline scripts and event-handling html attributes). as an ultimate form of protection, sites that want to never allow scripts to be executed can opt to globally disallow script execution. mitigating packet sni...
Content negotiation - HTTP
hink is the most adequate; an exhaustive list of default values for common browsers is available. the accept-ch header this is part of an experimental technology called client hints. initial support is in chrome 46 or later. the device-memory value is in chrome 61 or later. the experimental accept-ch lists configuration data that can be used by the server to select an appropriate response. valid values are: value meaning device-memory indicates the approximate amount of device ram. this value is an approximation given by rounding to the nearest power of 2 and dividing that number by 1024. for example, 512 megabytes will be reported as 0.5. dpr indicates the client's device pixel ratio. viewport-width indicates the layout viewport width...
Access-Control-Allow-Credentials - HTTP
d javascript code, both the server (using the access-control-allow-credentials header) and the client (by setting the credentials mode for the xhr, fetch, or ajax request) must indicate that they’re opting in to including credentials. header type response header forbidden header name no syntax access-control-allow-credentials: true directives true the only valid value for this header is true (case-sensitive). if you don't need credentials, omit this header entirely (rather than setting its value to false). examples allow credentials: access-control-allow-credentials: true using xhr with credentials: var xhr = new xmlhttprequest(); xhr.open('get', 'http://example.com/', true); xhr.withcredentials = true; xhr.send(null); using fetch with credentials...
Alt-Svc - HTTP
Web › HTTP › Headers › Alt-Svc
rtise alternative services through which the same resource can be reached. an alternative service is defined by a protocol/host/port combination. syntax alt-svc: clear alt-svc: <protocol-id>=<alt-authority>; ma=<max-age> alt-svc: <protocol-id>=<alt-authority>; ma=<max-age>; persist=1 clear the special value ''clear" indicates that the origin requests all alternatives for that origin to be invalidated. <protocol-id> the alpn protocol identifier. examples include h2 for http/2 and h3-25 for draft 25 of the http/3 protocol. <alt-authority> the quoted string specifying the alternative authority which consists of an optional host override, a colon, and a mandatory port number. ma=<max-age>optional the number of seconds for which the alternative service is considered fresh. if omitted, it...
Clear-Site-Data - HTTP
epts one or more directives. if all types of data should be cleared, the wildcard directive ("*") can be used. // single directive clear-site-data: "cache" // multiple directives (comma separated) clear-site-data: "cache", "cookies" // wild card clear-site-data: "*" directives all directives must comply with the quoted-string grammar. a directive that does not include the double quotes is invalid. "cache" indicates that the server wishes to remove locally cached data (i.e. the browser cache, see http caching) for the origin of the response url. depending on the browser, this might also clear out things like pre-rendered pages, script caches, webgl shader caches, or address bar suggestions. "cookies" indicates that the server wishes to remove all cookies for the origin of the respons...
CSP: base-uri - HTTP
e>`, such as the keywords 'unsafe-inline' and 'strict-dynamic' <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: connect-src - HTTP
ntent-security-policy: connect-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: default-src - HTTP
tent-security-policy: default-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: form-action - HTTP
tent-security-policy: form-action <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: manifest-src - HTTP
tent-security-policy: manifest-src <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: navigate-to - HTTP
tent-security-policy: navigate-to <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number. the site's address may include an optional leading wildcard (the asterisk character, '*'), and you may use a wildcard (again, '*') as the port number, indicating that all legal ports are valid for the source. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. *.example.com: matches all attempts to load from any subdomain of example.co...
CSP: require-sri-for - HTTP
curity-policy: require-sri-for script style; script requires sri for scripts. style requires sri for style sheets. script style requires sri for both, scripts and style sheets. examples if you set your site to require sri for script and styles using this directive: content-security-policy: require-sri-for script style <script> elements like the following will be loaded as they use a valid integrity attribute. <script src="https://code.jquery.com/jquery-3.1.1.slim.js" integrity="sha256-5i/mq300m779n2ovdrl16lbohwxnudzl/r2avuxyxwa=" crossorigin="anonymous"></script> however, scripts without integrity won't load anymore: <script src="https://code.jquery.com/jquery-3.1.1.slim.js"></script> ...
ETag - HTTP
Web › HTTP › Headers › ETag
are the same. etags are therefore similar to fingerprints, and might also be used for tracking purposes by some servers. they might also be set to persist indefinitely by a tracking server. header type response header forbidden header name no syntax etag: w/"<etag_value>" etag: "<etag_value>" directives w/ optional 'w/' (case-sensitive) indicates that a weak validator is used. weak etags are easy to generate, but are far less useful for comparisons. strong validators are ideal for comparisons but can be very difficult to generate efficiently. weak etag values of two representations of the same resources might be semantically equivalent, but not byte-for-byte identical. this means weak etags prevent caching when byte range requests are used, but strong etag...
Expires - HTTP
Web › HTTP › Headers › Expires
if there is a cache-control header with the max-age or s-maxage directive in the response, the expires header is ignored. header type response header forbidden header name no cors-safelisted response header yes syntax expires: <http-date> directives <http-date> an http-date timestamp. ...
From - HTTP
Web › HTTP › Headers › From
you shouldn't use the from header for access control or authentication. ...
If-Range - HTTP
Web › HTTP › Headers › If-Range
the if-range http request header makes a range request conditional: if the condition is fulfilled, the range request will be issued and the server sends back a 206 partial content answer with the appropriate body. if the condition is not fulfilled, the full resource is sent back, with a 200 ok status. this header can be used either with a last-modified validator, or with an etag, but not with both. the most common use case is to resume a download, to guarantee that the stored resource has not been modified since the last fragment has been received. header type request header forbidden header name no syntax if-range: <day-name>, <day> <month> <year> <hour>:<minute>:<second> gmt if-range: <etag> directives <etag> an entity tag uniquely representing the req...
Last-Modified - HTTP
less accurate than an etag header, it is a fallback mechanism. conditional requests containing if-modified-since or if-unmodified-since headers make use of this field. ...
Pragma - HTTP
Web › HTTP › Headers › Pragma
ackwards compatibility with http/1.0 clients. header type general header, but response behavior is not specified and thus implementation-specific. forbidden header name no cors-safelisted response header yes syntax pragma: no-cache directives no-cache same as cache-control: no-cache. forces caches to submit the request to the origin server for validation before releasing a cached copy. examples pragma: no-cache specifications specification title rfc 7234, section 5.4: pragma hypertext transfer protocol (http/1.1): caching ...
Range - HTTP
Web › HTTP › Headers › Range
the range http request header indicates the part of a document that the server should return. several parts can be requested with one range header at once, and the server may send back these ranges in a multipart document. if the server sends back ranges, it uses the 206 partial content for the response. if the ranges are invalid, the server returns the 416 range not satisfiable error. the server can also ignore the range header and return the whole document with a 200 status code. header type request header forbidden header name no syntax range: <unit>=<range-start>- range: <unit>=<range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end>, <range-start>-<range-...
Referrer-Policy - HTTP
oss-origin referrer-policy: same-origin referrer-policy: strict-origin referrer-policy: strict-origin-when-cross-origin referrer-policy: unsafe-url directives no-referrer the referer header will be omitted entirely. no referrer information is sent along with requests. no-referrer-when-downgrade (default) this is the default behavior if no policy is specified, or if the provided value is invalid. the origin, path, and querystring of the url are sent as a referrer when the protocol security level stays the same (http→http, https→https) or improves (http→https), but isn't sent to less secure destinations (https→http). there is effort from browsers in moving to a stricter default value, namely strict-origin-when-cross-origin (see https://github.com/whatwg/fetch/pull/952), consider ...
Set-Cookie - HTTP
shuts down. cookies are session cookies if they don't specify the expires or max-age attributes. set-cookie: sessionid=38afes7a8 permanent cookie instead of expiring when the client is closed, permanent cookies expire at a specific date (expires) or after a specific length of time (max-age). set-cookie: id=a3fwa; expires=wed, 21 oct 2015 07:28:00 gmt set-cookie: id=a3fwa; max-age=2592000 invalid domains a cookie for a domain that does not include the server that set it should be rejected by the user agent. the following cookie will be rejected if set by a server hosted on originalcompany.com: set-cookie: qwerty=219ffwef9w0f; domain=somecompany.co.uk a cookie for a sub domain of the serving domain will be rejected. the following cookie will be rejected if set by a server hosted on ex...
Link prefetching FAQ - HTTP
increased browser security. do prefetched requests contain a referer: header? yes, prefetched requests include a http referer: header indicating the document from which the prefetching hint was extracted. this may impact referrer tracking that is commonly used on many sites. for this reason, link prefetching may not be appropriate for all content. however, it is possible to instruct mozilla to validate a prefetched document when the user follows a href to the prefetched document by specifying the cache-control: must-revalidate http response header. this header enables caching, but requires an if-modified-since or if-none-match validation request before the serving the document out of the browser's cache. as a server admin, can i distinguish prefetch requests from normal requests? yes, we s...
HEAD - HTTP
Web › HTTP › Methods › HEAD
ithout actually downloading the file. a response to a head method should not have a body. if it has one anyway, that body must be ignored: any entity headers that might describe the erroneous body are instead assumed to describe the response which a similar get request would have received. if the response to a head request shows that a cached url response is now outdated, the cached copy is invalidated even if no get request was made. request has body no successful response has body no safe yes idempotent yes cacheable yes allowed in html forms no syntax head /index.html specifications specification title rfc 7231, section 4.3.2: head hypertext transfer protocol (http/1.1): semant...
Protocol upgrade mechanism - HTTP
rms that "yes, i really mean to open a websocket connection." this header is automatically added by clients that choose to use it; it cannot be added using the xmlhttprequest.setrequestheader() method. sec-websocket-key: key key the key for this request to upgrade. the client adds this if it wishes to do so, and the server will include in the response a key of its own, which the client will validate before delivering the upgrade response to you. the server's response's sec-websocket-accept header will have a value computed based upon the specified key. sec-websocket-protocol the sec-websocket-protocol header specifies one or more websocket protocols that you wish to use, in order of preference. the first one that is supported by the server will be selected and returned by the server i...
HTTP range requests - HTTP
since the last fragment has been received. the if-range http request header makes a range request conditional: if the condition is fulfilled, the range request will be issued and the server sends back a 206 partial content answer with the appropriate body. if the condition is not fulfilled, the full resource is sent back, with a 200 ok status. this header can be used either with a last-modified validator, or with an etag, but not with both. if-range: wed, 21 oct 2015 07:28:00 gmt partial request responses there are three relevant statuses, when working with range requests: in case of a successful range request, the 206 partial content status is sent back from a server. in case of a range request that is out of bounds (none of the range values overlap the extent of the resource, i.e fi...
Redirections in HTTP - HTTP
n: the body, presented by the browser as a web page, lists the possible redirections and the user clicks on one to select it. code text typical use case 300 multiple choice not many: the choices are listed in an html page in the body. machine-readable choices are encouraged to be sent as link headers with rel=alternate. 304 not modified sent for revalidated conditional requests. indicates that the cached response is still fresh and can be used. alternative way of specifying redirections http redirects aren't the only way to define redirections. there are two others: html redirections with the <meta> element javascript redirections via the dom html redirections http redirects are the best way to create redirections, but sometimes y...
A typical HTTP session - HTTP
Web › HTTP › Session
ontent contains a default page to display if the user-agent is not able to follow the link) <!doctype html... (contains a site-customized page helping the user to find the missing resource) notification that the requested resource doesn't exist: http/1.1 404 not found content-type: text/html; charset=utf-8 content-length: 38217 connection: keep-alive cache-control: no-cache, no-store, must-revalidate, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:35:13 gmt expires: thu, 06 dec 2018 17:35:13 gmt server: meinheld/0.6.1 strict-transport-security: max-age=63072000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block vary: accept-encoding,cookie x-cache: error from cloudfront <!doctype html... (contains a site-customized page helping the user to ...
400 Bad Request - HTTP
Web › HTTP › Status › 400
the hypertext transfer protocol (http) 400 bad request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). the client should not repeat this request without modification. status 400 bad request specifications specification title rfc 7231, section 6.5.1: 400 bad request hypertext transfer protocol (http/1.1): semantics and content ...
401 Unauthorized - HTTP
Web › HTTP › Status › 401
this status is sent with a www-authenticate header that contains information on how to authorize correctly. this status is similar to 403, but in this case, authentication is possible. ...
407 Proxy Authentication Required - HTTP
Web › HTTP › Status › 407
this status is sent with a proxy-authenticate header that contains information on how to authorize correctly. ...
502 Bad Gateway - HTTP
Web › HTTP › Status › 502
note: a gateway might refer to different things in networking and a 502 error is usually not something you can fix, but requires a fix by the web server or the proxies you are trying to get access through. ...
Grammar and types - JavaScript
yota additionally, you can use a numeric or string literal for the name of a property or nest an object inside another. the following example uses these options. var car = { manycars: {a: 'saab', b: 'jeep'}, 7: 'mazda' }; console.log(car.manycars.b); // jeep console.log(car[7]); // mazda object property names can be any string, including the empty string. if the property name would not be a valid javascript identifier or number, it must be enclosed in quotes. property names that are not valid identifiers cannot be accessed as a dot (.) property, but can be accessed and set with the array-like notation("[]"). var unusualpropertynames = { '': 'an empty string', '!': 'bang!' } console.log(unusualpropertynames.''); // syntaxerror: unexpected string console.log(unusualpropertynames['']...
Indexed collections - JavaScript
= array(42) // creates an array with no elements // and arr.length set to 42. // // this is equivalent to: let arr = [] arr.length = 42 calling array(n) results in a rangeerror, if n is a non-whole number whose fractional portion is non-zero. the following example illustrates this behavior. let arr = array(9.3) // rangeerror: invalid array length if your code needs to create arrays with single elements of an arbitrary data type, it is safer to use array literals. alternatively, create an empty array first before adding the single element to it. in es2015, you can use the array.of static method to create arrays with single element. let wisenarray = array.of(9.3) // wisenarray contains only one element 9.3 referring to a...
Regular expression syntax cheatsheet - JavaScript
ch * literally, precede it with a backslash; for example, /a\*/ matches "a*". note that some characters like :, -, @, etc. neither have a special meaning when escaped nor when unescaped. escape sequences like \:, \-, \@ will be equivalent to their literal, unescaped character equivalents in regular expressions. however, in regular expressions with the unicode flag, these will cause an invalid identity escape error. this is done to ensure backward compatibility with existing code that uses new escape sequences like \p or \k. to match this character literally, escape it with itself. in other words to search for \ use /\\/. assertions if you are looking to contribute to this document, please also edit the original article boundary-type assertions cha...
Regular expressions - JavaScript
available in: the reference pages for exec(), test(), match(), matchall(), search(), replace(), split() this guide articles': character classes, assertions, groups and ranges, quantifiers, unicode property escapes using special characters to verify input in the following example, the user is expected to enter a phone number. when the user presses the "check" button, the script checks the validity of the number. if the number is valid (matches the character sequence specified by the regular expression), the script shows a message thanking the user and confirming the number. if the number is invalid, the script informs the user that the phone number is not valid. within non-capturing parentheses (?: , the regular expression looks for three numeric characters \d{3} or | a left parenthesi...
Working with objects - JavaScript
set using a bracket notation (for more details see property accessors). objects are sometimes called associative arrays, since each property is associated with a string value that can be used to access it. so, for example, you could access the properties of the mycar object as follows: mycar['make'] = 'ford'; mycar['model'] = 'mustang'; mycar['year'] = 1969; an object property name can be any valid javascript string, or anything that can be converted to a string, including the empty string. however, any property name that is not a valid javascript identifier (for example, a property name that has a space or a hyphen, or that starts with a number) can only be accessed using the square bracket notation. this notation is also very useful when property names are to be dynamically determined (wh...
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
renceerror: use before delaration (edge) referenceerror: can't access lexical declaration `x' before initialization (firefox) referenceerror: 'x' is not defined (chrome) error type referenceerror what went wrong? a lexical variable was accessed before it was initialized. this happens within any block statement, when let or const declarations are accessed before they are defined. examples invalid cases in this case, the variable "foo" is redeclared in the block statement using let. function test() { let foo = 33; if (true) { let foo = (foo + 55); // referenceerror: can't access lexical // declaration `foo' before initialization } } test(); valid cases to change "foo" inside the if statement, you need to remove the let that causes the redeclaration. function test(){...
TypeError: can't access property "x" of "y" - JavaScript
is null, can't access property {x} of it (firefox) examples: typeerror: x is undefined, can't access property "prop" of it typeerror: x is null, can't access property "prop" of it typeerror: can't access property "prop" of undefined typeerror: can't access property "prop" of null error type typeerror. what went wrong? the property access was operated on undefined or null value. ...
TypeError: can't assign to property "x" on "y": not an object - JavaScript
(chrome) error type typeerror. what went wrong? in strict_mode, a typeerror is raised when attempting to create a property on primitive value such as a symbol, a string, a number or a boolean. primitive values cannot hold any property. the problem might be that an unexpected value is flowing at an unexpected place, or that an object variant of a string or a number is expected. examples invalid cases 'use strict'; var foo = "my string"; // the following line does nothing if not in strict mode. foo.bar = {}; // typeerror: can't assign to property "bar" on "my string": not an object fixing the issue either fix the code to prevent the primitive from being used in such places, or fix the issue is to create the object equivalent object. 'use strict'; var foo = new string("my string");...
SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated - JavaScript
the standardized syntax uses a leading zero followed by a lowercase or uppercase latin letter "o" (0o or 0o). ...
SyntaxError: for-in loop head declarations may not have initializers - JavaScript
lue |for (var i = 0 in obj)|. in non-strict mode, this head declaration is silently ignored and behaves like |for (var i in obj)|. in strict mode, however, a syntaxerror is thrown. examples this example throws a syntaxerror: "use strict"; var obj = {a: 1, b: 2, c: 3 }; for (var i = 0 in obj) { console.log(obj[i]); } // syntaxerror: for-in loop head declarations may not have initializers valid for-in loop you can remove the initializer (i = 0) in the head of the for-in loop. "use strict"; var obj = {a: 1, b: 2, c: 3 }; for (var i in obj) { console.log(obj[i]); } array iteration the for...in loop shouldn't be used for array iteration. did you intend to use a for loop instead of a for-in loop to iterate an array? the for loop allows you to set an initializer then as well: var a...
SyntaxError: a declaration in the head of a for-of loop can't have an initializer - JavaScript
izer (firefox) syntaxerror: for-of loop variable declaration may not have an initializer. (chrome) error type syntaxerror what went wrong? the head of a for...of loop contains an initializer expression. that is, a variable is declared and assigned a value |for (var i = 0 of iterable)|. this is not allowed in for-of loops. you might want a for loop that does allow an initializer. examples invalid for-of loop let iterable = [10, 20, 30]; for (let value = 50 of iterable) { console.log(value); } // syntaxerror: a declaration in the head of a for-of loop can't // have an initializer valid for-of loop you need to remove the initializer (value = 50) in the head of the for-of loop. maybe you intended to make 50 an offset value, in that case you could add it to the loop body, for example. ...
URIError: malformed URI sequence - JavaScript
the javascript exception "malformed uri sequence" occurs when uri encoding or decoding wasn't successful. message urierror: the uri to be encoded contains invalid character (edge) urierror: malformed uri sequence (firefox) urierror: uri malformed (chrome) error type urierror what went wrong? uri encoding or decoding wasn't successful. an argument given to either the decodeuri, encodeuri, encodeuricomponent, or decodeuricomponent function was not valid, so that the function was unable encode or decode properly. examples encoding encoding replaces each instance of certain characters by one, two, three, or four escape sequences representing the utf-8 encoding of the character. an urierror will be thrown if there is an attempt to encode a surrogate which is not part of a high-low pair, ...
SyntaxError: missing formal parameter - JavaScript
in the declaration of a function, the parameters must be identifiers, not any value like numbers, strings, or objects. declaring functions and calling functions are two separate steps. declarations require identifier as parameters, and only when calling (invoking) the function, you provide the values the function should use. ...
TypeError: "x" is not a constructor - JavaScript
information on what a constructor is. there are many global objects, like string or array, which are constructable using new. however, some global objects are not and their properties and methods are static. the following javascript standard built-in objects are not a constructor: math, json, symbol, reflect, intl, atomics. generator functions cannot be used as constructors either. examples invalid cases var car = 1; new car(); // typeerror: car is not a constructor new math(); // typeerror: math is not a constructor new symbol(); // typeerror: symbol is not a constructor function* f() {}; var obj = new f; // typeerror: f is not a constructor a car constructor suppose you want to create an object type for cars. you want this type of object to be called car, and you want it to have pr...
SyntaxError: "x" is a reserved identifier - JavaScript
the javascript exception "variable is a reserved identifier" occurs when reserved keywords are used as identifiers. message syntaxerror: the use of a future reserved word for an identifier is invalid (edge) syntaxerror: "x" is a reserved identifier (firefox) syntaxerror: unexpected reserved word (chrome) error type syntaxerror what went wrong? reserved keywords will throw in if they are used as identifiers. these are reserved in strict mode and sloppy mode: enum the following are only reserved when they are found in strict mode code: implements interface let package private protected public static examples strict and non-strict reserved keywords the enum identifier is generally reserved. var enum = { red: 0, green: 1, blue: 2 }; // syntaxerror: enum is a reserved iden...
ReferenceError: assignment to undeclared variable "x" - JavaScript
he code assigning to them is executed. declared variables are a non-configurable property of their execution context (function or global). undeclared variables are configurable (e.g. can be deleted). for more details and examples, see the var reference page. errors about undeclared variable assignments occur in strict mode code only. in non-strict code, they are silently ignored. examples invalid cases in this case, the variable "bar" is an undeclared variable. function foo() { 'use strict'; bar = true; } foo(); // referenceerror: assignment to undeclared variable bar valid cases to make "bar" a declared variable, you can add the var keyword in front of it. function foo() { 'use strict'; var bar = true; } foo(); ...
TypeError: "x" is (not) "y" - JavaScript
ndefined typeerror: "x" is null typeerror: "undefined" is not an object typeerror: "x" is not an object or null typeerror: "x" is not a symbol error type typeerror. what went wrong? there was an unexpected type. this occurs oftentimes with undefined or null values. also, certain methods, such as object.create() or symbol.keyfor(), require a specific type, that must be provided. ...
SyntaxError: function statement requires a name - JavaScript
work: function greeter() { german: function () { return "moin"; } } // syntaxerror: function statement requires a name this would work, for example: function greeter() { german: function g() { return "moin"; } } object methods if you intended to create a method of an object, you will need to create an object. the following syntax without a name after the function keyword is valid then. var greeter = { german: function () { return "moin"; } }; callback syntax also, check your syntax when using callbacks. brackets and commas can get difficult easily. promise.then( function() { console.log("success"); }); function() { console.log("error"); } // syntaxerror: function statement requires a name correct would be: promise.then( function() { cons...
TypeError: variable "x" redeclares argument - JavaScript
ox) error type typeerror warning in strict mode only. what went wrong? the same variable name occurs as a function parameter and is then redeclared using a var assignment in a function body again. this might be a naming conflict and thus javascript warns about it. this error occurs as a warning in strict mode code only. in non-strict code, the redeclaration is silently ignored. examples invalid cases in this case, the variable "arg" redeclares the argument. 'use strict'; function f(arg) { var arg = 'foo'; } valid cases to fix this warning, the var statement can just be omitted, because the variable exists already. in other cases, you might to rename either the function parameter or the variable name. 'use strict'; function f(arg) { arg = 'foo'; } ...
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
the javascript exception "right-hand side of 'in' should be an object" occurs when the in operator was used to search in strings, or in numbers, or other primitive types. it can only be used to check if a property is in an object. message typeerror: invalid operand to 'in' (edge) typeerror: right-hand side of 'in' should be an object, got 'x' (firefox) typeerror: cannot use 'in' operator to search for 'x' in 'y' (firefox, chrome) error type typeerror what went wrong? the in operator can only be used to check if a property is in an object. you can't search in strings, or in numbers, or other primitive types. examples searching in strings unlike in other programming languages (e.g. python), you can't search in strings using the in operator. "hello" in "hello world"; // typeerror: cann...
Functions - JavaScript
ody as a string which may prevent some js engine optimizations and can also cause other problems. as all other objects, generatorfunction objects can be created using the new operator: new generatorfunction (arg1, arg2, ... argn, functionbody) arg1, arg2, ... argn zero or more names to be used by the function as formal argument names. each must be a string that conforms to the rules for a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function definition. invoking the generatorfunction constructor as a function (without using the new operator) has the same effect as invoking it as a constructor. function parameters default parameters d...
Array.prototype.length - JavaScript
les project, please clone https://github.com/mdn/interactive-examples and send us a pull request. description the value of the length property is an integer with a positive sign and a value less than 2 to the 32nd power (232). var namelista = new array(4294967296); //2 to the 32nd power = 4294967296 var namelistc = new array(-100) //negative sign console.log(namelista.length); //rangeerror: invalid array length console.log(namelistc.length); //rangeerror: invalid array length var namelistb = []; namelistb.length = math.pow(2,32)-1; //set array length less than 2 to the 32nd power console.log(namelistb.length); //4294967295 you can set the length property to truncate an array at any time. when you extend an array by changing its length property, the number of actual elements increases;...
ArrayBuffer.prototype.slice() - JavaScript
ontains all bytes from begin to the end of this arraybuffer. return value a new arraybuffer object. description the slice() method copies up to, but not including, the byte indicated by the end parameter. if either begin or end is negative, it refers to an index from the end of the array, as opposed to from the beginning. the range specified by the begin and end parameters is clamped to the valid index range for the current array. if the computed length of the new arraybuffer would be negative, it is clamped to zero. examples copying an arraybuffer const buf1 = new arraybuffer(8); const buf2 = buf1.slice(0); specifications specification ecmascript (ecma-262)the definition of 'arraybuffer.prototype.slice' in that specification. ...
AsyncFunction - JavaScript
ction is actually an asyncfunction object. note that asyncfunction is not a global object. it can be obtained with the following code: object.getprototypeof(async function(){}).constructor syntax new asyncfunction([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function definition. description async function objects created with the asyncfunction constructor are parsed when the function is created. this is less efficient than declaring an async function with an async...
Function() constructor - JavaScript
e example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new function([arg1 [, arg2 [, ...argn]] ,] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier, or a list of such strings separated with a comma. for example: "x", "thevalue"—or "x,thevalue". functionbody a string containing the javascript statements comprising the function definition. description function objects created with the function constructor are parsed when the function is created. this is less efficient than declaring a function with a function expre...
GeneratorFunction - JavaScript
a generatorfunction object. note that generatorfunction is not a global object. it could be obtained by evaluating the following code. object.getprototypeof(function*(){}).constructor syntax new generatorfunction ([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function definition. description generator function objects created with the generatorfunction constructor are parsed when the function is created. this is less efficient than declaring a generator function wi...
Intl.DateTimeFormat() constructor - JavaScript
roperties: datestyle the date formatting style to use when calling format(). possible values include: "full" "long" "medium" "short" timestyle the time formatting style to use when calling format(). possible values include: "full" "long" "medium" "short" fractionalseconddigits the number of fractional seconds to apply when calling format(). valid values are 0-3. calendar calendar. possible values include: "buddhist", "chinese", " coptic", "ethiopia", "ethiopic", "gregory", " hebrew", "indian", "islamic", "iso8601", " japanese", "persian", "roc". dayperiod the way day periods should be expressed. possible values include: "narrow", "short", " long". numberingsystem numbering system. possible values include: "arab", "arabext", " ...
Intl.Locale() constructor - JavaScript
the intl.locale constructor is a standard built-in property of the intl object that represents a unicode locale identifier. syntax new intl.locale(tag [, options]) parameters tag the unicode locale identifier string. options an object that contains configuration for the locale. keys are unicode locale tags, values are valid unicode tag values. examples basic usage at its very simplest, the intl.locale constructor takes a locale identifier string as its argument: let us = new intl.locale('en-us'); using the locale constructor with an options object the constructor also takes an optional configuration object argument, which can contain any of several extension types. for example, set the hourcycle property of the configuration object to your desired hour cycle type, and then pa...
Intl.Locale.prototype.calendar - JavaScript
the intl.locale.prototype.calendar property is an accessor property which returns the type of calendar used in the locale. description the calendar property returns the part of the locale that indicates the locale's calendar era. while most of the world uses the gregorian calendar, there are several regional calendar eras used around the world. the following table shows all the valid unicode calendar key strings, along with a description of the calendar era they represent. unicode calendar keys unicode calendar keys calendar key (name) description buddhist thai buddhist calendar chinese traditional chinese calendar coptic coptic calendar dangi traditional korean calendar ethioaa ethiopic calendar, amete alem (epoc...
Intl.Locale.prototype.collation - JavaScript
ing records in a database. while the idea of placing strings in order might seem trivial, the idea of order can vary from region to region and language to language. the collation property helps to make it easier for javascript programmers to access the collation type used by a particular locale. below is a table with the available collation types, taken from the unicode collation specification. valid collation types collation type description big5han pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected. do not use. direct ...
Intl.Locale.prototype.hourCycle - JavaScript
around the world: the 12 hour clock and the 24 hour clock. the hourcycle property makes it easier for javascript programmers to access the clock type used by a particular locale. like other additional locale data, hour cycle type is an extension subtag, which extends the data contained in a locale string. the hour cycle type can have several different values, which are listed in the table below. valid hour cycle types hour cycle type description h12 hour system using 1–12; corresponds to 'h' in patterns. the 12 hour clock, with midnight starting at 12:00 am. h23 hour system using 0–23; corresponds to 'h' in patterns. the 24 hour clock, with midnight starting at 0:00. h11 hour system using 0–11; corresponds to 'k' in patterns. the 12 ho...
Intl.Locale.prototype.language - JavaScript
eatures of a locale. the unicode specification treats the language identifier of a locale as the language and the region together (to make a distiction between dialects and variations, e.g. british english vs. american english). the language property of a locale returns strictly the locale's language subtag. examples setting the language in the locale identifer string argument in order to be a valid unicode locale identifier, a string must start with the language subtag. the main argument to the locale constructor must be a valid unicode locale identifier, so whenever the constructor is used, it must be passed an identifier with a language subtag. let langstr = new intl.locale("en-latn-us"); console.log(langstr.language); // prints "en" overriding language via the configuration object wh...
Intl.Locale.prototype.region - JavaScript
america, but there are differences in spelling and other language conventions between those two countries. knowing the locale's region helps javascript programmers make sure that the content from their sites and applications is correctly displayed when viewed from different areas of the world. examples setting the region in the locale identifer string argument the region is the third part of a valid unicode language identifier string, and can be set by adding it to the locale identifier string that is passed into the locale constructor. the region is a mandatory part of a let regionstr = new intl.locale("en-latn-us"); console.log(regionstr.region); // prints "us" setting the region via the configuration object the locale constructor takes a configuration object, which can be used to set ...
Intl.Locale.prototype.script - JavaScript
ny cases, denoting a script is not strictly necessary, since the language (which is necessary) is only written in a single script. there are exceptions to this rule, however, and it is important to indicate the script whenever possible, in order to have a complete unicode language identifier. examples setting the script in the locale identifer string argument the script is the second part of a valid unicode language identifier string, and can be set by adding it to the locale identifier string that is passed into the locale constructor. note that the script is not a required part of a locale identifier. let scriptstr = new intl.locale("en-latn-us"); console.log(scriptstr.script); // prints "latn" setting the script via the configuration object the locale constructor takes a configuration...
Object.defineProperties() - JavaScript
of this property descriptor may be changed and if the property may be deleted from the corresponding object. defaults to false. enumerable true if and only if this property shows up during enumeration of the properties on the corresponding object. defaults to false. a data descriptor also has the following optional keys: value the value associated with the property. can be any valid javascript value (number, object, function, etc). defaults to undefined. writable true if and only if the value associated with the property may be changed with an assignment operator. defaults to false. an accessor descriptor also has the following optional keys: get a function which serves as a getter for the property, or undefined if there is no getter. the function's return...
Object.defineProperty() - JavaScript
the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. defaults to false. enumerable true if and only if this property shows up during enumeration of the properties on the corresponding object. defaults to false. a data descriptor also has the following optional keys: value the value associated with the property. can be any valid javascript value (number, object, function, etc). defaults to undefined. writable true if and only if the value associated with the property may be changed with an assignment operator. defaults to false. an accessor descriptor also has the following optional keys: get a function which serves as a getter for the property, or undefined if there is no getter. when the property is accessed,...
Proxy.revocable() - JavaScript
an object whose properties are functions define the behavior of proxy p when an operation is performed on it. return value a newly created revocable proxy object is returned. description a revocable proxy is an object with following two properties {proxy: proxy, revoke: revoke}. proxy a proxy object created with new proxy(target, handler) call. revoke a function with no argument to invalidate (switch off) the proxy. if the revoke() function gets called, the proxy becomes unusable: any trap to a handler will throw a typeerror. once a proxy is revoked, it will remain revoked and can be garbage collected. calling revoke() again has no effect. examples using proxy.revocable var revocable = proxy.revocable({}, { get: function(target, name) { return "[[" + name + "]]"; } });...
String.prototype.anchor() - JavaScript
the anchor() method creates a string beginning with an <a name="..."> start tag, then some text, and then an </a> end tag. don't use this method. use dom apis instead. also, the html specification no longer allows the <a> element to have a name attribute, so this method doesn't even create valid markup. syntax str.anchor(name) parameters name a string representing a name value to put into the generated <a name="..."> start tag. return value a string beginning with an <a name="name"> start tag, then the text str, and then an </a> end tag description don't use this method. use dom apis instead. also, the html specification no longer allows the <a> element to have a name attribute, so this method doesn't even create valid markup. examples using anchor() var mystring = 'table o...
String.prototype.link() - JavaScript
return value a string containing an <a> html element. description use the link() method to create an html snippet for a hypertext link. ...
String.prototype.toLocaleLowerCase() - JavaScript
e locale to be used to convert to lower case according to any locale-specific case mappings. if multiple locales are given in an array, the best available locale is used. the default locale is the host environment’s current locale. return value a new string representing the calling string converted to lower case, according to any locale-specific case mappings. exceptions a rangeerror ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag. a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string. description the tolocalelowercase() method returns the value of the string converted to lower case according to any locale-specific case mappings. tolocalelowercase() does not affect the value of the string its...
String.prototype.toLocaleUpperCase() - JavaScript
e locale to be used to convert to upper case according to any locale-specific case mappings. if multiple locales are given in an array, the best available locale is used. the default locale is the host environment’s current locale. return value a new string representing the calling string converted to upper case, according to any locale-specific case mappings. exceptions a rangeerror ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag. a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string. description the tolocaleuppercase() method returns the value of the string converted to upper case according to any locale-specific case mappings. tolocaleuppercase() does not affect the value of the string its...
SyntaxError() constructor - JavaScript
the syntaxerror constructor creates a new error object that represents an error when trying to interpret syntactically invalid code. syntax new syntaxerror([message[, filename[, linenumber]]]) parameters message optional human-readable description of the error filename optional the name of the file containing the code that caused the exception linenumber optional the line number of the code that caused the exception examples catching a syntaxerror try { eval('hoo bar'); } catch (e) { console.error(e instanceof syntaxerror); console.error(e.message); console.error(e.name); console.error(e.filename); console.error(e.linenumber); console.error(e.columnnumber); console.error(e.stack); } creating a syntaxerror try { throw new syntaxerror('hello', 'somefile.js',...
SyntaxError - JavaScript
it is thrown when the javascript engine encounters tokens or token order that does not conform to the syntax of the language when parsing code. constructor syntaxerror() creates a new syntaxerror object. instance properties syntaxerror.prototype.message error message. although ecma-262 specifies that syntaxerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. syntaxerror.prototype.name error name. inherited from error. syntaxerror.prototype.filename path to file that raised this error. inherited from error. ...
TypedArray.prototype.subarray() - JavaScript
gin at. the offset is inclusive. the whole array will be included in the new view if this value is not specified. end optional element to end at. the offset is exclusive. if not specified, all elements from the one specified by begin to the end of the array are included in the new view. return value a new typedarray object. description the range specified by begin and end is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. if either begin or end is negative, it refers to an index from the end of the array instead of from the beginning. also note that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa. examples usin...
WeakSet.prototype.add() - JavaScript
n/interactive-examples and send us a pull request. syntax ws.add(value); parameters value required. the object to add to the weakset collection. return value the weakset object. examples using add var ws = new weakset(); ws.add(window); // add the window object to the weakset ws.has(window); // true // weakset only takes objects as arguments ws.add(1); // results in "typeerror: invalid value used in weak set" in chrome // and "typeerror: 1 is not a non-null object" in firefox specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.add' in that specification. ...
WebAssembly.CompileError() constructor - JavaScript
syntax new webassembly.compileerror(message, filename, linenumber) parameters message optional human-readable description of the error. filename optional the name of the file containing the code that caused the exception. linenumber optional the line number of the code that caused the exception. ...
WebAssembly.CompileError - JavaScript
constructor webassembly.compileerror() creates a new webassembly.compileerror object. instance properties webassembly.compileerror.prototype.message error message. although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message. webassembly.compileerror.prototype.name error name. inherited from error. webassembly.compileerror.prototype.filename path to file that raised this error. inherited from error. webassembly.compileerror.prototype.linenumber line number in file that raised this error. inherited from error. ...
WebAssembly.Module.customSections() - JavaScript
sectionname the string name of the desired custom section. return value a (possibly empty) array containing arraybuffer copies of the contents of all custom sections matching sectionname. exceptions if module is not a webassembly.module object instance, a typeerror is thrown. description a wasm module is comprised of a sequence of sections. most of these sections are fully specified and validated by the wasm spec, but modules can also contain custom sections that are ignored and skipped over during validation. (read high level structure for information on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other purposes, for example the name custom se...
decodeURI() - JavaScript
lone https://github.com/mdn/interactive-examples and send us a pull request. syntax decodeuri(encodeduri) parameters encodeduri a complete, encoded uniform resource identifier. return value a new string representing the unencoded version of the given encoded uniform resource identifier (uri). exceptions throws an urierror ("malformed uri sequence") exception when encodeduri contains invalid character sequences. description replaces each escape sequence in the encoded uri with the character that it represents, but does not decode escape sequences that could not have been introduced by encodeuri. the character “#” is not decoded from escape sequences. examples decoding a cyrillic url decodeuri('https://developer.mozilla.org/ru/docs/javascript_%d1%88%d0%b5%d0%bb%d0%bb%d1%8b');...
encodeURIComponent() - JavaScript
over the wire: |`^ replace(/%(?:7c|60|5e)/g, unescape); } // here is an alternative to the above function function encoderfc5987valuechars2(str) { return encodeuricomponent(str). // note that although rfc3986 reserves "!", rfc5987 does not, // so we do not need to escape it replace(/['()*]/g, c => "%" + c.charcodeat(0).tostring(16)). ...
eval() - JavaScript
rting strings to javascript objects) if the string you're calling eval() on contains data (for example, an array: "[1, 2, 3]"), as opposed to code, you should consider switching to json, which allows the string to use a subset of javascript syntax to represent data. see also downloading json and javascript in extensions. note that since json syntax is limited compared to javascript syntax, many valid javascript literals will not parse as json. for example, trailing commas are not allowed in json, and property names (keys) in object literals must be enclosed in quotes. be sure to use a json serializer to generate strings that will be later parsed as json. pass data instead of code for example, an extension designed to scrape contents of web-pages could have the scraping rules defined in xpat...
isNaN() - JavaScript
confusing special-case behavior since the very earliest versions of the isnan function specification, its behavior for non-numeric arguments has been confusing. when the argument to the isnan function is not of type number, the value is first coerced to a number. the resulting value is then tested to determine whether it is nan. thus for non-numbers that when coerced to numeric type result in a valid non-nan numeric value (notably the empty string and boolean primitives, which when coerced give numeric values zero or one), the "false" returned value may be unexpected; the empty string, for example, is surely "not a number." the confusion stems from the fact that the term, "not a number", has a specific meaning for numbers represented as ieee-754 floating-point values. the function should be i...
parseInt() - JavaScript
parseint(4.7, 10) parseint(4.7 * 1e22, 10) // very large number becomes 4 parseint(0.00000000000434, 10) // ve...
Exponentiation (**) - JavaScript
a few exceptions. for example, in bash, the ** operator is defined to have a lower precedence than unary operators. in javascript, it is impossible to write an ambiguous exponentiation expression. that is, you cannot put a unary operator (+/-/~/!/delete/void/typeof) immediately before the base number; doing so will cause a syntaxerror. -2 ** 2; // 4 in bash, -4 in other languages. // this is invalid in javascript, as the operation is ambiguous. -(2 ** 2); // -4 in javascript and the author's intention is unambiguous. note that some programming languages use the caret symbol ^ for exponentiation, but javascript uses that symbol for the bitwise logical xor operator. examples basic exponentiation 2 ** 3 // 8 3 ** 2 // 9 3 ** 2.5 // 15.588457268119896 10 ** -1 // 0.1 nan ** 2 // nan ...
Nullish coalescing operator (??) - JavaScript
r operator (||): let foo; // foo is never assigned any value so it is still undefined let somedummytext = foo || 'hello!'; however, due to || being a boolean logical operator, the left hand-side operand was coerced to a boolean for the evaluation and any falsy value (0, '', nan, null, undefined) was not returned. this behavior may cause unexpected consequences if you consider 0, '', or nan as valid values. let count = 0; let text = ""; let qty = count || 42; let message = text || "hi!"; console.log(qty); // 42 and not 0 console.log(message); // "hi!" and not "" the nullish coalescing operator avoids this pitfall by only returning the second operand when the first one evaluates to either null or undefined (but no other falsy values): let mytext = ''; // an empty string (which is als...
Pipeline operator (|>) - JavaScript
n a readable manner. the result is syntactic sugar in which a function call with a single argument can be written like this: let url = "%21" |> decodeuri; the equivalent call in traditional syntax looks like this: let url = decodeuri("%21"); syntax expression |> function the value of the specified expression is passed into the function as its sole parameter. parameters expression any valid expression. function any function. examples chaining function calls the pipeline operator can improve readability when chaining several functions. const double = (n) => n * 2; const increment = (n) => n + 1; // without pipeline operator double(increment(double(double(5)))); // 42 // with pipeline operator 5 |> double |> double |> increment |> double; // 42 specifications spec...
Property accessors - JavaScript
s to make a distinction between properties and methods. however, the property/method distinction is little more than a convention. a method is simply a property that can be called (for example, if it has a reference to a function instance as its value). there are two ways to access properties: dot notation and bracket notation. dot notation in the object.property syntax, the property must be a valid javascript identifier. (in the ecmascript standard, the names of properties are technically "identifiernames", not "identifiers", so reserved words can be used but are not recommended). for example, object.$1 is valid, while object.1 is not. const variable = object.property_name; object.property_name = value; const object = {}; object.$1 = 'foo'; console.log(object.$1); // 'foo' object.1 =...
Spread syntax (...) - JavaScript
rray to the end of an existing array. without spread syntax, this is done as: const arr1 = [0, 1, 2]; const arr2 = [3, 4, 5]; // append all items from arr2 onto arr1 arr1 = arr1.concat(arr2); with spread syntax this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr1, ...arr2]; // arr1 is now [0, 1, 2, 3, 4, 5] // note: not to use const otherwise, it will give typeerror (invalid assignment) array.prototype.unshift() is often used to insert an array of values at the start of an existing array. without spread syntax, this is done as: const arr1 = [0, 1, 2]; const arr2 = [3, 4, 5]; // prepend all items from arr2 onto arr1 array.prototype.unshift.apply(arr1, arr2) // arr1 is now [3, 4, 5, 0, 1, 2] with spread syntax, this becomes: let arr1 = [0, 1, 2]; let arr2 = [3...
instanceof - JavaScript
t, different constructors, etc.). this may result in unexpected results. for instance, [] instanceof window.frames[0].array will return false, because array.prototype !== window.frames[0].array and arrays inherit from the former. this may not make sense at first, but for scripts dealing with multiple frames or windows, and passing objects from one context to another via functions, this will be a valid and strong issue. for instance, you can securely check if a given object is, in fact, an array using array.isarray(myobj) for example, checking if a nodes is a svgelement in a different context, you can use mynode instanceof mynode.ownerdocument.defaultview.svgelement. note for mozilla developers: in code using xpcom, instanceof has special effect: obj instanceof xpcominterface (e.g. componen...
try...catch - JavaScript
ndle this very common expected error } else { throw e; // re-throw the error unchanged } } the exception identifier when an exception is thrown in the try-block, exception_var (i.e., the e in catch (e)) holds the exception value. you can use this identifier to get information about the exception that was thrown. this identifier is only available in the catch-block's scope. function isvalidjson(text) { try { json.parse(text); return true; } catch { return false; } } the finally-block the finally-block contains statements to execute after the try-block and catch-block(s) execute, but before the statements following the try...catch...finally-block. note that the finally-block executes regardless of whether an exception is thrown. also, if an exception is thrown, t...
Template literals (Template strings) - JavaScript
the ecmascript proposal template ...
<math> - MathML
Web › MathML › Element › math
in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it. attributes in addition to the following attributes, the <math> element accepts any attributes of the <mstyle> element. class, id, style provided for use with stylesheets. dir overall directionality of formulas. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. ...
<mmultiscripts> - MathML
pts> base (subscript superscript)* [ <mprescripts/> (presubscript presuperscript)* ] </mmultiscripts> after the base expression you can specify a postsubscript and a postsuperscript. prescripts are optional and are separated by the empty tag <mprescripts/> (only one <mprescripts /> element is allowed, otherwise you will get an duplicatemprescripts error in the error console and "invalid-markup" in your rendering). in addition you are able to use <none/> as a placeholder for empty scripts (not for the base). see the examples section for a correct usage. attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text col...
<semantics> - MathML
to make expressions understandable to computer algebra systems. the mathml elements <semantics>, <annotation> and <annotation-xml> are used to combine presentation and content markup and to provide both, layout information and semantic meaning of mathematical expressions. the <semantics> element acts as a container element associating annotations and must have child elements (it will raise an invalid markup error otherwise). the <annotation> element is the container element containing semantic information in a non-xml format, whereas the <annotation-xml> element contains content in an xml format, e.g. content mathml or openmath. the rules of determining the visible child in a <semantics> element are the following: if no rule other rule applies: by default only the first child is rendered,...
MathML documentation index - MathML
Web › MathML › Index
athml element reference mathml, mathml reference this is an alphabetical list of mathml presentation elements. 10 <maction> mathml, mathml reference, mathml:element, mathml:enlivening expressions the following example uses the "toggle" actiontype: 11 <math> mathml, mathml reference, mathml:element the top-level element in mathml is <math>. every valid mathml instance must be wrapped in <math> tags. in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it. 12 <menclose> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <menclose> element renders its content inside an enclosing notation specified by the notation attr...
MathML
rstand how it works. authoring mathml suggestions and tips for writing mathml, including suggested mathml editors and how to integrate their output into web content. view all... getting help from the community view mozilla forums... mailing list newsgroup rss feed matrix chat room wiki used by mozilla contributors w3c math home www-math w3.org mail archive tools w3c validator mathzilla firefox add-on collection texzilla — javascript latex to mathml converter (live demo, firefox os webapp, firefox add-on, using in a web page, js program etc) latexml - convert latex documents into html+mathml web pages web equation - turn handwritten equations into mathml or latex mathjax - cross-browser javascript display engine for mathematics. to force mathjax to use nativ...
The "codecs" parameter in common media types - Web media technologies
x a, section 3 in the av1 specification for details. t the one-character tier indicator. for the main tier (seq_tier equals 0), this character is the letter m. for the high tier (seq_tier is 1), this character is the letter h. the high tier is only available for level 4.0 and up. dd the two-digit component bit depth. this value must be one of 8, 10, or 12; which values are valid varies depending on the profile and other properties. m the one-digit monochrome flag; if this is 0, the video includes the u and v planes in addition to the y plane. otherwise, the video data is entirely in the y plane and is therefore monochromatic. see yuv in digital video concepts for details on how the yuv color system works. the default value is 0 (not monochrome). ccc ...
OpenSearch description format
by loading the file directly into firefox. ampersands (&) in the template url must be escaped as &amp;, and tags must be closed with a trailing slash or matching end tag. the xmlns attribute is important — without it you could get the error message "firefox could not download the search plugin". you must include a text/html url — search plugins including only atom or rss url types (which is valid, but firefox doesn't support) will also generate the "could not download the search plugin" error. remotely fetched favicons must not be larger than 10kb (see bug 361923). in addition, the search plugin service provides a logging mechanism that may be useful to plugin developers. use about:config to set the pref 'browser.search.log' to true. then, logging information will appear in firefox's e...
Critical rendering path - Web Performance
n on how to style that dom. cssom is similar to the dom, but different. while the dom construction is incremental, cssom is not. css is render blocking: the browser blocks page rendering until it receives and processes all of the css. css is render blocking because rules can be overwritten, so the content can't be rendered until the cssom is complete. css has its own set of rules for identifying valid tokens. remember the c in css stands for 'cascade'. css rules cascade down. as the parser converts tokens to nodes, with descendants of nodes inheriting styles. the incremental processing features don't apply to css like they do with html, because subsequent rules may override previous ones. the css object model gets built as the css is parsed, but can't be used to build the render tree until it ...
Performance fundamentals - Web Performance
rendering the gecko javascript engine supports just-in-time (jit) compilation. this enables application logic to perform comparably to other virtual machines — such as java virtual machines — and in some cases even close to "native code". the graphics pipeline in gecko that underpins html, css, and canvas is optimized in several ways. the html/css layout and graphics code in gecko reduces invalidation and repainting for common cases like scrolling; developers get this support "for free". pixel buffers painted by both gecko "automatically" and applications to canvas "manually" minimize copies when being drawn to the display framebuffer. this is done by avoiding intermediate surfaces where they would create overhead (such as per-application "back buffers" in many other operating systems), a...
SVG Event Attributes - SVG: Scalable Vector Graphics
Web › SVG › Attribute › Events
vent 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, oninput, 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, onwaiting grap...
dur - SVG: Scalable Vector Graphics
Web › SVG › Attribute › dur
clock-value> this value specifies the length of the simple duration. the value must be greater than 0 and can be expressed with hours (h), minutes (m), seconds (s) or milliseconds (ms). itʼs possible to combine those time representations to create some complex durations like hh:mm:ss.iii or mm:ss.iii. media this value specifies the simple duration as the intrinsic media duration. this is only valid for elements that define media. (for animation elements the attribute will be ignored if media is specified.) indefinite this value specifies the simple duration as indefinite. note: the interpolation will not work if the simple duration is indefinite (although this may still be useful for <set> elements). specifications specification status comment svg an...
id - SVG: Scalable Vector Graphics
Web › SVG › Attribute › id
<id> specifies the element's id. the id must be unique within the node tree, must not be an empty string, and must not contain any whitespace characters. note: you should avoid the use of id values that would be parsed as an svg view specification (e.g., mydrawing.svg#svgview(viewbox(0,200,1000,1000))) or a basic media fragment when used as a url target fragment. it must be valid in xml documents. a stand-alone svg document uses xml 1.0 syntax, which specifies that valid ids only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character. specifications specification status comment scalable vector graphics (svg) 2the definition of '...
marker-end - SVG: Scalable Vector Graphics
points="20,100 40,60 70,80 100,20" marker-end="url(#triangle)"/> </svg> usage notes value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the final vertex. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the final vertex. if the reference is not valid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the definition of 'marker-end' in that specification. candidate recommendation no significant change scalable vector graphics (svg) 1.1 (second edition)the definition of 'marker-end' in that specification. recommendation initial definition ...
marker-mid - SVG: Scalable Vector Graphics
points="20,100 40,60 70,80 100,20" marker-mid="url(#circle)"/> </svg> usage notes value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the given vertices. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the given vertices. if the reference is not valid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the definition of 'marker-mid' in that specification. candidate recommendation no significant change scalable vector graphics (svg) 1.1 (second edition)the definition of 'marker-mid' in that specification. recommendation initial definition ...
marker-start - SVG: Scalable Vector Graphics
points="20,100 40,60 70,80 100,20" marker-start="url(#triangle)"/> </svg> usage notes value none | <marker-ref> default value none animatable yes none indicates that no marker symbol shall be drawn at the first vertex. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the first vertex. if the reference is not valid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the definition of 'marker-start' in that specification. candidate recommendation no significant change scalable vector graphics (svg) 1.1 (second edition)the definition of 'marker-start' in that specification. recommendation initial definit...
tabindex - SVG: Scalable Vector Graphics
using this attribute. html, body, svg { height: 100%; } <?xml version="1.0"?> <svg viewbox="0 0 260 260" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="60" r="15" tabindex="1" /> <circle cx="60" cy="160" r="30" tabindex="3" /> <circle cx="160" cy="60" r="30" tabindex="2" /> <circle cx="160" cy="160" r="60" tabindex="4" /> </svg> usage notes value valid integer default value none animatable no valid integer relative order of the element for the purposes of sequential focus navigation. specifications specification status comment scalable vector graphics (svg) 2the definition of 'tabindex' in that specification. candidate recommendation initial definition ...
target - SVG: Scalable Vector Graphics
Web › SVG › Attribute › target
ult is the same as _top. <xml-name> specifies the name of the browsing context (tab, inline frame, object, etc.) for display of the linked content. if a context with this name already exists, and can be securely accessed from this document, it is re-used, replacing the existing content. if it does not exist, it is created (the same as '_blank', except that it now has a name). the name must be a valid xml name [xml11], and should not start with an underscore (u+005f low line character), to meet the requirements of a valid browsing context name from html. specifications specification status comment scalable vector graphics (svg) 2the definition of 'target' in that specification. candidate recommendation removed the _replace value. scalable vector gr...
version - SVG: Scalable Vector Graphics
Web › SVG › Attribute › version
the version attribute is used to indicate what specification a svg document conforms to. it is only allowed on the root <svg> element. it is purely advisory and has no influence on rendering or processing. while it is specified to accept any number, the only two valid choices are currently 1.0 and 1.1. <svg version="1.1" viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="80" height="80"/> </svg> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'version' in that specification. recommendation initial definition ...
SVG Attribute reference - SVG: Scalable Vector Graphics
Web › SVG › Attribute
tion 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, oninput, 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, onwaiting grap...
<a> - SVG: Scalable Vector Graphics
Web › SVG › Element › a
ctor-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<circle> - SVG: Scalable Vector Graphics
Web › SVG › Element › circle
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<ellipse> - SVG: Scalable Vector Graphics
Web › SVG › Element › ellipse
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<foreignObject> - SVG: Scalable Vector Graphics
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<g> - SVG: Scalable Vector Graphics
Web › SVG › Element › g
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<line> - SVG: Scalable Vector Graphics
Web › SVG › Element › line
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<marker> - SVG: Scalable Vector Graphics
Web › SVG › Element › marker
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<path> - SVG: Scalable Vector Graphics
Web › SVG › Element › path
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<polygon> - SVG: Scalable Vector Graphics
Web › SVG › Element › polygon
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<polyline> - SVG: Scalable Vector Graphics
Web › SVG › Element › polyline
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<rect> - SVG: Scalable Vector Graphics
Web › SVG › Element › rect
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<svg> - SVG: Scalable Vector Graphics
Web › SVG › Element › svg
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<symbol> - SVG: Scalable Vector Graphics
Web › SVG › Element › symbol
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<text> - SVG: Scalable Vector Graphics
Web › SVG › Element › text
ity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<textPath> - SVG: Scalable Vector Graphics
Web › SVG › Element › textPath
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<tspan> - SVG: Scalable Vector Graphics
Web › SVG › Element › tspan
ity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
<use> - SVG: Scalable Vector Graphics
Web › SVG › Element › use
, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-...
Namespaces crash course - SVG: Scalable Vector Graphics
doctype declaration". dtds were never designed with mixed content in mind, and past attempts to create mixed content dtds are now considered to have failed. xml, and some xml dialects (svg included), don't require a doctype declaration, and svg 1.2 won't even have one. the fact that doctype declarations (usually) match the content in single content type files is merely coincidental. dtds are for validation only, not identification of content. user agents that cheat and identify xml content using its doctype declaration cause harm. the real answer to the question is that xml content tells the user agent which dialect the element names belong to by giving them explicit "namespace declarations". declaring namespaces so what do these namespace declarations look like, and where do they go? here ...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
reorder smil attribute implementation status unknown made <tspan> and <textpath> graphics elements implementation status unknown allow x, y, width, and height on <symbol> implementation status unknown made <use> element shadow trees consistent with shadow dom spec implementation status unknown role mapping of <a> element depending on whether it is a valid link implementation status unknown aria state and property attributes animatable implementation status unknown styling change notes contentstyletype attribute removed implementation status unknown linkstyle on svgstyleelement implemented (bug 1239128 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43)) inner <svg>s and <foreig...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
to install the *very* old adobe svg viewer that comes bundled with it. this will set up the os to associate the .svg filename extension with the incorrect media type "image/svg-xml" instead of "image/svg+xml". microsoft windows one way to fix this in microsoft windows is to start regedit (start > run > regedit) and search for "svg". change every occurance of "image/svg-xml" (or whatever the invalid media type is) to "image/svg+xml". normally, this matters just for the entry "hkey_classes_root\.svg\content type". after correcting the os file associations you will probably need to re-clean your mimetypes.rdf as described in the section above. fixing the bug need to look at the exthandler code. related bugs: bug 332690 and bug 303581. ...
SVG: Scalable Vector Graphics
Web › SVG
ails about each svg attribute. svg dom interface reference details about the svg dom api, for interaction with javascript. applying svg effects to html content svg works together with html, css and javascript. use svg to enhance a regular html page or web application. view all... community view mozilla forums... mailing list newsgroup rss feed tools svg test suite markup validator more tools... other resources: xml, css, dom, canvas examples google maps (route overlay) & docs (spreadsheet charting) svg bubble menus svg authoring guidelines an overview of the mozilla svg project frequently asked questions regarding svg and mozilla svg as an image svg animation with smil svg art gallery animation and interactions like html, svg has a document model (do...
Certificate Transparency - Web security
t the server operator can customise the ct log sources providing the scts sent via the tls extension/stapled ocsp response. browser requirements google chrome requires ct log inclusion for all certificates issues with a notbefore date of after 30 april 2018. users will be prevented from visiting sites using non-compliant tls certificates. chrome had previously required ct inclusion for extended validation (ev) and symantec-issued certificates. apple requires a varying number of scts in order for safari and other servers to trust server certificates. firefox does not currently check or require the use of ct logs for sites that users visit. the expect-ct header can be used to request that a browser always enforces the requirement for certificate transparency (e.g. in chrome, even if the cert...
Subresource Integrity - Web security
um using a command invocation such as this: shasum -b -a 384 filename.js | awk '{ print $1 }' | xxd -r -p | base64 notes: the pipe-through-xxd step takes the hexadecimal output from shasum and converts it to binary. the pipe-through-awk step is necessary because shasum will pass the hashed filename in its output to xxd. that can have disastrous consequences if the filename happens to have valid hex characters in it — because xxd will also decode that and pass it to base64. additionally, the sri hash generator at https://www.srihash.org/ is an online tool you can use to generate sri hashes. cross-origin resource sharing and subresource integrity for subresource-integrity verification of a resource served from an origin other than the document in which it's embedded, browsers addit...
Web security
x-frame-options the x-frame-options http response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. csp: frame-ancestors the http content-security-policy (csp) frame-ancestors directive specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. user information security insecure passwords serving login forms over http is especially dangerous because of the wide variety of attacks that can be used against them to extract a user’s password. network eavesdroppers could steal a user's password by sniffing the network, or by modifying the served pa...
Using custom elements - Web Components
nally, we register our custom element on the customelementregistry using the define() method we mentioned earlier — in the parameters we specify the element name, and then the class name that defines its functionality: customelements.define('popup-info', popupinfo); it is now available to use on our page. over in our html, we use it like so: <popup-info img="img/alt.png" data-text="your card validation code (cvc) is an extra security feature — it is the last 3 or 4 numbers on the back of your card."></popup-info> note: you can see the full javascript source code here. internal vs. external styles in the above example we apply style to the shadow dom using a <style> element, but it is perfectly possible to do it by referencing an external stylesheet from a <link> element instead.
Using shadow DOM - Web Components
w.appendchild(style); shadow.appendchild(wrapper); wrapper.appendchild(icon); wrapper.appendchild(info); using our custom element once the class is defined, using the element is as simple as defining it, and putting it on the page, as explained in using custom elements: // define the new element customelements.define('popup-info', popupinfo); <popup-info img="img/alt.png" data-text="your card validation code (cvc) is an extra security feature — it is the last 3 or 4 numbers on the back of your card."> internal versus external styles in the above example we apply style to the shadow dom using a <style> element, but it is perfectly possible to do it by referencing an external stylesheet from a <link> element instead.
element-available - XPath
the qname is expanded into an expanded-name using the namespace declarations in scope for the expression. returns returns true if and only if the expanded-name is the name of an instruction. ...
XPath
rminology. jxon jxon (lossless javascript xml object notation) is a generic name by which is defined the representation of javascript objects using xml. there are some cases in which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example). in these cases jxon could represent the most practical way and valid alternative to xpath. view all... tools chropath xpath panel that integrates tightly into firebug, providing an editor and inspector (firefox add-on). xmlquire (formerly known as sketchpath) a graphical xpath builder/debugger(.net). xpath tester an online xpath builder/debugger. related topics xslt, xquery, xml, dom, jxon, jsonpath comparison of css selectors and xpath ...
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
xpath functions, xpath axes the <xsl:attribute-set> element creates a named set of attributes, which can then be applied as whole to the output document, in a manner similar to named styles in css. syntax <xsl:attribute-set name=name use-attribute-sets=list-of-names> <xsl:attribute> </xsl:attribute-set> required attributes name specifies the name of the attribute set. the name must be a valid qname. optional attributes use-attribute-sets builds an attribute set from other attribute sets. the names of the contributing sets must be separated with whitespace characters and must not directly or indirectly embed themselves. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 7.1.4. gecko support supported. ...
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
inside the output document element for which it establishes attribute values. but it may be after or inside elements that won't be part of the output (like <xsl:choose> or <xsl:apply-templates> etc.). syntax <xsl:attribute name=name namespace=uri> template </xsl:attribute> required attributes name specifies the name of the attribute to be created in the output document. the name must be a valid qname. optional attributes namespace defines the namespace uri for this attribute in the output document. you cannot set the related namespace prefix with this element. type instruction, appears within a template or an <xsl:attribute-set> element. defined xslt, section 7.1.3. gecko support supported. ...
<xsl:element> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › element
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:element> element creates an element in the output document. syntax <xsl:element name=name namespace=uri use-attribute-sets=list-of-names > template </xsl:element> required attributes name specifies the desired name of the output element. the name must be a valid qname. optional attributes namespace specifies the namespace of the output element. use-attribute-sets a whitespace‐separated list of attribute-set element names to be applied to the element element’s output element. applied attributes can be overridden via nested attribute elements. type instruction, appears within a template. defined xslt, section 7.1.2. gecko support supported. ...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › number
t-string lang=xml:lang-code letter-value="alphabetic" | "traditional" grouping-separator=character grouping-size=number /> required attributes none. optional attributes count specifies what in the source tree should be numbered sequentially. it uses an xpath expression. level defines how levels of the source tree should be considered in generating sequential numbers. it has three valid values: single, multiple, and any. the default value is single: single numbers sibling nodes sequentially, as in the items in a list. the processor goes to the first node in the ancestor-or-self axis that matches the count attribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the from attribute, if there is one) that also match the cou...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
e compilation step again. from inside your latest directory (and while inside your emscripten compiler environment terminal window), compile your c code with the following command. (note that we need to compile with no_exit_runtime, which is necessary as otherwise when main() exits the runtime would be shut down — necessary for proper c emulation, e.g., atexits are called — and it wouldn't be valid to call compiled code.) emcc -o hello3.html hello3.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html -s no_exit_runtime=1 -s "extra_exported_runtime_methods=['ccall']" if you load the example in your browser again, you'll see the same thing as before! now we need to run our new myfunction() function from javascript. first of all, open up your hello3.html file in a text...
Using the WebAssembly JavaScript API - WebAssembly
memory since a reference is an engine-trusted value whose bytes must not be read or written directly by content for safety, portability, and stability reasons. tables have an element type, which limits the types of reference that can be stored in the table. in the current iteration of webassembly, there is only one type of reference needed by webassembly code — functions — and thus only one valid element type. in future iterations, more element types will be added. function references are necessary to compile languages like c/c++ that have function pointers. in a native implementation of c/c++, a function pointer is represented by the raw address of the function’s code in the process’s virtual address space and so, for the safety reasons mentioned above, cannot be stored directly i...
WebAssembly
61firefox android full support 58opera android full support 45safari ios no support nosamsung internet android full support 8.0nodejs no support novalidatechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support n...