Search completed in 1.47 seconds.
1515 results for "ping":
Your results are loading. Please wait...
Compositing and clipping - Web APIs
clipping paths a clipping path is like a normal canvas shape but it acts as a mask to hide unwanted parts of shapes.
...the red star shape is our clipping path.
... if we compare clipping paths to the globalcompositeoperation property we've seen above, we see two compositing modes that achieve more or less the same effect in source-in and source-atop.
...And 13 more matches
PaymentResponse.shippingAddress - Web APIs
the shippingaddress read-only property of the paymentrequest interface returns a paymentaddress object containing the shipping address provided by the user.
... syntax var shippingaddress = paymentrequest.shippingaddress; value a paymentaddress object providing details comprising the shipping address provided by the user.
... example generally, the user agent will fill the shippingaddress property for you.
...And 7 more matches
PaymentRequest.shippingAddress - Web APIs
the shippingaddress read-only property of the paymentrequest interface returns the shipping address provided by the user.
... syntax var paymentaddress = paymentrequest.shippingaddress; example generally, the user agent will fill the shippingaddress property value.
... you can trigger this by setting paymentoptions.requestshipping to true when calling the paymentrequest constructor.
...And 6 more matches
PaymentRequest.shippingOption - Web APIs
the shippingoption read-only attribute of the paymentrequest interface returns either the id of a selected shipping option, null (if no shipping option was set to be selected) or a shipping option selected by the user.
... it is initially null by when no "selected" shipping options are provided.
... this attribute is only populated if the constructor is called with the requestshipping flag set to true.
...And 6 more matches
PaymentRequest.onshippingoptionchange - Web APIs
the onshippingoptionchange event of the paymentrequest interface is fired whenever the user changes a shipping option.
... syntax paymentrequest.addeventlistener('shippingoptionchange', shippingoptionchangeevent => { ...
... }); paymentrequest.onshippingoptionchange = function(shippingoptionchangeevent) { ...
...And 5 more matches
PaymentResponse.shippingOption - Web APIs
the shippingoption read-only property of the paymentrequest interface returns the id attribute of the shipping option selected by the user.
... this option is only present when the requestshipping option is set to true in the paymentoptions object passed to the paymentrequest constructor.
... syntax var shippingoption = paymentrequest.shippingoption; example in the example below, the paymentrequest.onshippingaoptionchange event is called.
...And 5 more matches
CSSGroupingRule - Web APIs
an object implementing the cssgroupingrule interface represents any css at-rule that contains other rules nested within it.
... interface cssgroupingrule : cssrule { readonly attribute cssrulelist cssrules; unsigned long insertrule (domstring rule, unsigned long index); void deleterule (unsigned long index); } properties common to all cssgroupingrule instances the cssgroupingrule derives from cssrule and inherits all properties of this class.
... it has one specific property: cssgroupingrule.cssrules read only returns a cssrulelist of the css rules in the media rule.
...And 4 more matches
PaymentRequest.onshippingaddresschange - Web APIs
the onshippingaddresschange event of the paymentrequest interface is fired whenever the user changes their shipping address, including when an address is added by the user for the first time.
... syntax paymentrequest.addeventlistener('shippingaddresschange', shippingaddresschangeevent => { ...
... }); paymentrequest.onshippingaddresschange = function(shippingaddresschangeevent) { ...
...And 4 more matches
PaymentRequest: shippingoptionchange event - Web APIs
for payment requests that request shipping information, and for which shipping options are offered, the shippingoptionchange event is sent to the paymentrequest whenever the user chooses a shipping option from the list of available options.
... the string identifying the currently-selected shipping option can be found in the shippingoption property.
... bubbles no cancelable no interface paymentrequestupdateevent event handler property onshippingoptionchange examples this code snippet sets up a handler for the shippingoptionchange event.
...And 4 more matches
PaymentRequest: shippingaddresschange event - Web APIs
the shippingaddresschange event is sent to the paymentrequest object when the user selects a shipping address or changes details of their shipping address.
... bubbles no cancelable no interface paymentrequestupdateevent event handler property onshippingaddresschange usage notes depending on the browser, the shipping address information may be redacted 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).
...And 3 more matches
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
the container will need to have a height in order that the items will start wrapping and creating new columns, and items will stretch taller to fill each column completely.
... wrapping and flex-direction wrapping works as you might expect when combined with flex-direction.
... creating gutters between items when wrapping flex items, the need to space them out is likely to arise.
...And 3 more matches
Looping code - Learn web development
a condition — as mentioned before, this defines when the loop should stop looping.
... after (contacts.length-1) iterations, if the contact name does not match the entered search the paragraph text is set to "contact not found.", and the loop continues looping until the condition is no longer true.
... skipping iterations with continue the continue statement works in a similar manner to break, but instead of breaking out of the loop entirely, it skips to the next iteration of the loop.
...And 2 more matches
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
the paymentdetailsupdate dictionary's shippingaddresserrors property, if present, contains an addresserrors object whose contents provide error messages for 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.
...And 2 more matches
Gamepad.mapping - Web APIs
WebAPIGamepadmapping
the gamepad.mapping property of the gamepad interface returns a string indicating whether the browser has remapped the controls on the device to a known layout.
...if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard.
... syntax readonly attribute domstring mapping; example var gp = navigator.getgamepads()[0]; console.log(gp.mapping); value a string.
... specifications specification status comment gamepadthe definition of 'gamepad.mapping' in that specification.
PaymentRequest.shippingType - Web APIs
the shippingtype read-only property of the paymentrequest interface returns one of "shipping", "delivery", "pickup", or null if one was not provided by the constructor.
... syntax var shippingtype = paymentrequest.shippingtype value one of "shipping", "delivery", "pickup", or null.
... specifications specification status comment payment request apithe definition of 'shippingtype' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingtypechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.
Grouping operator ( ) - JavaScript
the grouping operator ( ) controls the precedence of evaluation in expressions.
... syntax ( ) description the grouping operator consists of a pair of parentheses around an expression or sub-expression to override the normal operator precedence so that expressions with lower precedence can be evaluated before an expression with higher priority.
... examples using the grouping operator overriding multiplication and division first, then addition and subtraction to evaluate addition first.
... var a = 1; var b = 2; var c = 3; // default precedence a + b * c // 7 // evaluated by default like this a + (b * c) // 7 // now overriding precedence // addition before multiplication (a + b) * c // 9 // which is equivalent to a * c + b * c // 9 specifications specification ecmascript (ecma-262)the definition of 'the grouping operator' in that specification.
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
if you've had experience developing with dynamic html, you'll probably find it relatively easy to pick up the knowledge you'll need to develop firefox extensions.
...i will assume that you have experience developing with dynamic html, as well as the topics below.
...it does not have strict typing like java, making it extremely flexible and giving it qualities that in some senses could be considered similar to lisp.
Warning: -file- is being assigned a //# sourceMappingURL, but already has one - JavaScript
the javascript warning "-file- is being assigned a //# sourcemappingurl, but already has one." occurs when a source map has been specified more than once for a given javascript source.
... message warning: -file- is being assigned a //# sourcemappingurl, but already has one.
... examples setting source maps setting a source map by using a comment in the file: //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map or, alternatively, you can set a header to your javascript file: x-sourcemap: /path/to/file.js.map ...
Dragging and Dropping Multiple Items - Web APIs
if a particular drop target only supports dropping a single item, it could either reject the dragged items or it could just use just the first item.
... the dodrop event hander is called when dropping an item.
Clipping and masking - SVG: Scalable Vector Graphics
clipping refers to removing parts of elements defined by other parts.
...for the clipping, every path inside the clippath is inspected and evaluated together with its stroke properties and transformation.
Developing for Firefox Mobile - Archive of obsolete content
see developing webextensions for firefox for android to learn more about development of webextensions for firefox for android.
Developing New Mozilla Features - Archive of obsolete content
develop relationships with existing developers in the area of your feature if you want to add a big new feature to mail, spend some time helping the existing mail developers.
XPCOM Interface Reference by grouping
grouping and category names were made by somewhat arbitrary decision by the author.
Index - Web APIs
WebAPIIndex
below is a list of all the apis and interfaces (object types) that you may be able to use while developing your web app or site.
... 29 addresserrors api, address, addresserrors, dictionary, errors, interface, 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).
... 179 audioparammap draft, experimental the web audio api interface audioparammap represents a set of multiple audio parameters, each described as a mapping of a domstring identifying the parameter to the audioparam object representing its value.
...And 42 more matches
Index - Archive of obsolete content
154 developing for firefox mobile add-on sdk no summary!
... 174 bookmarks code snippets, developing mozilla, extensions, places no summary!
... 175 boxes code snippets make the box style="display: block" and the wrapping behavior will occur when the box is resized: 176 canvas code snippets canvas, code snippets, graphics no summary!
...And 41 more matches
Index
MozillaTechXPCOMIndex
8 generating guids add-ons, developing mozilla, developing_mozilla:tools, extensions, tools, xpcom guids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5.
... 14 introduction to xpcom for the dom developing mozilla warning: this document has not yet been reviewed by the dom gurus, it might contain some errors.
...it returns a reference to the clone: 33 components.utils.createobjectin add-ons, developing mozilla, extensions, javascript, reference, référence(2), xpcom:language bindings, xpconnect components.utils.createobjectin creates a new javascript object in the scope of the specified object's compartment.
...And 34 more matches
nss tech note5
gestcontext, data, sizeof data); s = pk11_digestfinal(digestcontext, digest, &len, sizeof digest); /* now, digest contains the 'signed digest', and len contains the length of the digest */</big> clean up pk11_destroycontext(digestcontext, pr_true); pk11_freesymkey(symkey); pk11_freeslot(slot); you can also look at a sample program illustrating this symmetric key wrapping/unwrapping of a symmetric key include headers #include "nss.h" #include "pk11pub.h" make sure nss is initialized.the simplest init function, in case you don't need a nss database is nss_nodb_init(".") choose a wrapping mechanism.
... see wrapmechanismlist in security/nss/lib/pk11wrap/pk11slot.c and security/nss/lib/ssl/ssl3con.c for examples of wrapping mechanisms.
...you can get the best slot given a wrap mechanism (as shown above), or get the best wrap mechanism given a slot using:</big> ck_mechanism_type wrapmech = pk11_getbestwrapmechanism(slot) prepare the wrapping key if using a raw key /* turn the raw key into a secitem */ secitem keyitem; keyitem.data = /* ptr to an array of key bytes */ keyitem.len = /* length of the array of key bytes */ /* turn the secitem into a key object */ pk11symkey* wrappingsymkey = pk11_importsymkey(slot, wrapmech, ...
...And 23 more matches
SubtleCrypto.unwrapKey() - Web APIs
this is sometimes called the "unwrapping key".
... syntax const result = crypto.subtle.unwrapkey( format, wrappedkey, unwrappingkey, unwrapalgo, unwrappedkeyalgo, extractable, keyusages ); parameters format is a string describing the data format of the key to unwrap.
... unwrappingkey is the cryptokey to use to decrypt the wrapped key.
...And 17 more matches
Mobile accessibility - Learn web development
user input — make user input requirements as painless as possible on mobile (e.g., in forms, keep typing to a minimum).
...for example: single-tapping an app will select it, and the device will read out what the app is.
... swiping left and right will move between apps, or buttons/controls if you are in a control bar.
...And 13 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).
... 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.
... examples snippet: limiting destination countries this first example is just a snippet showing an implementation of the event handler for the shippingaddresschange event which checks to be sure the chosen address is located within one of a limited number of countries.
...And 13 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
72 <blockquote>: the block quotation element blockquote, element, html, html grouping content, html:flow content, html:palpable content, html:sectioning root, quotations, reference, web the html <blockquote> element (or html block quotation element) indicates that the enclosed text is an extended quotation.
... 87 <dd>: the description details element definition, description details, element, html, html grouping content, reference, web, dd, description list, details the html <dd> element provides the description, definition, or value for the preceding term (<dt>) in a description list (<dl>).
... 93 <div>: the content division element content division, element, html, html grouping content, html:flow content, layout, reference, web, div the html content division element (<div>) is the generic container for flow content.
...And 13 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
11 accessibility accessibility, glossary web accessibility (a11y) refers to best practices for keeping a website usable despite physical and technical restrictions.
... 66 card sorting card sorting, design, glossary card sorting is a simple technique used in information architecture whereby people involved in the design of a website (or other type of product) are invited to write down the content / services / features they feel the product should contain, and then organize those features into categories or groupings.
... 72 character encoding composing, glossary an encoding defines a mapping between bytes and text.
...And 12 more matches
Inputs and input sources - Web APIs
this may involve the user simply tapping on a spot on the screen, tracking their eyes, or the use of a joystick or motion-sensing controller to move a cursor.
...the screen mode indicates that the target ray is determined based on the user interacting with the webxr context by engaging with the screen in some way—most likely by the viewer tapping the screen or dragging the target ray around with their fingers.
... mapping the grip space to the world coordinate system.
...And 12 more matches
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
the clip-path css property creates a clipping region that sets what part of an element should be shown.
...if specified by itself, it causes the edges of the specified box, including any corner shaping (such as a border-radius), to be the clipping path.
... none no clipping path is created.
...And 11 more matches
CanvasRenderingContext2D.clip() - Web APIs
the canvasrenderingcontext2d.clip() method of the canvas 2d api turns the current or given path into the current clipping region.
... it replaces any previous clipping region.
... in the image below, the red outline represents a clipping region shaped like a star.
...And 10 more matches
SubtleCrypto.wrapKey() - Web APIs
wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
...this is sometimes called the "wrapping key".
... syntax const result = crypto.subtle.wrapkey( format, key, wrappingkey, wrapalgo ); parameters format is a string describing the data format in which the key will be exported before it is encrypted.
...And 10 more matches
A guide to searching crash reports
grouping you can cluster the results of each search into groups using the same criteria.
...search is easy to understand, but the grouping capabilities are easy to overlook.
... grouping in the previous section we saw one example of grouping, in the "signature facet" tab that is shown by default.
...And 9 more matches
Using textures in WebGL - Web APIs
turn off mips and set // wrapping to clamp to edge gl.texparameteri(gl.texture_2d, gl.texture_wrap_s, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); } }; image.src = url; return texture; } function ispowerof2(value) { return (value & (value - 1)) == 0; } the loadtexture() routine starts...
...after that we setup filtering and wrapping for the texture based on whether or not the image we download was a power of 2 in both dimensions or not.
...their wrapping mode must also be set to clamp_to_edge.
...And 9 more matches
ui/frame - Archive of obsolete content
if the frame script initiates the conversation, you need to specify "*" as the origin: window.parent.postmessage("ping", "*"); if the frame script has received a message from the add-on already, it can use the origin property of the event object passed to the message hander: // listen for messages from the add-on, and send a reply window.addeventlistener("message", function(event) { event.source.postmessage("pong", event.origin) }, false); this frame script listens to change events on the "city-selector" <se...
... for targetorigin, you can use the origin property of the event object passed to the message listener: var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var frame = new frame({ url: "./city-info.html", onmessage: function(e) { // message only the frame that pinged us e.source.postmessage("pong", e.origin); } }); var toolbar = toolbar({ name: "ping-pong", title: "ping pong", items: [frame] }); this does not have to be the message event: the other events frame can emit: attach, load and ready, also provide access to source and origin.
...if you send a json object, the sdk takes care of serializing and deserializing it for you: // frame.js var label = window.document.getelementbyid("linky"); label.addeventlistener("click", function() { window.parent.postmessage({ "type" : "ping", "reason" : "they clicked me" }, "*"); }, true); // main.js var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); frame.on("message", pong); function pong(e) { if (e.data.type == "ping") { console.log(e.data.reason); e.source.postmessage("pong", event.origin); } } globals constructors frame(options) creates an frame.
...And 8 more matches
PaymentRequest.PaymentRequest() - Web APIs
displayitems an array of optional line items for the payment request that the user agent may display, such as product details, tax, and shipping.
... shippingoptions the shipping options the user may choose from.
... if this sequence is blank, it indicates the merchant cannot ship to the current shipping address.
...And 8 more matches
WebGL model view projection - Web APIs
box.draw({ top : 0.9, // x bottom : 0, // x left : -0.9, // y right : 0.9, // y depth : 0.5, // z color : [0.4, 1, 0.4, 1] // green }); finally, for demonstration that clipping is actually going on, this box doesn't get drawn because it's entirely outside of clip space.
... the clipping of points and polygons from clip space actually happens after the homogeneous coordinates have been transformed back into cartesian coordinates (by dividing by w).
...see perspective projection matrix below for an introduction to how to use more complex matrices to help control and prevent clipping.
...And 8 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
change your preferences for more efficient development before you get to work developing your extension, you’ll want to change some of your firefox preferences.
... true javascript.options.strict (present in firefox 3.5+) enforces strict error output from javascript true table 1: preferences to set for developing extensions to make these changes, start your development profile, type about:config into firefox’s location bar and open the preferences window; find the preferences listed in table 1 and double-click on them to set them accordingly.
...this is not required for developing extensions, but it is handy to have around.
...And 7 more matches
PaymentRequest - Web APIs
paymentrequest.shippingaddress read only secure context if requested via payment options, returns the shipping address chosen by the user for the purposes of calculating shipping.
... this property is only populated if the constructor is called with the requestshipping flag set to true.
... paymentrequest.shippingoption read only secure context returns the identifier of the selected shipping option.
...And 7 more matches
ARIA: gridcell role - Accessibility
it is intended to mimic the functionality of the html td element for table-style grouping of information.
...instead use the native html td element in conjunction with the and contenteditable attribute: <td>potato</td> <td>cabbage</td> <td>onion</td> description gridcells with dynamically added, hidden, or removed rows and columns any element with a role="gridcell" applied to it should use aria to describe its order in the table-style grouping, provided the table, grid, or treegrid has the ability to have rows and/or columns dynamically added, hidden, or removed.
... this sample code demonstrates a table-style grouping of information where the third and fourth columns have been removed.
...And 7 more matches
scroll-snap-type - CSS: Cascading Style Sheets
both the scroll container snaps to snap positions in both of its axes independently (potentially snapping to different elements in each axis).
... examples snapping in different axes html <div class="holster"> <div class="container x mandatory-scroll-snapping" dir="ltr"> <div>x mand.
... ltr</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> </div> <div class="container x proximity-scroll-snapping" dir="ltr"> <div>x prox.
...And 7 more matches
/loader - Archive of obsolete content
this is provided by a mandatory options.paths hash that represents the mapping between module id prefixes and locations.
...in those cases you have to decide what the entry point module is relative to and provide an appropriate mapping for it: let { loader } = require('toolkit/loader'); let loader = loader({ paths: { // resolve all modules starting with `toolkit/` as follows: // toolkit/foo -> resource://gre/modules/commonjs/toolkit/foo.js // toolkit/foo/bar -> resource://gre/modules/commonjs/toolkit/foo/bar.js 'toolkit/': 'resource://gre/modules/commonjs/toolkit/', // resolev all other non-relati...
...ce:///modules/devtools/gcli.js // panel -> resource:///modules/panel.js '': 'resource:///modules/', // allow relative urls and resolve them to add-on root: // ./main -> resource://my-addon/root/main.js './': 'resource://my-addon/root/' } }); the order of keys in paths is irrelevant since they are sorted by keys from longest to shortest to allow overlapping mapping.
...And 6 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
well, xul overlays and windows, jsm files, chrome & resource mappings with localization, default preferences, but no xpcom components of your own.
...mappings, so that you can access your files with custom paths such as: resource://myaddon/filename.ext chrome://myaddon/content/filename.ext step 2: no more resource:// uris for files internal to your bundle unfortunately, resource mappings in your chrome.manifest were not usable in restartless add-ons until mozilla finally fixed this bug in firefox 38, which looked bad, but only because mozilla is st...
...resource mappings for files in the mozilla distribution, such as services.jsm (above), will continue to work.
...And 6 more matches
Index - Learn web development
beginner, express, flask, learn, node, php, python, django, lamp, server-side, servers throughout most of the learning area, we tell you to just open your examples directly in a browser — this can be done by double clicking the html file, dragging and dropping it into the browser window, or choosing file > open...
... 46 how to contribute to the learning area on mdn beginner, contribute, documentation, guide, learn, mdn meta, l10n:priority on this page, you'll find everything you need to start helping improve mdn's learning content.
...in this article, we'll look at all the common things that you really ought to know about strings when learning javascript, such as creating strings, escaping quotes in strings, and joining strings together.
...And 6 more matches
Arrays - Learn web development
suppose we want to store a shopping list in an array.
... paste the following code into the console: let shopping = ['bread', 'milk', 'cheese', 'hummus', 'noodles']; shopping; in the above example, each element is a string, but in an array we can store various data types — strings, numbers, objects, and even other arrays.
... enter the following into your console: shopping[0]; // returns "bread" you can also modify an item in an array by simply giving a single array item a new value.
...And 6 more matches
Index
there are tools for managing nss databases, for dumping or verifying certificates, for registering pkcs#11 modules with a database, for processing cms encrypted/signed messages, etc.
...nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
...nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
...And 6 more matches
Using the Payment Request API - Web APIs
details — an object containing information concerning the specific payment, such as the total payment amount, tax, shipping cost, etc.
... so for example, you could create a new paymentrequest instance like so: var request = new paymentrequest(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); the functions invoked inside the constructor simply return the required object parameters: function buildsupportedpaymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard'], supportedtypes: ['debit', 'credit'] } }]; } function buildshoppingcartdetails() { // hardcoded for demo purposes: return { id: 'order-123', displayitems: [ { label: 'example item', ...
... simulate immediate success: paymentresponse.complete('success') .then(function() { // for demo purposes: intropanel.style.display = 'none'; successpanel.style.display = 'block'; }); }) this object provides the developer with access to details they can use to complete the logical steps required after the payment completes, such as an email address to contact the customer, a shipping address for mailing goods out to them, etc.
...And 6 more matches
Writing WebSocket servers - Web APIs
once the server sends these headers, the handshake is complete and you can start swapping data!
... keeping track of clients this doesn't directly relate to the websocket protocol, but it's worth mentioning here: your server must keep track of clients' sockets so you don't keep handshaking again with clients who have already completed the handshake.
... pings and pongs: the heartbeat of websockets at any point after the handshake, either the client or the server can choose to send a ping to the other party.
...And 6 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
the following is an example of a request that will be preflighted: const xhr = new xmlhttprequest(); xhr.open('post', 'https://bar.other/resources/post-here/'); xhr.setrequestheader('x-pingother', 'pingpong'); xhr.setrequestheader('content-type', 'application/xml'); xhr.onreadystatechange = handler; xhr.send('<person><name>arun</name></person>'); the example above creates an xml body to send with the post request.
... also, a non-standard http x-pingother request header is set.
...t/response: options /doc http/1.1 host: bar.other user-agent: mozilla/5.0 (macintosh; intel mac os x 10.14; rv:71.0) gecko/20100101 firefox/71.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip,deflate connection: keep-alive origin: http://foo.example access-control-request-method: post access-control-request-headers: x-pingother, content-type http/1.1 204 no content date: mon, 01 dec 2008 01:15:39 gmt server: apache/2 access-control-allow-origin: https://foo.example access-control-allow-methods: post, get, options access-control-allow-headers: x-pingother, content-type access-control-max-age: 86400 vary: accept-encoding, origin keep-alive: timeout=2, max=100 connection: keep-alive once the preflight request is c...
...And 6 more matches
Storing the information you need — Variables - Learn web development
try typing these lines into your web browser's console.
... you can test whether these values now exist in the execution environment by typing just the variable's name, e.g.
...if they don't exist, you'll get an error message — try typing in scoobydoo; note: don't confuse a variable that exists but has no defined value with a variable that doesn't exist at all — they are very different things.
...And 5 more matches
Index of archived content - Archive of obsolete content
toolbar annotator creating annotations displaying annotations implementing the widget overview storing annotations chrome authority creating event targets creating reusable modules developing for firefox mobile display a popup getting started (jpm) getting started (cfx) list open tabs listen for page load listening for load and unload localization logging modifying web pages based on url modifying the page hosted by a tab open a web ...
...ase support in old browsers xpath getattributens common pitfalls communication between html and your extension creating custom firefox extensions with the mozilla build system custom about: urls default preferences deploying a plugin as an extension developing add-ons displaying web content in an extension without security issues downloading json and javascript in extensions enhanced extension installation extension etiquette extension library extension packaging extension samples extension theming guidelines extension versioning, update and compatibility ...
... multiple item extension packaging offering a context menu for form controls overlay extensions firefox addons developer guide appendix: what you should know about open-source software licenses chapter 1: introduction to extensions chapter 2: technologies used in developing extensions chapter 3: introduction to xul—how to build a more intuitive ui chapter 4: using xpcom—implementing advanced processes chapter 5: let's build a firefox extension chapter 6: firefox extensions and xul applications license and authors xul school tutorial ...
...And 4 more matches
Layout System Overview - Archive of obsolete content
this must happen very fast, so the user's typing is not delayed.
...this is especially critical when the user is typing into the document: it would be quite unusable if typing a character at the end of a document in the html editor caused the entire document to be reformatted - it would be too slow, at least on low-end machines.
...clients generally do not want to incur the expense of traversing all of the frames from the root to find the frame they are interested in, so the frame manager provides some other mappings based on the needs of the clients.
...And 4 more matches
JavaScript Client API - Archive of obsolete content
before developing against the javascript api, it is recommended to speak to developers of the api.
...function foorecord(collection, id) { cryptowrapper.call(this, collection, id); } foorecord.prototype = { __proto__: cryptowrapper.prototype, _logname: "record.foo", ttl: foo_ttl, // optional get bar() this.cleartext.bar, set bar(value) { this.cleartext.bar = value; }, get baz() this.cleartext.baz, set baz(value) { this.cleartext.baz = value; } }; to save all that typing for declaring the getters and setters, you can also use utils.defergetset: function foorecord(collection, id) { cryptowrapper.call(this, collection, id); } foorecord.prototype = { __proto__: cryptowrapper.prototype, _logname: "record.foo", ttl: foo_ttl // optional }; utils.defergetset(foorec, "cleartext", ["bar", "baz"]); the store object the store object (which extends store, as def...
... if not, you may have to invent your own mapping from data objects to guids as long as it's consistent.
...And 4 more matches
3D collision detection - Game development
axis-aligned bounding boxes as with 2d collision detection, axis-aligned bounding boxes (aabb) are the quickest algorithm to determine whether the two game entities are overlapping or not.
... this consists of wrapping game entities in a non-rotated (thus axis-aligned) box and checking the positions of these boxes in the 3d coordinate space to see if they are overlapping.
...the overlapping area between two non-rotated boxes can be checked with logical comparisons alone, whereas rotated boxes require additional trigonometric operations, which are slower to calculate.
...And 4 more matches
TypeScript support in Svelte - Learn web development
objective: learn how to configure and use typescript when developing svelte applications.
... typescript: optional static typing for javascript typescript is a superset of javascript that provides features such as optional static typing, classes, interfaces, and generics.
... readability: static typing gives the code more structure, making it self-documenting and more readable.
...And 4 more matches
Command line crash course - Learn web development
a large number of tools can be used by typing commands into the command line; many come pre-installed on your system, and a huge number of others are installable from package registries.
... the next images show the command prompts available in windows — there’s a good range of options from the "cmd" program to "powershell" — which can be run from the start menu by typing the program name.
... try typing this into your system's terminal: cd desktop if you want to move back up to the previous directory, you can use two dots: cd ..
...And 4 more matches
Localizing without a specialized tool
you can follow more detailed guidelines on compare-locale's page, but running the following command from the command line should be enough: $ sudo easy_install -u compare-locales to start, be sure to open your command line interface and change your directory to where you are keeping your localization files, the en-us sources $ cd /path/to/your/working/directory now, you will need run compare locales.
... to do this, enter the following commands, keeping sure to change "x-testing" to the actual locale code of your locale.
... you can do this by typing: cd ../../ where each ".." represents the prior sub directory before the main directory where you want to be.
...And 4 more matches
NSS Sample Code Sample1
this program shows the following: rsa key pair generation naming rsa key pairs looking up a previously generated key pair by name creating aes and mac keys (or encryption and mac keys in general) wrapping symmetric keys using your own rsa key pair so that they can be stored on disk or in a database.
... as an alternative to token symmetric keys as a way to store large numbers of symmetric keys wrapping symmetric keys using an rsa key from another server unwrapping keys using your own rsa key pair the main part of the program shows a typical sequence of events for two servers that are trying to extablish a shared key pair.
...in particular, this // creates the key pair that is used for wrapping keys int init(); // generates keys for encryption (aes) and macing.
...And 4 more matches
Bytecode Descriptions
toasynciter stack: iter, next ⇒ asynciter create and push an async iterator wrapping the sync iterator iter.
...if the circumstances permit the optimization, tryskipawait replaces value with the result of the await expression (unwrapping the resolved promise, if any) and pushes true.
...if we did the lookup twice, there would be observable bugs, thanks to dynamic scoping.
...And 4 more matches
Logical properties for floating and positioning - CSS: Cascading Style Sheets
the logical properties and values specification contains logical mappings for the physical values of float and clear, and also for the positioning properties used with positioned layout.
... mapped properties and values the table below details the properties and values discussed in this guide along with their physical mappings.
...these have no mapping to physical properties, aside from the inset property.
...And 4 more matches
scroll-snap-stop - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | always examples snapping in different axes this example is duplicated from scroll-snap-type with minor variances.
...: center; justify-content: space-between; flex-flow: column nowrap; font-family: monospace; } .container { display: flex; overflow: auto; outline: 1px dashed lightgray; flex: none; } .container.x { width: 100%; height: 128px; flex-flow: row nowrap; } .container.y { width: 256px; height: 256px; flex-flow: column nowrap; } /* definite scroll snap */ .mandatory-scroll-snapping > div { scroll-snap-stop: always; } .proximity-scroll-snapping > div { scroll-snap-stop: normal; } /* scroll-snap */ .x.mandatory-scroll-snapping { scroll-snap-type: x mandatory; } .y.mandatory-scroll-snapping { scroll-snap-type: y mandatory; } .x.proximity-scroll-snapping { scroll-snap-type: x proximity; } .y.proximity-scroll-snapping { scroll-snap-type: y proximity; } .container...
...} .y.container > div { line-height: 256px; font-size: 128px; width: 256px; height: 256px; } /* appearance fixes */ .y.container > div:first-child { line-height: 1.3; font-size: 64px; } /* coloration */ .container > div:nth-child(even) { background-color: #87ea87; } .container > div:nth-child(odd) { background-color: #87ccea; } html <div class="container x mandatory-scroll-snapping" dir="ltr"> <div>x mand.
...And 4 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
41 clip-path svg, svg attribute the clip-path presentation attribute defines or associates a clipping path with the element it is related to.
... 218 text-anchor svg, svg attribute the text-anchor attribute is used to align (start-, middle- or end-alignment) a string of pre-formatted text or auto-wrapped text where the wrapping area is determined from the inline-size property relative to a given point.
... 273 clipping and masking advanced, svg, svg:tutorial erasing part of what one has created might at first sight look contradictory.
...And 4 more matches
ui/sidebar - Archive of obsolete content
s a simple but complete add-on that shows how to set up communication between main.js and a script in a sidebar, in the case where the sidebar script initiates communication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body> </html> the "sidebar.js" file sends a ping message to main.js using port.emit() as soon as it loads, and adds a listener to the pong message.
... addon.port.emit("ping"); addon.port.on("pong", function() { console.log("sidebar script got the reply"); }); the "main.js" file creates a sidebar object and adds a listener to its attach event.
... on attach, "main.js" starts listening to the ping message, and responds with a pong: var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html"), onattach: function (worker) { worker.port.on("ping", function() { console.log("add-on script got the message"); worker.port.emit("pong"); }); } }); try running the add-on, and showing the sidebar using the "view->sidebar->my sidebar" menu item.
...And 3 more matches
Using the Editor from XUL - Archive of obsolete content
for command state maintenance, starting and stopping the throbber etc.).
... nstexteditorkeylistener this event listener handles key presses for typing, and other editing operations (backspace, delete, enter/return).
... cases that it does not handle explicitly it passes on to nshtmleditor::editorkeypress(), which is where normal typing keys end up.
...And 3 more matches
Eclipse CDT
keeping the index up-to-date as the source changes from day-to-day, you'll want to update the index to keep the code assistance working well.
... to get a list of autocomplete options in an editor tab, start typing the name of an identifier and then type ctrl-space.
... unfortunately, the autocomplete list cannot (currently) be configured to appear automatically as soon as you start typing a character that might be the start of an identifier name.
...And 3 more matches
HTTP Cache
//github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl it is a helper interface wrapping following four arguments into a single one: private-browsing boolean flag anonymous load boolean flag app id number (0 for no app) is-in-browser boolean flag helper functions to create nsiloadcontextinfo objects: c++ consumers: functions at loadcontextinfo.h exported header js consumers: resource://gre/modules...
... 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.
... adding a new storage should there be a need to add a new distinct storage for which the current scoping model would not be sufficient - use one of the two following ways: [preffered] add a new <your>storage method on nsicachestorageservice and if needed give it any arguments to specify the storage scope even more.
...And 3 more matches
SourceMap.jsm
names: an array of identifiers that can be referenced by individual mappings.
... mappings: a string of base64 vlqs which contain the actual mappings.
... sourcemapgenerator.prototype.addmapping(mapping) add a single mapping from original source line and column to the generated source's line and column for this source map being created.
...And 3 more matches
PR_CreateFileMap
creates a file mapping object.
... prot protection option for read and write accesses of a file mapping.
... returns if successful, a file mapping of type prfilemap.
...And 3 more matches
Web Replay
the tab will pause at this point and allow state to be inspected, forward/reverse stepping, and so forth.
... this mechanism requires intercepting mmap (or similar low level allocation functions) so that any newly addressable memory is known — anonymous mappings would not otherwise be intercepted or included in the recording, as heap allocation is non-deterministic while replaying.
... mprotect is intercepted and nop'ed to avoid interference with the dirty memory mechanism, and munmap is intercepted with no actual unmapping performed, so that memory does not need to be remapped when restoring a snapshot (a set of free regions is maintained to allow reusing this memory).
...And 3 more matches
The JavaScript input interpreter - Firefox Developer Tools
to enter multi-line expressions, press shift+enter after typing each line, then enter to run all the entered lines.
...can access variables defined in the page, both built-in variables like window and variables added by javascript libraries like jquery: autocomplete the editor has autocomplete: enter the first few letters and a popup appears with possible completions: press enter, tab, or the right arrow key to accept the suggestion, use the up/down arrows to move to a different suggestion, or just keep typing if you don't like any of the suggestions.
... when the "instant evaluation" feature is enabled, the interpreter displays results of expressions as you're typing them in single-line mode.
...And 3 more matches
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
loopend: an optional value, in seconds, where looping should end if the loop attribute is true.
...if loopend is less than 0, looping will end at 0.
... if loopend is greater than the duration of the buffer, looping will end at the end of the buffer.
...And 3 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
in mapping applications, the camera may either be placed directly over the scene, or might use various angles to show perspective.
... the following function returns a projection perspective matrix that integrates the specified field of view angle as well as the given near and far clipping plane distances: function createperspectivematrix(viewport, fovdegrees, nearclip, farclip) { const fovradians = fov * (math.pi / 180.0); const aspectratio = viewport.width / viewport.height; const transform = mat4.create(); mat4.perspective(transform, fovradians, aspectratio, nearclip, farclip); return transform; } after converting the fov angle, fovdegrees, from d...
... the perspective matrix encapsulates the field of view (technically, this is the vertical field of view), aspect ratio, and the near and far clipping planes within the 4x4 matrix transform, which is then returned to the caller.
...And 3 more matches
-webkit-mask-composite - CSS: Cascading Style Sheets
syntax values clear overlapping pixels in the source mask image and the destination mask image are cleared.
... source-in overlapping pixels in the source mask image and the destination mask image are replaced by the pixels of the source mask image; all other pixels are cleared.
... source-out overlapping pixels in the source mask image and the destination mask image are cleared; all remaining pixels of the source mask image are rendered.
...And 3 more matches
Logical properties for sizing - CSS: Cascading Style Sheets
in this guide we will explain the flow-relative mappings between physical dimension properties and logical properties used for sizing elements on our pages.
...while these flow relative mappings may well become the default for many of us, in a design you may well use both physical and logical sizing.
... mappings for dimensions the table below provides mappings between logical and physical properties.
...And 3 more matches
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
the below example demonstrates scroll snapping along the y axis, with scroll-snap-align used on the section element to dictate the point the scrolling should stop.
... using scroll-snap-type the scroll-snap-type property needs to know the direction in which scroll snapping happens.
... this could be x or y, or the logical mappings block or inline.
...And 3 more matches
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
this will ensure your scroll snapping works in all browsers which implement the specification, including firefox.
... if you do not do this your scroll snapping will no longer work in firefox 68 and up.
... in this initial example we have used the old specification alongside the current specification in order to make scroll snapping work in all browsers which support some form of scroll snapping.
...And 3 more matches
HTML attribute: step - HTML: Hypertext Markup Language
WebHTMLAttributesstep
the step sets the stepping interval when clicking up and down spinner buttons, moving a slider left and right on a range, and validating the different date 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).
... the default stepping value for number inputs is 1, allowing only integers to be entered, unless the stepping base is not an integer.
...And 3 more matches
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
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.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...And 3 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
additional attributes in addition to the attributes common to all <input> elements, datetime-local inputs offer the following attributes: attribute description max the latest date and time to accept min the earliest date and time to accept step the stepping interval to use for this input, such as when clicking arrows on spinner controls or performing validation max the latest date and time to accept.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...And 3 more matches
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
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.
...e id of the <datalist> element that contains the optional pre-defined autocomplete options max the maximum value to accept for this input min the minimum value to accept for this input placeholder an example value to display inside the field when it's empty readonly a boolean attribute indicating whether the value is read-only step a stepping interval to use when using up and down arrows to adjust the value, as well as for validation list the values of the list attribute is the id of a <datalist> element located in the same document.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
...And 3 more matches
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
tion 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 discussed in the value section above, to accept.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...And 3 more matches
String.prototype.toLocaleUpperCase() - JavaScript
the tolocaleuppercase() method returns the calling string value converted to upper case, according to any locale-specific case mappings.
... syntax str.tolocaleuppercase() str.tolocaleuppercase(locale) str.tolocaleuppercase([locale, locale, ...]) parameters locale optional the locale parameter indicates the locale to be used to convert to upper case according to any locale-specific case mappings.
... return value a new string representing the calling string converted to upper case, according to any locale-specific case mappings.
...And 3 more matches
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
syntax <xsl:number count=expression level="single" | "multiple" | "any" from=expression value=expression format=format-string lang=xml:lang-code letter-value="alphabetic" | "traditional" grouping-separator=character grouping-size=number /> required attributes none.
...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 count attribute.if no match is found, the sequence will be an empty list.
...the processor looks at all ancestors of the current node and the current node itself, stopping when it reaches a match for the from attribute, if there is one.
...And 3 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
there are earlier experiments going back a long way in developing user interfaces using a combination of html and scripting languages, and xul could be considered an evolutionary step from that.
...for example, there is the mozilla amazon browser, which helps with shopping at amazon, and the presentation method in xul, a tool for writing and displaying presentations to try out the code samples in this chapter, save them as text files with .xul extensions and drag and drop them into the firefox browser window.
...if you are developing an application with an interface that can open web pages, i recommend that you always use this declaration to limit access to the parent frame.
...And 2 more matches
The Box Model - Archive of obsolete content
in order to have wrapping descriptions, you need to set the text as a child node instead of using the value attribute: <description>&xulschoolhello.description.label;</description> even then, the text will extend as much as it can in a single line, so you need to add some css limits in order to make it wrap inside a xul dialog or window.
... never cut text lines into separate locale strings in order to bypass wrapping difficulties.
... there are other more complicated text wrapping cases where a description won't be good enough.
...And 2 more matches
MMgc - Archive of obsolete content
here's what the different poison values mean: 0xfafafafa uninitialized unmanaged memory 0xedededed unmanaged memory that was freed explicitly 0xbabababa managed memory that was freed by the sweep phase of the garbage collector 0xcacacaca managed memory that was freed by an explicit call to gc::free (including drc reaping) 0xdeadbeef this is written to the 4 bytes just after any object allocated via mmgc.
...// 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.
...also finalize builds up a lists of pages that need sweeping so sweep doesn't need to visit every page.
...And 2 more matches
URIs and URLs - Archive of obsolete content
the resource is the conceptual mapping to an entity or set of entities, not necessarily the entity which corresponds to that mapping at any particular instance in time.
... thus, a resource can remain constant even when its content---the entities to which it currently corresponds---changes over time, provided that the conceptual mapping is not changed in the process.
... escaping to be able to parse an url safely it is sometimes necessary to "escape" certain characters, to hide them from the parser.
...And 2 more matches
XForms Select1 Element - Archive of obsolete content
note, some representations of the select1 element do not support visual grouping.
...xhtml widget characteristics analogous widgets is <html:select/> visual grouping by choices element is supported selection="open" is supported if incremental attribute value is false, the bound node is updated when the select1 control is blurred (i.e.
... loses focus), otherwise it is updated upon item selection xul widget characteristics analogous widgets are <html:select/> and <xul:menulist/> visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e.
...And 2 more matches
Anatomy of a video game - Game development
games are constantly looping through these stages, over and over, until some end condition occurs (such as winning, losing, or exiting to go to bed).
...imagine that you are developing a "find the differences between these two similar pictures"-type game.
... for the second issue, stopping the main loop, you will need to cancel the call to main() with window.cancelanimationframe().
...And 2 more matches
HTML text fundamentals - Learn web development
to style content with css, or make it do interesting things with javascript, you need to have elements wrapping the relevant content, so css/javascript can effectively target it.
...lists are everywhere in life—from your shopping list to the list of directions you subconsciously follow to get to your house every day, to the lists of instructions you are following in these tutorials!
... unordered unordered lists are used to mark up lists of items for which the order of the items doesn't matter—let's take a shopping list as an example.
...And 2 more matches
Graceful asynchronous programming with Promises - Learn web development
there are certain steps that you have to take for your order to be successful, which doesn't really make sense to try to execute out of order, or in order but before each previous step has quite finished: you choose what toppings you want.
... with old-style callbacks, a pseudo-code representation of the above functionality might look something like this: choosetoppings(function(toppings) { placeorder(toppings, function(order) { collectorder(order, function(pizza) { eatpizza(pizza); }, failurecallback); }, failurecallback); }, failurecallback); this is messy and hard to read (often referred to as "callback hell"), requires the failurecallback() to be called multiple times (once for each nested function), with other issues besides.
...if we represented the above pseudo-code using asynchronous promises instead, we'd end up with something like this: choosetoppings() .then(function(toppings) { return placeorder(toppings); }) .then(function(order) { return collectorder(order); }) .then(function(pizza) { eatpizza(pizza); }) .catch(failurecallback); this is much better — it is easier to see what is going on, we only need a single .catch() block to handle all the errors, it doesn't block the main thread (so we can keep playing video games while we wait for the pizza to be ready to collect), and each operation is guaranteed to wait for previous operations to complete before running.
...And 2 more matches
Server-side web frameworks - Learn web development
different frameworks use different mechanisms for the mapping.
... @app.route("/") def hello(): return "hello world!" while django expects developers to define a list of url mappings between a url pattern and a view function.
...the team_level is a choice field, so we also provide a mapping between choices to be displayed and data to be stored, along with a default value.
...And 2 more matches
Creating localizable web applications
an important step of developing a web application or creating web content is making sure that it can be localized.
... so in order to display a localized label of a category or a tab, you should create a mapping between the non-localizable english names used in the urls and the localizable english strings used in the interface.
...good: function num_format($num, $decimals) { $locale_info = localeconv(); return number_format($num, $decimals, $locale_info['decimal_point'], $locale_info['thousands_sep']); } printf(_("%s mb"), num_format($size, 1)); wrap as few html tags as possible when wrapping the localizable content with the gettext function calls, put all the code that irrelevant to localization outside the function call.
...And 2 more matches
Index
7 gcintegration developing mozilla, firefox, garbage collection, intermediate, intro, jsapi, needsupdate, spidermonkey, tools, memory the spidermonkey garbage collector (gc) will be changing a lot in the future.
... 269 js_fileescapedstring jsapi reference, reference, référence(2), spidermonkey js_fileescapedstring writes str into file fp escaping any non-printable or non-ascii character.
... 429 js_putescapedstring jsapi reference, reference, référence(2), spidermonkey js_putescapedstring and js_putescapedstring write str into buffer escaping any non-printable or non-ascii character using \escapes for js string literals.
...And 2 more matches
Index
41 mailnews xpcshell-tests automated testing, developing mozilla, mailnews, seamonkey, thunderbird mailnews xpcshell-tests are written and run in the same manner as the core xpcshell-tests.
... initially, the training.dat file is empty (there was discussion of shipping with a default file) on spam detection, the user can choose to move spam to a special "junk" folder the user can configure junk mail can be automatically purged from the "junk" folder to analyze a message for spam, we need the entire message, not just the headers.
...depending on the installed theme the result will look something like this: 80 building a thunderbird extension 7: installation extensions, thunderbird while you are developing the extension, there are two ways you can make thunderbird load it so you can test it as you go.
...And 2 more matches
Using IndexedDB - Web APIs
this way, you can run multiple transactions with non-overlapping scopes concurrently.
...you can concurrently run multiple readonly transactions with overlapping scopes, but you can have only one readwrite transaction for an object store.
...this way, you can run multiple transactions with non-overlapping scopes concurrently.
...And 2 more matches
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.
...And 2 more matches
PaymentRequestUpdateEvent - Web APIs
the paymentrequestupdateevent interface is used for events sent to a paymentrequest instance when changes are made to shipping-related information for a pending paymentrequest.
... those events are: shippingaddresschange secure context dispatched whenever the user changes their shipping address.
... also available using the onshippingaddresschange event handler property.
...And 2 more matches
ReadableStream.pipeTo() - Web APIs
the pipeto() method of the readablestream interface pipes the current readablestream to a given writablestream and returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
... piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it.
... options optional the options that should be used when piping to the writable stream.
...And 2 more matches
Using server-sent events - Web APIs
developing a web application that uses server-sent events is straightforward.
... you can also listen for events with addeventlistener(): evtsource.addeventlistener("ping", function(event) { const newelement = document.createelement("li"); const time = json.parse(event.data).time; newelement.innerhtml = "ping at " + time; eventlist.appendchild(newelement); }); this code is similar, except that it will be called automatically whenever the server sends a message with the event field set to "ping"; it then parses the json in the data field and outputs that ...
... the php code for the example we're using here follows: date_default_timezone_set("america/new_york"); header("cache-control: no-cache"); header("content-type: text/event-stream"); $counter = rand(1, 10); while (true) { // every second, send a "ping" event.
...And 2 more matches
Rendering and the WebXR frame animation callback - Web APIs
you achieve this by doing as much as is practicable off the main thread and by keeping your frame rendering callback as efficient as possible.
...this is called dropping frames.
...and if the device's refresh rate is 120 hz, you only have 0.00883333 seconds to render each frame if you want to avoid dropping frames.
...And 2 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
here i am keeping everything in source order, trying to avoid any disconnect between the source and display as described in the guide grid layout and accessibility.
...i find this named areas method very helpful at a prototyping stage, it is easy to play around with the location of elements.
... you could always begin to use grid in this way for prototyping, even if you can’t rely on it fully in production due to the browsers that visit your site.
...And 2 more matches
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
the logical properties and values specification introduces flow-relative mappings for many of the properties and values in css.
...the logical properties and values specification defines mappings for these physical values to their logical, or flow relative, counterparts — e.g.
... an example of why these mappings might be needed is as follows.
...And 2 more matches
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
ttribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest year and month to accept as a valid input min the earliest year and month to accept as a valid input readonly a boolean which, if present, indicates that the input's value can't be edited step a stepping interval to use when incrementing and decrementing the value of the input field list the values of the list attribute is the id of a <datalist> element located in the same document.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...And 2 more matches
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
additional attributes in addition to the attributes shared by all <input> elements, range inputs offer the following attributes: attribute description list the id of the <datalist> element that contains optional pre-defined options max the maximum permitted value min the minimum permitted value step the stepping interval, used both for user interface and validation purposes list the values of the list attribute is the id of a <datalist> element located in the same document.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...And 2 more matches
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
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 to the beginning again.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is provided) are valid.
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
...And 2 more matches
String.prototype.toLocaleLowerCase() - JavaScript
the tolocalelowercase() method returns the calling string value converted to lower case, according to any locale-specific case mappings.
... syntax str.tolocalelowercase() str.tolocalelowercase(locale) str.tolocalelowercase([locale, locale, ...]) parameters locale optional the locale parameter indicates the locale to be used to convert to lower case according to any locale-specific case mappings.
... return value a new string representing the calling string converted to lower case, according to any locale-specific case mappings.
...And 2 more matches
StringView - Archive of obsolete content
*/ /* mapping...
...*/ /* mapping...
...*/ /* mapping...
...*/ for (var nidx = 0; nidx < noutptlen; nidx++) { awhole[nidx] = vsource.charcodeat(nidx) & 0xff; } break conversionswitch; case 5: /* domstring to utf-8 or to utf-16 */ /* mapping...
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
matsuzawa-san is a co-author of firefox 3 hacks (o'reilly japan, 2008.) this chapter discusses tools to assist in developing extensions.
...it works like typical debuggers, and is useful not only for developing extensions, but also for general web development.
... the author has done almost no work developing extensions, but has used this to investigate how extensions were implemented.
... the next command will import the source code: gonzui-import.exe mozilla once the import process is complete, type the following command to launch the gonzui server: gonzui-server.exe now you can access gonzui from your web browser by typing the following into your location bar : http://localhost:46984 this lets you browse all packages, click on links to traverse them, and take traversed-link locations as search starting points (figure a).
Anonymous Content - Archive of obsolete content
scoping and access using the dom when a binding is attached and certain conditions are met, the children of the binding's content element are cloned.
...because anonymous content elements can also have bindings attached that generate their own anonymous content, this scoping can be taken to an arbitrary level of nesting.
... bindings can fine-tune the control of the stylesheet scoping with the inheritstyle attribute, which indicates whether or not author sheets defined at outer scopes affect the anonymous content generated by the binding.
... for the primary generating binding only, this attribute is checked to see if any author sheets at outer levels of scoping should be applied to the anonymous content generated by the bindings attached to the bound element.
-ms-wrap-through - Archive of obsolete content
initial valuewrapapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete syntax values wrap the exclusion element inherits its parent node's wrapping context.
... none the exclusion element does not inherit its parent node's wrapping context.
... the wrapping context of a box is a collection of exclusion areas contributed by its associated exclusion boxes.
... the inline flow content of a box is placed in the area that corresponds to the subtraction of its wrapping context from its own content area.
E4X for templating - Archive of obsolete content
security and escaping function e (str) { if (typeof str === 'xml') {str = str.tostring();} return str; } function quot (s) { // useful for placing user input within inline javascript; may be combined with escape function above as well if (typeof s === 'string') { return s.replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } if (typeof s === 'xml') { return s.tostring().replace(/"/g, ...
...he simple xmllist() constructor (<></>) may be useful to still be able to use an expression closure (i.e., without needing return statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to store such e4x in separate file templates (to be eval()d at a later time, taking into account security considerations, such as escaping with the above), e4x content using such functions can also be easily serialized inline (and then perhaps converted to the dom) as needed: var list = <>{_if(elems.length(), function () <> <markup/> <markup/> </>)}</>.toxmlstring(); iterating functions such as the following foreach (which can work with arrays, objects, or e4x objects) are quite convenient in iterating over complex ...
...inline functions as explained in the tutorial, it is possible to use anonymous functions inline (returning the desired content, including potentially xmllist's) in order to execute more than a single related statement, keeping this logic together with the resulting xml.
... although a big advantage of e4x is being able to separate presentation from business logic, and the above-mentioned technique may fly in the face of this, if formatted well, it can also allow inline shaping of xml somewhat akin to the w3c standard xquery language, allowing the scripting to mix in context with the surrounding declarative xml: var a = <a><b/><c/><d/></a>; var b = <bar>{function () { var content = <></>; for each (var el in a) { el.@att = 'val'; content += el; } return content; }()}</bar>; giving: <bar> <b att="val"/> <c att="val"/> <d att="val"/> </bar> one may still wish to remove complex business logic and supply as variables to the e4x, but the above allows the shaping of resulting content to be made more clear (and sometimes design ...
Building up a basic demo with the PlayCanvas engine - Game development
environment setup to start developing with playcanvas, you don't need much.
... playcanvas application to begin developing our game we have to create the playcanvas application first (using the given <canvas> element), and then start the update loop.
...one = new pc.entity(); cone.addcomponent("model", { type: "cone" }); app.root.addchild(cone); cone.translate(2, 0, 0); var conematerial = new pc.phongmaterial(); conematerial.diffuse.set(0.9, 0.9, 0.9); conematerial.update(); cone.model.model.meshinstances[0].material = conematerial; the code above will create a new cone, add it to the app and move it by 2 units to the right so it's not overlapping the cylinder.
...we're wrapping the y scale value in math.abs to pass the absolute values (greater or equal to 0); sin varies between -1 and 0, and for negative values the cylinder scaling can render unexpectedly (in this case it looks black half the time.) now onto the movement part.
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
model view controller example imagine a simple shopping list app.
... going back to our shopping list app, the model would specify what data the list items should contain — item, price, etc.
... in our shopping list app, the view would define how the list is presented to the user, and receive the data to display from the model.
... so for example, our shopping list could have input forms and buttons that allow us to add or delete items.
UI pseudo-classes - Learn web development
se generated content is placed relative to an element's formatting box, but form inputs work more like replaced elements and therefore don't have one), we will add an empty <span> to hang the generated content on: <div> <label for="fname">first name: </label> <input id="fname" name="fname" type="text" required> <span></span> </div> the immediate problem with this was that the span was dropping onto a new line below the input because the input and label are both set with width: 100%.
...a classic example is a shipping form — commonly you'll get asked if you want to use the same address for billing and shipping; if so, you can just send a single address to the server, and might as well just disable the billing address fields.
... <form> <fieldset id="shipping"> <legend>shipping address</legend> <div> <label for="name1">name: </label> <input id="name1" name="name1" type="text" required> </div> <div> <label for="address1">address: </label> <input id="address1" name="address1" type="text" required> </div> <div> <label for="pcode1">zip/postal code: </label> <input id="pcode1" name="pcode1" type="text" required> </div> </fieldset> <fieldset id="billing"> <legend>billing address</legend> <div> <label for="b...
...illing-checkbox">same as shipping address:</label> <input type="checkbox" id="billing-checkbox" checked> </div> <div> <label for="name" class="billing-label disabled-label">name: </label> <input id="name" name="name" type="text" disabled required> </div> <div> <label for="address2" class="billing-label disabled-label">address: </label> <input id="address2" name="address2" type="text" disabled required> </div> <div> <label for="pcode2" class="billing-label disabled-label">zip/postal code: </label> <input id="pcode2" name="pcode2" type="text" disabled required> </div> </fieldset> <div><button>submit</button></div> </form> now onto the css.
Document and website structure - Learn web development
<section> is similar to <article>, but it is more for grouping together a single part of the page that constitutes one single piece of functionality (e.g., a mini map, or a set of article headlines and summaries).
...for example, imagine a shopping cart widget that you could choose to pull up at any point during your time on an e-commerce site: <div class="shopping-cart"> <h2>shopping cart</h2> <ul> <li> <p><a href=""><strong>silver earrings</strong></a>: $99.95.</p> <img src="../products/3333-0985/thumb.png" alt="silver earrings"> </li> <li> ...
...scared, but determined to protect his friends, he raised his wand and prepared to do battle, hoping that his distress call had made it through.</p> <hr> <p>meanwhile, harry was sitting at home, staring at his royalty statement and pondering when the next spin off series would come out, when an enchanted distress letter flew through his window and landed in his lap.
...we'd advise going through the next article in the series first and not just skipping to it though!
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
requestanimationframe() requestanimationframe() is a specialized looping function created for running animations efficiently in the browser.
...however, more frames means more processing, which can often cause stuttering and skipping — also known as dropping frames, or jank.
...(note that the function name starts with "cancel", not "clear" as with the "set..." methods.) just pass it the value returned by the requestanimationframe() call to cancel, which you stored in the variable raf: cancelanimationframe(raf); active learning: starting and stopping our spinner in this exercise, we'd like you to test out the cancelanimationframe() method by taking our previous example and updating it, adding an event listener to start and stop the spinner when the mouse is clicked anywhere on the page.
... function keyhandler(e) { let isover = false; console.log(e.key); if (e.key === "a") { result.textcontent = 'player 1 won!!'; isover = true; } else if (e.key === "l") { result.textcontent = 'player 2 won!!'; isover = true; } if (isover) { document.removeeventlistener('keydown', keyhandler); settimeout(reset, 5000); } }; } stepping through this: first, cancel the spinner animation with cancelanimationframe() (it is always good to clean up unneeded processes), and hide the spinner container.
Manipulating documents - Learn web development
active learning: a dynamic shopping list to round off the article, we'd like to set you a little challenge — we want to make a simple shopping list example that allows you to dynamically add items to the list using a form input and button.
... to start with, download a copy of our shopping-list.html starting file and make a copy of it somewhere.
... finally, use the focus() method to focus the input element ready for entering the next shopping list item.
... note: if you get really stuck, have a look at our finished shopping list (see it running live also.) summary we have reached the end of our study of document and dom manipulation.
A first splash into JavaScript - Learn web development
then we can try typing in the examples shown below — type in each one from the "example" columns exactly as shown, pressing return/enter after each one, and see what results they return.
...add the following line just below the let resetbutton; line near the top of your javascript, then save your file: guessfield.focus(); this line uses the focus() method to automatically put the text cursor into the <input> text field as soon as the page loads, meaning that the user can start typing their first guess right away, without having to click the form field first.
...an object is a collection of related functionality stored in a single grouping.
... now try typing guesses into the console and pressing return.
Handling text — strings in JavaScript - Learn web development
in this article, we'll look at all the common things that you really ought to know about strings when learning javascript, such as creating strings, escaping quotes in strings, and joining strings together.
... escaping characters in a string to fix our previous problem code line, we need to escape the problem quote mark.
... escaping characters means that we do something to them to make sure they are recognized as text, not part of the code.
... you can even do this with two numbers — you can force a number to become a string by wrapping it in quote marks.
Understanding client-side JavaScript frameworks - Learn web development
in this article we will first have a look at the desired functionality of our app, then we'll create a todos.svelte component and put static markup and styles in place, leaving everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles.
...dynamic behavior in svelte: working with variables and props now that we have our markup and styles ready we can start developing the required features for our svelte to-do list app.
...keeping the list short is therefore helpful.
... note that we were hoping to have more frameworks included upon initial publication, but we decided to release the content and then add more framework guides later, rather than delay it longer.
Introduction to cross browser testing - Learn web development
once you've agreed on these details, you can go ahead and start developing the site.
...you should split the different parts of the development into modules, for example you might split the different site areas up — home page, product page, shopping cart, payment workflow, etc.
... you might then further subdivide these — implement common site header and footer, implement product page detail view, implement persistent shopping cart widget, etc.
...to start with, you should make sure there are no general issues with your code that are stopping your feature from working: test it in a couple of stable browsers on your system, like firefox, safari, chrome, or ie/edge.
Handling common JavaScript problems - Learn web development
browser developer tools browser developer tools have many useful features for helping to debug javascript.
... web workers api for running javascript in a separate thread, helping to improve performance.
...whereas libraries are often usable for solving individual problems and dropping into existing sites, frameworks tend to be more along the lines of complete solutions for developing complex web applications.
... for example, try going into your browser's developer console and start typing window.audiocontext if this feature is supported in your browser, it will autocomplete.
Software accessibility: Where are we today?
ces and software include: screen reading software, which speaks text displayed on the screen using hardware or software text-to-speech, and which allows a blind person to use the keyboard to simulate mouse actions alternate input devices, which allow people with physical disabilities to use alternatives to a keyboard and mouse voice recognition software, which allows a person to simulate typing on a keyboard or selecting with a mouse by speaking into the computer screen magnification software, which allows a low-vision computer user to more easily read portions of the screen comprehension software, which allows a dyslexic or learning disabled computer user to see and hear text as it is manipulated on the computer screen in fact, the entire adaptive technology industry has grown up ...
...mozilla developers follow the general front-end accessibility requirements: there are a number of potential "gotchas" when developing xul ui.
... ensure correct keyboard accessibility when developing new controls: mozilla's xul and html widgets already support proper keyboard accessibility, so let's not regress in that area.
... support msaa and atk via nsiaccessible when developing new controls: mozilla is a great position to provide context so that custom controls can be made accessible.
How Mozilla determines MIME Types
externalhelperappservice (located at uriloader/exthandler/nsexternalhelperappservice.cpp) the file->mime type mapping works like this: on beos, the operating system is asked for the type of the file (not quite yet, bug 217723) on macos, the type and creator code will be used to lookup the type of the file from the os a hardcoded list of extensions is checked (containing currently 13 entries, nsexternalhelperappservice.cpp line 463 (this is done for speed – it is faster to find data in the hardcoded list t...
... if that also failed, the list of loaded plugins is checked for a plugin that can handle this extension, and is asked for the mime type if no plugin is registered, the ext-to-type-mapping xpcom category is searched for the extension.
... this allows extensions to register additional mappings.
... if no ext-to-type-mapping category is found, the externalhelperappservice returns application/x-extension-ext, where ext is the extension of the file.
Mozilla Web Developer FAQ
if you use downloadable fonts, please make sure the fonts have the right unicode mappings and the content uses the right unicode characters.
...dom) and xslt transformations that do not disable output escaping.
... 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.
...this affects data round tripping using hidden form inputs.
Research and prep
e-commerce search these search engines should allow users to get connected to new and used products they want to buy as quickly and painlessly as possible in a "trusted" site -- for example, choosing the most popular auction, general shopping, or classified type sites that have the desired user experience are good choices.
... e-commerce search amazon broad set of products, simple search interface with no/limited advertising, popular shopping engine.
... e-commerce search amazon broad set of products, simple search interface with no/limited advertising, popular shopping engine.
... e-commerce search amazon broad set of products, simple search interface with no/limited advertising, popular shopping engine.
Creating a Cookie Log
change to your firefox directory (usually c:\program files\mozilla firefox) type "set nspr_log_file=c:\temp\cookie-log.txt", enter type "set nspr_log_modules=cookie:4" and press enter run firefox by typing "firefox.exe" and pressing enter.
... run firefox by typing "./firefox" and pressing enter mac os x open terminal.app, which is located in the /applications/utilities folder (these instructions are for bash, the default shell in mac os x 10.3 and higher; if you use something else, you probably know how to modify these instructions already).
... run firefox by typing "./firefox-bin" and pressing return (note that firefox will launch behind windows for other applications).
... thanks for helping us make firefox better!
NSS_3.12_release_notes.html
til sqlite nssdbm 1 new include file is shipped with nss3.12: utilrename.h new functions in the nss shared library: cert_checknamespace (see cert.h) cert_encodecertpoliciesextension (see cert.h) cert_encodeinfoaccessextension (see cert.h) cert_encodeinhibitanyextension (see cert.h) cert_encodenoticereference (see cert.h) cert_encodepolicyconstraintsextension (see cert.h) cert_encodepolicymappingextension (see cert.h) cert_encodesubjectkeyid (see certdb/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_getpkixver...
...g_source cert_rev_m_require_info_on_missing_source cert_rev_m_ignore_missing_fresh_info cert_rev_m_fail_on_missing_fresh_info cert_rev_m_stop_testing_on_fresh_info cert_rev_m_continue_testing_on_fresh_info cert_rev_mi_test_each_method_separately cert_rev_mi_test_all_local_information_first cert_rev_mi_no_overall_info_requirement cert_rev_mi_require_some_fresh_info_available cert_policy_flag_no_mapping cert_policy_flag_explicit cert_policy_flag_no_any cert_enable_ldap_fetch cert_enable_http_fetch new macro in utilrename.h: smime_aes_cbc_128 the nssckbi pkcs #11 module's version changed to 1.70.
..._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 public_mech_sha512_flag public_mech_camellia_flag new oids (see secoidt.h) new ec signature ...
...rt_issuer sec_oid_x509_freshest_crl sec_oid_x509_inhibit_any_policy sec_oid_x509_subject_info_access camellia oids (rfc3657) sec_oid_camellia_128_cbc sec_oid_camellia_192_cbc sec_oid_camellia_256_cbc pkcs 5 v2 oids sec_oid_pkcs5_pbkdf2 sec_oid_pkcs5_pbes2 sec_oid_pkcs5_pbmac1 sec_oid_hmac_sha1 sec_oid_hmac_sha224 sec_oid_hmac_sha256 sec_oid_hmac_sha384 sec_oid_hmac_sha512 sec_oid_pkix_timestamping sec_oid_pkix_ca_repository sec_oid_iso_sha1_with_rsa_signature changed oids (see secoidt.h) sec_oid_pkcs12_key_usage changed to sec_oid_bogus_key_usage sec_oid_ansix962_ecdsa_signature_with_sha1_digest changed to sec_oid_ansix962_ecdsa_sha1_signature note: sec_oid_ansix962_ecdsa_signature_with_sha1_digest is also kept for compatibility reasons.
Hacking Tips
thus when dumping the assembly under gdb, this kind of instructions would be easily noticeable.
... (gdb) bt #0 0x00000000007eaad4 in js::inlinelist<js::jit::mbasicblock>::begin() const (this=0x33dbbc0) at …/js/src/jit/inlinelist.h:280 #1 0x00000000007cb845 in js::jit::mirgraph::begin() (this=0x33dbbc0) at …/js/src/jit/mirgraph.h:787 #2 0x0000000000837d25 in js::jit::buildphireversemapping(js::jit::mirgraph&) (graph=...) at …/js/src/jit/ionanalysis.cpp:2436 #3 0x000000000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 … (gdb) frame 3 #3 0x000000000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 (gdb) iongraph mir function 0 (asm.js compilation): success; 1 passes.
...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.
... dumping the javascript heap from the shell, you can call the dumpheap before firefox function to dump out all gc things (reachable and unreachable) that are present in the heap.
JS_MapGCRoots
syntax uint32 js_mapgcroots(jsruntime *rt, jsgcrootmapfun map, void *data); callback syntax #define js_map_gcroot_next 0 /* continue mapping entries */ #define js_map_gcroot_stop 1 /* stop mapping entries */ #define js_map_gcroot_remove 2 /* remove and free the current entry */ typedef int (*jsgcrootmapfun)(void *rp, const char *name, void *data); description call js_mapgcroots to map the gc's roots table using map(rp, name, data).
...to continue mapping, return js_map_gcroot_next.
... this function acquires and releases rt's gc lock around the mapping of the roots table, so the map function should run to completion in as few cycles as possible.
... the map function cannot call js_gc, js_maybegc, js_beginrequest, or any js api entry point that acquires locks, without double-tripping or deadlocking on the gc lock.
Querying Places
let options = placesutils.history.getnewqueryoptions(); // no query parameters will return everything let query = placesutils.history.getnewquery(); // execute the query let result = placesutils.history.executequery(query, options); result types nsinavhistoryqueryoptions has a resulttype property that allows configuration of the grouping and level of detail to be returned in the results.
...when you specify exactly one folder and no query parameters, the system will be more efficient querying and keeping the results up-to-date since this maps to exactly one bookmark folder.
... dump("folder " + node.title + " id = " + node.itemid + "\n"); break; case node.result_type_separator: dump("-----------\n"); break; } the result view interface if you are mapping a result into ui, you can implement the nsinavhistoryresultviewer interface and attach it to the result with the nsinavhistoryresult.viewer attribute.
...for queries mapping to one bookmark folder, this will be a nsinavhistorycontainerresultnode.
nsIAccessibleRole
thus, panes represent a level of grouping lower than frame windows or documents, but above individual controls.
... role_grouping 20 logically groups other objects.
... there is not always a parent-child relationship between the grouping object and the objects it contains.
... role_toolbar 22 represents a toolbar, which is a grouping of controls (push buttons or toggle buttons) that provides easy access to frequently used features.
Address book sync client design
// // the client keeps a sync mapping table which holds the following: // // serverrecordid - unique id for a record provided by the // uab server.
... // // step 1: // when the user begins a sync, run through the local database and update the // sync mapping table.
... // // sync approach - server handles all conflict resolution: // // step 2: // using the sync mapping table and the local records database, generate the change // list to send to the server.
... save the changes to // the local database, clear the sync mapping table flags and save the new sync // mapping table.
UI Tour - Firefox Developer Tools
ignore source causes the debugger to skip the file when "stepping into" functions; this can be helpful for avoiding stepping into libraries used by your code.
... enable framework grouping collects items belonging to a framework into a collapsible group (for example, jquery in the screenshot above).
... when grouping is enabled, the menu option changes to disable framework grouping.
... ignore source causes the debugger to skip the file when "stepping into" functions.
CanvasRenderingContext2D - Web APIs
canvasrenderingcontext2d.clip() creates a clipping path from the current sub-paths.
... everything drawn after clip() is called appears inside the clipping path only.
... for an example, see clipping paths in the canvas tutorial.
...the contents of the window's viewport are rendered, ignoring viewport clipping and scrolling.
Intersection Observer API - Web APIs
entries.foreach((entry) => { let box = entry.target; let visiblepct = (math.floor(entry.intersectionratio * 100)) + "%"; box.queryselector(".topleft").innerhtml = visiblepct; box.queryselector(".topright").innerhtml = visiblepct; box.queryselector(".bottomleft").innerhtml = visiblepct; box.queryselector(".bottomright").innerhtml = visiblepct; }); } startup(); clipping and the intersection rectangle the browser computes the final intersection rectangle as follows; this is all done for you, but it can be helpful to understand these steps in order to better grasp exactly when intersections will occur.
... starting at the target's immediate parent block and moving outward, each containing block's clipping (if any) is applied to the intersection rectangle.
... a block's clipping is determined based on the intersection of the two blocks and the clipping mode (if any) specified by the overflow property.
... setting overflow to anything but visible causes clipping to occur.
Key Values - Web APIs
allows typing control characters.
...modifies keystrokes to allow typing upper (or other) case letters, and to support typing punctuation and other special characters.
... vk_oem_attn (0xf0) gdk_key_eisu_shift (0xff2f) gdk_key_eisu_toggle (0xff30) qt::key_eisu_shift (0x0100112f) qt::key_eisu_toggle (0x01001130) "codeinput" the code input key, which enables code input mode, which lets the user enter characters by typing their code points (their unicode character numbers, typically).
... vk_info qt::key_info (0x0100011b) keycode_info (165) "instantreplay" tellls the device to perform an instant replay (typically some form of jumping back a short amount of time then playing it again, possibly but not usually in slow motion).
PaymentRequest: paymentmethodchange event - Web APIs
the code assumes the existence of a method detailsforshipping(), which returns a paymentdetailsupdate object containing the shipping options for the ground shipping method, in the form found in the paymentshippingoption dictionary.
... by doing so, the payment form defaults to the ground shipping method.
... const options = { requestshipping: true }; const paymentrequest = new paymentrequest(paymentmethods, detailsforshipping("ground"), options); paymentrequest.addeventlistener("paymentmethodchange", handlepaymentchange, false); paymentrequest.show() .then(response => response.complete("success")) .catch(err => console.log("error handling payment request: " + err)); the event handler function itself, handlepaymentchange(), looks like this: handlepaymentchange = event => { const detailsupdate = {}; if (event.methodname === "https://apple.com/apple-pay") { const servicefeeinfo = calculateservicefee(event.methoddetails); object.assign(detailsupdate, servicefeeinfo); } event.updatewith(detailsupdate); }, false); this begins by looking at the event's methodname prope...
... related events merchantvalidation, shippingaddresschange, shippingoptionchange, and payerdetailchange specifications specification status comment payment request apithe definition of 'paymentmethodchange' in that specification.
PaymentResponse - Web APIs
paymentresponse.shippingaddress read only secure context returns the shipping address supplied by the user.
... this option is only present when the requestshipping option is set to true in the options parameter of the paymentrequest() constructor.
... paymentresponse.shippingoption read only secure context returns the id attribute of the shipping option selected by the user.
... this option is only present when the requestshipping option is set to true in the options parameter of the paymentrequest() constructor.
ReadableStream.pipeThrough() - Web APIs
the pipethrough() method of the readablestream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
... piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it.
... options optional the options that should be used when piping to the writable stream.
...in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.
Movement, orientation, and motion: A WebXR example - Web APIs
d) { navigator.xr.issessionsupported(session_type) .then((supported) => { xrbutton.disabled = !supported; }); } else { navigator.xr.supportssession(session_type) .then(() => { xrbutton.disabled = false; }) .catch(() => { xrbutton.disabled = true; }); } } the label of the button gets adjusted in the code that handles actuallys ttarting and stopping the webxr session; we'll see that below.
... then the view's normal matrix is computed by taking the model view matrix, inverting it, and transposing it (swapping its columns and rows).
...if the image's dimensions aren't both powers of two (see the ispowerof2() function), mipmapping is disabled and wrapping is clamped to the edges.
...webgl 2 supports arbitratily-sized textures for mipmapping.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
} function stoptextcolor() { clearinterval(nintervid); } </script> </head> <body onload="changecolor();"> <div id="my_box"> <p>hello world</p> </div> <button onclick="stoptextcolor();">stop</button> </body> </html> example 3: typewriter simulation the following example simulates typewriter by first clearing and then slowly typing content into the nodelist that matches a specified group of selectors.
... <!doctype html> <html> <head> <meta charset="utf-8" /> <title>javascript typewriter - mdn example</title> <script> function typewriter (sselector, nrate) { function clean () { clearinterval(nintervid); btyping = false; bstart = true; ocurrent = null; asheets.length = nidx = 0; } function scroll (osheet, npos, beraseandstop) { if (!osheet.hasownproperty('parts') || amap.length < npos) { return true; } var orel, bexit = false; if (amap.length === npos) { amap.push(0); } while (amap[npos] < osheet.parts.length) { orel = osheet.parts[amap[npos]]; scroll(orel, npos + 1, beraseandstop) ?
...= spart.slice(1); } function sheet (onode) { this.ref = onode; if (!onode.haschildnodes()) { return; } this.parts = array.prototype.slice.call(onode.childnodes); for (var nchild = 0; nchild < this.parts.length; nchild++) { onode.removechild(this.parts[nchild]); this.parts[nchild] = new sheet(this.parts[nchild]); } } var nintervid, ocurrent = null, btyping = false, bstart = true, nidx = 0, spart = "", asheets = [], amap = []; this.rate = nrate || 100; this.play = function () { if (btyping) { return; } if (bstart) { var aitems = document.queryselectorall(sselector); if (aitems.length === 0) { return; } for (var nitem = 0; nitem < aitems.length; nitem++) { asheets.push(new sheet(aitems[nitem])); /*...
... uncomment the following line if you have previously hidden your elements via css: */ // aitems[nitem].style.visibility = "visible"; } bstart = false; } nintervid = setinterval(typewrite, this.rate); btyping = true; }; this.pause = function () { clearinterval(nintervid); btyping = false; }; this.terminate = function () { ocurrent.nodevalue += spart; spart = ""; for (nidx; nidx < asheets.length; scroll(asheets[nidx++], 0, false)); clean(); }; } /* usage: */ var otwexample1 = new typewriter(/* elements: */ '#article, h1, #info, #copyleft', /* frame rate (optional): */ 15); /* default frame rate is 100: */ var otwexample2 = new typewriter('#controls'); /* you can also change the frame rate value modifying the "rate" property...
ARIA Test Cases - Accessibility
new tests for internet explorer 8 rc1 on this msdn page the aria state/role mapping in ie8 to msaa roles can be directly checked.
...label and current content as well as role are spoken, also when typing in a new value, that gets reflected.
... but when dropping down the lists of states in either example, after the second or so list item, jaws turns off forms mode, and the user has to turn off v cursor to be able to make selections or tab to anything useful.
...t seems to be missing search) exact same failures as with firefox - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - live regions thank you to charles chen for developing the live region examples.
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
this means that someone navigating using the keyboard could be tabbing through links on your site and suddenly find themselves jumping from the top to the bottom of the document due to a reordered item being next in line.
...check that you do not end up leaping from the top to the bottom of the layout in a peculiar way.
... given that interoperable support for display: contents is limited and we do not yet have subgrids, there is a definite temptation when developing a site using css grid layout to flatten out the markup, to remove semantic elements in order to make it simpler to create a layout.
...be aware of this temptation and find ways to develop your design without stripping out the markup.
aspect-ratio - CSS: Cascading Style Sheets
this property is not yet implemented in browsers, however some browsers are implementing this internally in order to provide the aspect ratio mapping described below.
... formal definition initial valueautoapplies toall elements except inline boxes and internal ruby or table boxesinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <ratio> examples mapping width and height to aspect-ratio firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements and other related elements that accept width and height attributes.
...chrome is also shipping this feature.
...l support 79notes notes chrome 79 adds internal support only for mapped valuesfirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nointernal mapping of width and height experimentalchrome full support 79edge full support 79firefox full support 71 full support 71 no support 69 — 71disabled disabled from version 69 until version 71 (exclusi...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
if they aren't grouped together in source order, if one of the group is checked, tabbing into the group starts when the first one in the group is encountered, skipping all those that aren't checked.
...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 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 4.2 to be valid, step would have had to be set to any, 0.1, 0.2, or any the min value would have had to be a number ending in .2, such as <input type="number" min="-5.2"> note: when the data entered by the user doesn't adhere to the stepping configuration, the value is considered invalid in contraint validation and will match the :invalid pseudoclass.
Browser detection using the user agent - HTTP
progressive enhancement this design technique involves developing your web site in 'layers', using a bottom-up approach, starting with a simpler layer and improving the capabilities of the site in successive layers, each using more features.
...while user agent sniffing can sometimes detect these, not all devices are the same: some mobile devices have big screen sizes, some desktops have a small touchscreen, some people use smart tv's which are an entirely different ballgame altogether, and some people can dynamically change the width and height of their screen by flipping their tablet on its side!
...for the purposes of grouping the content meaningfully, all the cat boxes are separated from all the dog boxes such that the cat and dog boxes are not intermixed together.
...or, there might be some weird flip-phone-like device thing in the future where flipping it out extends the screen.
OPTIONS - HTTP
WebHTTPMethodsOPTIONS
the access-control-request-headers header tells the server that when the actual request is sent, it will have the x-pingother and content-type headers.
... options /resources/post-here/ http/1.1 host: bar.example accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip,deflate connection: keep-alive origin: https://foo.example access-control-request-method: post access-control-request-headers: x-pingother, content-type the server now can respond if it will accept a request under these circumstances.
...(this header is similar to the allow response header, but used only for cors.) access-control-allow-headers any script inspecting the response is permitted to read the values of the x-pingother and content-type headers.
... http/1.1 204 no content date: mon, 01 dec 2008 01:15:39 gmt server: apache/2.0.61 (unix) access-control-allow-origin: https://foo.example access-control-allow-methods: post, get, options access-control-allow-headers: x-pingother, content-type access-control-max-age: 86400 vary: accept-encoding, origin keep-alive: timeout=2, max=100 connection: keep-alive specifications specification title rfc 7231, section 4.3.7: options hypertext transfer protocol (http/1.1): semantics and content ...
An overview of HTTP - HTTP
WebHTTPOverview
this immediately has the prospect of being problematic for users attempting to interact with certain pages coherently, for example, using e-commerce shopping baskets.
...http/2 went a step further by multiplexing messages over a single connection, helping keep the connection warm and more efficient.
... relaxing the origin constraint to prevent snooping and other privacy invasions, web browsers enforce strict separation between web sites.
...this is useful not only for e-commerce shopping baskets, but also for any site allowing user configuration of the output.
Closures - JavaScript
lexical scoping consider the following example code: function init() { var name = 'mozilla'; // name is a local variable created by init function displayname() { // displayname() is the inner function, a closure alert(name); // use variable declared in the parent function } displayname(); } init(); init() creates a local variable called name and a function called displayname().
...this is an example of lexical scoping, which describes how a parser resolves variable names when functions are nested.
... the word lexical refers to the fact that lexical scoping uses the location where a variable is declared within the source code to determine where that variable is available.
...thanks to javascript's lexical scoping, they each have access to the privatecounter variable and the changeby function.
Introduction - JavaScript
the javascript language resembles java but does not have java's static typing and strong type checking.
...java's class inheritance and strong typing generally require tightly coupled object hierarchies.
... variable data types are not declared (dynamic typing, loosely typed).
... variable data types must be declared (static typing, strongly typed).
clip-path - SVG: Scalable Vector Graphics
the clip-path presentation attribute defines or associates a clipping path with the element it is related to.
...path>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> html,body,svg { height:100% } <svg viewbox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <clippath id="myclip" clippathunits="objectboundingbox"> <circle cx=".5" cy=".5" r=".5" /> </clippath> <!-- top-left: apply a custom defined clipping path --> <rect x="1" y="1" width="8" height="8" stroke="green" clip-path="url(#myclip)" /> <!-- top-right: apply a css basic shape on a fill-box geometry.
... this is the same as having a custom clipping path with a clippathunits set to objectboundingbox --> <rect x="11" y="1" width="8" height="8" stroke="green" clip-path="circle() fill-box" /> <!-- bottom-left --> <rect x="1" y="11" width="8" height="8" stroke="green" clip-path="circle() stroke-box" /> <!-- bottom-right: apply a css basic shape on a view-box geometry.
... this is the same as having a custom clipping path with a clippathunits set to userspaceonuse --> <rect x="11" y="11" width="8" height="8" stroke="green" clip-path="circle() view-box" /> </svg> usage notes value <url> | [ <basic-shape> || <geometry-box> ] | none default value none animatable yes <geometry-box> an extra information to tell how a <basic-shape> is applied to an element: fill-box indicates to use the object bounding box; stroke-box indicates to use the object bounding box extended with the stroke; view-box indicates to use the nearest svg viewport as the reference box.
<clipPath> - SVG: Scalable Vector Graphics
WebSVGElementclipPath
the <clippath> svg element defines a clipping path, to be used by the clip-path property.
... a clipping path restricts the region to which paint can be applied.
... conceptually, parts of the drawing that lie outside of the region bounded by the clipping path are not drawn.
...*/ @keyframes openyourheart {from {r: 0} to {r: 60px}} #myclip circle { animation: openyourheart 15s infinite; } a clipping path is conceptually equivalent to a custom viewport for the referencing element.
Common XSLT Errors - XSLT: Extensible Stylesheet Language Transformations
the disable-output-escaping attribute.
...while we could try to add some heuristics to serialize and reparse just the part of the output document which has disable-output-escaping applied, heuristics often get things wrong and lead to surprising results, hence we've been reluctant to add this so far.
... often times stylesheets contain code like <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>, this is equivalent to simply putting &#160; in the stylesheet which will work great in all xslt engines.
... we do realize that the lack of disable-output-escaping is a problem and we'd like to find a solution for it, however so far we haven't found any good solutions.
jpm - Archive of obsolete content
any add-on which you are in the process of developing) in the branded release or beta versions of firefox.
... developing without browser restarts because jpm run restarts the browser each time you invoke it, it can be a little cumbersome if you are making very frequent changes to an add-on.
...but if you're developing the sdk modules themselves, of course, it isn't.
Getting started (cfx) - Archive of obsolete content
summary in this tutorial we've built and packaged an add-on using three commands: cfx init to initialize an empty add-on template cfx run to run a new instance of firefox with the add-on installed, so we can try it out cfx xpi to package the add-on into an xpi file for distribution these are the three main commands you'll use when developing sdk add-ons.
...but if you're developing the sdk modules themselves, of course, it isn't.
... developing without cfx run because cfx run restarts the browser each time you invoke it, it can be a little cumbersome if you are making frequent changes to an add-on.
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
all of these documents currently assume, however, that you are developing your extension using xul and javascript only.
...whether you build the whole mozilla tree or take this shortcut, you can build from now on by going to /mozilla/$(moz_objdir)/extensions/myextension/ and typing "make" on the command line.
... keeping it complex if you're developing a really complex extension with lots of xpcom components, you'll probably want to divide your code up into smaller modules.
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
var href = "http://www.google.com/"; var text = "google"; $("body").append( $("<div>", { class: "foo" }) .append($("<a>", { href: href, text: text }) .click(function (event) { alert(event.target.href) })) .append($("<span>").text("foo"))); innerhtml with html escaping this method is a last resort which should be used only as a temporary measure in established code bases.
...amp;", '"': "&quot;", "'": "&#39;", "<": "&lt;", ">": "&gt;" })[m]); } or slightly more verbose, but slightly more efficient: function escapehtml(str) { return str.replace(/[&"'<>]/g, (m) => escapehtml.replacements[m]); } escapehtml.replacements = { "&": "&amp;", '"': "&quot;", "'": "&#39;", "<": "&lt;", ">": "&gt;" }; note that quotation marks must be escaped in order to prevent fragments escaping attribute values.
...in these cases, multiple attributes should be used, one for each variable: function clickify(elem, address) { elem.setattribute("href", address); elem.setattribute("onclick", "openwindow(this.getattribute('href'))"); } escaping functions when the code fragment in question is not an event handler attribute and there is no feasible way to pass the data through other means, they must be escaped with functions such as uneval, string.quote, json.stringify, or number.
Setting up an extension development environment - Archive of obsolete content
note: you could run firefox using your regular profile while developing.
...note that since many people have this setting turned off when developing, you will see lots of warnings for problems with their code in addition to warnings for your own extension.
... using directories rather than jars regardless of whether you choose to eventually package your extension's chrome in a jar or in directories, developing in directories is simpler.
Add-ons - Archive of obsolete content
all of these documents currently assume, however, that you are developing your extension using xul and javascript only.
...well, xul overlays and windows, jsm files, chrome & resource mappings with localization, default preferences, but no xpcom components of your own.
... legacy add-ons this section contains links to documentation for legacy technology for add-on development, including: legacy extensions for firefox for android add-ons that work with desktop firefox do not automatically work in firefox for android: overlay extensions this page contains links to documentation for the approach to developing extensions for gecko-based applications which uses: performance best practices in extensions one of firefox's great advantages is its extreme extensibility.
CSS3 - Archive of obsolete content
the scoping mechanism.
...these shapes describe areas, around which inline content wraps instead of wrapping around the bounding box.
... css object model (cssom) working draft css font loading module level 3 working draft css scoping module level 1 working draft css inline layout working draft css images module level 4 working draft extends: the image() functional notation to describe the directionality of the image (rtl or ltr), allowing for bidi-sensitive images.
List of Mozilla-Based Applications - Archive of obsolete content
s 9 clines a clone of color lines (game) standalone version cloud web operating system cloud browse iphone/ipad/ipod touch browser seems to be firefox running remotely on servers that people access through device conkeror keyboard-oriented browser convertigo enterprise mashup server server tool for transactional web scraping and for web clipping cometbird another firefox mod modified version of firefox correo email couac (fr) web-based email and jabber app couchdb document-oriented database uses spidermonkey courtanet benefit (fr) underwriting software for french insurance brokers crosscheck browserless testing framework ...
...uses mozilla rhino crowbar server tool cycloctopus screen scraping console cyclone3 content management system danger mobile platform uses gecko on the server side -- no longer active?
... orca browser web browser gecko-based version of avant browser pale moon web browser optimized browser developed by moonchild productions for gnu/linux & windows platforms, originally forked from firefox palo suite excel extension uses prism partygaming online gaming product uses gecko pencil tool for making diagrams and gui prototyping available as a firefox extension or a standalone app pentaho bi suite commercial open source business intelligence uses xul and mozilla rhino persevere tools for persistence and distributed computing uses mozilla rhino phloneme publishing tool for vocab collab phped php editor embedded mozilla browser in product pidgin im...
Creating a hybrid CD - Archive of obsolete content
mkhybrid -o ~/party.iso -r -j -hfs -v mozilla.party -map ~/hfsmapping ~/party/ cdrecord -v speed=2 dev=0,6,0 ~/party.iso its also handy to be able to mount an image file to test it.
... mount ~/party.iso /mnt/cdrom -t iso9660 -o loop=/dev/loop3,blocksize=1024 umount /mnt/cdrom here is the hfs mapping that i used.
... # example filename mapping file used by mkhybrid for hfs # # extn xlate creator type comment .hqx ascii 'sitx' 'text' "binhex file" .zip raw 'sitx' 'zip ' "zip file" .gz raw 'sitx' 'zip ' "gzip file" .tgz raw 'sitx' 'zip ' "tar.gz gzip file" .tar raw 'sitx' 'tarf' "tar file" .tif raw '8bim' 'tiff' "photoshop tiff image" .doc raw 'mswd' 'wdbn' "word file" .mov raw 'tvod' 'moov' "quicktime movie" .bin raw 'sitx' 'bina' "mac binary" .h ascii 'cwie' 'text' ...
Venkman Introduction - Archive of obsolete content
at the time if this writing, the order and grouping of file names cannot be changed.
... at the time of this writing, the local variables view's default sort order and grouping are not adjustable.
... if you would like to keep venkman from stopping in a particular stack frame in the future, check "don't debug" from the stack frame's context menu.
Creating XPI Installer Modules - Archive of obsolete content
package creation overview this tutorial describes the following sequence of steps for creating a new package: developing the resources organizing the resources creating the contents.rdf file making the barley install script creating a xpi you can examine (or install!) the package described here by downloading the barley xpi file and using a zip unarchiver[zip] to open it.
...developing the resources needless to say, one of the first things you will have to create is the actual software you wish to make redistributable.
...while you are developing these resources and before you have made them a package of their own, you can test the basic layout and functionality by opening barley.xul from within mozilla by using file -> open.
Using XPInstall to Install Plugins - Archive of obsolete content
you can create an xpinstall file by first zipping all the items you want installed with winzip (create a zip archive) and then renaming it with the xpi file extension instead of the zip file extension.
...if you are developing a plugin and wish to make it scriptable, read the relevant portions of the plugin api.
... using xpinstall to run an exe (native code) installer if you wish to run a native installer (exe) to install plugin software, but wish to make the delivery of this native installer streamlined and within the browser's process, then you ought to consider wrapping it in an xpi package.
Custom toolbar button - Archive of obsolete content
open the file in firefox (for example, by dragging it and dropping it in firefox, or by choosing file – open file...
... note: for information about how to find the profile directory, see: profile folder explanation: the profile directory contains information specific to a user, keeping it separate from the application.
... copy the name from here and paste it, to avoid typing errors: custom-toolbar-button@example.com perform the following steps in this new directory, creating two files and a directory there.
label - Archive of obsolete content
ArchiveMozillaXULlabel
if the box direction is reversed, the cropping is reversed.
... the caption is in the "value" attribute remember that the label element has a "value" attribute, unlike value in html whereas buttons, checkboxes use label="foo" as the attribute <label label="a caption"/> <!-- wrong --> <label value="a caption"/> <label value="click the button"/> <button label="a button"/> <checkbox label="a decision" value="1"/> wrapping by default, label text does not wrap.
... to enable wrapping, use a text node instead of the value attribute.
textbox - Archive of obsolete content
possible values: pasteintact paste newlines unchanged pastetofirst paste text up to the first newline, dropping the rest of the text replacewithcommas pastes the text with the newlines replaced with commas replacewithspaces pastes the text with newlines replaced with spaces strip pastes the text with the newlines removed stripsurroundingwhitespace pastes the text with newlines and adjacent whitespace removed onblur type: script code this event is sent when a textbox loses keyboard f...
... wrap type: string set this attribute to the value off to disable word wrapping in the textbox.
... if this attribute is not specified, word wrapping is enabled.
Archived Mozilla and build documentation - Archive of obsolete content
developing new mozilla features tips for contributing new features to mozilla.
...the space manager is responsible for keeping track of where space is taken up and where it is available.
...this article is a jumping-off point to help you find those presentations.
NPWindow - Archive of obsolete content
syntax typedef struct _npwindow { void* window; /* platform specific handle */ uint32_t x; /* coordinates of top left corner */ uint32_t y; /* relative to a netscape page */ uint32_t width; /* maximum window size */ uint32_t height; nprect cliprect; /* clipping rectangle coordinates */ #ifdef xp_unix void * ws_info; /* platform-dependent additional data */ #endif /* xp_unix */ npwindowtype type; /* window or drawable target */ } npwindow; fields the data structure has the following fields: window platform-specific handle to a native window element in the netscape window hierarchy on windows (hwnd) and unix (x window id).
... cliprect clipping rectangle of the plug-in; the origin is the top left corner of the drawable or window.
... clipping to the cliprect prevents the plug-in from overwriting the status bar, scroll bars, and other page elements when partially scrolled off the screen.
Sunbird Theme Tutorial - Archive of obsolete content
developing your theme to develop your theme, make further changes to the theme files.
...you might prefer to use this method only while you are developing your theme, and to use the normal method for public releases.
... installing a packaged theme install your packaged theme in the normal way, by dragging the jar (or a link to it) and dropping it in sunbird's themes window.
Building a Theme - Archive of obsolete content
try typing this url into the location bar in firefox!
...during the development phase for firefox versions 2.0 and higher, you can point firefox to the folder where you are developing the theme, and it'll load it up every time you restart firefox.
... on mac os or linux, you can use the command-line zip tool: zip -r my_theme.xpi install.rdf chrome.manifest browser communicator global mozapps or, if you have 7-zip installed, you can use that for zipping it up: 7z a -tzip my_theme.xpi chrome chrome.manifest note: the command-line tool will update an existing zip file, not replace it - so if you have files you've deleted from your theme, be sure to remove the .xpi file before running the zip command again.
Common Firefox theme issues and solutions - Archive of obsolete content
web console close button sprite mapping is messed up on the web console (tools > web developer > web console) the sprite mapping for the close button is messed up.
... resources amo editors theme testing guidelines when developing and testing your themes, please refer to the theme testing guidelines amo editors use to review themes.
... mozillazine firefox nightly theme changes thread mozillazine's firefox nightly theme changes thread is a great resource for keeping up to date with the latest changes to the firefox ui and contains links to the bugzilla bug reports, which detail what changes were made.
XForms Select Element - Archive of obsolete content
note, some representations of the select element do not support visual grouping.
...characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:listbox seltype="multiple"/> visual grouping by choices element isn't implemented if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e.
...characteristics appearance attribute contains the value full there are no analogue widgets in xhtml or in xul visual grouping by choices element is supported if incremental attribute value is false then bound node is updated when item is blurred examples <xf:model> <xf:instance> <data xmlns=""> <values>g</values> </data> </xf:instance> </xf:model> <xf:select ref="/data/values" appearance="full"> <xf:choices> <xf:label>green colors</xf:label> <xf:item> <xf:label>pale green</xf:label> <xf:value>pg</xf:value> </xf:item> <xf:item> <xf:label>green</xf:label> <xf:value>g</xf:value> </xf:item> ...
Audio for Web games - Game development
jumping to, playing, and then pausing that silence will mean we can now use javascript to play that file at arbitrary points.
...this is often the way that musicians compose music anyway, and the web audio api is extremely good at keeping these parts in sync.
... see also web audio api on mdn <audio> on mdn developing game audio with the web audio api (html5rocks) mixing positional audio and webgl (html5rocks) songs of diridum: pushing the web audio api to its limits making html5 audio actually work on mobile audio sprites (and fixes for ios) ...
Desktop gamepad controls - Game development
note: please remember that different devices may have different key mappings, i.e.
...the same goes for the axes information — looping through axes adds the values to the array.
...if we want to check the button is not held already (so it's a new press), then looping through the cached states from the previous frame does the job — if the button was already pressed, then we ignore the new press and set it to false.
Implementing controls using the Gamepad API - Game development
the theme for the competition was "change", so they submitted a game where you have to feed the hungry fridge by tapping the healthy food (apples, carrots, lettuces) and avoid the "bad" food (beer, burgers, pizza.) a countdown changes the type of food the fridge wants to eat every few seconds, so you have to be careful and act quickly.
... mapping: the layout type of the buttons; standard is the only available option for now.
... mapping standard the mapping type is now an enumerable object instead of a string: enum gamepadmappingtype { "", "standard" }; this enum defines the set of known mappings for a gamepad.
Texel - MDN Web Docs Glossary: Definitions of Web-related terms
the process of mapping the appropriate texel’s to their corresponding points on a polygon is called texture mapping, which is a stage of the process of rendering a 3d image for display.
... texture mapping is typically done prior to lighting the scene; however, in webgl, lighting is performed as part of the texture mapping process.
...when texture mapping occurs the renderer maps texel’s to the appropriate pixels.
HTML: A good basis for accessibility - Learn web development
you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text input.
... <tr> <td>name</td> <td>age</td> <td>gender</td> </tr> <tr> <td>gabriel</td> <td>13</td> <td>male</td> </tr> <tr> <td>elva</td> <td>8</td> <td>female</td> </tr> <tr> <td>freida</td> <td>5</td> <td>female</td> </tr> </table> but this has problems — there is no way for a screen reader user to associate rows or columns together as groupings of data.
...they can improve accessibility by helping a user quickly navigate to different sections of a document.
HTML: A good basis for accessibility - Learn web development
you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text input.
... <tr> <td>name</td> <td>age</td> <td>gender</td> </tr> <tr> <td>gabriel</td> <td>13</td> <td>male</td> </tr> <tr> <td>elva</td> <td>8</td> <td>female</td> </tr> <tr> <td>freida</td> <td>5</td> <td>female</td> </tr> </table> but this has problems — there is no way for a screen reader user to associate rows or columns together as groupings of data.
...they can improve accessibility by helping a user quickly navigate to different sections of a document.
Overflowing content - Learn web development
at worst, a site visitor will let you know that content is overlapping.
...this offers the advantage of keeping the layout consistent, instead of scrollbars appearing or disappearing, depending upon the amount of content in the container.
... when developing a site, always keep overflow in mind.
Styling tables - Learn web development
zebra striping we wanted to dedicate a separate section to showing you how to implement zebra stripes — alternating rows of color that make the different data rows in your table easier to parse and read.
... add the following css to the bottom of your style.css file: /* zebra striping */ tbody tr:nth-child(odd) { background-color: #ff33cc; } tbody tr:nth-child(even) { background-color: #e495e4; } tbody tr { background-image: url(noise.png); } table { background-color: #ff33cc; } earlier on you saw the :nth-child selector being used to select specific child elements.
... use zebra striping to make alternative rows easier to read.
Floats - Learn web development
the background of floats the float property was introduced to allow web developers to implement simple layouts involving an image floating inside a column of text, with the text wrapping around the left or right of it.
...clearing the following element doesn't help with this box clearing problem, where you want the bottom of the box to wrap the floated item and wrapping content even if the content is shorter.
...this involves inserting some generated content after the box which contains the float and wrapping content, and setting that to clear both.
How do you make sure your website works properly? - Learn web development
ping is a useful shell tool that tests the domain name you provide and tells you if the server's responding or not: $ ping mozilla.org ping mozilla.org (63.245.215.20): 56 data bytes 64 bytes from 63.245.215.20: icmp_seq=0 ttl=44 time=148.741 ms 64 bytes from 63.245.215.20: icmp_seq=1 ttl=44 time=148.541 ms 64 bytes from 63.245.215.20: icmp_seq=2 ttl=44 time=148.734 ms 64 bytes from 63.245.215.20: ic...
...mp_seq=3 ttl=44 time=147.857 ms ^c --- mozilla.org ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 147.857/148.468/148.741/0.362 ms just keep in mind a handy keyboard shortcut: ctrl+c.
... if you don't stop the runtime, ping will ping the server indefinitely.
Tips for authoring fast-loading HTML pages - Learn web development
minimize the number of files for performance while keeping unrelated css in separate files for maintenance.
... minimize the number of files for performance while keeping unrelated javascript in separate files for maintenance.
... minimize the number of files for performance while keeping unrelated javascript in separate files for maintenance.
Getting started with HTML - Learn web development
active learning: creating your first html element edit the line below in the input area by wrapping it with the tags <em> and </em>.
...(not entire paragraphs or groupings of content) an inline element will not cause a new line to appear in the document.
... make important words stand out in bold by wrapping them inside a <strong> opening tag and </strong> closing tag.
Functions — reusable blocks of code - Learn web development
keeping parts of your code locked away in functions avoids such problems, and is considered the best practice.
... active learning: playing with scope let's look at a real example to demonstrate scoping.
... note: the same scoping rules do not apply to loop (e.g.
Image gallery - Learn web development
looping through the images we've already provided you with lines that store a reference to the thumb-bar <div> inside a constant called thumbbar, create a new <img> element, set its src attribute to a placeholder value xxx, and append this new <img> element inside thumbbar.
... you need to: put the section of code below the "looping through images" comment inside a loop that loops through all 5 images — you just need to loop through five numbers, one representing each image.
... previous overview: building blocks in this module making decisions in your code — conditionals looping code functions — reusable blocks of code build your own function function return values introduction to events image gallery ...
Making decisions in your code — conditionals - Learn web development
if you help me by going and doing the shopping, i'll give you some extra allowance so you can afford that toy you wanted." in javascript, we could represent this like so: let shoppingdone = false; if (shoppingdone === true) { let childsallowance = 10; } else { let childsallowance = 5; } this code as shown always results in the shoppingdone variable returning false, meaning disappointment for our poor child.
... it'd be up to us to provide a mechanism for the parent to set the shoppingdone variable to true if the child did the shopping.
...cheese available for making cheese on toast.'); } else { console.log('no cheese on toast for you today.'); } and, returning to our previous example about the child doing a chore for their parent, you could write it like this: let shoppingdone = false; if (shoppingdone) { // don't need to explicitly specify '=== true' let childsallowance = 10; } else { let childsallowance = 5; } nesting if ...
Client-side storage - Learn web development
storing the contents of a shopping cart from a previous session, remembering if a user was previously logged in).
...try typing this into your javascript console (change the value to your own name, if you wish!): localstorage.setitem('name','chris'); the storage.getitem() method takes one parameter — the name of a data item you want to retrieve — and returns the item's value.
... now type these lines into your javascript console: let myname = localstorage.getitem('name'); myname upon typing in the second line, you should see that the myname variable now contains the value of the name data item.
Drawing graphics - Learn web development
add the following block to the bottom of the draw() function: if (posx % 13 === 0) { if (sprite === 5) { sprite = 0; } else { sprite++; } } we are wrapping the whole block in if (posx % 13 === 0) { ...
...if so, we move on to the next sprite by incrementing sprite (wrapping to 0 after we're done with sprite #5).
...add the following chunk of code at the bottom of your javascript: let cube; let loader = new three.textureloader(); loader.load( 'metal003.png', function (texture) { texture.wraps = three.repeatwrapping; texture.wrapt = three.repeatwrapping; texture.repeat.set(2, 2); let geometry = new three.boxgeometry(2.4, 2.4, 2.4); let material = new three.meshlambertmaterial( { map: texture, shading: three.flatshading } ); cube = new three.mesh(geometry, material); scene.add(cube); draw(); }); there's a bit more to take in here, so let's go through it in stages: we first create a c...
Basic math in JavaScript — numbers and operators - Learn web development
for example, try typing these lines into your console: let mynumber = '74'; mynumber + 3; you end up with the result 743, not 77, because mynumber is actually defined as a string.
... you can test this by typing in the following: typeof mynumber; to fix the calculation, you can do this: number(mynumber) + 3; arithmetic operators arithmetic operators are the basic operators that we use to do sums in javascript: operator name purpose example + addition adds two numbers together.
...s the new variable value x -= 3; x = x - 3; *= multiplication assignment multiplies the variable value on the left by the value on the right, and returns the new variable value x *= 3; x = x * 3; /= division assignment divides the variable value on the left by the value on the right, and returns the new variable value x /= 5; x = x / 5; try typing some of the above examples into your console, to get an idea of how they work.
Multimedia: video - Learn web development
video autoplay to ensure that a looping background video autoplays, you must add several attributes to the video tag: autoplay, muted, and playsinline.
... <video autoplay="" loop="" muted="true" playsinline="" src="backgroundvideo.mp4"> while the loop and autoplay make sense for a looping and autoplaying video, the muted attribute is required for autoplay in mobile browsers.
...it includes a video that is auto-playing, looping, and muted.
React interactivity: Events and state - Learn web development
update it as follows: function handlesubmit(e) { e.preventdefault(); props.addtask("say hello!"); } clicking on the "add" button in your browser will prove that the addtask() callback function works, but it'd be nice if we could get the alert to show us what we're typing in our input field!
... // near the top of the `form` component function handlechange(e) { console.log("typing!"); } // down in the return statement <input type="text" id="new-todo-input" classname="input input__lg" name="text" autocomplete="off" value={name} onchange={handlechange} /> currently, your input’s value will not change as you type, but your browser will log the word "typing!" to the javascript console, so we know our event listener is attached to the input.
...add the following right at the top of your app() function definition: const [tasks, settasks] = usestate(props.tasks); now, we can change our tasklist mapping so that it is the result of mapping tasks, instead of props.tasks.
Getting started with Svelte - Learn web development
it extends css by adding a scoping mechanism, allowing each component to define their own styles without the risk of clashing with other component's styles.
...this is one example of svelte extending javascript syntax to make it more useful, while keeping it familiar.
... components styles are scoped, keeping them from clashing with each other.
Creating our first Vue component - Learn web development
add an id to the checkbox, and a for attribute mapping the checkbox to the label, as shown below.
...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.
...this will be sufficient for keeping component ids unique.
Introducing a complete toolchain - Learn web development
we will however be avoiding any superfluous tooling, with the aim of keeping complexity to a minimum.
...keeping them as separate dependencies reduces any unnecessary work when deploying to production (which we will look at in the next chapter).
...it's not a prerequisite of developing for the web, but it's useful to have the tools configured correctly if they’re going to help catch errors during development — which eslint is particularly useful for.
Learn web development
we have started keeping learning area release notes to show what has changed — keep checking back frequently!
... if you're interested in helping develop/improve the content, take a look at how you can help and get in touch!
... we are more than happy to talk to you, whether you are a learner, teacher, experienced web developer, or someone else interested in helping to improve the learning experience.
Accessibility API cross-reference
the roles it specifies have already informed the 'semantic elements' of html5 (such as main and footer), but there is not a one-to-one mapping between the aria roles and the semantics of html5.
... gridcell a type of mouse pointer used for resizing windows grip n/a n/a n/a probably a group box (titledbox in mozilla) grouping panel panel group <fieldset>, <div> a heading for a section of the page.
...fore leaving it n/a modal modal aria-modal=true edit control that can take multiple lines n/a multi_line multi_line aria-multiline=true can select more than one of the children multiselectable multiselectable multi_selectable aria-multiselectable=true currently off-screen offscreengrouping n/a n/a n/a indicates that every pixel is painted within the object's rectangular region n/a opaque opaque n/a bgcolor (deprecated in favor of css background-color) object is currently pressed down.
Gecko info for Windows accessibility vendors
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.
...cular type: store a pointer to the start_item if the current item has a flows_to relation, follow that relation otherwise, go to the next item in depth first search order if the current item matches your criteria, then return current_item if the current_item == start_item, return null (no item found) if the end has been reached, go back to the start if wrapping is desired, otherwise return null (no item found) go to step 2 checkable, required and invalid states are supported gecko defines three state constants using previously unused states: const unsigned long state_checkable = state_marqueed; // useful on menuitem, listitem // and treeitem.
... role_grouping html: <fieldset> xul: <groupbox> dhtml: role="wairole:group" or dhtml: role="wairole:radiogroup" for a <fieldset> the name is exposed using the <legend> role_separator xul: <separator> html: <hr> dhtml: role="wairole:separator" role_toolbar xul: <toolbar> dhtml: role="wairole:toolbar" ...
Accessible Toolkit Checklist
however, be aware that the wrapping layer will introduce accessibility bugs, and thus you will need to test extensively and fill in the holes.
... typing letter or several letters to navigate (same letter goes to each item starting with that, different letters go to first item starting with that entire string).
... already selected up/down arrow key navigation left arrow to first collapse a branch, then move to parent right arrow to first expand a branch, then move to first child multiple selection is possible with ctrl+arrow to move focus without selecting, then space to select item, shift+space to select to current point or control+space to toggle selection of current item typing letter or several letters to navigate (similar to list support for this) shift+f10 or context menu key to bring up context menu for current item (on os x ctrl+space is used to bring up context menu).
SVG Guidelines
you can also use svg grouping to avoid duplicating those attributes avoid introducing variants of the same file (color/style variants), and use sprites instead (with class names) default style values there's usually no need to set the default style value unless you're overriding a style.
... here are some commonly seen examples: style="display: none;" on <defs> elements (a <defs> element is hidden by default) type="text/css" on <style> elements stroke: none or stroke-width: 0 svg grouping style grouping group similarly styled shapes under one <g> tag; this avoids having to set the same class/styles on many shapes.
... avoid excessive grouping editors can sometimes do excessive grouping while exporting svgs.
Security best practices for Firefox front-end engineers
this article will help firefox developers understand the security controls in place and avoid common pitfalls when developing front-end code for firefox.
... the last flag ensures that developers will identify and avoid the problems early on in the development cycle and before shipping the code.
...developers are able to avoid tripping the rule by using escaping functions in combination with template strings, for example: bar.innerhtml = escapehtml`<a href='${url}'>about</a>`; in system-privileged chrome code, any kind of remaining scripts will still be removed by our sanitizer.
overflow-clip-box-block
the overflow-clip-box-block css property specifies relative to which box the clipping happens when there is an overflow — in the block direction.
... syntax values padding-box this keyword makes the clipping be related to the padding box.
... content-box this keyword makes the clipping be related to the content box.
overflow-clip-box-inline
the overflow-clip-box-inline css property specifies relative to which box the clipping happens when there is an overflow — in the inline direction.
... syntax values padding-box this keyword makes the clipping be related to the padding box.
... content-box this keyword makes the clipping be related to the content box.
overflow-clip-box
the overflow-clip-box css property specifies relative to which box the clipping happens when there is an overflow.
... initial valuepadding-boxapplies toall elementsinheritednomediavisualcomputed valueas specifiedanimation typediscretecanonical orderthe unique non-ambiguous order defined by the formal grammar syntax values padding-box this keyword makes the clipping be related to the padding box.
... content-box this keyword makes the clipping be related to the content box.
Embedding the editor
that state would have to include the document, undo stack, and typing state.
... the implementation of the editing session would be responsible for swapping out the editor's state on focus changes etc.
... steps to embedding this section attempts to lay out an implementation plan, with the aim of keeping everything working as the various steps are taken.
Application Translation with Mercurial
by pressing the windows key and r on the keyboard or by calling the "run..." command from the windows "start" button, and then typing cmd and pressing the enter key.
...c:\mozilla\coding\buildtools\mozillabuild\start-shell-msvc2010.bat you can autocomplete the file path after typing a few characters and then pressing the tabulator key.
...so let's go to c:\mozilla by typing cd /c/mozilla/ create a new directory for the source code: mkdir mozilla-aurora initialize the new directory as new repository: hg init mozilla-aurora go into the new directory: cd mozilla-aurora unpack the source code: hg unbundle /path/to/the/downloaded/mozilla-aurora.hg this can take some time, mostly depending on the performance of the hard drive.
Index
3 bootstrapping a new locale localization, mercurial, translate, bit bucket (see also https://developer.mozilla.org/en/create_a_new_localization) 4 encodings for localization files internationalization, localization when creating a localization for mozilla products, it’s important to be aware of the encoding of the files that you generate.
...enjoy developing your style guide!
... the documentation is divided into 4 parts: 35 creating localizable web applications internationalization, localizability, localization, web development an important step of developing a web application or creating web content is making sure that it can be localized.
Localizing with Koala
user: type your name and your e-mail address in the form: "firstname lastname <me@example.com>" (be sure to type the wrapping quotes: "") note that you no longer have to edit the location now, it automatically fills in when you check the "mercurial" checkbox (e.g.
...this is helpful for keeping the localization files clean and tidy at all times.
...they're just a simple key=value mapping.
Leak-hunting strategies and tips
--jesse) dropping a reference on the floor by: forgetting to release (because you weren't using nscomptr when you should have been): see bug 99180 or bug 93087 for an example or bug 28555 for a slightly more interesting one.
... dropping a non-refcounted object on the floor (especially one that owns references to reference counted objects).
...this needs to be done when running, since we do the address to symbol mapping at runtime.
Phishing: a short definition
a relatively simple, yet effective, phishing scheme is sending an email with a fake invoice of a person’s favorite shopping site.
...the ss7 telephony system is vulnerable, making eavesdropping, or rerouting text messages quite trivial.
...unfortunately, some users still feel it's too tedious unlocking a phone, opening the otp app, and manually typing a few digits each time a provider requests a new token.
PR_CloseFileMap
closes a file mapping.
... syntax #include <prio.h> prstatus pr_closefilemap(prfilemap *fmap); parameter the function has the following parameter: fmap the file mapping to be closed.
... description when a file mapping created with a call to pr_createfilemap is no longer needed, it should be closed with a call to pr_closefilemap.
PR_MemMap
syntax #include <prio.h> void* pr_memmap( prfilemap *fmap, print64 offset, pruint32 len); parameters the function has the following parameters: fmap a pointer to the file-mapping object representing the file to be memory-mapped.
... description pr_memmap maps a section of the file represented by the file mapping fmap to memory.
... when the file-mapping memory region is no longer needed, it should be unmapped with a call to pr_memunmap.
NSS tools : ssltab
when used with looping mode, the different connections are separated with horizontal lines.
...-l prefix turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete.
...to make the tool continue to accept connections, switch on looping mode with the -l option.
NSS tools : ssltap
when used with looping mode, the different connections are separated with horizontal lines.
...-l prefix turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete.
...to make the tool continue to accept connections, switch on looping mode with the -l option.
NSS Tools ssltap
when used with looping mode, the different connections are separated with horizontal lines.
... -l turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete.
...to make the tool continue to accept connections, switch on looping mode with the -l option.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
when used with looping mode, the different connections are separated with horizontal lines.
... -l prefix turn on looping; that is, continue to accept connections rather than stopping after the first connection is complete.
...to make the tool continue to accept connections, switch on looping mode with the -l option.
Scripting Java
so the previous example could be even shorter: js> java [javapackage java] we can access java classes simply by stepping down the package hierarchy: js> java.io.file [javaclass java.io.file] if your scripts access a lot of different java classes, it can get awkward to use the full package name of the class every time.
...this is also acceptable, it just takes more typing.
...this difference is inevitable given javascript's use of dynamic typing as was discussed in chapter 2: since the type of a variable is not known until runtime, only then can overload resolution occur.
Statistics API
there are several ways to get access to this data: the environment variable moz_gctimer controls text dumping of gc stats.
... the browser preference javascript.options.mem.log controls dumping of human-readable gc stats messages to the developer console.
...gc work can be divided into phases, such as marking or sweeping.
SpiderMonkey Internals
provided so far: traps, with which breakpoints, single-stepping, step over, step out, and so on can be implemented.
... line number to pc and back mapping functions.
... if (eval(sumofdivisors[divisor]) == divisor) { print("" + divisor + " = " + sumofdivisors[divisor]); } } delete sumofdivisors; print("that's all."); } the line number to pc and back mappings can be tested using the js program with the following script: load("perfect.js"); print(perfect); dis(perfect); print(); for (var ln = 0; ln <= 40; ln++) { var pc = line2pc(perfect, ln); var ln2 = pc2line(perfect, pc); print("\tline " + ln + " => pc " + pc + " => line " + ln2); } the result of the for loop over lines 0 to 40 inclusive is: line 0 => pc 0 => line 16 line 1 => pc 0 ...
WebReplayRoadmap
to that end, this document will be revised over time as we find new and better ways of helping developers.
... points on the path could be clicked to seek there, which should offer faster and less clunky navigation than stepping buttons.
... aggregate call graph and data flow (not yet implemented) when developing a complex web app it is often hard to find where a function is called, the callees at a call site, where some data in an object came from or where it is used, or what type a value has.
Gecko Roles
thus, panes represent a level of grouping lower than frame windows or documents, but above individual controls.
... role_grouping logically groups other objects.
... role_toolbar represents a toolbar, which is a grouping of controls (push buttons or toggle buttons) that provides easy access to frequently used features.
An Overview of XPCOM
it can raise some real housekeeping problems when, for example, a client uses an interface and forgets to decrement the reference count.
...most of these types are simple mappings.
... variable mappings nsrefcnt default reference count type.
Component Internals
component manifests the component manifest is a mapping of files to components and components to classes.
... it specifies the following information: location on disk of registered components with file size class id to location mapping contract id to class id mapping the component manifest maps component files to unique identifiers for the specific implementations (class ids), which in turn are mapped to more general component identifiers (contract ids).
... type library manifests type library manifests contain the following information: location of all type library files mapping of all known interfaces to type libraries where these structures are defined using the data in these two manifests, xpcom knows exactly which component libraries have been installed and what implementations go with which interfaces.
IAccessible2
groupposition() returns grouping information.
...another use of this value by an at is to identify when a grouping object has changed, for example when moving from a radio button in one group to a radio button in a different group.
...without the availability of windowhandle, the at would have to get the window handle by using windowfromaccessibleobject on each iaccessible, which is slow because it's implemented by oleacc.dll as a loop which crawls up the ancestor chain and looks for a role_window object, mapping that back to a window handle.
mozIRegistry
there are some bootstrapping issues related to using the service manager to access the moziregistry interface.
...i'll be discussing that implementation only briefly (mainly because i'm hoping i can pawn off the chore of implementing it to somebody else).
...nsrepository is essentially a mapping from xpcom clsids to class factories, plus code to manage that mapping, including functions that create instances of a given clsid.
nsIHttpServer
* * @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.
...path * the absolute path on the server against which requests will be served * from dir (e.g., "/", "/foo/", etc.); must begin and end with a forward * slash * @param dir * the directory to be used to serve all requests for paths underneath path * (except those further overridden by another, deeper path registered with * another directory); if null, any current mapping for the given path is * removed * @throws ns_error_invalid_arg * if dir is non-null and does not exist or is not a directory, or if path * does not begin with and end with a forward slash */ void registerdirectory(in string path, in nsifile dir); /** * associates files with the given extension with the given content-type when * served by this server, in the absence...
... if type is empty, removes any extant * mapping, if one is present.
nsISelectionPrivate
allowadjacent specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it.
... allowadjacent specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it.
... allowadjacent specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it.
nsIUTF8ConverterService
skipping asciiness/utf8ness check.
...converturispectoutf8() ensure that aspec (after url-unescaping it) is encoded in utf-8.
...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.
LDAP Support
mail compose typedown in mail compose, when typing a partial mail address, a typedown window appears listing possible matches against address books and ldap directories.
... these relationships ensure: generality is maintained when mapping from ldap attributes to address book.
... consistent round tripping when editing address book attributes which are stored on an ldap server.
WebIDL bindings
also, unless stated otherwise, nullable types are represented by wrapping nullable<> around the base type.
... in all cases, optional arguments which do not have a default value are represented by wrapping const optional<>& around the representation of the argument type.
...this can mean xpcom interfaces (whether declared in xpidl or not) or it can mean some type that there's a castable native unwrapping function for.
Mozilla
browser security an important aspect of developing code for any browser, including firefox, as well as any web-oriented project, is its security.
... performance the articles linked to from here will help you improve performance, whether you're developing core mozilla code or an add-on.
...firefox and thunderbird releases are both signed before shipping; this article describes the process.
Drawing and Event Handling - Plugins
//the npwindow structure typedef enum { npwindowtypewindow = 1, npwindowtypedrawable } npwindowtype; typedef struct _npwindow { void* window; /* platform-specific handle */ uint32 x; /* position of top-left corner */ uint32 y; /* relative to a netscape page */ uint32 width; /* maximum window size */ uint32 height; nprect cliprect; /* clipping rectangle in port coordinates */ #ifdef xp_unix void * ws_info; /* platform-dependent additional data */ #endif /* xp_unix */ npwindowtype type; /* whether this is a window or a drawable */ } npwindow; the window parameter is a platform-specific handle to a native window element in the browser window hierarchy on windows and unix.
... the cliprect field defines the clipping rectangle of the plug-in in a coordinate system where the origin is the top-left corner of the drawable or window.
...the mac os grafport structure's cliprgn field should be set to the clipping rectangle for the instance in port coordinates.
Debugger - Firefox Developer Tools
however, the onnewglobalobject method allows the api user to monitor all global object creation that occurs anywhere within the javascript system (the “jsruntime”, in spidermonkey terms), thereby escaping the capability-based limits.
...however, the addallglobalsasdebuggees method allows the api user to monitor all global object creation that occurs anywhere within the javascript system (the “jsruntime”, in spidermonkey terms), thereby escaping the capability-based limits.
...however, findallglobals allows the api user to find all global objects anywhere within the javascript system (the “jsruntime”, in spidermonkey terms), thereby escaping the capability-based limits.
Examine and edit CSS - Firefox Developer Tools
you can add a class to the element by typing a name in the add new class field below the rules toolbar.
... typing in the search box performs a live filtering of the list, so, for example, if you just want to see font-related settings, you can type "font" in the search box, and only properties with "font" in the name will be listed.
... as you start typing a property name, you'll see a list of autocomplete suggestions.
AudioWorkletNode.port - Web APIs
examples to demonstrate bidirectional communication capabilities, we'll create an audioworkletprocessor, which will output silence and respond to ping requests from its audioworkletnode.
... // ping-pong-processor.js class pingpongprocessor extends audioworkletprocessor { constructor (...args) { super(...args) this.port.onmessage = (e) => { console.log(e.data) this.port.postmessage('pong') } } process (inputs, outputs, parameters) { return true } } registerprocessor('ping-pong-processor', pingpongprocessor) now in our main scripts file we'll load the processor, create an instance of audioworkletnode passing the name of the processor, and connect the node to an audio graph.
... const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will output "ping" and "pong" strings to the console every second.
AudioWorkletProcessor.port - Web APIs
examples to demonstrate bidirectional communication capabilities, we'll create an audioworkletprocessor, which will output silence and respond to ping requests from its audioworkletnode.
... // ping-pong-processor.js class pingpongprocessor extends audioworkletprocessor { constructor (...args) { super(...args) this.port.onmessage = (e) => { console.log(e.data) this.port.postmessage('pong') } } process (inputs, outputs, parameters) { return true } } registerprocessor('ping-pong-processor', pingpongprocessor) now in our main scripts file we'll load the processor, create an instance of audioworkletnode passing the name of the processor, and connect the node to an audio graph.
... const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will output "ping" and "pong" strings to the console every second.
CSSConditionRule - Web APIs
it is a child of cssgroupingrule.
... interface cssconditionrule : cssgroupingrule { attribute domstring conditiontext; } properties the cssconditionrule derives from cssrule, cssgroupingrule and inherits all properties of these classes.
... methods the cssconditionrule derives from cssrule, cssgroupingrule and inherits all methods of these classes.
CSSMediaRule - Web APIs
it implements the cssconditionrule interface, and therefore the cssgroupingrule and the cssrule interface with a type value of 4 (cssrule.media_rule).
... interface cssmediarule : cssconditionrule { readonly attribute medialist media; } properties as a cssconditionrule, and therefore both a cssgroupingrule and a cssrule, cssmediarule also implements the properties of these interfaces.
... methods as a cssconditionrule, and therefore both a cssgroupingrule and a cssrule, cssmediarule also implements the methods of that interface.
CSSSupportsRule - Web APIs
it implements the cssconditionrule interface, and therefore the cssrule and cssgroupingrule interfaces with a type value of 12 (cssrule.supports_rule).
... interface csssupportsrule : cssconditionrule { } properties as a cssconditionrule and therefore a cssrule and a cssgroupingrule, csssupportsrule also implements the properties of these interfaces.
... methods as a cssconditionrule and therefore a cssruleand a cssgroupingrule, csssupportsrule also implements the methods of that interface.
Document.querySelector() - Web APIs
since javascript also uses backslash escaping, be especially careful when writing string literals using these characters.
... see escaping special characters for more information.
... 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 example), you must escape the character with a backslash ("\").
Document.querySelectorAll() - Web APIs
since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters.
... see escaping special characters for more information.
...you can use any common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results.
Element.querySelectorAll() - Web APIs
since javascript also uses backspace escaping, special care must be taken when writing string literals using these characters.
... see escaping special characters for more information.
...you can use any common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); note: nodelist is not a genuine array, that is to say it doesn't have the array methods like slice, some, map etc.
Using the Gamepad API - Web APIs
this information is intended to allow you to find a mapping for the controls on the device as well as display useful feedback to the user.
... mapping: a string indicating whether the browser has remapped the controls on the device to a known layout.
...if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard.
HTML Drag and Drop API - Web APIs
for more information, see dragging and dropping multiple items.
... function dragstart_handler(ev) { ev.datatransfer.dropeffect = "copy"; } for more details, see: drag effects define a drop zone by default, the browser prevents anything from happening when dropping something onto most html elements.
... examples and demos copying and moving elements with the datatransfer interface copying and moving elements with the datatransferlistitem interface dragging and dropping files (firefox only): http://jsfiddle.net/9c2ef/ dragging and dropping files (all browsers): https://jsbin.com/hiqasek/ a parking project using the drag and drop api: https://park.glitch.me/ (you can edit here) specifications specification status comment html living standard living standard see also drag operations dragging and dropping mult...
PaymentAddress - Web APIs
the paymentaddress interface of the payment request api is used to store shipping or payment address information.
... examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options.
... const supportedinstruments = [ { supportedmethods: "basic-card", }, ]; const details = { total: { label: "donation", amount: { currency: "usd", value: "65.00" } }, displayitems: [ { label: "original donation amount", amount: { currency: "usd", value: "65.00" }, }, ], shippingoptions: [ { id: "standard", label: "standard shipping", amount: { currency: "usd", value: "0.00" }, selected: true, }, ], }; const options = { requestshipping: true }; async function dopaymentrequest() { const request = new paymentrequest(supportedinstruments, details, options); // add event listeners here.
PaymentDetailsUpdate - Web APIs
for address field specific errors, use shippingaddresserrors.
... 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.
PaymentRequest.show() - Web APIs
those look like this: async/await syntax using await to wait for a promise to be resolved makes it possible to write 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(), resp...
...ectively, 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 which have been or need to be changed.
... then/catch syntax you can also use the older promise-based approach to work with payments, using the then() and catch() functions on the promise returned by show(): function processspayment() { const payrequest = new paymentrequest(methoddata, details, options); payrequest.onshippingaddresschange = ev => ev.updatewith(checkaddress(payrequest)); payrequest.onshippingoptionchange = ev => ev.updatewith(checkshipping(payrequest)); payrequest.show() .then(response => validateresponse(response)) .catch(err => handleerror(err)); } this is functionally equivalent to the processpayment() method using the await syntax.
PaymentRequestUpdateEvent.updateWith() - Web APIs
for address field specific errors, use shippingaddresserrors.
... 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.
PaymentResponse.retry() - Web APIs
this lets your app gracefully deal with situations such as invalid shipping addresses or declined credit cards.
... shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shipping address that failed validation.
...async function recursivevalidate(request, response) { const promisestofixthings = []; const errors = await validate(request, response); if (!errors) { return; } if (errors.shippingaddress) { // "shippingaddresschange" fired at request object const promise = fixfield(request, "shippingaddresschange", shippingvalidator); promisestofixthings.push(promise); } if (errors.payer) { // "payerdetailchange" fired at response object const promise = fixfield(response, "payerdetailchange", payervalidator); promisestofixthings.push(promise); } await promis...
Payment Request API - Web APIs
payment request concepts and usage many problems related to online shopping-cart abandonment can be traced to checkout forms, which can be difficult and time consuming to fill out and often require multiple steps to complete.
... credentials management: users can manage their credit cards and shipping addresses directly in the browser.
... interfaces paymentaddress an object that contains address information; used for billing and shipping addresses, for example.
Web Push API Notifications best practices - Web APIs
this article provides a useful summary of best practices to keep in mind when developing web sites and applications that use push notifications for user engagement.
...win them back with an expiring offer of free shipping that they can’t ignore!
... what are you hoping to achieve with this push notification?
WaveShaperNode.oversample - Web APIs
this leads to better results by avoiding some aliasing, but comes at the expense of a lower precision shaping curve.
... '2x' double the amount of samples before applying the shaping curve.
... '4x' multiply by 4 the amount of samples before applying the shaping curve.
WebGL2RenderingContext.getSamplerParameter() - Web APIs
gl.texture_wrap_r: returns a glenum indicating the texture wrapping function for the texture coordinate r.
... gl.texture_wrap_s: returns a glenum indicating the texture wrapping function for the texture coordinate s.
... gl.texture_wrap_t: returns a glenum indicating the texture wrapping function for the texture coordinate t.
WebGL2RenderingContext.samplerParameter[if]() - Web APIs
gl.texture_wrap_r: a glenum specifying the texture wrapping function for the texture coordinate r.
... gl.texture_wrap_s: a glenum specifying the texture wrapping function for the texture coordinate s.
... gl.texture_wrap_t: a glenum specifying the texture wrapping function for the texture coordinate t.
WebGLRenderingContext.depthRange() - Web APIs
the webglrenderingcontext.depthrange() method of the webgl api specifies the depth range mapping from normalized device coordinates to window or viewport coordinates.
... syntax void gl.depthrange(znear, zfar); parameters znear a glclampf specifying the mapping of the near clipping plane to window or viewport coordinates.
... zfar a glclampf specifying the mapping of the far clipping plane to window or viewport coordinates.
WebGLRenderingContext.getTexParameter() - Web APIs
gl.texture_wrap_s glenum wrapping function for texture coordinate s gl.repeat (default value), gl.clamp_to_edge, gl.mirrored_repeat.
... gl.texture_wrap_t glenum wrapping function for texture coordinate t gl.repeat (default value), gl.clamp_to_edge, gl.mirrored_repeat.
... gl.texture_wrap_r glenum wrapping function for texture coordinate r gl.repeat (default value), gl.clamp_to_edge, gl.mirrored_repeat.
WebGLRenderingContext.texParameter[fi]() - Web APIs
gl.texture_wrap_s wrapping function for texture coordinate s gl.repeat (default value),gl.clamp_to_edge, gl.mirrored_repeat.
... gl.texture_wrap_t wrapping function for texture coordinate t gl.repeat (default value),gl.clamp_to_edge, gl.mirrored_repeat.
... gl.texture_wrap_r wrapping function for texture coordinate r gl.repeat (default value), gl.clamp_to_edge, gl.mirrored_repeat.
WebGL best practices - Web APIs
keeping the application's vram usage under this cap will help to avoid out-of-memory errors and associated instability.
...consider reducing canvas.width and height and keeping canvas.style.width and height at a constant size.
... however, for 2d resources that are never "zoomed out", don't pay the 30% memory surcharge for mipmaps: const tex = gl.createtexture(); gl.bindtexture(gl.texture_2d, tex); gl.texparameterf(gl.texture_2d, gl.texture_min_filter, gl.linear); // defaults to nearest_mipmap_linear, for mipmapping!
Web Video Text Tracks Format (WebVTT) - Web APIs
cues may have overlapping timings.
... if the webvtt file is being used for chapters (<track> kind is chapters) then the file cannot have overlapping timings.
... example 10 - basic cue timing examples 00:00:22.230 --> 00:00:24.606 00:00:30.739 --> 00:00:34.074 00:00:34.159 --> 00:00:35.743 00:00:35.827 --> 00:00:40.122 example 11 - overlapping cue timing examples 00:00:00.000 --> 00:00:10.000 00:00:05.000 --> 00:01:00.000 00:00:30.000 --> 00:00:50.000 example 12 - non-overlapping cue timing examples 00:00:00.000 --> 00:00:10.000 00:00:10.000 --> 00:01:00.581 00:01:00.581 --> 00:02:00.100 00:02:01.000 --> 00:02:01.000 cue settings cue settings are optional components used to position where the cue payload text will be displayed ove...
Using the Web Animations API - Web APIs
we no longer need to rely on dom-heavy techniques such as writing css properties and scoping classes onto elements to control playback direction.
...we use updateplaybackrate() instead of setting the playbackrate directly since that produces a smooth update: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * .9); } }, 3000); but urging them on by clicking or tapping causes them to speed up by multiplying their playbackrate: var gofaster = function() { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * 1.1); } document.addeventlistener("click", gofaster); document.addeventlistener("touchstart", gofaster); the background elements also have playbackrates that are impacted when you click or tap.
... } } note: getanimations() and effect are not shipping in all browsers as of this writing, but the polyfill does support them today.
Migrating from webkitAudioContext - Web APIs
changes to starting and stopping nodes in webkitaudiocontext, there are two ways to start and stop audiobuffersourcenode and oscillatornode: the noteon() and noteoff() methods, and the start() and stop() methods.
...var src = context.createbuffersource(); src.buffer = somebuffer; src.buffer.gain = 0.5; src.connect(context.destination); src.noteon(0); // new standard audiocontext code: var src = context.createbuffersource(); src.buffer = somebuffer; var gain = context.creategain(); src.connect(gain); gain.gain.value = 0.5; gain.connect(context.destination); src.start(0); removal of audiobuffersourcenode.looping the looping attribute of audiobuffersourcenode has been removed.
...instead of having code like this: var source = context.createbuffersource(); source.looping = true; you can change it to respect the last version of the specification: var source = context.createbuffersource(); source.loop = true; note, the loopstart and loopend attributes are not supported in webkitaudiocontext.
Background audio processing using AudioWorklet - Web APIs
or you can process each input independently, applying an algorithm to the incoming data on each channel of each input and writing the results into the corresponding outputs' channels (keeping in mind that the number of inputs and outputs may differ, and the channel counts on those inputs and outputs may also differ).
...each sample is added to the corresponding sample in the output buffer, with a simple code fragment in place to prevent the samples from exceeding the legal range of -1.0 to 1.0 by capping the values; there are other ways to avoid clipping that are perhaps less prone to distortion, but this is a simple example that's better than nothing.
...in other words, true overrides the api's logic and gives you control over your processor's lifetime policy, keeping the processor's owning audioworkletnode running even when it would otherwise decide to shut down the node.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
screen magnifiers will zoom to the focus, keeping it on the screen at all times, or even allow the user to enter a special low vision document reading mode, with a variety of features such as ticker mode where text is streamed on a single line.
...rollbar role_grip role_sound role_cursor role_caret role_alert role_window [inserted by system] role_client [important] role_menupopup [important] role_menuitem [important] role_tooltip role_application role_document role_pane [important] role_chart role_dialog [semi-important, not currently used by all at's] role_border role_grouping role_separator [important] role_toolbar role_statusbar [important] role_table [important] role_columnheader role_rowheader role_column role_row role_cell [important] role_link [important] role_helpballoon role_character role_list [important] role_listitem [important] role_outline [important] role_outlineitem [important] role_paget...
...for popup listboxes used for dropdowns in autocomplete text fields, change the color value by 1 when the user is typing in the textfield as opposed to arrowing through the list.
Accessibility documentation index - Accessibility
it is intended to mimic the functionality of the html td element for table-style grouping of information.
... 88 architecture accessibility, developing mozilla the implementation of text and embedded objects in mozilla is clever but confusing.
...this table reflects mapping rules for specific elements only, it doesn't reflect any general rules applicable to all elements.
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
space the image is repeated as much as possible without clipping.
...the mask-position property is ignored unless only one image can be displayed without clipping.
... the only case where clipping happens using space is when there isn't enough room to display one image.
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
space the image is repeated as much as possible without clipping.
...the mask-position property is ignored unless only one image can be displayed without clipping.
... the only case where clipping happens using space is when there isn't enough room to display one image.
font-weight - CSS: Cascading Style Sheets
certain commonly used values correspond to common weight names, as described in the common weight name mapping section below.
... common weight name mapping the numerical values 100 to 900 roughly correspond to the following common weight names: value common weight name 100 thin (hairline) 200 extra light (ultra light) 300 light 400 normal 500 medium 600 semi bold (demi bold) 700 bold 800 extra bold (ultra bold) 900 black (hea...
...vy) variable fonts most fonts have a particular weight which corresponds to one of the numbers in common weight name mapping.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
in a browser that supports this keyword you should be able to see that the text has taken all of the soft wrapping opportunities available to it, becoming as small as it can be without overflowing.
...it gets as big as it possibly can be, taking no soft-wrapping opportunities.
...the items will be floored at their min-content size — the size that they become if they take advantage of any soft wrapping opportunities available to them.
Overview of CSS Shapes - CSS: Cascading Style Sheets
the specification defines four <basic-shape> values, which are: inset() circle() ellipse() polygon() using the value inset() wraps text around a rectangular shape however you are able to add offset values, thus pulling the line boxes of any wrapping content closer to the object than would otherwise happen.
...this will further shorten the line boxes of any content wrapping the shape, pushing it away from the shape itself.
... developer tools for shapes along with css shapes support in the browser, firefox are shipping a shape path editor in the firefox devtools.
CSS Shapes - CSS: Cascading Style Sheets
the specification defines a number of different ways to define a shape on a floated element, causing wrapping lines to wrap round the shape rather than following the rectangle of the element's box.
...this creates a circle shape, and the content wrapping the float now wraps around that shape.
... this changes the length of the wrapping text's line boxes.
Selector list - CSS: Cascading Style Sheets
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.
... working draft renamed to "selector list" css level 1the definition of 'grouping' in that specification.
background-repeat - CSS: Cascading Style Sheets
space the image is repeated as much as possible without clipping.
...the background-position property is ignored unless only one image can be displayed without clipping.
... the only case where clipping happens using space is when there isn't enough room to display one image.
background-size - CSS: Cascading Style Sheets
values contain scales the image as large as possible without cropping or stretching the image.
...opera 9.5 also interprets the two-value form as a horizontal scaling factor and, from appearances, a vertical clipping dimension.
...opera 9.5 also interprets the two-value form as a horizontal scaling factor and, from appearances, a vertical clipping dimension.
font-weight - CSS: Cascading Style Sheets
certain commonly used values correspond to common weight names, as described in the common weight name mapping section below.
... inherited value bolder lighter 100 400 100 200 400 100 300 400 100 400 700 100 500 700 100 600 900 400 700 900 400 800 900 700 900 900 700 common weight name mapping the numerical values 100 to 900 roughly correspond to the following common weight names (see the opentype specification): value common weight name 100 thin (hairline) 200 extra light (ultra light) 300 light 400 normal (regular) 500 medium 600 semi bold (demi bold) 700 bold 800 extra b...
...old (ultra bold) 900 black (heavy) 950 extra black (ultra black) variable fonts most fonts have a particular weight which corresponds to one of the numbers in common weight name mapping.
mask-repeat - CSS: Cascading Style Sheets
space the image is repeated as much as possible without clipping.
...the mask-position property is ignored unless only one image can be displayed without clipping.
... the only case where clipping happens using space is when there isn't enough room to display one image.
shape-outside - CSS: Cascading Style Sheets
by default, inline content wraps around its margin box; shape-outside provides a way to customize this wrapping, making it possible to wrap text around complex objects rather than simple boxes.
...the shape follows the normal border radius shaping rules for the outside of the border.
...the shape follows the normal border radius shaping rules for the inside of the border.
Using HTML sections and outlines - Developer guides
they are intended to enhance the limited semantics of earlier versions of html, which included only the <div> tag as a generic mechanism for grouping related content.
... html section element (<section>) defines a section of a document to indicate a related grouping of semantic meaning.
...g involved</h1> <article> <header> <h2>how to become an mdn contributor</h2> <p>do you want to help protect the web?....</p> </header> <section> <h3>steps to editing an article</h3> </section> <footer> <p>author info</p> <p>publication date</p> </footer> </article> </section> section element the section element is used for a thematic grouping of content.
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
then we'll wrap things up with a brief discussion of how to use color wisely: how to select appropriate colors, keeping in mind the needs of people with differing visual capabilities.
...while they can't replace having a good designer helping you make these decisions, they can definitely get you started.
...it's not really a resource for helping you with the color sleection process, but is still full of useful information.
HTML attribute reference - HTML: Hypertext Markup Language
dropzone global attribute indicates that the element accepts the dropping of content onto it.
... hidden global attribute prevents rendering of given element, while keeping child elements, e.g.
... ping <a>, <area> the ping attribute specifies a space-separated list of urls to be notified if a user follows the hyperlink.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
autoplay a boolean attribute; if specified, the video automatically begins to play back as soon as it can do so without stopping to finish loading the data.
... canplaythrough the browser estimates it can play the media up to its end without stopping for content buffering.
... 16 00:03:22 --> 00:03:24 it's… it's a… 16 00:03:25 --> 00:03:32 [loud thumping] [dishes clattering] captions should not obstruct the main subject of the video.
Link types - HTML: Hypertext Markup Language
<a>, <area>, <form> <link> pingback defines an external resource uri to call if one wishes to make a comment or a citation about the webpage.
... the protocol used to make such a call is defined in the pingback 1.0 specification.
... note: if the x-pingback: http header is also present, it supersedes the <link> element with this link type.
HTTP headers - HTTP
WebHTTPHeaders
ping-from ...
... ping-to ...
... x-pingback ...
A typical HTTP session - HTTP
WebHTTPSession
to work around this problem, web developers use several techniques: ping the server periodically via the xmlhttprequest, fetch apis, using the websockets api, or similar protocols.
...(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-tra...
...(contains a site-customized page helping the user to find the missing resource) response status codes http response status codes indicate if a specific http request has been successfully completed.
JavaScript data types and data structures - JavaScript
dynamic typing javascript is a loosely typed and dynamic language.
... beware of "stringly-typing" your code!
... false "normal" objects, and functions a javascript object is a mapping between keys and values.
SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead - JavaScript
use //# instead warning: syntaxerror: using //@ to indicate sourcemappingurl pragmas is deprecated.
... //@ sourcemappingurl=http://example.com/path/to/your/sourcemap.map standard syntax use the "#" sign instead.
... //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map or, alternatively, you can set a sourcemap header to your javascript file to avoid having a comment at all: sourcemap: /path/to/file.js.map ...
Array.prototype.reduce() - JavaScript
note: if initialvalue is not provided, reduce() will execute the callback function starting at index 1, skipping the first index.
...lue ) => accumulator.concat(currentvalue), [] ) counting instances of values in an object let names = ['alice', 'bob', 'tiff', 'bruce', 'alice'] let countednames = names.reduce(function (allnames, name) { if (name in allnames) { allnames[name]++ } else { allnames[name] = 1 } return allnames }, {}) // countednames is: // { 'alice': 2, 'bob': 1, 'tiff': 1, 'bruce': 1 } grouping objects by a property let people = [ { name: 'alice', age: 21 }, { name: 'max', age: 20 }, { name: 'jane', age: 20 } ]; function groupby(objectarray, property) { return objectarray.reduce(function (acc, obj) { let key = obj[property] if (!acc[key]) { acc[key] = [] } acc[key].push(obj) return acc }, {}) } let groupedpeople = groupby(people, 'age') // groupedp...
...e((resolve, reject) => { resolve(a * 2) }) } // function 3 - will be wrapped in a resolved promise by .then() function f3(a) { return a * 3 } // promise function 4 function p4(a) { return new promise((resolve, reject) => { resolve(a * 4) }) } const promisearr = [p1, p2, f3, p4] runpromiseinsequence(promisearr, 10) .then(console.log) // 1200 function composition enabling piping // building-blocks to use for composition const double = x => x + x const triple = x => 3 * x const quadruple = x => 4 * x // function composition enabling pipe functionality const pipe = (...functions) => input => functions.reduce( (acc, fn) => fn(acc), input ) // composed functions for multiplication of specific values const multiply6 = pipe(double, triple) const multiply9 = pipe(tri...
Array.prototype.map() - JavaScript
due to the algorithm defined in the specification, if the array which map was called upon is sparse, resulting array will also be sparse keeping same indices blank.
...return a return a; }; } examples mapping an array of numbers to an array of square roots the following code takes an array of numbers and creates a new array containing the square roots of the numbers in the first array.
... let kvarray = [{key: 1, value: 10}, {key: 2, value: 20}, {key: 3, value: 30}] let reformattedarray = kvarray.map(obj => { let robj = {} robj[obj.key] = obj.value return robj }) // reformattedarray is now [{1: 10}, {2: 20}, {3: 30}], // kvarray is still: // [{key: 1, value: 10}, // {key: 2, value: 20}, // {key: 3, value: 30}] mapping an array of numbers using a function containing an argument the following code shows how map works when a function requiring one argument is used with it.
Atomics.notify() - JavaScript
the static atomics.notify() method notifies up some agents that are sleeping in the wait queue.
... count optional the number of sleeping agents to notify.
... examples using notify given a shared int32array: const sab = new sharedarraybuffer(1024); const int32 = new int32array(sab); a reading thread is sleeping and waiting on location 0 which is expected to be 0.
Operator precedence - JavaScript
note on grouping and short-circuiting in the table below, grouping is listed as having the highest precedence.
... however, that does not always mean the expression within the grouping symbols ( … ) is evaluated first, especially when it comes to short-circuiting.
... precedence operator type associativity individual operators 21 grouping n/a ( … ) 20 member access left-to-right … .
Strict mode - JavaScript
you can also take the approach of wrapping the entire contents of a script in a function and having that outer function use strict mode.
...in normal javascript mistyping a variable in an assignment creates a new property on the global object and continues to "work" (although future failure is possible: likely, in modern javascript).
...javascript sometimes makes this basic mapping of name to variable definition in the code impossible to perform until runtime.
Web audio codec guide - Web media technologies
for that reason, speech-specific codecs often begin by dropping sound that falls outside a set range.
...the simplest are those which are meant for ripping cds or pulling in audio files and quickly and automatically converting them to mp3 or aac format to store in a library, such as itunes.
... but when developing web apps that use audio as a component of the app, such as games, you will need more control over the encoding process and more options surrounding the format used while encoding the audio.
Web video codec guide - Web media technologies
additionally, in saturated portions of the image (that is, where colors are pure and intense, such as a bright, pure red [rgba(255, 0, 0, 1)]), color depths below 10 bits per component (10-bit color) allow banding, where gradients cannot be represented without visible stepping of the colors.
... note the blue and pink fringes around the edges of the star above (as well as the stepping and other significant compression artifacts).
...for exmaple, instead of computing motion differences for two frames that are two pixels apart due to inter-frame motion, skipping every other frame could lead to computing a difference that comes out to four pixels of movement.
Optimizing startup performance - Web Performance
it's worth keeping in mind that most browsers typically start complaining that your script is blocking the main thread for too long at around 10 seconds or so.
...you should also consider gzipping your data to make it as small as you can.
...avoid doing this without keeping the user apprised that the game is in fact still starting up.
Add to Home screen - Progressive web apps (PWAs)
part of this is the simple gesture of accessing an app by tapping its icon on your home screen, and then having it appear neatly in its own window.
... tapping this will show a confirmation banner — pressing the big + add to home screen button completes the action, adding the app to the home screen.
... tapping this icon opens it up, but as a fullscreen app, you'll no longer see the browser ui around it.
Installing and uninstalling web apps - Progressive web apps (PWAs)
this makes it simple for a user to use a gesture to access an app by tapping or clicking its icon.
... tapping this will show a confirmation banner—pressing the banner's big "+ add to home screen" button completes the action, adding the app to the home screen.
... tapping that icon should then take you to the same confirmation banner shown in firefox above.
Graphic design for responsive sites - Progressive web apps (PWAs)
in 1996, many people involved in building the web would have laughed at you if you had told them that less than 20 years in the future we would be developing web sites that worked well on mobile phones, tablets, tvs, even cars and home lighting.
...this article provides a high level discussion aimed at helping you to choose the best option for your graphical needs.
... coping with different resolutions in this section we'll review different strategies for dealing with getting images to work across devices with different resolutions.
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
example: clipping this example demonstrates using svg to clip html content.
...</p> <button onclick="toggleradius()">toggle radius</button> <svg height="0"> <clippath id="clipping-path-1" clippathunits="objectboundingbox"> <circle cx="0.25" cy="0.25" r="0.25" id="circle"/> <rect x="0.5" y="0.2" width="0.5" height="0.8"/> </clippath> </svg> .target { clip-path: url(#clipping-path-1); } p { width: 300px; border: 1px solid #000; display: inline-block; } this establishes a clipping area made of a circle and rectangle, assigns it the id #clipping-path-1, th...
...you can rotate the text: <svg height="60" width="200"> <text x="0" y="15" fill="blue" transform="rotate(30 20,50)">example text</text> </svg> using external references svg used for clipping, masking, and filtering can be loaded from an external source, as long as that source comes from the same origin as the html document to which it's applied.
clip - SVG: Scalable Vector Graphics
WebSVGAttributeclip
the value of auto defines a clipping path along the bounds of the viewport created by the given element.
... as a presentation attribute, it can be applied to any element but it has effect only on the following six elements: <svg>, <symbol>, <image>, <foreignobject>, <pattern>, <marker> html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- auto clipping --> <svg x="0" width="10" height="10" clip="auto"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> <!-- rect(top, right, bottom, left) clipping --> <svg x="10" width="10" height="10" clip="rect(1, 9, 8, 2)"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> </svg> usage notes warning: this property is deprecated.
... value auto | rect() default value auto animatable yes the value auto defines a clipping path along the bounds of the viewport created by the given element.the value rect() defines a clipping rectangle following the following syntax: rect(<top>, <right>, <bottom>, <left>).
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
it has implications for the <tspan>, <tref>, and <altglyph> elements, event processing, for bounding box calculations and for calculation of clipping paths: if display is set to none on a <tspan>, <tref>, or <altglyph> element, then the text string is ignored for the purposes of text layout.
... the geometry of a graphics element with display set to none is not included in bounding box and clipping paths calculations.
...similarly, setting display="none" on a child of a <clippath> element will prevent the given child element from contributing to the clipping path.
2015 MDN Fellowship Program - Archive of obsolete content
in 2015, mdn will expand the impact of this content by developing kits of key learning materials, including such elements as code samples, videos and other elements being finalized.
... activities and deliverables act as lead curator for technical curriculum addressing a key web technology, developing code samples, videos, interactive exercises and other components to be determined.
SDK and XUL Comparison - Archive of obsolete content
advantages of the sdk simplicity the sdk provides high-level javascript apis to simplify many common tasks in add-on development, and tool support which greatly simplifies the process of developing, testing, and packaging an add-on.
... mobile support starting in sdk 1.5, we've added experimental support for developing add-ons on the new native version of firefox mobile.
panel - Archive of obsolete content
// // set the focus to the text area so the user can // just start typing.
...// // set the focus to the text area so the user can // just start typing.
widget - Archive of obsolete content
st data = require("sdk/self").data; var player = widgets.widget({ id: "player", width: 72, label: "player", contenturl: data.url("buttons.html"), contentscriptfile: data.url("button-script.js") }); player.port.on("play", function() { console.log("playing"); }); player.port.on("pause", function() { console.log("pausing"); }); player.port.on("stop", function() { console.log("stopping"); }); to learn much more about content scripts, see the working with content scripts guide.
...quire("sdk/widget"); const data = require("sdk/self").data; var player = widgets.widget({ id: "player", width: 72, label: "player", contenturl: data.url("buttons.html") }); player.port.emit("init"); player.port.on("play", function() { console.log("playing"); }); player.port.on("pause", function() { console.log("pausing"); }); player.port.on("stop", function() { console.log("stopping"); }); attaching panels to widgets you can supply a panel to the widget's constructor: if you do this, the panel is automatically displayed when the user clicks the widget.
core/promise - Archive of obsolete content
for example grouping promises to observe single resolution of all of them is as simple as this: var group = promised(array); var abc = group(aasync, basync, casync).then(function(items) { return items[0] + items[1] + items[2]; }); all the all function is provided to consume an array of promises and return a promise that will be accepted upon the acceptance of all the promises in the initial array.
... treat all values as promises module provides a simple function for wrapping values into promises: const { resolve } = require('sdk/core/promise'); var a = resolve(5).then(function(value) { return value + 2; }); a.then(console.log); // => 7 also resolve not only takes values, but also promises.
cfx - Archive of obsolete content
this flag is particularly useful for sdk developers or people working with the development version of the sdk, who may want to run an add-on using newer versions of the modules than than those shipping in firefox.
... this flag is particularly useful for sdk developers or people working with the development version of the sdk, who may want to run an add-on using newer versions of the modules than than those shipping in firefox.
Boxes - Archive of obsolete content
wrapping contents in html you can use a div as a container and when the div changes size, the contents will wrap or adjust the layout.
...make the box style="display: block" and the wrapping behavior will occur when the box is resized: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox style="display: block"> <label value="aaa"/> <label value="bbb"/> <label value="ccc"/> <label value="ddd"/> <label value="eee"/> <label value="fff"/> <label value="ggg"/> <label value="hhh"/> <label value="iii"/> <label value="jjj"/> <label value="kkk"/> <label value="lll"/> <label value="mmm"/> <label value="nnn"/> <label value="ooo"/> <label value="p...
Drag & Drop - Archive of obsolete content
dropping files onto an xul application it's possible to setup drag and drop events to handle dropping files from external applications or os file managers onto your xul-based application.
...if the file types are present in the drag data, the function returns that dropping the data is allowed.
Enhanced Extension Installation - Archive of obsolete content
these include: the application profile directory <profile>/extensions/ the application install directory <application>/extensions/ any location specified in a text file with a {guid} name placed in one of the above locations, useful for developing extensions at another location, e.g.
... any location specified in a guid-to-path registry key mapping, e.g.
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
about xpcom xpcom is a framework for developing platform-independent components.
... note: if you're developing components in c++ or other compiled languages, be sure to include binaries for every platform.
Appendix D: Loading Scripts - Archive of obsolete content
debuggable: development tools support debugging javascript loaded by script tags disadvantages scoping: scripts loaded via script tags share the global scope with all other scripts loaded into the same window.
... disadvantages limited scoping: as data from the main thread may only be accessed via json message passing, there are significant difficulties in performing many operations in worker scopes.
Getting Started with Firefox Extensions - Archive of obsolete content
they allow the application to be customized to fit the personal needs of each user if they need additional features, while keeping the applications small to download.
...if you're only getting started developing add-ons, the add-ons sdk provides a great way to quickly create simple ones and build on them.
Introduction - Archive of obsolete content
this tutorial is meant to be the stepping stone that will turn you into a professional firefox extension developer in no time.
...gecko versions are somewhat independent from firefox versions, and you can see a mapping of firefox versions and gecko versions at the gecko page.
JavaScript Object Management - Archive of obsolete content
it's one of the funky properties of javascript: all objects are nothing more than name / value mappings.
... javascript code modules javascript code modules (also known as jsm) are new to firefox 3, and they're the best tool for keeping everything in sync between windows.
XPCOM Objects - Archive of obsolete content
just like in component identifiers, the nsi prefix is just a way of keeping things in order.
... stepping into the time machine, we see the preferences service component page.
Overlay extensions - Archive of obsolete content
this page contains links to documentation for the approach to developing extensions for gecko-based applications which uses: xul overlays to specify the interface apis available to privileged code, such as tabbrowser and javascript modules, to interact with the application and content.
... firefox add-ons developer guide a guide to developing overlay extensions.
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
extending traditional hypertext navigation the hypertext approach to developing web pages, in which developers format text layouts into pages and link those pages to related content, is analogous to a book or a magazine: readers view pages, go to other pages for more information, and view resources listed as references on that page.
...the incorrect words are highlighted while the user is typing.
Notes on HTML Reflow - Archive of obsolete content
in reflowdirtychild, the parent frame sets the ns_frame_has_dirty_child state bit on itself, and does any bookkeeping necessary to remember which child is dirty (for example, the block frame marks the linebox dirty that contains the child frame).
...the target frame recovers its bookkeeping information (e.g., the block frame iterates through the dirty lineboxes), and reflows the dirty child frames.
Documentation for BiDi Mozilla - Archive of obsolete content
where the system is capable of tasks such as reversing and shaping text, symmetric swapping, numeric translation, etc., no special text rendering is needed, though there may be a call to a native api to set the base text direction (for example settextalign on windows).
...ype summary of new classes class name xpcom interface (if applicable) implementation comments nsibidi intl\unicharutil\public\nsibidi.h intl\unicharutil\src\nsbidiimp.cpp implementation of the unicode bidi algorithm nsiubidiutils intl\unicharutil\public\nsiubidiutils.h intl\unicharutil\src\nsbidiutilsimp.cpp utilities for bidi processing, including: character classification symmetric swapping reordering shaping numeric translation conversion to/from presentation forms nsbidipresutils layout/base/nsbidipresutils.cpp utilities for the layout engine including: resolve frames by bidi level split framesreorder frames format bidi text support for deletion and insertion of frames by editor nsbiditextframe layout/generic/nsbidiframes.cpp subclass of nsframe with additional method seto...
jspage - Archive of obsolete content
ntdefault(); },stoppropagation:function(){if(this.event.stoppropagation){this.event.stoppropagation();}else{this.event.cancelbubble=true;}return this;},preventdefault:function(){if(this.event.preventdefault){this.event.preventdefault(); }else{this.event.returnvalue=false;}return this;}});function class(b){if(b instanceof function){b={initialize:b};}var a=function(){object.reset(this);if(a._prototyping){return this; }this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c;}.extend(this); a.implement(b);a.constructor=class;a.prototype.constructor=a;return a;}function.prototype.protect=function(){this._protected=true;return this;};object.reset=function(a,c){if(c==null){for(var e in a){object.reset(a,e); }return a;}de...
...lete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=object.reset(b);break;case"array":a[c]=$unlink(a[c]); break;}return a;};new native({name:"class",initialize:class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; },wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new error('the method "'+b+'" cannot be called.'); }var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); }});class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=class.mutators[a]...
Modularization techniques - Archive of obsolete content
the nscomponentmanager is simply a mapping of class ids to factories and their containing libraries.
...note that one interface can have a number of classes that implement it, so there is not necessarily a one-to-one mapping from iids to cids.
Running Tamarin acceptance tests - Archive of obsolete content
build/hg/tamarin-redux/generated/shell_toplevel.abc $ export avm=/users/build/hg/tamarin-redux/objdir-release/shell/avmshell $ python runtests.py tamarin tests started: 2010-09-28 10:37:06.410676 current configuration: x64-mac-tvm-release avm version: 5260:6d1899261bac executing 2532 tests against vm: /users/build/hg/builds/5260-6d1899261bac/mac/avmshell_64 2532 running abcasm/abs_helper.as skipping...
... reason: 2531 running abcasm/adhoc.abs skipping...
[Deprecated] The Mozilla build VM - Archive of obsolete content
other links of interest may include: developer guide (documentation about developing on and for mozilla projects).
... mentored bugs have a mentor who commits to helping you every step of the way.
Using Breakpoints in Venkman - Archive of obsolete content
the following meta comment types are available: the //@jsd_log comment will insert a breakpoint which is set to execute the script that follows without stopping.
... the //@jsd_eval command will insert a breakpoint which is set to execute the script that follows without stopping and without logging the result.
Video presentations - Archive of obsolete content
this article is a jumping-off point to help you find those presentations.
...(as quicktime; 138 mb and 132 mb) developing mozilla these presentations cover various aspects of the process of working on the mozilla project, including building, testing, and debugging.
Unix stub installer - Archive of obsolete content
build the unix installer (debug or non-debug target) by typing "make" in the src2 directory grab a nightly build, say from <http://ftp.mozilla.org/pub/mozilla/n...staller.tar.gz> gunzip and untar the build to some temporary location like /tmp.
... if you need to use gdb to debug the installer run it by typing "gdb mozilla-installer-bin" on the shell prompt.
XPJS Components Proposal - Archive of obsolete content
the xpjsmanager is in charge of loading these .js files, helping them register themselves, and acting as an intermediary between the xpcom component manager and the js code.
...the xpjsmanager will receive this call from the js code, store the mapping of clsid to .js filespec in the registry for its own use later, and then call the real component manager to do the registration.
panel.flip - Archive of obsolete content
horizontal flipping doesn't normally happen, since this would cause menus to open in strange places.
... an arrow panel can also specify a value of slide, which causes the arrow to "slide" instead of flipping when the panel doesn't have room.
wrap - Archive of obsolete content
ArchiveMozillaXULAttributewrap
« xul reference home wrap type: string set this attribute to the value off to disable word wrapping in the textbox.
... if this attribute is not specified, word wrapping is enabled.
Index - Archive of obsolete content
ArchiveMozillaXULIndex
959 complete this page is for readers who have followed the custom toolbar button tutorial for firefox, thunderbird and sunbird, or the custom toolbar button:seamonkey tutorial for seamonkey, and who want to learn more about developing extensions.
... 1062 stacks and decks tutorials, xul, xul_tutorial there may be need to display elements as a set of overlapping cards.
The Joy of XUL - Archive of obsolete content
key features and benefits powerful widget-based markup language the goal of xul is to build cross platform applications, in contrast with dhtml which is intended for developing web pages.
... conclusion mozilla, featuring xul, delivers a compelling technology for developing cross-platform applications with the same rich user interface and end user experience as native desktop applications.
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
to include the style on your chrome.manifest file: style chrome://global/content/customizetoolbar.xul chrome://myextension/skin/toolbar-button.css if you are developing for firefox 1.0, attach it to the customize toolbar window (chrome://global/content/customizetoolbar.xul) using skin/contents.rdf.
...1.0:packages"> <li resource="urn:mozilla:skin:classic/1.0:myextension"/> </seq> </chrome:packages> </description> <seq about="urn:mozilla:stylesheets"> <li resource="chrome://global/content/customizetoolbar.xul"/> </seq> <seq about="chrome://global/content/customizetoolbar.xul"> <li>chrome://myextension/skin/toolbar-button.css</li> </seq> </rdf> the skin/contents.rdf file is denigrated in developing for later releases of firefox.
Complete - Archive of obsolete content
this page is for readers who have followed the custom toolbar button tutorial for firefox, thunderbird and sunbird, or the custom toolbar button:seamonkey tutorial for seamonkey, and who want to learn more about developing extensions.
...for more information about developing extensions, see the main extensions page here.
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
open the file in seamonkey (for example, by dragging it and dropping it in the navigator window, or by choosing file – open file...
...copy and paste the line from here, to avoid typing errors: content,install,url,resource:/chrome/custombutton/ explanation: this line registers your custom toolbar button extension, linking it into seamonkey.
Element Positioning - Archive of obsolete content
examples of setting widths and heights <button label="1" style="width: 100px;"/> <button label="2" style="width: 100em; height: 10px;"/> <button label="3" flex="1" style="min-width: 50px;"/> <button label="4" flex="1" style="min-height: 2ex; max-width: 100px"/> <textbox flex="1" style="max-width: 10em;"/> <description style="max-width: 50px">this is some boring but simple wrapping text.</description> example 1 the first button will be displayed with a width of 100 pixels (px means pixels).
... cropping text and buttons you could potentially create a button element that contains a label that is larger than the maximum width of the button.
List Controls - Archive of obsolete content
you cannot enter your own text by typing it in.
...n editable menulist, add the editable attribute as follows: example 6 : source view <menulist editable="true"> <menupopup> <menuitem label="www.mozilla.org" /> <menuitem label="www.xulplanet.com" /> <menuitem label="www.dmoz.org" /> </menupopup> </menulist> the url field created here has three pre-populated choices that the user can select or they can enter one of their own by typing it into the field.
More Event Handlers - Archive of obsolete content
example 1 : source view <vbox oncommand="alert(event.currenttarget.tagname);"> <button label="ok"/> <checkbox label="show images"/> </vbox> stop event propagation once you handle an event, regardless of where in the propagation the event is, you will likely want to stop the event from being sent to further elements, essentially stopping the capturing or bubbling phases from continuing.
...note that preventing the default action is not the same as stopping event propagation with the stoppropagation method.
Property Files - Archive of obsolete content
in case you need to format a string that already contains the percentage character in it (to get something like "50% off" returned), escape the percentage character with another percentage character, like this: my.percentage.string = %s%% off not escaping the percentage character will generate an incorrect string that strips the space character between the percentage character and the next word of the string ("50%off").
... non-ascii characters, utf-8 and escaping gecko 1.8.x (or later) supports property files encoded in utf-8.
Skinning XUL Files by Hand - Archive of obsolete content
the parent-child relationship is more economical than the aforementioned contextual subgrouping, which searches the entire subtree of an element for the subelement.
...each type uses a different grouping of elements.
XUL Structure - Archive of obsolete content
this directory is called 'chrome' probably because it seemed like a convenient name to use in keeping with the chrome packages that are included with mozilla.
...in firefox, this preference may be added to the user preferences by typing "about:config" in the address field, and setting this value to true.
browser - Archive of obsolete content
disableglobalhistory type: boolean disables global history for the docshell attached to the browser while keeping session history active.
... showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
menuitem - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
...this would be useful if the images are stored remotely or you plan on swapping the image frequently.
menulist - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
... editable type: boolean indicates that the value of the menulist can be modified by typing directly into the value field.
panel - Archive of obsolete content
ArchiveMozillaXULpanel
horizontal flipping doesn't normally happen, since this would cause menus to open in strange places.
... an arrow panel can also specify a value of slide, which causes the arrow to "slide" instead of flipping when the panel doesn't have room.
tab - Archive of obsolete content
ArchiveMozillaXULtab
if the box direction is reversed, the cropping is reversed.
...this would be useful if the images are stored remotely or you plan on swapping the image frequently.
toolbarbutton - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
...this would be useful if the images are stored remotely or you plan on swapping the image frequently.
treecol - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
...any splitter to either side will resize those columns while keeping the fixed column at a constant size.
XULRunner Hall of Fame - Archive of obsolete content
build instructions pencil the pencil project's unique mission is to build a free and opensource tool for making diagrams and gui prototyping that everyone can use.
... crowbar a web scraping environment based on the use of a server-side headless mozilla-based browser.
MacFAQ - Archive of obsolete content
note that in order to copy the framework while keeping the relative soft-links in the framework, do something like: % ( cd dist ; gnutar cf - xul.framework | ( cd /library/frameworks ; gnutar xf - )) installing your application your application must be installed as a xulrunner app before you can open it.
...here's how to implement command-line trapping when the app is already running, without getting into appleevents or c++ code.
application/http-index-format specification - Archive of obsolete content
any illegal characters must be escaped via the url escaping syntax defined by rfc 1738.
...any illegal characters must be escaped via the url escaping syntax defined by rfc 1738.
nsIContentPolicy - Archive of obsolete content
this interface can be very useful if you are developing a content-aware plugin (blocking ads or altering the look of content, for example), or if you want to stop or allow user-browsed urls.
... type_ping 10 indicates a ping triggered by a click on an <a> element using the ping attribute.
Gecko Compatibility Handbook - Archive of obsolete content
in older browsers, this results in the td cell tightly wrapping around the input element.
... aol webmaster.info site - developing for netscape gecko covers common issues facing webmasters, and how to update your code.
2006-11-03 - Archive of obsolete content
what gui lib was used for developing firefox 2.0 ?
... a user inquires about what gui library is used for developing firefox 2.0.
2006-11-04 - Archive of obsolete content
gui lib was used for developing firefox 2.0 ?
... a user inquires about what gui library is used for developing firefox 2.0.
2006-10-06 - Archive of obsolete content
problem looping c_opensession problem in thunderbird christian bongiorno has run into a problem developing a pkcs11 module for a new card.
... thunderbird is continuously repeating 7 functions including c_opensession which accesses the card that he is developing.
NPN_SetValue - Archive of obsolete content
luginwindowbool: sets windowed/windowless mode for plugin display; true=windowed, false=windowless nppvplugintransparentbool: sets transparent mode for display of a plugin; true=transparent, false=opaque nppvjavaclass nppvpluginwindowsize nppvplugintimerinterval nppvpluginscriptableinstance nppvpluginscriptableiid nppvjavascriptpushcallerbool: specifies whether you are pushing or popping the jscontext off the stack nppvpluginkeeplibraryinmemory: tells browser that the plugin dll should live longer than usual nppvpluginneedsxembed nppvpluginscriptablenpobject nppvformvalue nppvplugindrawingmodel value the value of the specified variable to be set.
... nppvjavascriptpushcallerbool sets whether you are pushing or popping the appropriate jscontext off the stack (see the two-way scriptability article on the mozilla plugins project page for more details).
Introduction to Public-Key Cryptography - Archive of obsolete content
for an overview of ssl, see "introduction to ssl." for an overview of encryption and decryption, see "encryption and decryption." information on digital signatures is available from "digital signatures." public-key cryptography is a set of well-established techniques and standards for protecting communications from eavesdropping, tampering, and impersonation attacks.
...users have difficulty keeping track of different passwords, tend to choose poor ones, and tend to write them down in obvious places.
Vulnerabilities - Archive of obsolete content
for example, the address resolution protocol (arp) trusts that an arp reply contains the correct mapping between media access control (mac) and internet protocol (ip) addresses.
...setting this to 1 would be the most secure setting against password guessing attacks, but it would also cause legitimate users to be locked out after mistyping a password once, and it would also permit attackers to perform denial-of-service attacks against users more easily by generating a single failed login attempt for each user account.
Scratchpad - Archive of obsolete content
for example, try typing d, then pressing ctrl + space.
...this is useful if you are working on firefox itself or developing add-ons.
Processing XML with E4X - Archive of obsolete content
the syntax is designed to be familiar to javascript programmers, but e4x does not provide a direct mapping from xml to native javascript objects; just the illusion of one.
...variables and expressions can be used to create attribute values by simply wrapping them with braces ({}) and omitting quotation marks that would normally go around an attribute value, as the following example illustrates: var a = 2; var b = <foo bar={a}>"hi"</foo>; upon execution the variable is evaluated and quotes are automatically added where appropriate.
Old Proxy API - Archive of obsolete content
proxies can be either be trapping or fixed.
... function handlermaker(obj) { return { // fundamental traps getownpropertydescriptor: function(name) { var desc = object.getownpropertydescriptor(obj, name); // a trapping proxy's properties must always be configurable if (desc !== undefined) { desc.configurable = true; } return desc; }, getpropertydescriptor: function(name) { var desc = object.getpropertydescriptor(obj, name); // not in es5 // a trapping proxy's properties must always be configurable if (desc !== undefined) { desc.configurable = true; } return desc; ...
Writing JavaScript for XHTML - Archive of obsolete content
a third solution is to use only external scripts, neatly sidestepping the special-character problem.
... solution: use dom methods many people avoided dom methods because of the typing to create one simple element, when document.write() worked.
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
for example, if an organization is developing a web-based client, they may have to adhere to standards imposed by these organizations: ansi (american national standards institute ) atsc (advanced television systems committee ) ieee (institute of electrical and electronics engineers ) ietf (internet engineering task force ) irtf (internet research task force ) iso (international standards organization ) itu (international telecommuni...
...consequently, xerox eventually had to shut down the production of their workstation development because of escalating manufacturing and developing costs and slowed sales.
Game promotion - Game development
developing and publishing your game is not enough.
...sometimes you have to spend more time promoting a game than actually developing it.
Explaining basic 3D theory - Game development
applying textures onto objects during the fragment processing stage of the rendering pipeline allows us to adjust it by wrapping and filtering it if necessary.
... texture wrapping allows us to repeat the 2d image around the 3d object.
Building up a basic demo with Babylon.js - Game development
environment setup to start developing with babylon.js, you don't need much.
... initialising the babylon.js engine we have to create a babylon.js engine instance first (passing it the <canvas> element to render on) before we start developing our game.
Building up a basic demo with Three.js - Game development
environment setup to start developing with three.js, you don't need much.
...we're wrapping the scale value in math.abs, to pass the absolute values, greater or equal to 0.
Build the brick field - Game development
s as shown below: for(c=0; c<brickinfo.count.col; c++) { for(r=0; r<brickinfo.count.row; r++) { var brickx = 0; var bricky = 0; newbrick = game.add.sprite(brickx, bricky, 'brick'); game.physics.enable(newbrick, phaser.physics.arcade); newbrick.body.immovable = true; newbrick.anchor.set(0.5); bricks.add(newbrick); } } here we're looping through the rows and columns to create the new bricks and place them on the screen.
...the ball goes through the bricks without stopping — we need proper collision detection.
Intrinsic Size - MDN Web Docs Glossary: Definitions of Web-related terms
for text the min-content size would be if the text wrapped as small as it can in the inline direction without causing an overflow, doing as much soft-wrapping as possible.
... the max-content size is the opposite — in the case of text, this would have the text display as wide as possible, doing no soft-wrapping, even if an overflow was caused.
Round Trip Time (RTT) - MDN Web Docs Glossary: Definitions of Web-related terms
the rtt between a network and server can be determined by using the ping command.
... $ ping example.com ping example.com (216.58.194.174): 56 data bytes 64 bytes from 216.58.194.174: icmp_seq=0 ttl=55 time=25.050 ms 64 bytes from 216.58.194.174: icmp_seq=1 ttl=55 time=23.781 ms 64 bytes from 216.58.194.174: icmp_seq=2 ttl=55 time=24.287 ms 64 bytes from 216.58.194.174: icmp_seq=3 ttl=55 time=34.904 ms 64 bytes from 216.58.194.174: icmp_seq=4 ttl=55 time=26.119 ms --- google.com ping statistics --- 5 packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 23.781/26.828/34.904/4.114 ms in the above example, the average round trip time is shown on the final line as 26.8ms.
MDN Web Docs Glossary: Definitions of Web-related terms
e dmz dns doctype document directive document environment dom (document object model) domain domain name domain sharding dominator dos attack dtls (datagram transport layer security) dtmf (dual-tone multi-frequency signaling) dynamic programming language dynamic typing e ecma ecmascript effective connection type element empty element encapsulation encryption endianness engine entity entity header event exception expando f fallback alignment falsy favicon fetch directive ...
...moke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification speculative parsing speed index sql sql injection sri stacking context state machine statement static method static typing strict mode string stun style origin stylesheet svg svn symbol symmetric-key cryptography synchronous syntax syntax error synthetic monitoring t tag tcp tcp handshake tcp slow start telnet texel thread ...
CSS and JavaScript accessibility best practices - Learn web development
it is a good idea to make sure the table headers stand out (normally using bold), and use zebra striping to make different rows easier to parse.
... keeping it unobtrusive you should keep unobtrusive javascript in mind when creating your content.
WAI-ARIA basics - Learn web development
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 display — it would be impossible to use the app in any effective way without some kind of way of alerting the user to the updates.
... form validation and error alerts first of all, let's revisit the form example we first looked at in our css and javascript accessibility article (read keeping it unobtrusive for a full recap).
Advanced styling effects - Learn web development
mix-blend-mode, which blends together the element it is set on with elements it is overlapping — both background and content.
... the css shapes specification enables the wrapping of text around a non-rectangular shape.
Debugging CSS - Learn web development
you can click the closing curly brace in the rule to start entering a new declaration into it, at which point you can start typing the new property and devtools will show you an autocomplete list of matching properties.
...if you need to ask for help, they will show the person helping you what you have already tried.
Handling different text directions - Learn web development
in the same way that we have mappings for width and height there are mappings for these properties.
...these values also have mappings, to logical values — block-start, inline-end, block-end, and inline-start.
Organizing your CSS - Learn web development
post-processing for optimization if you are concerned about adding size to your stylesheets by adding a lot of additional comments and whitespace for example, then a post-processing step could be to optimize the css by stripping out anything unnecessary in the production version.
... wrapping up this is the final part of our learning css guide, and as you can see there are many ways in which your exploration of css can continue from this point.
Test your skills: The Box Model - Learn web development
the box model three in this example the inline element has a margin, padding and border however the lines above and below are overlapping it.
... what can you add to your css to cause the size of the margin, padding, and border to be respected by the other lines, while still keeping the element inline?
The box model - Learn web development
margin box: the margin is the outermost layer, wrapping the content, padding and border as whitespace between this box and other elements.
...this is useful for situations where you do not want an item to break onto a new line, but do want it to respect width and height and avoid the overlapping seen above.
Flexbox - Learn web development
wrapping one issue that arises when you have a fixed amount of width or height in your layout is that eventually your flexbox children will overflow their container, breaking the layout.
...here we lay them out in a wrapping row, and align them in the center of the available space like we did in the individual button example we saw earlier.
Getting started with CSS - Learn web development
wrapping up in this tutorial, we have taken a look at a number of ways in which you can style a document using css.
... we will be developing this knowledge as we move through the rest of the lessons.
What is CSS? - Learn web development
css is constantly developing, with new features coming available.
... browser support once css has been specified then it is only useful for us in developing web pages if one or more browsers have implemented it.
Styling lists - Learn web development
the unstyled example is available on github (check out the source code too.) the html for our list example looks like so: <h2>shopping (unordered) list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <ul> <li>hummus</li> <li>pita</li> <li>green salad</li> <li>halloumi</li> </ul> <h2>recipe (ordered) list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for refer...
...this means that each paragraph and list will have the same font size and top and bottom spacing, helping to keep the vertical rhythm consistent.
How do I start to design my website? - Learn web development
therefore, before jumping into the technical side—for example, code and tools—you must first step back and decide in detail what you want to do.
...mail?) define how people will find those contact channels from your website sell goodies create the goodies store the goodies find a way to handle shipping find a way to handle payment make a mechanism on your site for people to place orders teach music through videos record video lessons prepare video files viewable online (again, could you do this with existing web services?) give people access to your videos on some part of your website two things to notice.
How do I use GitHub Pages? - Learn web development
every operating system comes with a command line tool: windows: command prompt can be accessed by pressing the windows key, typing command prompt, and choosing it from the list that appears.
...you tell the computer to do something in the terminal by typing in a command and hitting enter, as seen above.
How to build custom form controls - Learn web development
.select:after { content : "▼"; /* we use the unicode character u+25bc; make sure to set a charset meta tag */ position: absolute; z-index : 1; /* this will be important to keep the arrow from overlapping the list of options */ top : 0; right : 0; box-sizing : border-box; height : 100%; width : 2em; padding-top : .1em; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; text-align : center; } next, let's style the list of options: .select .optlist { z-index : 2; /* we explicitly said the list of options will al...
...this switch is a couple of lines: if at page load time our script is running, it will remove the no-widget class and add the widget class, thereby swapping the visibility of the <select> element and the custom control.
Front-end web developer - Learn web development
the learning and getting help article provides you with a series of tips for looking up information and helping yourself.
...the case study tutorials at the end of the second and third modules prepare you for grasping the essentials of modern tooling.
HTML basics - Learn web development
try to create a meaningful sequence of headings on your pages, without skipping levels.
...the most common list types are ordered and unordered lists: unordered lists are for lists where the order of the items doesn't matter, such as a shopping list.
JavaScript basics - Learn web development
this is called variable scoping.
... (read more about variable scoping.) events real interactivity on a website requires events handlers.
Creating hyperlinks - Learn web development
anatomy of a link a basic link is created by wrapping the text or other content, see block level links, inside an <a> element and using the href attribute, also known as a hypertext reference, or target, that contains the web address.
...for example: screenreader users like jumping around from link to link on the page, and reading links out of context.
Making asynchronous programming easier with async and await - Learn web development
try typing the following lines into your browser's js console: function hello() { return "hello" }; hello(); the function returns "hello" — nothing special, right?
...status: ${response.status}`); } else { return await response.blob(); } } myfetch().then((blob) => { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }).catch(e => console.log(e)); you can try typing in the example yourself, or running our live example (see also the source code).
Test your skills: Loops - Learn web development
this aim of this skill test is to assess whether you've understood our looping code article.
... loops 1 in our first looping task we want you start by creating a simple loop that goes through all the items in the provided myarray and prints them out on the screen inside list items (i.e., <li> elements), which are appended to the provided list.
Fetching data from the server - Learn web development
enter ajax this led to the creation of technologies that allow web pages to request small chunks of data (such as html, xml, json, or plain text) and display them only when needed, helping to solve the problem described above.
...this may not be such a big issue on a desktop on a broadband connection, but it's a major issue on mobile devices and in developing countries that don't have ubiquitous fast internet service.
JavaScript object basics - Learn web development
the live version will give you a blank screen, but that's ok — again, open your devtools and try typing in the above commands to see the object structure.
...let's say we wanted users to be able to store custom value types in their people data, by typing the member name and value into two text inputs.
Getting started with Ember - Learn web development
ember has clear conventions that are useful for enforcing consistency and helping team members get up to speed quickly.
... starting the development server you may start the app in development mode by typing the following command in your terminal, while inside the todomvc directory: ember server this should give you an output similar to the following: build successful (190ms) – serving on http://localhost:4200/ slowest nodes (totaltime >= 5%) | total (avg) -----------------------------------------+----------- broccolimergetrees (17) | 35ms (2 ms) package /assets/vendor...
Getting started with React - Learn web development
setting up your first react app there are many ways to use react, but we're going to use the command-line interface (cli) tool create-react-app, as mentioned earlier, which expedites the process of developing a react application by installing some packages and creating some files for you, handling the tooling described above.
... the public directory contains files that will be read by your browser while you're developing the app; the most important of these is index.html.
Starting our Svelte Todo list app - Learn web development
in this article we will first have a look at the desired functionality of our app, then we'll create a todos.svelte component and put static markup and styles in place, leaving everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles.
...this will be the basic functionality that we'll be developing in this tutorial series, plus we'll look at some more advanced concepts along the way too.
Deployment and next steps - Learn web development
git commit -m "initial commit" git push -u origin master note: you could use the git protocol instead of https, which is faster and saves you from typing your username and password every time you access your origin repo.
...after completing this series of tutorials you should have a strong base from which to start developing professional web applications with svelte.
Dynamic behavior in Svelte: working with variables and props - Learn web development
previous overview: client-side javascript frameworks next now that we have our markup and styles ready we can start developing the required features for our svelte to-do list app.
... now try going back to localhost:5000, pressing ctrl + shift + k to open your browser console and typing something into the input field.
Handling common accessibility problems - Learn web development
you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text input (other form elements have different controls, for example the <select> element can have its options displayed and cycled between using the up and down arrow keys).
...a basic data table can be written with very simple markup (see bad-table.html live, and source), but this has problems — there is no way for a screen reader user to associate rows or columns together as groupings of data — to do this you need to know what the header rows are, and if they are heading up rows, columns, etc.
Deploying our app - Learn web development
we are hoping that this section will at least make you aware of the need for testing, and will plant the seed that inspires you to go and learn more.
...while there is a long way to go before you can consider yourself a client-side tooling wizard, we are hoping that this module has given you that first important step towards understanding client-side tooling, and the confidence to learn more and try out new things.
Package management basics - Learn web development
we've met npm already, but stepping back from npm itself, a package manager is a system that will manage your project dependencies.
...the javascript bundle my-project.fb76efcf.js is a whopping 195k — very large, given that all it does is print a line of text.
Multiprocess on Windows
interceptors are, essentially, wrapper objects which implement the same interfaces as the object that they are wrapping.
...this should be the iid that we want the interceptor to actually use when wrapping the array element.
Mozilla’s UAAG evaluation report
ntrolling popup behavior: turn window.open off for particular sites: user_pref("capability.policy.popupsites.sites", "http://www.annoyingsite1.com http://www.popupsite2.com"); user_pref("capability.policy.popupsites.windowinternal.open", "noaccess"); or turn it off everywhere: user_pref("capability.policy.default.windowinternal.open", "noaccess"); override popping up new windows on target=anything: user_pref("browser.target_new_blocked", true); override popup windows at beginning of new page load (blocks most popup advertisements): user_pref("dom.disable_open_during_load", true); 5.4 selection and focus in viewport.
...(p1) vg mozilla implements standard keyboard bindings there are a few missing pieces, such as support in xul comboboxes (menulist) for selecting items by typing alphanumeric keystrokes 7.3 operating environment conventions.
Add-ons
developing extensions in the past, there were several toolsets for developing firefox extensions, but as of november 2017, extensions must be built using webextensions apis.
...you’ll find: overview of the firefox extension features tools and processes for developing and testing how to publish your extension on addons.mozilla.org or distribute it yourself how to manage your published extension an enterprise guide for developing and using extensions how to develop themes for firefox firefox developer communities extensions for firefox for android in 2020, mozilla will release a new firefox for android experience.
Android-specific test suites
while developing, you can launch these tests from within android studio, which is the fastest way to iterate on code and tests.
...while developing, lint warnings should appear within android studio, although this is not infallible.
Chrome registration
the chrome registry the gecko runtime maintains a service known as the chrome registry that provides mappings from chrome package names to the physical location of chrome packages on disk.
... resource aliases can be created using the resource instruction: resource aliasname uri/to/files/ [flags] this will create a mapping for resource://<aliasname>/ uris to the path given.
Debugging on Windows
avoiding stepping into certain functions you can avoid stepping into certain functions, such as nscomptr methods, using an undocumented feature of vc.
...because the code is optimized, stepping through the code may occasionally provide small surpises when the debugger jumps over something.
Configuring Build Options
skipping any step may cause the build to fail, or the built software to be unusable.
... people developing patches (especially in c++) should generally use this option.
How Mozilla's build system works
for many developers, typing mach build to build the tree is sufficient to work with the source tree.
...a tier is a grouping of related directories containing makefiles of their own.
pymake
to run tests instead of typing make mochitest-plain in the object directory, you would type python ../build/pymake/make.py mochitest-plain.
... try typing just pymake into the shell and press enter.
Interface development guide
the articles linked from this page offer guidelines for developing and using these interfaces.
... mailing list newsgroup rss feed related topics javascript, xpcom, developing mozilla ...
Experimental features in Firefox
due to a bug that came up during testing of the user interface, we have decided to postpone shipping this api while discussions over potential changes to the api are held.
... nightly 75 no developer edition 75 no beta 75 no release 75 no preference name devtools.webconsole.input.context mobile gesture support in responsive design mode mouse gestures are used to simulate mobile gestures like swiping/scrolling, double-tap and pinch-zooming and long-press to select/open the context menu.
Index
168 performance best practices for firefox front-end engineers best practices, developing firefox, developing mozilla, firefox, front-end, mozilla, performance this guide will help firefox developers working on front-end code produce code which is as performant as possible—not just on its own, but in terms of its impact on other parts of firefox.
... 172 security best practices for firefox front-end engineers best practices, developing firefox, developing mozilla, firefox, front-end, mozilla, performance this article will help firefox developers understand the security controls in place and avoid common pitfalls when developing front-end code for firefox.
Chrome-only CSS reference
MozillaGeckoChromeCSS
d by the properties attribute.css -moz-bool-pref() @supports functionthe -moz-bool-pref() @supports condition is available to gecko chrome and ua stylesheets to check if a boolean preference is enabled.css <display-xul> component</display-xul>firefox supports the following -moz- prefixed xul display values:overflow-clip-boxthe overflow-clip-box css property specifies relative to which box the clipping happens when there is an overflow.
... it is short hand for the overflow-clip-box-inline and overflow-clip-box-block properties.overflow-clip-box-blockthe overflow-clip-box-block css property specifies relative to which box the clipping happens when there is an overflow — in the block direction.overflow-clip-box-inlinethe overflow-clip-box-inline css property specifies relative to which box the clipping happens when there is an overflow — in the inline direction.
Introduction to Layout in Mozilla
structures content node elements, attributes, leaves dom frame rectangular formatting primitive geometric information [0..n] per content node 2nd thru nth are “continuations” style context non-geometric information may be shared by adjacent frames reference counted, owned by frame view clipping, z-order, transparency [0..1] per frame, owned by frame widget native window [0..1] per view, owned by view key data structures the document owns the content model, and one or more presentations exposed programmatically via dom apis the presentation owns the frame hierarchy frames own the style contexts, views, widgets pre...
...notifications passes these to the style set object, who in turn passes to the frame constructor frame constructor creates frames constructframeinternal recursively walks content tree, resolves style and creates frames either created by tag (<select>) or by display type (<p>) frame manager maintains mapping from content to frame style resolution compute stylistic information based on the style rules that apply for the frame’s content node style data broken into different structures display, visibility, font, color, background, … inherit vs.
Following the Android Toasts Tutorial from a JNI Perspective
because we don't want to keep typing string signatures everywhere, we can end up with typos and hard to trace back errors, we use the sig object.
...because we want to avoid typos, we will avoid typing the signatures and user our sig object.
Localization and Plurals
if you're here to make your code (e.g., extensions) localizable for plural forms, you can jump straight to developing with pluralform.
...: initial version with pluralrule check, properties input loading, table generation, sample output display 0.2: use pluralform.numforms() to get the number of forms instead of figuring out locally to better support future rules - requires build from 2007/01/27 or later 0.3: generate a list of what numbers fall into which plural form to minimize the sample output to at most 3 of each form developing with pluralform the functionality for getting the correct plural forms is provided by a javascript module, pluralform.jsm.
What every Mozilla translator should know
we have the main repository called mozilla-central (or trunk) where the day to day developing work is done.
...all the content of the trunk is copied to this new branch so that the developing work is done in two (or more) parallel places: the generic trunk and the version oriented branch(es).
Mozilla Style System
when script dynamically changes the data represented by a css style rule, we create a new nsistylerule object; keeping the old one around briefly helps to determine what changed and how we need to handle that change.
... the grouping of properties into structs follows two rules: any properties in the same style struct must also be in the same css struct all of the properties in a style struct must be inherited or they must all be non-inherited (see inheritance for an explanation of the difference) the first of these rules is no longer important (in fact, the separation of the specified values into nscss* structs is no l...
DMD
launch launch fennec either by tapping on the icon as usual, or from the command line (as before, be sure to replace org.mozilla.fennec_$username with the app identifier as appropriate).
... adb shell am start -n org.mozilla.fennec_$username/.app trigger use the existing memory-report dumping hook: adb shell am broadcast -a org.mozilla.gecko.memory_dump in logcat, you should see output similar to this: i/dmd (20731): opened /storage/emulated/0/download/memory-reports/dmd-default-20731.json.gz for writing ...
Profiling with Xperf
tips in the summary views, the yellow bar can be dragged left and right to change the grouping -- for example, drag it to the left of the module column to have grouping happen only by process (stuff that's to the left), so that you get symbols in order of weight, regardless of what module they're in.
... dragging the columns around will change grouping in various ways; experiment to get the data that you're looking for.
Profiling with the Firefox Profiler
at present there is no central list of these thread names, but you can find them by grepping the source.
... warning: dumping texture data slows performance considerably, and requires a lot of storage for the profile files.
Scroll-linked effects
this constant moving and snapping will result in a jittery visual effect.
... example 2: scroll snapping below is an implementation of scroll snapping, where the scroll position snaps to a particular destination when the user's scrolling stops near that destination.
about:memory
these files can be loaded as is, but they can also be loaded after unzipping.
...all the measurements within a single tree are non-overlapping.
Performance
the articles linked to from here will help you improve performance, whether you're developing core mozilla code or an add-on.
... related topics javascript, xpcom, developing mozilla, extensions, addons ...
ui.tooltipDelay
ui.tooltipdelay stores the delay in milliseconds between the mouse stopping over an element and the appearing of its tooltip.
... type:integer default value:500 exists by default: no application support: gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) status: active; last updated 2012-02-21 introduction: pushed to nightly on 2011-12-15 bugs: bug 204786 values integer (milliseconds, default: 500) the time for delay between the mouse stopping over the element and the tooltip appearing is stored in milliseconds and the default value is 500ms.
NSS 3.12.4 release notes
unnecessary escaping is permitted.
...inside a union, to be matched and not treated as a special character, these characters must be escaped: \ ( | ) [ ~ except when they occur inside a bracketed expression, where only \ and ] require escaping.
NSS API Guidelines
nss makes use of traditional memory allocation functions, wrapping nspr's pr_alloc in a util function called port_alloc.
... list and array returning functions should be available at the higher layers of the api, most wrapping layer_traverse() functions.
Enc Dec MAC Output Public Key as CSR
(-0x2000) #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif #endif /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -s -r -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'g' for generating rsa keypair for wrapping\n\n", "g"); fprintf(stderr, "%-20s specify 'e' for encrypt operation\n\n", "e"); fprintf(stderr, "%-20s specify 'd' for decrypt operation\n\n", "d"); fprintf(stderr, "%-20s specify db directory path\n\n", "-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p "); fprintf(stderr, "%-20s speci...
.../ mackey = generatesymkey(slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* wrap encrypt key */ rv = wrapkey(enckey, pubkey, &wrappedenckey); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* wrap mac key */ rv = wrapkey(mackey, pubkey, &wrappedmackey); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping mac key\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); ...
FC_UnwrapKey
name fc_unwrapkey - unwrap a key syntax ck_rv fc_unwrapkey( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hunwrappingkey, ck_byte_ptr pwrappedkey, ck_ulong uswrappedkeylen, ck_attribute_ptr ptemplate, ck_ulong usattributecount, ck_object_handle_ptr phkey ); parameters hsession [in] session handle.
...hunwrappingkey [in] handle of the ket to use for unwrapping.
FC_WrapKey
name fc_wrapkey - wrap a key syntax ck_rv fc_wrapkey( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hwrappingkey, ck_object_handle hkey, ck_byte_ptr pwrappedkey, ck_ulong_ptr puswrappedkeylen ); parameters hsession [in] session handle.
...hwrappingkey [in] pointer to the public key template.
NSS tools : certutil
--extpm add the policy mappings extension to the certificate.
...nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
sslerr.html
cause the pkcs#11 token is not logged in." sec_error_ocsp_responder_cert_invalid -8036 "the configured ocsp responder's certificate is invalid." sec_error_ocsp_bad_signature -8035 "ocsp response has an invalid signature." sec_error_out_of_search_limits -8034 "certification validation search is out of search limits." sec_error_invalid_policy_mapping -8033 "policy mapping contains any-policy." sec_error_policy_validation_failed -8032 "certificate chain fails policy validation." sec_error_unknown_aia_location_type -8031 "unknown location type in certificate aia extension." sec_error_bad_http_response -8030 "server returned a bad http response." sec_error_bad_ldap_response -8029 ...
...odule returned ckr_device_error, indicating that a problem has occurred with the token or slot." sec_error_bad_info_access_method -8022 "unknown information access method in certificate extension." sec_error_crl_import_failed -8021 "error attempting to import a crl." sec_error_unknown_pkcs11_error -8018 "unknown pkcs #11 error." (unknown error value mapping) ...
certutil
--extpm add the policy mappings extension to the certificate.
...nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
Network Security Services
nss api guidelines explains how the libraries and code are organized, and guidelines for developing code (naming conventions, error handling, thread safety, etc.) nss technical notes links to nss technical notes, which provide latest information about new nss features and supplementary documentation for advanced topics in programming with nss.
... nss tools tools for developing, debugging, and managing applications that use nss.
Rhino Examples
the programs may be specified as files on the command line or by typing interactively while the shell is running.
... primitivewrapfactory primitivewrapfactory.java is an example of a wrapfactory that can be used to control the wrapping behavior of the rhino engine on calls to java methods.
Garbage collection
sweeping todo generational gc todo gc statistics api you can access the light statistics the gc keeps at runtime through the gc statistics api.
... gc/memory.{h,cpp} contains a few functions for mapping and unmapping pages, along with platform-specific implementations.
JSAPI User Guide
similarly, you can create a js::value wrapping a jsobject, double, or jsstring pointer to a js::value using js::objectvalue(jsobject&), js::doublevalue(double), or js::stringvalue(jsstring*).
... keeping objects alive if your jsapi application crashes, it is likely due to a gc-related error.
JS_FileEscapedString
this article covers features introduced in spidermonkey 1.8.5 write string into file with escaping.
... description js_fileescapedstring writes str into file fp escaping any non-printable or non-ascii character.
JS_PutEscapedString
this article covers features introduced in spidermonkey 1.8.5 write a string into buffer with escaping.
... description js_putescapedstring and js_putescapedstring write str into buffer escaping any non-printable or non-ascii character using \escapes for js string literals.
Secure Development Guidelines
the following content will likely see significant revision, though can be used as a reference for security best practices to follow when developing code for mozilla.
...is exploitable (in some browsers) with a simple request such as: http://www.victim.com?something=<script>alert('oops')</script> xss: prevention escape all dynamic input that will be sent back to the user html encoding &amp; → & &lt; → < &gt; → > &quot; → " &apos; → ' url encoding % encoding java/vbscript escaping depends on the context; in a single-quoted string, escaping ' would suffice sql injection occurs when un-trusted input is mixed with a sql string sql is a language used to interact with databases code injection attack that is similar to xss but targeted at sql rather than html and javascript if input is mixed with sql, it could itself become an sql instruction and be used to: ...
Browser security
an important aspect of developing code for any browser, including firefox, as well as any web-oriented project, is its security.
... secure development guidelinesthe following content will likely see significant revision, though can be used as a reference for security best practices to follow when developing code for mozilla.security and the jar protocolthis article discusses security concerns with the jar: protocol, which only firefox has ever implemented for web content.
Animated PNG graphics
MozillaTechAPNG
0 indicates infinite looping.
...conceptually, such scaling occurs while mapping the output buffer onto the canvas.
XUL Accessibility
<label value="it's label for control" control="control" /> <hbox role="grouping" id="control" /> get tooltiptext attribute if the element is anonymous child of the element that is the direct child of toolbaritem element or the element is direct child of toolbaritem element then title attribute of toolbaritem element is used (currently it's used in firefox ui only) if the element has aria role and the role allows to aggregate name from subtree of element then generate name ...
... <description value="it's label for control" control="control" /> <hbox role="grouping" id="control" /> get tooltiptext attribute value if the aria role is used and it allows to have accessible value then aria-valuetext or aria-valuenow are used if the element is xlink then value is generated from link location actions if the element is xlink then jump action is exposed if the element has registered click event handler then click action is exposed xul elements notification u...
Avoiding leaks in JavaScript XPCOM components
j has a pointer to n, so the wrapper wrapping n owns a reference to n as long as j is reachable from a garbage collection root.
... n has a pointer to j, so the wrapper wrapping j exists as long as n doesn't release the pointer, and creates a garbage collection root that roots j.
Using XPCOM Utilities to Make Things Easier
but there are only a few places in that code that are unique to the weblock component, and it was a lot of typing.
...to avoid these kinds of redundancies, to regulate the way generic code is written, and to save typing, xpcom providesgeneric module macros that expand into the module code you've already seen.
Mozilla internal string guide
string(); mtitle = new nsstring(); } ~foo() { delete mlocalname; delete mtitle; } private: // these store utf-8 and utf-16 values respectively nscstring* mlocalname; nsstring* mtitle; }; the above code may appear to save the cost of the string objects, but nsstring/nscstring are small objects - the overhead of the allocation outweighs the few bytes you'd save by keeping a pointer.
... wrapping character buffers nsdependentstring nsdependentcstring wrap const char* / const char16_t* buffers.
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
zip input and output for getting an input stream from a zip archive, see the nsizipreader interface: // file is an nsifile object mapping to a zip archive var zipreader = components.classes["@mozilla.org/libjar/zip-reader;1"] .createinstance(components.interfaces.nsizipreader); zipreader.open(file); var stream = zipreader.getinputstream("/path/to/zipped/file"); // process the stream // when we don't need the zipreader anymore zipreader.close(); for writing from an input stream to a zip archive, see the...
... nsizipwriter interface: // file is an nsifile object mapping to a zip archive var zipwriter = components.classes["@mozilla.org/zipwriter;1"] .createinstance(components.interfaces.nsizipwriter); zipwriter.open(file, ioflags); // stream is the output stream zipwriter.addentrystream("/path/to/zipped/file", modtime, compression, stream, queueforlater); // if queued for later operations, and all operations are queued zipwriter.processqueue(); // when we don't need the zipwriter anymore zipwriter.close(); concatenating input streams var stringstream = components.constructor("@mozilla.org/io/string-input-stream;1", "nsistringinputstream", "setdata"); function buildstream(data) { ...
XPConnect wrappers
this wrapper is responsible for mapping calls from javascript into c++.
... double wrapping.
NS_ConvertASCIItoUTF16
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
NS_ConvertUTF16toUTF8
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - source parameters prun...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
NS_ConvertUTF8toUTF16
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
NS_LossyConvertUTF16toASCII
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - source parameters prun...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsAdoptingCString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - source parameters prun...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsAdoptingString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsAutoString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsCAutoString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - sour...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsCString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - source parameters prun...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsDependentCString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - source parameters prun...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsDependentString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsFixedCString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - source parameters prun...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsFixedString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsPromiseFlatCString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - source parameters prun...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsPromiseFlatString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsXPIDLCString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsastring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsastring_internal& astring void assignwithconversion(const prunichar*, print32) - source parameters prun...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsXPIDLString
@param aeliminateleading controls stripping of leading ws @param aeliminatetrailing controls stripping of trailing ws parameters prbool aeliminateleading prbool aeliminatetrailing assignwithconversion void assignwithconversion(const nsacstring_internal&) - source assign/append/insert with _lossy_ conversion parameters nsacstring_internal& astring void assignwithconversion(const char*, print32) - source parameters char* a...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
imgIContainer
flag_clamp: extend the image to the fill area by clamping image sample coordinates instead of by tiling.
...when aflags includes flag_clamp, the image will be extended to this area by clamping image sample coordinates.
nsIClassInfo
obsolete since gecko 2.0 methods gethelperforlanguage() get a language mapping specific helper object that may assist in using objects of this class in a specific lanaguage.
... nsisupports gethelperforlanguage( in pruint32 language ); parameters language this parameter selects the language mapping specific helper object to be returned.
nsILocalFileMac
setfiletypeandcreatorfromextension() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) sets the file type and creator code from a file extension internet config is used to determine the mapping.
...internet config is used to determine the mapping.
nsIMsgHeaderParser
exceptions thrown missing exception missing description reformatunquotedaddresses() given a string, will make it safe to use by adding missing quote and escaping needed quote wstring reformatunquotedaddresses( in wstring line ); parameters line the header line to parse.
... removealiasestome allows the address parser to use the preference which contains regular expressions which also mean 'me' for the purpose of stripping the user's email address(es) out of addrs string removeduplicateaddresses( in string addrs, in string other_addrs, in prbool removealiasestome ); parameters addrs the addresses to remove duplicates from.
nsINavHistoryContainerResultNode
toolkit/components/places/public/nsinavhistoryservice.idlscriptable a foundation for the interfaces that provide a description of a query result on the places service that describes a container (which is any kind of grouping, including bookmark folders).
...for host and day groupings, doing this has no performance cost since the children have already been computed.
nsISelection2
allowadjacent specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it.
... allowadjacent specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it.
nsITextInputProcessor
however, especially for keeping compatibility with legacy api, you may want to modify only the modifier state of a textinputprocessor instance.
...but the computation doesn't emulate the mapping of native key event handling completely because it has some special cases depending on platform or selected keyboard layout.
nsIWebBrowserPersist
encode_flags_raw 4 output without formatting or wrapping the content.
...parameter is ignored if wrapping is not specified by the encoding flags.
nsIWinTaskbar
this id is used by the taskbar for grouping windows and when associating pinned shortcuts with running instances and jump lists.
...setgroupidforwindow() set the grouping id for a window.
XPCOM reference
xpcom3 to specify static xpcom modules.standard xpcom componentsthere are a number of components provided in the standard implementation of xpcom; these are as follows.xpcom glue classesthese "glue" classes are provided to make it easier to use xpcom from c++ code.xpcom interface referencethis is a reference to the xpcom interfaces provided by the mozilla platform.xpcom interface reference by groupingthis page lists the current (as of dec.
...grouping and category names were made by somewhat arbitrary decision by the author.
Getting Started Guide
this takes a little getting used to on your part, but ends up with less typing, clearer, safer code, and less leaks.
... you can tell nscomptr it doesn't need to addref the new value on assignment by wrapping the new value in dont_addref.
wrappedJSObject
// constructor function helloworld() { }; helloworld.prototype = { hello: function() { return "hello world!"; }, queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.nsisupports) && !aiid.equals(components.interfaces.nsihelloworld)) throw components.results.ns_error_no_interface; return this; } }; xpconnect wrapping now let's get a reference to our component.
... this functionality can be used for quick prototyping, as well as to painlessly pass arbitrary js values to the component (which can be used for sharing complex js data in particular).
XUL Overlays
MozillaTechXULOverlays
if you are developing a mozilla extension, note that the id namespace is shared by all the extensions.
...because an overlay is superimposed on the master document, there are no ambiguities relating to scoping of style sheets or scripts.
Thunderbird extensions
an overview of thunderbird components developer reference docs: folder classes db views (message list) message summary database mailnews protocols mailnews filters error reporting tools steel library (obsolete as of thunderbird 52, use https://github.com/protz/thunderbird-stdlib) developing new account types useful newsgroup discussions (anything that's very old should be regarded suspiciously, because there has been significant api rewrite over the past years making most techniques considerably easier) thunderbird api docs (mostly a collection of out-of-date pages, relevance is rather dubious) general links finding the code for a featur...
...ommunity / communications thunderbird specific : add-ons section on developer.thunderbird.net thunderbird communication channels add-on developers forum/mailing list #maildev irc channel more general : mozillazine extension development forum general developer channels related topics xul, javascript, xpcom, themes, developing mozilla categori ...
Plugins
tutorials and references the articles below are developer information about the developing for click-to-play, and plugin blocking.
... archived information legacy documentation about developing npapi plugins.
Debugging service workers - Firefox Developer Tools
if this is not enough to help you figure out the problem, you could also try going to the javascript debugger and stepping through your code to pinpoint exactly where it is going wrong.
...when pressed, this takes you straight to the javascript debugger view of your service worker code, and you can use the full power of the debugger to debug it — stepping through code, etc.
Set a breakpoint - Firefox Developer Tools
continue to here: when stepping through code, this option tells the debugging to continue execution through to this point.
... inline variable preview new in firefox 71, the source pane now gives you an inline preview of the variables on each line of code you've stepped through: this is a very useful timesaver when stepping through your code.
Use a source map - Firefox Developer Tools
the comment's syntax is like this: //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map in the video above we load https://mdn.github.io/devtools-examples/sourcemaps-in-console/index.html.
...the compiled source contains a comment like this, that points to a source map: //# sourcemappingurl=main.js.map in the debugger's source list pane, the original coffeescript source now appears as "main.coffee", and we can debug it just like any other source.
Edit Shape Paths in CSS - Firefox Developer Tools
a solid line shows the outline of the shape that is wrapping the text.
...once again, clipping will occur if you exceed the bounds of the margin box.
Firefox Developer Tools
memory figure out which objects are keeping memory in use.
... bugs.firefox-dev.tools a tool helping to find bugs to work on.
Animation.playbackRate - Web APIs
examples in the growing/shrinking alice game example, clicking or tapping the bottle causes alice's growing animation (alicechange) to reverse, causing her to shrink: var shrinkalice = function() { alicechange.playbackrate = -1; alicechange.play(); } // on tap or click, alice will shrink.
...stener("mousedown", growalice, false); cake.addeventlistener("touchstart", growalice, false); in another example, the red queen's race game, alice and the red queen are constantly slowing down: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.playbackrate *= .9; } }, 3000); but clicking or tapping on them causes them to speed up by multiplying their playbackrate: var gofaster = function() { redqueen_alice.playbackrate *= 1.1; } document.addeventlistener("click", gofaster); document.addeventlistener("touchstart", gofaster); specifications specification status comment web animationsthe definition of 'animation.playbackrate' in that specification.
AudioBufferSourceNode.loop - Web APIs
syntax var loopingenabled = audiobuffersourcenode.loop; audiobuffersourcenode.loop = true | false; value a boolean which is true if looping is enabled; otherwise, the value is false.
... when looping is enabled, the sound begins playing at the time specified as the start point when start() is called.
BasicCardRequest - Web APIs
hose are: amex cartebancaire diners discover jcb mastercard mir unionpay visa examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object that describes what data is needed to fullfil the payment (e.g., a shipping address).
...{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, selected: true } ] }; var options = {requestshipping: true}; try { var request = new paymentrequest(supportedinstruments, details, options); // add event listeners here.
BasicCardResponse - Web APIs
examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object containing further options.
...a: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, selected: true } ] }; var options = {requestshipping: true}; try { var request = new paymentrequest(supportedinstruments, details, options); // add event listeners here.
DOMMatrixReadOnly - Web APIs
dommatrixreadonly.flipx() returns a new dommatrix created by flipping the source matrix around its x-axis.
... dommatrixreadonly.flipy() returns a new dommatrix created by flipping the source matrix around its y-axis.
GlobalEventHandlers.onkeypress - Web APIs
html <label>enter numbers only: <input> </label> javascript function numbersonly(event) { return event.charcode === 0 || /\d/.test(string.fromcharcode(event.charcode)); } const input = document.queryselector('input'); input.onkeypress = numbersonly; // prevent pasting (since pasted content might include non-number characters) input.onpaste = event => false; result capture the typing of a hidden word the following javascript function will do something after the user types the word "exit" in any point of a page.
...*/ alert("yesss!!!"); location.assign("https://developer.mozilla.org/"); } return true; }; })(); note: a more complete framework for capturing the typing of hidden words is available on github.
GlobalEventHandlers.onpointerdown - Web APIs
var targetbox = document.getelementbyid("target"); targetbox.onpointerdown = handledown; function handledown(evt) { var action; switch(evt.pointertype) { case "mouse": action = "clicking"; break; case "pen": action = "tapping"; break; case "touch": action = "touching"; break; default: action = "interacting with"; break; } targetbox.innerhtml = "<strong>thanks for " + action + " me!</strong>"; evt.preventdefault(); } this simply uses onpointerdown to establish the function handledown() as the event handler for pointer down events.
...try tapping, clicking, or touching the box and see what happens.
The HTML DOM API - Web APIs
dragging and dropping of content on webpages.
... nodes may be strictly organizational, providing a means for grouping other nodes together or for providing a point at which a hierarchy can be constructed; other nodes may represent visible components of a document.
Recommended Drag Types - Web APIs
see dragging and dropping multiple items for more details about this.
...dir.path); var file = cc['@mozilla.org/file/local;1'].createinstance(components.interfaces.nsilocalfile); file.initwithpath(dir.path); file.appendrelativepath(name); console.log("output final path is =" + file.path); // now you can write or copy the file yourself… } } } see also html drag and drop api (overview) drag operations dragging and dropping multiple items html5 living standard: drag and drop ...
Basic concepts - Web APIs
a database connection can have several active transactions associated with it at a time, so long as the writing transactions do not have overlapping scopes.
...as for reading transactions, you can have several of them — even overlapping ones.
Browser storage limits and eviction criteria - Web APIs
here's the actual mapping to directories under a user's firefox profile (other browsers may differ slightly): <profile>/storage — the main top-level directory for storages maintained by the quota manager (see below) <profile>/storage/permanent — persistent data storage repository <profile>/storage/temporary — temporary data storage repository <profile>/storage/default — default data storage repository no...
...once the global limit for temporary storage is reached (more on the limit later), we try to find all currently unused origins (i.e., ones with no tabs/apps open that are keeping open datastores).
Checking when a deadline is due - Web APIs
this is the least avoidable bit of user typing.
...2013, '13, 13?), i decided the best solution was to give them a choice to pick from, which also saves on annoying typing for mobile users.
Timing element visibility with the Intersection Observer API - Web APIs
addeventlistener("visibilitychange", handlevisibilitychange, false); let observeroptions = { root: null, rootmargin: "0px", threshold: [0.0, 0.75] }; adobserver = new intersectionobserver(intersectioncallback, observeroptions); buildcontents(); refreshintervalid = window.setinterval(handlerefreshinterval, 1000); } first, a reference to the content wrapping <main> element is obtained, so we can insert our content into it.
... these are accessed through each ad's htmlelement.dataset attribute, which provides a domstringmap mapping each custom attribute's name to its value.
Keyboard API - Web APIs
keyboard mapping provides an interface for retrieving the string generated by particular physical key on a keyboard to correctly identify that key to a user.
... keyboard api concepts and usage keyboard mapping on physical keyboards, the code attribute contains the physical location of the key that was pressed, and the key attribute contains the string generated by pressing the key at that physical location on the keyboard.
LocalMediaStream - Web APIs
see stopping a video stream in mediastreamtrack to learn how.
...see stopping a video stream in mediastreamtrack to learn how to stop an entire stream.
ParentNode.querySelector() - Web APIs
since javascript also uses backspace escaping, special care must be taken when writing string literals using these characters.
... see escaping special characters for more information.
ParentNode.querySelectorAll() - Web APIs
since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters.
... see escaping special characters for more information.
PaymentResponse.onpayerdetailchange - Web APIs
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, 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.
PaymentResponse: payerdetailchange event - Web APIs
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 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, 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.
RTCRtpTransceiver.stop() - Web APIs
the stop() method in the rtcrtptransceiver interface permanently stops the transceiver by stopping both the associated rtcrtpsender and rtcrtpreceiver.
... note: stopping the transceiver causes a negotiationneeded event to be sent to the transceiver's rtcpeerconnection, so the connection can adapt to the change.
ReadableStream - Web APIs
readablestream.pipethrough() provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
... readablestream.pipeto() pipes the current readablestream to a given writablestream and returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.
Using the Screen Capture API - Web APIs
stopping display capture the stopcapture() method is called when the "stop capture" button is clicked.
... function stopcapture(evt) { let tracks = videoelem.srcobject.gettracks(); tracks.foreach(track => track.stop()); videoelem.srcobject = null; } dumping configuration information for informational purposes, the startcapture() method shown above calls a method named dumpoptions(), which outputs the current track settings as well as the constraints that were placed upon the stream when it was created.
SubtleCrypto - Web APIs
the wrapped key matches the format specified in the given parameters, and wrapping is done by the given wrapping key, using the specified algorithm.
... if the key is sensitive you should use wrapkey(), which exports the key and then encrypts it using another key; the api calls a "key-wrapping key".
WaveShaperNode.WaveShaperNode() - Web APIs
options optional options are as follows: curve: the shaping curve used for the waveshaping effect.
... oversample: specifies what type of oversampling (if any) should be used when applying the shaping curve.
WebGLRenderingContext - Web APIs
viewing and clipping webglrenderingcontext.scissor() defines the scissor box.
... webglrenderingcontext.depthrange() specifies the depth range mapping from normalized device coordinates to window or viewport coordinates.
Raining rectangles - Web APIs
the game loop is responsible for drawing the animation frames, and keeping the animation responsive to user input.
... var diffpos = [ position[0] - rainingrect.position[0], position[1] - rainingrect.position[1] ]; if ( diffpos[0] >= 0 && diffpos[0] < rainingrect.size[0] && diffpos[1] >= 0 && diffpos[1] < rainingrect.size[1] ) { score += 1; scoredisplay.innerhtml = score; rainingrect = new rectangle(); } } function rectangle () { // keeping a reference to the new rectangle object, rather // than using the confusing this keyword.
Taking still photos with WebRTC - Web APIs
initialization we start by wrapping the whole script in an anonymous function to avoid global variables, then setting up various variables we'll be using.
... wrapping up the startup() method there are only two more lines of code in the startup() method: clearphoto(); } this is where we call the clearphoto() method we'll describe below in the section clearing the photo box.
Using WebRTC data channels - Web APIs
this makes it easy to write efficient routines that make sure there's always data ready to send without over-using memory or swamping the channel completely.
...with eor support in place, rtcdatachannel payloads can be much larger (officially up to 256kib, but firefox's implementation caps them at a whopping 1gib).
Fundamentals of WebXR - Web APIs
the overlapping area, which is sort of a shade of purple, is the area in which the viewer has binocular vision and, as a result, depth perception.
...these devices often work by snapping your phone into the headset so that its screen and onboard graphics processor can be used to render and display the xr scene.
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
because getviewerpose() is only available in an xrframe, you will need to begin this process in your rendering callback, possibly using a worker to do the computations in order to reduce frame dropping.
... on the other hand, if your app involves the user physically moving in real space to move around through your virtual world, simply adopting the new tracking position and jumping there can be unsettling to the user, and should be avoided if possible.
Starting up and shutting down a WebXR session - Web APIs
important: you should always test your code on actual ar and/or vr hardware before releasing or shipping a product!
... with the new reference space in hand and stored into the worlddata object for safe-keeping, we call the session's requestanimationframe() method to schedule a callback to be executed when it's time to render the next frame of animation for the webxr session.
Controlling multiple parameters with ConstantSourceNode - Web APIs
see stopping the oscillators below for that code.
... stopping the oscillators stopping the oscillators when the user toggles the play state to pause the tones is as simple as stopping each node.
Example and tutorial: Simple synth keyboard - Web APIs
the range element will typically be presented as a slider control; we configure it to allow any value between 0.0 and 1.0, stepping by 0.01 each position.
... stopping a tone the notereleased() function is the event handler called when the user releases the mouse button or moves the mouse out of the key that's currently playing.
Web Audio API - Web APIs
dynamicscompressornode the dynamicscompressornode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once.
...it is an audionode that use a curve to apply a waveshaping distortion to the signal.
Using the Web Speech API - Web APIs
for this basic demo, we are just keeping things simple.
... browser support support for web speech api speech synthesis is still getting there across mainstream browsers, and is currently limited to the following: firefox desktop and mobile support it in gecko 42+ (windows)/44+, without prefixes, and it can be turned on by flipping the media.webspeech.synth.enabled flag to true in about:config.
XRInputSource - Web APIs
the orientation of this space indicates the angle at which the hand is gripping the object.
...a primary squeeze action should correspond to a gripping act in reality, such as taking hold of an object or pressing a trigger on a tool or weapon.
XRSession - Web APIs
WebAPIXRSession
this includes things such as the near and far clipping planes (distances defining how close and how far away objects can be and still get rendered), as well as field of view information.
...this indicates that the device being squeezed has been released, and may represent dropping a grabbed object, for example.
XSL Transformations in Mozilla FAQ - Web APIs
can i do disable-output-escaping?
...disabling output escaping requires us to add a parsing step to our output generation, which we don't.
Web APIs
WebAPI
below is a list of all the apis and interfaces (object types) that you may be able to use while developing your web app or site.
... blobevent bluetooth bluetoothadvertisingdata bluetoothcharacteristicproperties bluetoothdevice bluetoothremotegattcharacteristic bluetoothremotegattdescriptor bluetoothremotegattserver bluetoothremotegattservice body broadcastchannel budgetservice budgetstate buffersource bytelengthqueuingstrategy bytestring c cdatasection css cssconditionrule csscounterstylerule cssgroupingrule cssimagevalue csskeyframerule csskeyframesrule csskeywordvalue cssmathproduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist cssstyledeclaration cssstylerule cssstylesheet cssstylevalue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssva...
ARIA: button role - Accessibility
aria-expanded if the button controls a grouping of other elements, the aria-expanded state indicates whether the controlled grouping is currently expanded or collapsed.
... if the button has aria-expanded="false" set, the grouping is not currently expanded; if the button has aria-expanded="true" set, it is currently expanded; if the button has aria-expanded="undefined" set or the attribute is ommitted, it is not expandable.
Cognitive accessibility - Accessibility
if you have added content to links for screen readers, and that content is verbose and potentially confusing to sighted readers, consider clipping the added text to visually hide it from those not using assistive technologies.
... be consistent and predictable, and use norms while unlabeled iconography is not the most effective method of conveying information, keeping the use of the icons (and if labeled, their label text) consistent helps people to understand what the icon represents.
HTML To MSAA - Accessibility
this table reflects mapping rules for specific elements only, it doesn't reflect any general rules applicable to all elements.
...le_system_ whitespace '\n' (new line char) state_system_ readonly n/a n/a n/a button role_system_ pushbutton from child nodes n/a state_system_ focusable state_system_ default if @type attribute has value "submit" n/a "press" n/a caption bstr role n/a n/a n/a description_for (0x100f), points to table element div bstr role n/a n/a n/a n/a n/a n/a fieldset role_system_ grouping text equivalent from child legend element n/a n/a labelled_by (1003), points to legend element n/a n/a hr role_system_ separator n/a n/a n/a n/a n/a n/a img, input @type=image role_system_ graphic from @alt attribute, empty @alt attribute means name can't be calculated at all n/a state_system_ animated if image has more than one frame n/a "showlongdesc" if @longdesc attribute is presented...
Text labels and names - Accessibility
use a legend to label a fieldset when grouping a set of form elements together with a <fieldset> element, you should include a nested <legend> element inside it, containing a clear description of the group.
...do not rely on placeholder text, because it disappears as soon as the user starts typing.
:disabled - CSS: Cascading Style Sheets
WebCSS:disabled
/* selects any disabled <input> */ input:disabled { background: #ccc; } syntax :disabled examples this example shows a basic shipping form.
... html <form action="#"> <fieldset id="shipping"> <legend>shipping address</legend> <input type="text" placeholder="name"> <input type="text" placeholder="address"> <input type="text" placeholder="zip code"> </fieldset> <br> <fieldset id="billing"> <legend>billing address</legend> <label for="billing-checkbox">same as shipping address:</label> <input type="checkbox" id="billing-checkbox" checked> <br> <input type="text" placeholder="name" disabled> <input type="text" placeholder="address" disabled> <input type="text" placeholder="zip code" disabled> </fieldset> </form> css input[type="text"]:disabled { background: #ccc; } javascript // wait for t...
Basic concepts of flexbox - CSS: Cascading Style Sheets
to cause wrapping behaviour add the property flex-wrap with a value of wrap.
... find out more about wrapping flex items in the guide mastering wrapping of flex items.
In Flow and Out of Flow - CSS: Cascading Style Sheets
you can see the background colour of the following paragraph running underneath, it is only the line boxes of that paragraph that have been shortened to cause the effect of wrapping content around the float.
... when taking an item out of flow with positioning, you will need to manage the possibility of content overlapping.
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
grid-gap: 10px; } .wrapper div:nth-child(4n+1) { grid-column-end: span 2; grid-row-end: span 2; background-color: #ffa94d; } .wrapper div:nth-child(2) { grid-column: 3; grid-row: 2 / 4; } .wrapper div:nth-child(5) { grid-column: 1 / 3; grid-row: 1 / 3; } filling in the gaps so far, other than items we have specifically placed, grid is always progressing forward and keeping items in dom order.
...definition lists are an interesting challenge to style as they are flat, there is nothing wrapping the groups of dt and dd items.
Basic Concepts of grid layout - CSS: Cascading Style Sheets
control of overlapping content more than one item can be placed into a grid cell or area and, they can partially overlap each other.
... grid-row-start: 1; grid-row-end: 3; } .box2 { grid-column-start: 1; grid-row-start: 2; grid-row-end: 4; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .box { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } the item box2 is now overlapping box1, it displays on top as it comes later in the source order.
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
auto-filling grid tracks we can create a similar effect to flexbox, while still keeping the content arranged in strict rows and columns, by creating our track listing using repeat notation and the auto-fill and auto-fit properties.
...in the flexbox example, the items are larger than the 200 pixel basis before wrapping.
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
the logical properties and values specification defines flow-relative mappings for the various margin, border, and padding properties and their shorthands.
... mappings for margins, borders, and padding the specification details mappings for each logical value to a physical counterpart.
Shapes from box values - CSS: Cascading Style Sheets
this shape follows all of the normal border radius shaping rules for the outside of the border.
...this shape follows all of the normal border radius shaping rules for the inside of the border.
Inline formatting context - CSS: Cascading Style Sheets
in the next example there is a (<span>) element wrapping a set of words wrapping onto two lines.
... the border on the <span> breaks at the wrapping point.
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
universal selector *, ns|*, *|*, |* type selector elementname class selector .classname id selector #idname attribute selector [attr=value] grouping selectors selector list a, b specifies that both a and b elements are selected.
... this is a grouping method to select several matching elements.
<blend-mode> - CSS: Cascading Style Sheets
the effect is like two opaque pieces of paper overlapping.
... the effect is like two images printed on transparent film overlapping.
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
there are mappings for all of the existing values of display; the most common ones are listed in the table below.
... the single values of display are described in the specification as legacy values, and currently you gain no benefit from using the two-value versions, as there is a direct mapping for each two-value version to a legacy version, as demonstrated in the table above.
display - CSS: Cascading Style Sheets
WebCSSdisplay
inline-table the inline-table value does not have a direct mapping in html.
...x of display css flow layout (display: block, display: inline) block and inline layout in normal flow flow layout and overflow flow layout and writing modes formatting contexts explained in flow and out of flow display: flex basic concepts of flexbox aligning items in a flex container controlling ratios of flex items along the main axis cross-browser flexbox mixins mastering wrapping of flex items ordering flex items relationship of flexbox to other layout methods backwards compatibility of flexbox typical use cases of flexbox display: grid basic concepts of grid layout relationship to other layout methods line-based placement grid template areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and ...
line-break - CSS: Cascading Style Sheets
the different wrapping opportunities must not be prioritized.
... formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | loose | normal | strict | anywhere examples setting text wrapping see whether the text is wrapped before "々", "ぁ" and "。".
mask - CSS: Cascading Style Sheets
WebCSSmask
the mask css shorthand property hides an element (partially or fully) by masking or clipping the image at specific points.
...h and height of 50px */ mask: url(masks.svg#star) repeat-x; /* element within svg graphic used as horizontally repeated mask */ mask: url(masks.svg#star) stroke-box; /* element within svg graphic used as mask extending to the box enclosed by the stroke */ mask: url(masks.svg#star) exclude; /* element within svg graphic used as mask and combined with background using non-overlapping parts */ /* global values */ mask: inherit; mask: initial; mask: unset; /* multiple masks */ mask: url(masks.svg#star) left / 16px repeat-y, /* element within svg graphic is used as a mask on the left-hand side with a width of 16px */ url(masks.svg#circle) right / 16px repeat-y; /* element within svg graphic is used as a mask on the right-hand side with a width of 16px */ values <...
Guide to scroll anchoring - CSS: Cascading Style Sheets
scroll anchoring is a browser feature that aims to solve this problem of content jumping, which happens if content loads in after the user has already scrolled to a new part of the document.
...in most cases anchored scrolling is exactly what you want — content jumping is a poor experience for anyone.
scroll-margin-inline-end - CSS: Cascading Style Sheets
the scroll-margin-inline-end property defines the margin of the scroll snap area at the end of the inline dimension that is used for snapping this box to the snapport.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-margin-inline-start - CSS: Cascading Style Sheets
the scroll-margin-inline-start property defines the margin of the scroll snap area at the start of the inline dimension that is used for snapping this box to the snapport.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-margin-inline - CSS: Cascading Style Sheets
description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
scroll-margin - CSS: Cascading Style Sheets
thus, the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport.
...the outer container is styled like this: .scroller { text-align: left; width: 250px; height: 250px; overflow-x: scroll; display: flex; box-sizing: border-box; border: 1px solid #000; scroll-snap-type: x mandatory; } the main parts relevant to the scroll snapping are overflow-x: scroll, which makes sure the contents will scroll and not be hidden, and scroll-snap-type: x mandatory, which dictates that scroll snapping must occur along the horizontal axis, and the scrolling will always come to rest on a snap point.
text-transform - CSS: Cascading Style Sheets
the text-transform property takes into account language-specific case mapping rules such as the following: in turkic languages, like turkish (tr), azerbaijani (az), crimean tatar (crh), volga tatar (tt), and bashkir (ba), there are two kinds of i, with and without the dot, and two case pairings: i/İ and ı/i.
... authors should not expect capitalize to follow language-specific title casing conventions (such as skipping articles in english).
white-space - CSS: Cascading Style Sheets
nowrap collapses white space as for normal, but suppresses line breaks (text wrapping) within the source.
... the following table summarizes the behavior of the various white-space values: new lines spaces and tabs text wrapping end-of-line spaces normal collapse collapse wrap remove nowrap collapse collapse no wrap remove pre preserve preserve no wrap preserve pre-wrap preserve preserve wrap hang pre-line preserve collapse wrap remove break-spaces preserve preserve wrap wrap formal ...
Introduction to Web development - Developer guides
for another (overlapping) set of links to learning resources, see the mdn learning pages.
... common css questions — common questions and answers for beginners intermediate css concepts — grouping, pseudo-classes and more.
User input and controls - Developer guides
finger touch when developing web applications meant to be installed on touchscreen devices, it’s a good practice to take into consideration the different capabilities in terms of screen resolution and user input.
... tutorials touch events guide managing screen orientation using fullscreen mode dragging and dropping multiple items drag operations guide reference mouseevent keyboardevent touch events pointer_lock_api screen orientation api fullscreen api drag & drop content editable ...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
a complete address would look like so: 103 frogmarch street upper-wapping winchelsea tn99 8zz the address levels are: address-level1: the post town — "winchelsea" in this case.
... address-line2: the locality — "upper-wapping" in this case.
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
not allowed annotation annotation pingback gives the address of the pingback server that handles pingbacks to the current document.
... pingback gives the address of the pingback server that handles pingbacks to the current document.
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
avoid skipping heading levels: always start from <h1>, next use <h2> and so on.
... <h1>heading elements</h1> <h2>summary</h2> <p>some text here...</p> <h2>examples</h2> <h3>example 1</h3> <p>some text here...</p> <h3>example 2</h3> <p>some text here...</p> <h2>see also</h2> <p>some text here...</p> here is the result of this code: accessibility concerns navigation a common navigation technique for users of screen reading software is jumping from heading to heading to quickly determine the content of the page.
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
ping a space-separated list of urls.
... when the link is followed, the browser will send post requests with the body ping to the urls.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
you have to set a form owner, either by wrapping it in a <form> or set the attribute form to the id of the form.
... desktop browsers windows 8.1 os x 10.x firefox yes - firefox 30.0 no (even with a tabindex) firefox 63 chrome yes - chrome 35 yes - chrome 65 safari n/a no (even with a tabindex) safari 12 (bug 22261) internet explorer yes - internet explorer 11 n/a presto yes - opera 12 yes - opera 12 does tapping on a <button> give it focus?
<dl>: The Description List element - HTML: Hypertext Markup Language
WebHTMLElementdl
<dl> <dt>name</dt> <dd>godzilla</dd> <dt>born</dt> <dd>1952</dd> <dt>birthplace</dt> <dd>japan</dd> <dt>color</dt> <dd>green</dd> </dl> tip: it can be handy to define a key-value separator in the css, such as: dt::after { content: ": "; } wrapping name-value groups in <div> elements whatwg html allows wrapping each name-value group in a <dl> element in a <div> element.
...because of this, make sure each list item's content is written in such a way that it communicates its relationship to the other list items in the list grouping.
<table>: The Table element - HTML: Hypertext Markup Language
WebHTMLElementtable
mdn adding a caption to your table with <caption> caption & summary • tables • w3c wai web accessibility tutorials scoping rows and columns the scope attribute on header elements is redundant in simple contexts, because scope is inferred.
...in addition to helping people who use assistive technology understand the table's content, this may also benefit people with cognitive concerns who may have difficulty understanding the associations the table layout is describing.
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
<optgroup> the html <optgroup> element creates a grouping of options within a <select> element.
... <nobr> the non-standard, obsolete html <nobr> element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text.
HTTP conditional requests - HTTP
integrity of a partial download partial downloading of files is a functionality of http that allows to resume previous operations, saving bandwidth and time, by keeping the already obtained information: a server supporting partial downloads broadcasts this by sending the accept-ranges header.
...it is then up to the client to deal with the error: either by notifying the user to start again (this time on the newest version), or by showing the user a diff of both versions, helping them decide which changes they wish to keep.
Using HTTP cookies - HTTP
WebHTTPCookies
typically, it's used to tell if two requests came from the same browser — keeping a user logged-in, for example.
... cookies are mainly used for three purposes: session management logins, shopping carts, game scores, or anything else the server should remember personalization user preferences, themes, and other settings tracking recording and analyzing user behavior cookies were once used for general client-side storage.
CSP: connect-src - HTTP
the apis that are restricted are: <a> ping, fetch, xmlhttprequest, websocket, eventsource, and navigator.sendbeacon().
... examples violation cases given this csp header: content-security-policy: connect-src https://example.com/ the following connections are blocked and won't load: <a ping="https://not-example.com"> <script> var xhr = new xmlhttprequest(); xhr.open('get', 'https://not-example.com/'); xhr.send(); var ws = new websocket("https://not-example.com/"); var es = new eventsource("https://not-example.com/"); navigator.sendbeacon("https://not-example.com/", { ...
A re-introduction to JavaScript (JS tutorial) - JavaScript
the first is good for basic looping; the second for loops where you wish to ensure that the body of the loop is executed at least once: while (true) { // an infinite loop!
...in this way, we can pass in any number of arguments into the function while keeping our code minimal.
Grammar and types - JavaScript
escaping characters for characters not listed in the table, a preceding backslash is ignored, but this usage is deprecated and should be avoided.
...this is known as escaping the quotation mark.
SyntaxError: missing ; before statement - JavaScript
however, oftentimes, this error is only a consequence of another error, like not escaping strings properly, or using var wrongly.
... examples unescaped strings this error can occur easily when not escaping strings properly and the javascript engine is expecting the end of your string already.
Intl.Locale.prototype.hourCycle - JavaScript
the intl.locale.prototype.hourcycle property is an accessor property that returns the time keeping format convention used by the locale.
... description there are 2 main types of time keeping conventions (clocks) used around the world: the 12 hour clock and the 24 hour clock.
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
usegrouping the values provided for these properties in the options argument or filled in as defaults.
...ns = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.numberingsystem; // "latn" usedoptions.notation; // "standard" usedoptions.signdisplay; // "auto" usedoption.style; // "decimal" usedoptions.minimumintegerdigits; // 1 usedoptions.minimumfractiondigits; // 0 usedoptions.maximumfractiondigits; // 3 usedoptions.usegrouping; // true specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.numberformat.prototype.resolvedoptions' in that specification.
TypedArray.prototype.map() - JavaScript
examples mapping a typed array to a typed array of square roots the following code takes a typed array and creates a new typed array containing the square roots of the numbers in the first typed array.
... const numbers = new uint8array([1, 4, 9]); const roots = numbers.map(math.sqrt); // roots is now: uint8array [1, 2, 3], // numbers is still uint8array [1, 4, 9] mapping a typed array of numbers using a function containing an argument the following code shows how map works when a function requiring one argument is used with it.
eval() - JavaScript
"a.b.c" eval( 'var result = obj.' + proppath ); avoiding eval() here could be done by splitting the property path and looping through the different properties: function getdescendantprop(obj, desc) { var arr = desc.split('.'); while (arr.length) { obj = obj[arr.shift()]; } return obj; } var obj = {a: {b: {c: 0}}}; var proppath = getproppath(); // returns e.g.
... pass data instead of code for example, an extension designed to scrape contents of web-pages could have the scraping rules defined in xpath instead of javascript code.
Destructuring assignment - JavaScript
let a, b; [a=5, b=7] = [1]; console.log(a); // 1 console.log(b); // 7 swapping variables two variables values can be swapped in one destructuring expression.
... without destructuring assignment, swapping two values requires a temporary variable (or, in some low-level languages, the xor-swap trick).
block - JavaScript
examples block scoping rules with var or function declaration in non-strict mode variables declared with var or created by function declarations in non-strict mode do not have block scope.
... block scoping rules with let, const or function declaration in strict mode by contrast, identifiers declared with let and const do have block scope: let x = 1; { let x = 2; } console.log(x); // logs 1 the x = 2 is limited in scope to the block in which it was defined.
let - JavaScript
examples scoping rules variables declared by let have their scope in the block for which they are defined, as well as in any contained sub-blocks.
...ply undeclared variables and variables that hold a value of undefined, using the typeof operator to check for the type of a variable in that variable's temporal dead zone will throw a referenceerror: // prints out 'undefined' console.log(typeof undeclaredvariable); // results in a 'referenceerror' console.log(typeof i); let i = 10; another example of temporal dead zone combined with lexical scoping due to lexical scoping, the identifier foo inside the expression (foo + 55) evaluates to the if block's foo, and not the overlying variable foo with the value of 33.
Autoplay guide for media and Web Audio APIs - Web media technologies
autoplay availability as a general rule, you can assume that media will be allowed to autoplay only if at least one of the following is true: the audio is muted or its volume is set to 0 the user has interacted with the site (by clicking, tapping, pressing keys, etc.) if the site has been whitelisted; this may happen either automatically if the browser determines that the user engages with media frequently, or manually through preferences or other user interface features if the autoplay feature policy is used to grant autoplay support to an <iframe> and its document.
... autoplay of media elements now that we've covered what autoplay is and what can prevent autoplay from being allowed, we'll look at how your web site or app can automatically play media upon page load, how to detect when autoplay fails to occur, and tips for coping when autoplay is denied by the browser.
Image file type and format guide - Web media technologies
png (portable network graphics) the png (pronounced "ping") image format uses lossless or lossy compression to provide more efficient compression, and supports higher color depths than gif, as well as full alpha transparency support.
...looping is supported.
Web Performance
resource timing api resource loading and timing the loading of those resources, including managing the resource buffer and coping with cors the performance timeline the performance timeline standard defines extensions to the performance interface to support client-side latency measurements within applications.
... web performance checklist a performance checklist of features to consider when developing applications with links to tutorials on how to implement each feature, include service workers, diagnosing performance problems, font loading best practices, client hints, creating performant animations, etc.
Privacy, permissions, and information security
privacy and security controls there are multiple layers of controls for helping to protect users against security and privacy breaches.
... keeping personal data safe managing site permissions bringing it all together <using feature policy with permissions and so forth; how to use them together, how they interact, etc> permission requests in <iframe> elements things can get tricky when your web app uses the <iframe> element to embed content from another site inside your own, especially if the document you load into the frame has its own...
How to make PWAs installable - Progressive web apps (PWAs)
these technologies allow the app to be launched directly from the device's home screen, rather than the user having to open the browser and then navigate to the site by using a bookmark or typing the url.
...if developing your app using firefox, be aware that you will need a service worker to be compatible with chromium-based browsers.
Introduction to progressive web apps - Progressive web apps (PWAs)
you can install a native app so that it works offline, and users love tapping their icons to easily access their favorite apps, rather than navigating to it using a browser.
... safety the web platform provides a secure delivery mechanism that prevents snooping while simultaneously ensuring that content hasn’t been tampered with, as long as you take advantage of https and develop your apps with security in mind.
Mobile first - Progressive web apps (PWAs)
therefore we should try to simplify things on mobile, keeping each view cut down to a single, simple purpose where possible, and reducing the amount of typing users are expected to do.
... mobile navigation when developing mobile app layouts, you often run into problems with navigation menus.
clip-rule - SVG: Scalable Vector Graphics
the following fragment of code will cause an evenodd clipping rule to be applied to the clipping path because clip-rule is specified on the <path> element that defines the clipping shape: <g> <clippath id="myclip"> <path d="..." clip-rule="evenodd" /> </clippath> <rect clip-path="url(#myclip)" ...
... /> </g> whereas the following fragment of code will not cause an evenodd clipping rule to be applied because the clip-rule is specified on the referencing element, not on the object defining the clipping shape: <g> <clippath id="myclip"> <path d="..." /> </clippath> <rect clip-path="url(#myclip)" clip-rule="evenodd" ...
clipPathUnits - SVG: Scalable Vector Graphics
value userspaceonuse | objectboundingbox default value userspaceonuse animatable yes userspaceonuse this value indicates that all coordinates inside the <clippath> element refer to the user coordinate system as defined when the clipping path was created.
... objectboundingbox this value indicates that all coordinates inside the <clippath> element are relative to the bounding box of the element the clipping path is applied to.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
aving systemlanguage attribute according to allowreorder 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 / ...
...mplemented (bug 1238882) <meshrow> (renamed meshrow) not implemented (bug 1238882) <meshpatch> (renamed meshpatch) not implemented (bug 1238882) <hatch> not implemented (bug 1239147) <hatchpath> (renamed hatchpath) not implemented (bug 1239147) display behavior of paint server elements defined by ua style sheet not implemented clipping, masking, and compositing change notes overflow respected on outermost <svg> elements inline in html implementation status unknown interactivity change notes tabindex attribute implemented (bug 778654) bounding-box on pointer-events not implemented (bug 945187) load, abort, error, and unload instead of svgload, ...
SVG Tutorial - SVG: Scalable Vector Graphics
WebSVGTutorial
if you're able, please help out by chipping in and writing a paragraph or two.
... introducing svg from scratch introduction getting started positions basic shapes paths fills and strokes gradients patterns texts basic transformations clipping and masking other content in svg filter effects svg fonts svg image tag tools for svg svg and css the following topics are more advanced and hence should get their own tutorials.
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
syntax <xsl:decimal-format name=name decimal-separator=character grouping-separator=character infinity=string minus-sign=character nan=string percent=character per-mille=charater zero-digit=character digit=character pattern-separator=character /> required attributes none.
... grouping-separator specifies the thousands separator character.
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtext
syntax <xsl:text disable-output-escaping="yes" | "no"> text </xsl:text> required attributes none.
... optional attributes disable-output-escaping (netscape does not serialize the result of transformation - the "output" below - so this attribute is essentially irrelevant in context.
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvalue-of
syntax <xsl:value-of select=expression disable-output-escaping="yes" | "no" /> required attributes select specifies the xpath expression to be evaluated and written to the output tree.
... optional attributes disable-output-escaping (netscape does not serialize the result of transformation - the "output" below - so this attribute is essentially irrelevant in context.
Modules - Archive of obsolete content
the module system used by the sdk is based on the commonjs specification: it is implemented using a loader object, which handles all the bookkeeping related to module loading, such as resolving and caching urls.
Private Properties - Archive of obsolete content
keeping the namespace hidden from all functions, except members of point, effectively implements private properties.
Module structure of the SDK - Archive of obsolete content
except for scripts that interact directly with web content, all the javascript code you'll write or use when developing add-ons using the sdk is part of a commonjs module, including: sdk modules: the javascript modules which the sdk provides, such as panel and page-mod.
page-mod - Archive of obsolete content
mapping workers to tabs the worker has a tab property which returns the tab associated with this worker.
simple-prefs - Archive of obsolete content
to provide this mapping the boolint requires two mandatory attributes called "on" and "off", both of which are supplied as strings.
io/file - Archive of obsolete content
read more about escaping characters in strings.
lang/functional - Archive of obsolete content
this could be useful, for example, if we are checking the user's keyboard input, and want to wait until they've paused in their typing before we do so.
system/xul-app - Archive of obsolete content
ids a mapping of application names to their ids.
cfx to jpm - Archive of obsolete content
permanently removed fields data fullname - use title instead lib packages tests icon64 package.json escaping where with cfx you might have had to escape with 2 upto 3 backslashes ( \ ), jpm only needs one now.
console - Archive of obsolete content
if you're developing your add-on using the extension auto-installer, then the add-on is installed in firefox, meaning that messages will appear in the browser console.
Display a Popup - Archive of obsolete content
// // set the focus to the text area so the user can // just start typing.
Getting Started (jpm) - Archive of obsolete content
summary in this tutorial we've built and packaged an add-on using three commands: jpm init to initialize an empty add-on template jpm run to run a new instance of firefox with the add-on installed, so we can try it out jpm xpi to package the add-on into an xpi file for distribution these are the three main commands you'll use when developing sdk add-ons.
Listening for Load and Unload - Archive of obsolete content
you can just place your add-on's code at the top level instead of wrapping it in a function assigned to exports.main().
Modifying Web Pages Based on URL - Archive of obsolete content
keeping the content script in a separate file in the example above, we've supplied content script as a string.
Modifying the Page Hosted by a Tab - Archive of obsolete content
you should see a red border appear around the page, like this: keeping content scripts in a separate file in the example above, we've passed in content script as a string.
Localization - Archive of obsolete content
english has two forms, which can be described by mapping "1" to "one" and "everything else" to "other": one → n is 1; other → everything else russian uses four forms, that can be described as follows: one → n mod 10 is 1 and n mod 100 is not 11; few → n mod 10 in 2..4 and n mod 100 not in 12..14; many → n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14; other → everything else plural rules for all languages can be found ...
Tutorials - Archive of obsolete content
getting started installation how to install the jpm tool, which you will use for developing add-ons.
Forms related code snippets - Archive of obsolete content
autogrowing <textarea> this example shows how to make a textarea really autogrowing during a typing.
Examples and demos from articles - Archive of obsolete content
autogrowing <textarea> this example shows how to make a textarea really autogrowing during a typing.
HTML in XUL for rich tooltips - Archive of obsolete content
he mouse is over (which will soon launch the tooltip) var txt = event.target.getattribute("tooltiphtml"); // get the html div element that is inside the custom xul tooltip var div = document.getelementbyid("myhtmltipdiv"); //clear the html div element of any prior shown custom html while(div.firstchild) div.removechild(div.firstchild); //safely convert html string to a simple dom object, stripping it of javascript and more complex tags var injecthtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(txt, false, null, div); //attach the dom object to the html div element div.appendchild(injecthtml); } } window.addeventlistener('load', htmltip.onload, false); in the xul overlay, xmlns:html is used to ena...
Preferences - Archive of obsolete content
er.register(); and next, here is a more evolved version of the previous code better fit for code reuse both within a project and across projects (for example, using javascript code modules): /** * @constructor * * @param {string} branch_name * @param {function} callback must have the following arguments: * branch, pref_leaf_name */ function preflistener(branch_name, callback) { // keeping a reference to the observed preference branch or it will get // garbage collected.
Progress Listeners - Archive of obsolete content
using the following code, you will get notified when user navigates to another page (by clicking a link, using the back/forward button, by typing an address in the location bar, etc.) and also when user switches tabs.
getAttributeNS - Archive of obsolete content
return thisitem.getattribute('xml:'+nsatt); // prefix must be 'xml' per the specs } var attrs2, result; var attrs = thisitem.attributes; var prefixatt = new regexp('^(.*):'+nsatt.replace(/\./g, '\\.')+'$'); // e.g., xlink:href // find any prefixes with the local-name being searched (escape period since only character (besides colon) allowed in an xml name which needs escaping) for (var j = 0; j < attrs.length; j++) { // thisitem's atts // e.g., abc:href, xlink:href while (((result = prefixatt.exec(attrs[j].nodename)) !== null) && thisitem.nodename !== '#document' && thisitem.nodename !== '#document-fragment') { var xmlnsprefix = new regexp('^xmlns:'+result[1]+'$'); // e.g., xmnls:xl, xmlns:xlink // check higher ...
Communication between HTML and your extension - Archive of obsolete content
with a lot of help from irc://irc.mozilla.org#js and irc://irc.mozilla.org#extdev i was able to get it running pretty well, but i still would rather have the client less responsible for pinging the extension to "look" for what is on the page.
Default Preferences - Archive of obsolete content
mozilla provides a simple way of shipping default settings by allowing default preferences.
Installing Extensions and Themes From Web Pages - Archive of obsolete content
(* by all means don't let this stop you from developing more ambitious install systems, i am providing this documentation only as a guide that i hope most extension distributors will use since it handles most cases well) ...
Jetpack Processes - Archive of obsolete content
this is useful for associating handles to the lifetime of a particular window, context menu, or other element, and helping ensure that they do not leak.
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
the nsmsgutils.h header for developing core mail/news code, the nsmsgutils.h header is being enhanced to fill in some of the gaps caused by the differences between the internal and external apis.
Chapter 1: Introduction to Extensions - Archive of obsolete content
this lowers the threshold both to using and to developing extensions; that fact, combined with firefox's rapidly growing popularity, has created a positive feedback loop, with the number of extension users and extension developers growing explosively—there are now more than 7000 extensions and themes published at the firefox add-ons site (https://addons.mozilla.org).
Firefox addons developer guide - Archive of obsolete content
next » introduction to extensions technologies used in developing extensions introduction to xul—how to build a more intuitive ui using xpcom—implementing advanced processes let's build a firefox extension firefox extensions and xul applications license and authors next » ...
Adding Events and Commands - Archive of obsolete content
broadcasters keeping a consistent ui is another important aspect of extension behavior.
Adding menus and submenus - Archive of obsolete content
the separator is usually displayed as a horizontal line that creates a logical division between different types of menuitem elements, keeping everything more organized.
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
another argument in favor of keeping that data is that firefox doesn't delete its profile folders after it is uninstalled, so it would be consistent to keep it.
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
alternative: replace + function.apply() you may replace the original function with a new function, keeping a reference to the original function which you then call from the new one.
Appendix F: Monitoring DOM changes - Archive of obsolete content
monkey patching in many instances, especially when dealing with chrome code, the best way to modify actions which result in dom mutations is by wrapping the functions that trigger those changes.
Connecting to Remote Content - Archive of obsolete content
you would of course need to be very careful about escaping characters and protecting yourself against sql injection attacks.
Custom XUL Elements with XBL - Archive of obsolete content
you do need to be careful about keeping all anonid attributes consistent, and even some dom structure if the code does node traversal.
Handling Preferences - Archive of obsolete content
the preferences system provides a simple, unified storage facility for name / value mappings.
Setting Up a Development Environment - Archive of obsolete content
building idl files some extensions require developing xpcom components to add certain advanced functions.
The Essentials of an Extension - Archive of obsolete content
you can access any chrome file by just typing its uri in the location bar.
Useful Mozilla Community Sites - Archive of obsolete content
it's a very powerful tool you have when developing on top of the mozilla platform, and you should take advantage of it in order to create a truly successful add-on .
Supporting search suggestions in search plugins - Archive of obsolete content
your completion list can include as many suggestions as you like, although it should be kept manageable, given that the display will be updating live while the user is typing their search string.
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
we were hoping to go all the way with the xhtml conversion, but our ad units and some other third-party content prevent us from doing so.
Creating reusable content with CSS and XBL - Archive of obsolete content
challenges change the xbl file so that the square doubles in width when it changes color, instead of jumping to the right.
List of Former Mozilla-Based Applications - Archive of obsolete content
old article available about how borland embedded mozilla in kylix 2 mango im client last news item on site from january 2007 mobidvd dvd/vcd/cd ripping software site down mozilla suite internet application suite development shifted to firefox, thunderbird and seamonkey applications netscape navigator browser support for netscape ended on february 1, 2008 nvu web authoring tool development stopped in 2005 and is being continued as an unofficial bugfix release by the kompozer project pogo ...
Localizing an extension - Archive of obsolete content
the stockwatcher2.dtd file contains the mappings for the stockwatcher2.xul file: <!entity panel_loading "loading..."> <!entity menu_refresh_now.label "refresh now"> <!entity menu_apple.label "apple (aapl)"> <!entity menu_google.label "google (goog)"> <!entity menu_microsoft.label "microsoft (msft)"> <!entity menu_yahoo.label "yahoo (yhoo)"> update the xul files each xul file needs to reference its corresponding locale file.
Images, Tables, and Mysterious Gaps - Archive of obsolete content
instead of "shrinkwrapping" the image itself, the browser is now wrapping around the line in which the image sits.
Source Navigator - Archive of obsolete content
source navigator then loads the database and then display the following symbols window: searching a method by typing in the method name viewing the definition/declaration by highlighting the method in the code ...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
if you need scripting functionality, consider shipping a modified pluginhostctrl.dll that exposes methods you wish to call on your plugin.
Protecting Mozilla's registry.dat file - Archive of obsolete content
in other windows versions, internet explorer (which is hard to kick off completely) likes to install "personnalized settings" when the user logs in for the first time, and this seems to have the interesting "side-effect" of wiping any non-microsoft subfolders from %userprofile%\application data, including mozilla's .
Bookmark Keywords - Archive of obsolete content
under ordinary circumstances, this might be used to reduce typing of a common url: http://www.cnn.com/ could be given the keyword cnn.
Creating a Firefox sidebar extension - Archive of obsolete content
chrome.manifest content emptysidebar chrome/content/ locale emptysidebar en-us chrome/locale/ skin emptysidebar classic/1.0 chrome/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxoverlay.xul test while you're developing your sidebar, you will need to test it frequently from firefox.
In-Depth - Archive of obsolete content
it uses a rect() object to determine the clipping region.
Dehydra Function Reference - Archive of obsolete content
builtin functions the following functions are provided by dehydra and may be called by the user: print(msg) print a string to stdout (or stderr if the compiler is piping output).
Drag and Drop JavaScript Wrapper - Archive of obsolete content
the getsupportedflavours function should return a list of flavours that the element being dragged over can accept for dropping.
Downloading Nightly or Trunk Builds - Archive of obsolete content
if one has questions about the way a particular nightly was built, the best way to get that information is to download the executable, launch it, and then go to the "about:buildconfig" page, by typing this into the location bar.
Layout FAQ - Archive of obsolete content
this function converts an nsastring to an nsacstring by assuming that all the 16-bit units are ascii and just dropping the high byte on them all.
Code snippets - Archive of obsolete content
components.utils.import("resource://services-sync/main.js"); weave.service._freshstart(); // if you want to do it without wiping the server (which will cause corruption!): weave.service.generatenewsymmetrickeys(); print out a list of large bookmark records // change '1000' as appropriate.
Firefox Sync - Archive of obsolete content
related info javascript client api (useful for interacting with sync from mozilla applications, including developing extensions against sync) syncing custom preferences (useful for extension developers) code snippets (demonstrates common actions with the javascript api) ...
GRE - Archive of obsolete content
xulrunner: the new gre xulrunner is the new version of the gre, which not only allows embedding but is capable of bootstrapping entire xul applications such as firefox.
Creating a Help Content Pack - Archive of obsolete content
you don't actually need this attribute if you don't want it, but it's a useful shorthand to save typing.
Makefile.mozextension.2 - Archive of obsolete content
keeping it anyway..
Monitoring downloads - Archive of obsolete content
setting up when the extension loads, it will do some housekeeping chores.
Mozilla Application Framework in Detail - Archive of obsolete content
this will dramatically reduce the cost and complexity of developing and distributing rich web applications and full-functionality browsing devices that run them.
Mozilla Crypto FAQ - Archive of obsolete content
export control of encryption software: privacy on the line: the politics of wiretapping and encryption, by whitfield diffie and susan landau.
BundleLibrary - Archive of obsolete content
aol email : aolemail.webapp bbc radio player bbcradioplayer.webapp bloglines : bloglines.webapp bloglines beta: beta.bloglines.webapp chandler: chandler.webapp flash earth (integrates all major mapping sites) flashearth.webapp flickr: flickr.webapp gollum wikipedia browser in english:gollum_en.webapp google notebook: gnote.webapp google page creator: google_pagecreator.webapp google reader + gtalk : prism-bundle-google-reader-with-gtalk.webapp google webmaster tools: google_webmastertools.webapp grandcentral inbox: grandc.webapp (note: grandcentral requires the flash plugin.
Extensions - Archive of obsolete content
then install the extension by either dragging and dropping the extension onto the dialog, or by clicking the “install…” button, navigating to the extension and selecting it for installation.
New Skin Notes - Archive of obsolete content
--nickolay 04:43, 25 aug 2005 (pdt) the radio buttons on history page are jumping in a weird way because the selected row becomes bold.
RDF Datasource How-To - Archive of obsolete content
mapping your data to nodes and arcs [write me!] implementing the nsirdfdatasource interface your first chore will be to implement the nsirdfdatasource interface.
Frequently Asked Questions - Archive of obsolete content
it's also useful to know that you can check whether mozilla has recognised your plug-ins by typing 'about:plugins' into your address bar (linking to that doesn't work for security reasons).
Space Manager High Level Design - Archive of obsolete content
the space manager is responsible for keeping track of where space is taken up and where it is available.
Table Layout Strategy - Archive of obsolete content
so we specify it (this breaks in some other browsers) <col width="0*"><col><tbody></tbody>foobar <table border width="200px"> <col width="0*"><col> <tbody> <tr><td>foo</td><td>bar</td></tr> </tbody> </table> this shrink wrapping width has usually the suffix 0proportional effective columns <tbody></tbody>foobarbazzap <table width="200px" border> <tbody> <tr><td>foo</td><td colspan="2" width="120px">bar</td></tr> <tr><td>baz</td><td>zap</td></tr> </tbody> </table> the colspan here is bogus, so the third column should not get any width.
Tamarin build documentation - Archive of obsolete content
a prototype self-hosting ecmascript edition 4 compiler, esc, is provided with tamarin but it is not yet capable of bootstrapping itself or building applications.
Treehydra Manual - Archive of obsolete content
in other words, a mapping from program variables to concrete values.
Tuning Pageload - Archive of obsolete content
as in, if the user is moving the mouse or typing in that window, we'll be more responsive; if there is no user activity, we will aim for less parser interruption and less responsiveness but lower overall load time.
Venkman - Archive of obsolete content
related topics javascript, web development, developing mozilla original document information author(s): robert ginda other contributors: doctor unclear last updated date: july 13, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
XBL 1.0 Reference - Archive of obsolete content
implementation constructor destructor field property getter setter method parameter body handlers handler resources stylesheet image binding attachment and detachment attachment using css attachment using element.style property <constructor> call <destructor> call binding documents dom interfaces the nsidomdocumentxbl interface anonymous content introduction scoping and access using the dom content generation rules for generation attribute forwarding insertion points <children> handling dom changes event flow and targeting flow and targeting across scopes focus and blur events mouseover and mouseout events anonymous content and css selectors and scopes binding stylesheets binding implementations ...
XBL - Archive of obsolete content
still living "shadow dom" related specs shadow dom (editor's draft) css scoping » shadow encapsulation see also introduction to xbl from the xul tutorial.
addFile - Archive of obsolete content
some file transfer programs will convert apple binaries to this format on transfer if you transfer them from a macintosh to a unix/windows machine before zipping up those files on that target system.
crop - Archive of obsolete content
ArchiveMozillaXULAttributecrop
if the box direction is reversed, the cropping is reversed.
disableKeyNavigation - Archive of obsolete content
this is done incrementally, so typing more letters with select more specific items.
disableglobalhistory - Archive of obsolete content
« xul reference home disableglobalhistory type: boolean disables global history for the docshell attached to the browser while keeping session history active.
editable - Archive of obsolete content
« xul reference home editable type: boolean indicates that the value of the menulist can be modified by typing directly into the value field.
fixed - Archive of obsolete content
any splitter to either side will resize those columns while keeping the fixed column at a constant size.
newlines - Archive of obsolete content
possible values: pasteintact paste newlines unchanged pastetofirst paste text up to the first newline, dropping the rest of the text replacewithcommas pastes the text with the newlines replaced with commas replacewithspaces pastes the text with newlines replaced with spaces strip pastes the text with the newlines removed stripsurroundingwhitespace pastes the text with newlines and adjacent whitespace removed ...
popupanchor - Archive of obsolete content
anchor to the bottom right cornersyntax<element popupanchor="none | topleft | topright | bottomleft | bottomright" /> example<element id="edit-context" popup="editor-popup" popupanchor="topleft" popupalign="bottomright" /> notesthe popupanchor attribute can be used to specify that the popup content should come up anchored to one of the four corners of the content object (e.g., the button popping up the content).
showcaret - Archive of obsolete content
« xul reference home showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
statustext - Archive of obsolete content
example <!-- sets the status message when mouse is over buttons --> <button label="connect" statustext="connect to remote server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <button label="ping" statustext="ping the server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <statusbar> <statusbarpanel id="mystatuspanel" label="" flex="1"/> <spacer flex="1"/> </statusbar> <script> function setstatusmessage(obj){ document.getelementbyid('mystatuspanel').label = obj.getattribute('statustext'); } function clearstatusmessage(obj){ document.getelementbyid...
userAction - Archive of obsolete content
typing the user is typing into the textbox.
validate - Archive of obsolete content
this would be useful if the images are stored remotely or you plan on swapping the image frequently.
MenuItems - Archive of obsolete content
if (gundobuffertype == "typing") menuitem.label = "undo typing"; else if (gundobuffertype == "paste") menuitem.label = "undo paste"; else menuitem.label = "undo"; see modifying a menu for examples of how to add and remove items from a menu ...
PopupKeys - Archive of obsolete content
the following table lists the keys that are checked, and what the menu keyboard listener does in response: cursor up/down move the highlight within the menu up or down, wrapping around if necessary.
Providing Command-Line Options - Archive of obsolete content
ehandler.idl // specifically, flag descriptions should start at // character 24, and lines should be wrapped at // 72 characters with embedded newlines, // and finally, the string should end with a newline helpinfo : " -myapp open my application\n" + " -viewapp <uri> view and edit the uri in my application,\n" + " wrapping this description\n" }; var nsgetfactory = xpcomutils.generatensgetfactory([commandlinehandler]); ...
Sorting and filtering a custom tree view - Archive of obsolete content
this way, we don't have to deal with //mapping between the two data.push({name: "leonardo", description: "leader", weapon: "dual katanas"}); data.push({name: "michaelangelo", description: "party dude", weapon: "nunchaku"}); data.push({name: "donatello", description: "does machines", weapon: "bo"}); data.push({name: "raphael", description: "cool, but rude", weapon: "sai"}); data.push({name: "splinter", description: "rat", weapon: "wa...
Multiple Queries - Archive of obsolete content
there's no performance benefit, but it does save some typing.
Template Logging - Archive of obsolete content
this error is often caused by typing errors.
Template and Tree Listeners - Archive of obsolete content
or, we might want to allow dropping on specific rows only; the drop methods are supplied with an index argument so we can check for this.
textbox (Toolkit autocomplete) - Archive of obsolete content
this is done incrementally, so typing more letters with select more specific items.
Textbox (XPFE autocomplete) - Archive of obsolete content
typing the user is typing into the textbox.
Toolbars - Archive of obsolete content
related topics xul, themes, developing mozilla ...
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
this could be useful when trapping the focus and blur events.
Adding HTML Elements - Archive of obsolete content
is an example as it might be added to the find file window: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> then, you can use html tags as you would normally, keeping in mind the following: you must add a html: prefix to the beginning of each tag, assuming you declared the html namespace as above.
Adding Labels and Images - Archive of obsolete content
later, we'll find out how to constrain the width of elements so that we can see the wrapping more easily.
Content Panels - Archive of obsolete content
a back button, a forward button and a field for typing is urls has been added to the only toolbar (we'll learn about toolbar in a later section).
Document Object Model - Archive of obsolete content
it isn't any more efficient, but it does mean slightly less typing.
Focus and Selection - Archive of obsolete content
the command dispatcher is responsible for keeping track of the focused element as the user uses the interface.
Manifest Files - Archive of obsolete content
now, all you need to do is add some xul files into that new directory, and you will be able to load them by typing in a chrome url of the form chrome://tests/content/<filename>.
Stacks and Decks - Archive of obsolete content
« previousnext » there may be need to display elements as a set of overlapping cards.
The Chrome URL - Archive of obsolete content
the mapping between chrome urls and jar files are specified in the manifest files stored in the chrome directory.
Tree View Details - Archive of obsolete content
this is a fairly tricky process as it involves keeping track of which items have children and also which rows are open and closed.
Using Spacers - Archive of obsolete content
adding spacers one of the problems with developing user interfaces is that each user has a different display.
XBL Example - Archive of obsolete content
because we want page flipping, a deck element would be the most suitable to hold the page content.
XUL Reference - Archive of obsolete content
treecol treecols treeitem treerow treeseparator triple vbox where window wizard wizardpage categorical list of all xul elements « xul reference « windows window wizard wizardpage titlebar window structure --- menus and popups --- toolbars toolbar toolbarbutton toolbargrippy toolbaritem toolbarpallete toolbarseperator toolbarspring tabs and grouping tab tabbox tabpanel tabpanels tabs controls --- text and images label caption image lists --- trees --- layout --- templates --- scripting --- helper elements other xul lists dialog overlay page window wizard wizardpage preference preferences prefpane prefwindow browser tabbrowser editor iframe titlebar resizer s...
XUL accessibility guidelines - Archive of obsolete content
users who are used to navigating form fields themselves often end up repeating the jump operation and thereby skipping ahead one form field.
The Implementation of the Application Object Model - Archive of obsolete content
by keeping the dom tree in a sandbox (safely insulated from the containing aom tree in which it might occur), you have an easy means of distinguishing the two trees and preventing scripts in the dom tree from manipulating the aom tree.
XML - Archive of obsolete content
any familiarity you already have with xml will help you quickly get up to speed developing with xul.
XUL controls - Archive of obsolete content
the command event is fired after the user stops typing, or if the user tabs away or hits enter.
button - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
caption - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
checkbox - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
description - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
dialogheader - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
hbox - Archive of obsolete content
ArchiveMozillaXULhbox
example <!-- two button on the right --> <hbox> <spacer flex="1"/> <button label="connect"/> <button label="ping"/> </hbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup...
iframe - Archive of obsolete content
f.net" /> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> <iframe id="myframe" flex="1"/> <script> function donav(obj) { var url = obj.selecteditem.value; // note the firstchild is the menupopup element document.getelementbyid('myframe').setattribute('src', url); } </script> attributes showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
image - Archive of obsolete content
ArchiveMozillaXULimage
this would be useful if the images are stored remotely or you plan on swapping the image frequently.
listbox - Archive of obsolete content
this is done incrementally, so typing more letters with select more specific items.
listcell - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
listitem - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
menu - Archive of obsolete content
ArchiveMozillaXULmenu
if the box direction is reversed, the cropping is reversed.
menuseparator - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
promptBox - Archive of obsolete content
note: this is largely an implementation detail; if you're developing an add-on, you shouldn't need to tinker with this.
radio - Archive of obsolete content
ArchiveMozillaXULradio
if the box direction is reversed, the cropping is reversed.
richlistbox - Archive of obsolete content
this is done incrementally, so typing more letters with select more specific items.
<statusbarpanel> - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
tooltip - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
tree - Archive of obsolete content
ArchiveMozillaXULtree
this is done incrementally, so typing more letters with select more specific items.
XULRunner 2.0 Release Notes - Archive of obsolete content
system requirements before installing, make sure your computer meets the system requirements (nb: that page will change for firefox 4 shipping).
Building XULRunner - Archive of obsolete content
you can also check the user agent string in firefox help/about menu to get the mapping from a certain binary firefox version to the corresponding xulrunner version.
Getting started with XULRunner - Archive of obsolete content
he application creates an os x application bundle: /library/frameworks/xul.framework/xulrunner-bin --install-app /<path>/<to>/myapp.zip once installed, you can run the application: /library/frameworks/xul.framework/xulrunner-bin "/applications/finkle/testapp.app/contents/resources/application.ini" you may run it without installing (but with the menu bar and dock icon missing) in os x by typing: /library/frameworks/xul.framework/xulrunner-bin "/<full path>/testapp/application.ini" note: the full path is required or a "error: couldn't parse application.ini."-message will be returned.
Windows and menus in XULRunner - Archive of obsolete content
keeping css, dtd and javascript out of the xul file is considered a best practice.
Mozprofile - Archive of obsolete content
see https://github.com/mozilla/mozbase/b...permissions.py resources other mozilla programs offer additional and overlapping functionality for profiles.
Format - Archive of obsolete content
dropping bugs from blocking1.8.1+ david baron suggested a list of bugs that could be dropped from the blocking list.
2006-11-22 - Archive of obsolete content
if anyone has experience with these issues, and is comfortable helping out in the mozilla/accessible 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.
2006-12-01 - Archive of obsolete content
developping microsummary generator questions and discussion surrounding microsummaries in ff 2.0.
2006-10-06 - Archive of obsolete content
discussion highlights: ziga sancin suggests writing an introductory article for potential developers containing basic project information (history, list of main developers, project goals, roadmap and available communication channels, etc), tools needed to start developing and building tb, documentation on source structure as well as links to help one get started on the project.
Extentsions FAQ - Archive of obsolete content
use the debugger by typing in a command like this: /break chrome://myextension/content/myfile.js 123 then i suggest using flat chrome.
2006-10-27 - Archive of obsolete content
discussions developing a spelling dictionary developing a spelling dictionary.
2006-07-17 - Archive of obsolete content
dropping bugs from blocking1.8.1+ david baron suggested a list of bugs that could be dropped from the blocking list.
2006-10-20 - Archive of obsolete content
help required designing new home for quality.mozilla.org - talented web designers and/or artists interested in helping the design for quality.mozilla.org please read this posting.
2006-10-27 - Archive of obsolete content
she is hoping to incorporate it into firefox for use with signature files.
2006-11-10 - Archive of obsolete content
discussions developing an extension like xmlhttprequest / nsidocument / mozilla_internal_api a discussion on how to develop an extension similar to xmlhttprequest but for a different protocol than http, emulating the asynchronous aspect.
2006-11-24 - Archive of obsolete content
discussions tutorials: non c++ bindings for xpcom tutorials on how to interface with firefox using xpcom on a similar basis to how a developer can with internet explorer through it's com interface tutorals and references related to extension development tutorials on developing extensions which use the third party libraries for firefox references to mozilla api exposed javascript component + xmldocument not accessible a discussion on error: uncaught exception: permission denied to get property xmldocument.textcontent creating xpcom components a good discussion about "components.classes[cid] has no properties" error firefox http explanation about how firefox handles the http ...
External resources for plugin creation - Archive of obsolete content
project: juce project home page description (from the home page): juce (jules' utility class extensions) is an all-encompassing c++ class library for developing cross-platform applications.
NPP_SetWindow - Archive of obsolete content
the window structure contains a window handle and values for top left corner, width, height, and clipping rectangle (see note on unix below).
NPSavedData - Archive of obsolete content
after this, the plug-in is responsible for keeping or deleting the objects as necessary.
NPVariant - Archive of obsolete content
javascript type to npvarianttype enumeration mapping when using npvariants to access javascript objects in the browser, or vise versa, the mapping of javascript values to npvariants is as follows: javascript type npvarianttype undefined npvarianttype_void null npvarianttype_null boolean npvarianttype_bool number npvarianttype_int32 or npvari...
Plugins - Archive of obsolete content
shipping a plugin as a toolkit bundle plugins can be shipped as a toolkit bundle, allowing a user to easily install, uninstall and manage their personal plugins.
Atomic RSS - Archive of obsolete content
ArchiveRSSModuleAtom
documentation selected articles atomic rss tim bray talks about using atom 1.0 as a micro format and extension module for rss 2.0; keeping rss 2.0 as your sydication format but bringing in and using selected atom 1.0 elements.
RSS - Archive of obsolete content
atomic rss tim bray talks about using atom 1.0 as a micro format and extension module for rss 2.0; keeping rss 2.0 as your sydication format but bringing in and using selected atom 1.0 elements.
SAX - Archive of obsolete content
space='" + uri + "', localname='" + localname + "', qname='" + qname + "'"); }, characters: function(value) { print("characters: " + value); }, processinginstruction: function(target, data) { print("processinginstruction: target='" + target + "', data='" + data + "'"); }, ignorablewhitespace: function(whitespace) { // don't care }, startprefixmapping: function(prefix, uri) { // don't care }, endprefixmapping: function(prefix) { // don't care }, // nsisupports queryinterface: function(iid) { if(!iid.equals(components.interfaces.nsisupports) && !iid.equals(components.interfaces.nsisaxcontenthandler)) throw components.results.ns_error_no_interface; return this; } }; start parsing the xml reader compo...
Confidentiality, Integrity, and Availability - Archive of obsolete content
you should be able to access them, of course, and employees at the bank who are helping you with a transaction should be able to access them, but no one else should.
Digital Signatures - Archive of obsolete content
encryption and decryption address the problem of eavesdropping, one of the three internet security issues mentioned at the beginning of this document.
Introduction to SSL - Archive of obsolete content
the ssl 2.0 and ssl 3.0 protocols support overlapping sets of cipher suites.
Threats - Archive of obsolete content
threats against network traffic include the following: eavesdropping.
Security - Archive of obsolete content
digital signaturesencryption and decryption address the problem of eavesdropping, one of the three internet security issues mentioned at the beginning of this document.
UUID - Archive of obsolete content
uuid: universal unique identifier a uuid can be obtained by visiting http://www.famkruithof.net/uuid/uuidgen or by typing "firebot: uuid?" on irc.mozilla.org in a channel where nickname "firebot" is present.
Using SSH to connect to CVS - Archive of obsolete content
if you're typing the commands directly (as opposed to storing them in a batch file that you call), you'll need to replace the occurances of "%%" in the first line with "%".
References - Archive of obsolete content
the webpage explains and proposes with small examples the best coding practices and most recommendable ways of developing problem-free javascript code.
Using the W3C DOM - Archive of obsolete content
ml speed and performance comparison between innerhtml attribute and dom's nodevalue when modifying the text data of a text node by gérard talbot interactive dom level 2 characterdata interface attributes and methods tests: other ways to modify (replace, delete, manipulate) efficiently text nodes in the dom by gérard talbot <- previous section: using web standards: how next section: developing cross-browser pages -> ...
Using Web Standards in your Web Pages - Archive of obsolete content
contents benefits of using web standards making your page using web standards - how to using the w3c dom developing cross browser and cross platform pages using xmlhttprequest summary of changes references original document information author(s): mike cowperthwaite, marcio galli, jim ley, ian oeschger, simon paquet, gérard talbot last updated date: may 29, 2008 copyright information: portions of this content are © 1998–2008 by individual mozilla.org contributors; content available under a creati...
-ms-wrap-flow - Archive of obsolete content
in that case, the element contributes its border box to its containing block's wrapping context and content flows around it according to the clear property.
Displaying notifications (deprecated) - Archive of obsolete content
otification is configured the way you want it to be, call its show() method to display the notification: notification.show(); on android, for example, the resulting notification panel looks like this: when the user taps on the "hey, check this out!" notification here, the resulting changes to the document look like this: if you're using firefox mobile, you can see this example live by tapping the button below.
Array comprehensions - Archive of obsolete content
here is one that filters just the even numbers, then creates an array containing their doubles: var numbers = [1, 2, 3, 21, 22, 30]; var doubledevens = [for (i of numbers) if (i % 2 === 0) i * 2]; console.log(doubledevens); // logs 4,44,60 the square brackets of an array comprehension introduce an implicit block for scoping purposes.
String.prototype.quote() - Archive of obsolete content
the non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping the result in double-quotes (").
Archived JavaScript Reference - Archive of obsolete content
d.reflect.enumerate()the static reflect.enumerate() method used to return an iterator with the enumerable own and inherited properties of the target object, but has been removed in ecmascript 2016 and is deprecated in browsers.string.prototype.quote()the non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping the result in double-quotes (").
JSException - Archive of obsolete content
getwrappedexceptiontype instance method getwrappedexceptiontype returns the int mapping of the type of the wrappedexception object.
MSX Emulator (jsMSX) - Archive of obsolete content
as you may have realized, many challenges on performance are faced when developing in javascript.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
i'd like to think that the final result was in keeping with the original spirit of the amazing netscape fish cam page while giving it a nice new css-driven look.
background-size - Archive of obsolete content
and anyway, it's more the -moz-border-image that seems to be the problem - that gets inherited even if i add in -moz-border-image: none, to <body> or <html>, and setting the height to 100% is more a matter of covering it up rather than stopping it happening (see further examples a, b and c - b and c look ok, but adding margin or padding reveals that the image applies to both <body> and <html> even though explicitly set to none) user:robertc 2009-08-14 see also bug 509681 and bug 497995.
Reference - Archive of obsolete content
while also holding in account the previous example where it was avalable in both instances when prototyping object it should be : function->object->instance or (function=object)->instance and ofcourse function == object return false ;) and the following statements also tells me that function == object although math is only an instance of object...
Troubleshooting XForms Forms - Archive of obsolete content
if you are developing on your local machine using apache tomcat for example then add the following regular expression on a new line: ^http://localhost:8080/.* use the xforms buddy to view instance data the xforms buddy extension allows you to dynamically view model instance data while the xforms is running in the firefox browser.
XForms Group Element - Archive of obsolete content
example <group ref="address"> <label>shipping address</label> <input ref="line_1"> <label>address line 1</label> </input> <input ref="line_2"> <label>address line 2</label> </input> <input ref="postcode"> <label>postcode</label> </input> </group> ...
XForms - Archive of obsolete content
other strengths that xforms brings to the table is the separation of data from presentation, strong data typing, the ability to submit xml data to servers instead of name/value pairs, and a descriptive way to author forms so that they can be displayed by a wide variety of devices.
RDF in Fifty Words or Less - Archive of obsolete content
and fundamentally, there's no reason that you shouldn't be able to treat these as "bookmarks" as well, grouping them together into folders as you please, or maybe even creating "smart" folders that, when you open them, dynamically generate their contents by running common search that you define.
The Business Benefits of Web Standards - Archive of obsolete content
that has been the real impact of the zen garden, in helping to demonstrate the stunning results which are possible without altering the markup, and indeed keeping the amount of presentational markup to an acceptable minimum.
Using the Right Markup to Invoke Plugins - Archive of obsolete content
thus, in the following example, instead of stopping at the activex control, ie will display the same animation twice since it also understands the mime type for flash: <!-- usage will not work as intended --> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="366" height="142" id="myflash"> <param name="movie" value="javascript-to-...
Index - Game development
sometimes you have to spend more time promoting a game than actually developing it.
Game distribution - Game development
the chrome web store is also an attractive option — again, having a manifest file ready, zipping your game and filling in the online submission form is about all that's required.
Publishing games - Game development
game promotion developing and finishing the game is not enough.
Bounding volume collision detection with THREE.js - Game development
// expand three.js sphere to support collision tests vs box3 // we are creating a vector outside the method scope to // avoid spawning a new instance of vector3 on every check three.sphere.__closest = new three.vector3(); three.sphere.prototype.intersectsbox = function (box) { // get box closest point to sphere center by clamping three.sphere.__closest.set(this.center.x, this.center.y, this.center.z); three.sphere.__closest.clamp(box.min, box.max); var distance = this.center.distancetosquared(three.sphere.__closest); return distance < (this.radius * this.radius); }; demos we have prepared some live demos to demonstrate these techniques, with source code to examine.
GLSL Shaders - Game development
we can ignore the fourth parameter and leave it with the default 1.0 value; this is used to manipulate the clipping of the vertex position in the 3d space, but we don't need in our case.
Mobile touch controls - Game development
for example, tapping on the right side of the screen will fire the weapon: this.buttonshoot = this.add.button(this.world.width*0.5, 0, 'button-alpha', null, this); this.buttonshoot.oninputdown.add(this.goshootpressed, this); this.buttonshoot.oninputup.add(this.goshootreleased, this); the code above will create a new button using a transparent image that covers the right half of the screen.
Efficient animation for web games - Game development
we would recommend keeping track of when requestanimationframe has been called and only having a single handler for it.
Square tilemaps implementation: Static maps - Game development
in this case, we need to map the column and row to an array index: var index = row * map.cols + column; wrapping up, an example of a tilemap object could look like the following.
Tiles and tilemaps overview - Game development
the logic grid since tilemaps are an actual grid of visual tiles, it is common to create a mapping between this visual grid and a logic grid.
Tools for game development - Game development
toolchain for developing and debugging games how does this differ from normal web app debugging?
Build the brick field - Game development
k like this: function drawbricks() { for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { bricks[c][r].x = 0; bricks[c][r].y = 0; ctx.beginpath(); ctx.rect(0, 0, brickwidth, brickheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } } } again, we're looping through the rows and columns to set the x and y position of each brick, and we're also painting a brick on the canvas — size brickwidth x brickheight — with each loop iteration.
Buttons - Game development
keeping the paddle still before the game starts it works as expected, but we can still move the paddle when the game hasn't started yet, which looks a bit silly.
The score - Game development
compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps we now have a scoring system, but what's the point of playing and keeping score if you can't win?
2D maze game with device orientation - Game development
when the start button is pressed, instead of jumping directly into the action the game will show the screen with the information on how to play the game.
Gecko FAQ - Gecko Redirect 1
content developers are sick and tired of developing and testing every single web page multiple times in order to support the different, incompatible, proprietary doms of browsers from different vendors.
Accessibility - MDN Web Docs Glossary: Definitions of Web-related terms
web accessibility (a11y) refers to best practices for keeping a website usable despite physical and technical restrictions.
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
software design asynchronous software design expands upon the concept by building code that allows a program to ask that a task be performed alongside the original task (or tasks), without stopping to wait for the task to complete.
Card sorting - MDN Web Docs Glossary: Definitions of Web-related terms
card sorting is a simple technique used in information architecture whereby people involved in the design of a website (or other type of product) are invited to write down the content / services / features they feel the product should contain, and then organize those features into categories or groupings.
Ciphertext - MDN Web Docs Glossary: Definitions of Web-related terms
a ciphertext's security, and therefore the secrecy of the contained information, depends on using a secure cipher and keeping the key secret.
Cross Axis - MDN Web Docs Glossary: Definitions of Web-related terms
learn more property reference align-content align-items align-self flex-wrap flex-direction flex further reading css flexbox guide: basic concepts of flexbox css flexbox guide: aligning items in a flex container css flexbox guide: mastering wrapping of flex items ...
DNS - MDN Web Docs Glossary: Definitions of Web-related terms
the most prominent function of dns is the translation of human-friendly domain names (such as mozilla.org) to a numeric ip address (such as 151.106.5.172); this process of mapping a domain name to the appropriate ip address is known as a dns lookup.
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
note that while there is indeed a connection between this dynamic/static property of programming languages and dynamic/static-typing, the two are far from synonymous.
Flex - MDN Web Docs Glossary: Definitions of Web-related terms
t order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flexbox ...
Flex Container - MDN Web Docs Glossary: Definitions of Web-related terms
learn more property reference align-content align-items flex flex-direction flex-flow flex-wrap justify-content further reading css flexbox guide: basic concepts of flexbox css flexbox guide: aligning items in a flex container css flexbox guide: mastering wrapping of flex items ...
Flexbox - MDN Web Docs Glossary: Definitions of Web-related terms
t order further reading css flexible box layout module level 1 specification css flexbox guide: basic concepts of flexbox css flexbox guide: relationship of flexbox to other layout methods css flexbox guide: aligning items in a flex container css flexbox guide: ordering flex items css flexbox guide: controlling ratios of flex items along the main axis css flexbox guide: mastering wrapping of flex items css flexbox guide: typical use cases of flexbox ...
Graceful degradation - MDN Web Docs Glossary: Definitions of Web-related terms
it is a useful technique that allows web developers to focus on developing the best possible websites, given that those websites are accessed by multiple unknown user-agents.
High-level programming language - MDN Web Docs Glossary: Definitions of Web-related terms
unlike low-level programming languages, it may use natural language elements, or may automate (or even entirely hide) significant areas of computing systems, making the process of developing simpler and more understandable relative to a lower-level language.
IIFE - MDN Web Docs Glossary: Definitions of Web-related terms
(function () { statements })(); it is a design pattern which is also known as a self-executing anonymous function and contains two major parts: the first is the anonymous function with lexical scope enclosed within the grouping operator ().
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
in other words, an idempotent method should not have any side-effects (except for keeping statistics).
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
json can represent numbers, booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects).
Namespace - MDN Web Docs Glossary: Definitions of Web-related terms
namespace is a context for identifiers, a logical grouping of names used in a program.
Normative - MDN Web Docs Glossary: Definitions of Web-related terms
specifications might also contain sections that are marked 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.
Placeholder names - MDN Web Docs Glossary: Definitions of Web-related terms
placeholder names are commonly used in cryptography to indicate the participants in a conversation, without resorting to terminology such as "party a," "eavesdropper," and "malicious attacker." the most commonly used names are: alice and bob, two parties who want to send messages to each other, occasionally joined by carol, a third participant eve, a passive attacker who is eavesdropping on alice and bob's conversation mallory, an active attacker ("man-in-the-middle") who is able to modify their conversation and replay old messages ...
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
at the time, javascript developers were grasping at straws trying to get their website to work across all devices because there was such a discrepancy between browsers that the website might have to be programmed radically differently and have a much different user interface based upon the user's browser.
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
this is because of javascript's lexical scoping and the resulting variable shadowing.
Progressive Enhancement - MDN Web Docs Glossary: Definitions of Web-related terms
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.
Prototype - MDN Web Docs Glossary: Definitions of Web-related terms
see inheritance and the prototype chain learn more general knowledge software prototyping on wikipedia ...
SVG - MDN Web Docs Glossary: Definitions of Web-related terms
svg also provides a useful set of tools, such as clipping, masking, filters, and animations.
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
transport layer security (tls), formerly known as secure sockets layer (ssl), is a protocol used by applications to communicate securely across a network, preventing tampering with and eavesdropping on email, web browsing, messaging, and other protocols.
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
time-sensitive applications often use udp because dropping packets is preferable to waiting for packets delayed due to retransmission, which may not be an option in a real-time system.
WebExtensions - MDN Web Docs Glossary: Definitions of Web-related terms
webextensions is a cross-browser system for developing browser extensions in firefox.
Character encoding - MDN Web Docs Glossary: Definitions of Web-related terms
an encoding defines a mapping between bytes and text.
HTTPS - MDN Web Docs Glossary: Definitions of Web-related terms
this secure connection allows clients to safely exchange sensitive data with a server, such as when performing banking activities or online shopping.
non-normative - MDN Web Docs Glossary: Definitions of Web-related terms
software specifications often contains information marked as non-normative or informative, which means that those are provided there for the purpose of helping the readers to understand the specification better or to show an example or a best practice, and not needed to be followed as a rule.
User agent - MDN Web Docs Glossary: Definitions of Web-related terms
besides a browser, a user agent could be a bot scraping webpages, a download manager, or another app accessing the web.
Accessible multimedia - Learn web development
images, videos, <canvas> elements, flash movies, etc., aren't as easily understood by screenreaders or navigated by the keyboard, and we need to give them a helping hand.
Backgrounds and borders - Learn web development
when you do this you may end up with background images overlapping each other.
Creating fancy letterheaded paper - Learn web development
add a 1mm top and bottom solid border to the letter, in a color that is inkeeping with the rest of the color scheme.
Pseudo-classes and pseudo-elements - Learn web development
they tend to act as if you had applied a class to some part of your document, often helping you cut down on excess classes in your markup, and giving you more flexible, maintainable code.
CSS selectors - Learn web development
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 help you to find the right tool for the job.
Test your skills: floats - Learn web development
the box wrapping the float and text is displaying behind the float.
Test Your Skills: Fundamental layout comprehension - Learn web development
this task will test some of your knowledge by way of developing a simple webpage layout using a variety of techniques.
Practical positioning examples - Learn web development
we then give it a large margin-left to move it over to the right, making space for the info-box to sit in, so it is not overlapping anything else.
Styling links - Learn web development
finally, we set some padding-right on the links to make space for the background image to appear in, so we aren't overlapping it with the text.
What text editors are available? - Learn web development
save yourself the hassle of retyping all this by using a code snippet to pre-fill your document.
How can we design for all types of users? - Learn web development
image compression some users may choose to display images, but still have limited bandwidth available, especially in developing countries and on mobile devices.
How much does it cost to do something on the Web? - Learn web development
those programs are relatively limited, you'll soon want a more robust editor to add layers, effects, and grouping.
What are hyperlinks? - Learn web development
deeper dive as we said, a link is a text string tied to a url, and we use links to allow easy jumping from one document to another.
What is a Domain Name? - Learn web development
note : for some domain name, it might not be a registrar which is in charge of keeping track.
What software do I need to build a website? - Learn web development
there are dozens of browser options for your personal use, but when you're developing a website you should test it at least with the following major browsers, to make sure your site works for most people: mozilla firefox google chrome microsoft internet explorer apple safari if you're targeting a specific group (e.g., technical platform or country), you may have to test the site with additional browsers, like opera, konqueror, or uc browser.
How do you set up a local testing server? - Learn web development
remote files throughout most of the learning area, we tell you to just open your examples directly in a browser — this can be done by double clicking the html file, dragging and dropping it into the browser window, or choosing file > open...
Advanced form styling - Learn web development
if you really need full control over the option styling, you'll have to either use some kind of library to generate a custom control, or build your own custom control, or in the case of select use the multiple attribute, which makes all the options appear on the page, sidestepping this particular problem: <select id="select" name="select" multiple> ...
Client-side form validation - Learn web development
if the user tries to send the data, the browser will submit the form, provided there is nothing else stopping it from doing so (e.g., javascript).
HTML forms in legacy browsers - Learn web development
sometimes, dropping some functionality leads to a better user experience than having exactly the same functionality in all browsers.
How to structure a web form - Learn web development
here you'll see that we are wrapping the contact information fields inside a distinct <section> element.
Other form controls - Learn web development
the values are soft (the default value), which means the text submitted is not wrapped but the text rendered by the browser is wrapped; hard (the cols attribute must be specified when using this value), which means both the submitted and rendered texts are wrapped, and off, which stops wrapping.
Dealing with files - Learn web development
this doesn't matter in html — even if you are developing your website on windows, you should still use forward slashes in your code.
How the Web works - Learn web development
you can find the ip address of a website by typing its domain into a tool like ip checker.
Use JavaScript within a webpage - Learn web development
objective: learn how to trigger javascript in your html file, and learn the most important best practices for keeping javascript accessible.
Advanced text formatting - Learn web development
ment.queryselector('p'); para.onclick = function() { alert('owww, stop poking me!'); }</code></pre> <p>you shouldn't use presentational elements like <code>&lt;font&gt;</code> and <code>&lt;center&gt;</code>.</p> <p>in the above javascript example, <var>para</var> represents a paragraph element.</p> <p>select all the text with <kbd>ctrl</kbd>/<kbd>cmd</kbd> + <kbd>a</kbd>.</p> <pre>$ <kbd>ping mozilla.org</kbd> <samp>ping mozilla.org (63.245.215.20): 56 data bytes 64 bytes from 63.245.215.20: icmp_seq=0 ttl=40 time=158.233 ms</samp></pre> the above code will look like so: marking up times and dates html also provides the <time> element for marking up times and dates in a machine-readable format.
What’s in the head? Metadata in HTML - Learn web development
let's look at an example: <meta name="author" content="chris mills"> <meta name="description" content="the mdn web docs learning area aims to provide complete beginners to the web with all they need to know to get started with developing web sites and applications."> specifying an author is beneficial in many ways: it is useful to be able to understand who wrote the page, if you have any questions about the content and you would like to contact them.
Adding vector graphics to the Web - Learn web development
inlining svg is the only approach that lets you use css interactions (like :focus) and css animations on your svg image (even in your regular stylesheet.) you can make svg markup into a hyperlink by wrapping it in an <a> element.
From object to iframe — other embedding technologies - Learn web development
</a> </p> </object> pdfs were a necessary stepping stone between paper and digital, but they pose many accessibility challenges and can be hard to read on small screens.
Responsive images - Learn web development
note: when testing this with a desktop browser, if the browser fails to load the narrower images when you've got its window set to the narrowest width, have a look at what the viewport is (you can approximate it by going into the browser's javascript console and typing in document.queryselector('html').clientwidth).
HTML table advanced features and accessibility - Learn web development
previous overview: tables next in the second article in this module, we look at some more advanced features of html tables — such as captions/summaries and grouping your rows into table head, body and footer sections — as well as looking at the accessibility of tables for visually impaired users.
HTML Tables - Learn web development
LearnHTMLTables
html table advanced features and accessibility this module looks at some more advanced features of html tables — such as captions/summaries and grouping your rows into table head, body and footer sections — as well as looking at the accessibility of tables for visually impaired users.
Introducing asynchronous JavaScript - Learn web development
this means that you can let your code do several things at the same time without stopping or blocking your main thread.
Build your own function - Learn web development
previous overview: building blocks next in this module making decisions in your code — conditionals looping code functions — reusable blocks of code build your own function function return values introduction to events image gallery ...
Introduction to events - Learn web development
for a start, it is not a good idea to mix up your html and your javascript, as it becomes hard to parse — keeping your javascript separate is best practice; if it is in a separate file you can apply it to multiple html documents.
Test your skills: Events - Learn web development
we want you to solve this without looping through all the buttons and giving each one their own event listener.
JavaScript building blocks - Learn web development
looping code sometimes you need a task done more than once in a row.
Third-party APIs - Learn web development
one of the most obvious examples is using mapping apis to display custom maps on your pages.
Video and Audio APIs - Learn web development
stopping the video next, let's add functionality to handle stopping the video.
JavaScript First Steps - Learn web development
in this article we'll look at all the common things that you really ought to know about strings when learning javascript, such as creating strings, escaping quotes in string, and joining them together.
Solve common problems in your JavaScript code - Learn web development
looping/iteration how do you run the same bit of code over and over again?
Aprender y obtener ayuda - Learn web development
when you find solutions to such problems, it is worth writing down notes on what you did, and keeping some minimal code examples in a directory somewhere so you can look back on previous work.
Perceived performance - Learn web development
prevent jumping content and other reflows images or other assets causing content to be pushed down or jump to a different location, like the loading of third party advertisements, can make the page feel like it is still loading and is bad for perceived performance.
The business case for web performance - Learn web development
performance budgets setting a web performance budget can help you make sure the team stays on track in keeping the site and help prevent regressions.
JavaScript performance - Learn web development
gzipping compresses the file further, and should be used even if you don't minify.
Web performance - Learn web development
in this article we look at convincing managements, developing a performance culture and performance budget, and introduce ways to ensure regressions don't sneak into your code base.
Introduction to the server side - Learn web development
now try typing "favourite" in the search box and observe the autocomplete search predictions.
Website security - Learn web development
select * from users where name = 'a\';drop table users; select * from userinfo where \'t\' = \'t'; web frameworks will often take care of the character escaping for you.
Ember resources and troubleshooting - Learn web development
the intentional minimalism forces certain decisions, and allows for more consistent code, while keeping the template more structural rather than having them filled with bespoke logic.
Routing in Ember - Learn web development
updating the todos display inside todolist one small final thing that we need to fix is that previously, inside todomvc/app/components/todo-list.hbs, we were accessing the todo-data service directly and looping over all todos, as shown here: {{#each this.todos.all as |todo| }} since we now want to have our todolist component show a filtered list, we'll want to pass an argument to the todolist component representing the "current list of todos", as shown here: {{#each @todos as |todo| }} and that's it for this tutorial!
Ember app structure and componentization - Learn web development
looking at the code next to the rendered todo app, there are a number of ways we could decide how to break up the ui, but let's plan on splitting the html out into the following components: the component groupings are as follows: the main input / "new-todo" (red in the image) the containing body of the todo list + the mark-all-complete button (purple in the image) the mark-all-complete button, explicitly highlighted for reasons given below (yellow in the image) each todo is an individual component (green in the image) the footer (blue in the image) something odd to note is that the ma...
Beginning our React todo list - Learn web development
pre-project housekeeping create-react-app has made a few files we won't be using at all for our project.
Componentizing our Svelte app - Learn web development
previous overview: client-side javascript frameworks next in the last article we started developing our todo list app.
Working with Svelte stores - Learn web development
this is a perfect example of how svelte puts the compiler in charge of better developer ergonomics, not only saving us from typing boiler plate, but also generating less error-prone code.
Adding a new todo form: Vue events, methods, and models - Learn web development
.native: listens for a native event on the root (outer-most wrapping) element on your component.
Introduction to automated testing - Learn web development
once the install completes, test that node is installed by typing the following into the terminal, which returns the installed versions of node and npm: node -v npm -v if you've got node/npm already installed, you should update them to their latest versions.
Implementing feature detection - Learn web development
for example, load up our modernizr-css.html example in your browser, then try going to your javascript console and typing in modernizr.
Handling common HTML and CSS problems - Learn web development
store a reference to this element in a variable, for example: const test = document.getelementbyid('hplogo'); now try to set a new value for the css property you are interested in on that element; you can do this using the style property of the element, for example try typing these into the javascript console: test.style.transform = 'rotate(90deg)' test.style.webkittransform = 'rotate(90deg)' as you start to type the property name representation after the second dot (note that in javascript, css property names are written in lower camel case, not hyphenated), the javascript console should begin to autocomplete the names of the properties that exist in the browse...
Strategies for carrying out testing - Learn web development
the most common devices/browsers you'll want to test are as follows: the official android studio ide for developing android apps is a bit heavy weight for just testing websites on google chrome or the old stock android browser, but it does come with a robust emulator.
Setting up your own test automation environment - Learn web development
we could add a sleep() method to our quick_test.js test too — try wrapping your last line of code in a block like this: driver.sleep(2000).then(function() { input.sendkeys('filling in my form'); input.getattribute("value").then(function(value) { if(value !== '') { console.log('form input editable'); } }); }); webdriver will now wait for 2 seconds before filling in the form field.
Cross browser testing - Learn web development
what users, browsers, and devices do you most need to worry about?), how to go about doing testing, the main issues that you'll face with different types of code and how to mitigate them, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing.
Client-side tooling overview - Learn web development
this stage of the development process is one that you want the least amount of active interaction with so that once it is configured, it runs mostly automatically, only popping up to say hello if something has gone wrong.
Tools and testing - Learn web development
what users, browsers and devices do you most need to worry about?), how to go about testing, the main issues that you'll face with different types of code and how to fix/mitigate those, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing.
Accessibility/LiveRegionDevGuide
this developer's guide lays out general guidelines that assistive technology (at) developers can use in developing live region support.
Mozilla accessibility architecture
the member variables keeping track of the number of children, parent, first child and next sibling allow us to have instant traversal around accessible nodes that have already been visited.
Embedding API for Accessibility
.sites", "http://www.annoyingsite1.com http://www.popupsite2.com"); user_pref("capability.policy.popupsites.windowinternal.open","noaccess"); // or turn it off everywhere: user_pref("capability.policy.default.windowinternal.open","noaccess"); // override popping up new windows on target=anything user_pref("browser.block.target_new_window", true); // override popup windows at beginning of new page load (blocks most popup advertisements) user_pref("dom.disable_open_during_load", true); moz 0.8 client side redirects ...
Accessibility and Mozilla
this developer's guide lays out general guidelines that assistive technology (at) developers can use in developing live region support.
Index
685 obsolete add-ons, archive, look & feel, obsolete, themes this page contains theme documents and resources that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs.
Obsolete
this page contains theme documents and resources that we don't expect will ever be updated, but which we're keeping for the time being as potential source material for updated docs.
Adding a new event
eventnamelist.h defines mapping between dom event name, internal event message, event handler attribute owner and internal event class.
Testopia
developing plugins or extensions for any software is like trying to hit a moving target.
Debugging Table Reflow
0 constraint=3 widths=360 540 -1 -1 -1 -1 -1 -1 540 360 **end col dump** **start col dump** colindex=3 isanonymous=0 constraint=0 widths=360 540 -1 -1 -1 -1 -1 -1 -1 360 **end col dump** ***end table dump*** the first column has already the minimum content width, the table column can't shrink below that, the desired content width of 540 twips, that's the space to layout cell 1 without wrapping the text and the 1230 which correspond to the style="width:80px" at the first cell.
Debugging on Mac OS X
once done, you should be able to open any file quickly by hitting cmd-shift-o and typing in the name of a file.) in the product menu, select scheme > new scheme and name your scheme (for example, "debug").
HTTP logging
thanks for helping us debug firefox.
Gmake vs. Pymake
note that typing "python build/pymake/make.py -f client.mk" does not trigger a relative configure.
The Firefox codebase: CSS Guidelines
in this case, simply dropping the override should work.
Interface Compatibility
if necessary, it is possible for an extension to support multiple versions by shipping multiple shared libraries (dlls) in the same extension package, and selecting the correct version using versioning flags in its chrome.manifest file.
Contributing to the Mozilla code base
if you don't hear back within this time, naturally reach out to them: add a comment to the bug saying 'review ping?', check the "need more information from" box, and add the reviewer's name.
Working with Mozilla source code
svg cleanup guide guidelines and best practices for shipping new svgs.
Displaying Places information using views
the following table shows the mappings between these magic column id values and their corresponding nsinavhistoryresultnode properties: treecol id or anonid corresponding nsinavhistoryresultnode property title title url uri date time visitcount accesscount keyword * description * dateadded dateadded lastmodified lastmodified ...
Multiple Firefox profiles
you can remove such add-ons from your profile for nightly use while keeping them for use with other profiles.
Cross Process Object Wrappers
*/ browsermm.loadframescript("chrome://my-addon/content/frame-script.js", false); browsermm.addmessagelistener("my-addon-message", function(message) { let wrapper = message.objects.element; wrapper.addeventlistener("click", function() { console.log("they clicked"); }); }); mapping content documents to xul browsers a common pattern is to get the xul <browser> that corresponds to a content document.
Frame script loading and lifetime
to define the mapping between a chrome:// url and a frame script packaged with an extension, use a "chrome.manifest" file to register a chrome url: // chrome.manifest content my-e10s-extension chrome/content/ // chrome script mm.loadframescript("chrome://my-e10s-extension/content/content.js", true); allowdelayedload if the message manager is a global frame message manager or a window message manager then: if...
Performance
better: instead of only keeping the state in the parent an addon can employ a master-slave architecture where the parent has the authoritative state and replicates it to the child processes in advance so they can act based on their local copy.
Performance best practices for Firefox front-end engineers
if that happens, some of them will be postponed until the next frame (or possibly multiple frames, if necessary), this skipping of frames is called jank.
Storage access policy: Block cookies from trackers
for example, a request for content from tracker.example on news.example will not reuse an http connection with a request for content from tracker.example on shopping.example or with requests that occur when tracker.example is visited directly (i.e., as a first party).
Firefox and the "about" protocol
note: you must access about: protocol pages by typing them into the address bar.
Firefox
always keep in mind the side effects your changes may have, from blocking other tasks, to interfering with other user interface elements.privacythis document lists privacy-related documentation.security best practices for firefox front-end engineersthis article will help firefox developers understand the security controls in place and avoid common pitfalls when developing front-end code for firefox.site identity buttonthe site identity button is a feature in firefox that gives users more information about the sites they visit.
Browser API
htmliframeelement.stop() allows stopping of the <iframe>'s content loading.
ChromeWorker
summary if you're developing privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using chromeworker instead of the standard worker object.
Chrome-only API reference
MozillaGeckoChromeAPI
it currently works in (privileged) chrome code on firefox desktop (version 47 and above).chromeworkerif you're developing privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using chromeworker instead of the standard worker object.
Embedding Tips
this interface also has methods for reloading, stopping a load and going back and forward in the history.
Gecko
view all… community view mozilla forums: mailing list newsgroup rss feed related topics web standards xul embedding mozilla developing mozilla ...
Getting Started with Chat
/msg nick message sends a private message to the specified user /nick nickname change your current nickname nickname: ping get a user's attention (nickname is the name of the user you want the attention of) nickname: pong respond to a user's ping (nickname is the name of the user who wants your attention) /query nickname opens a private chat with the specified user /quit message disconnects you from the current server displaying the message in all connected channels prior to qui...
IME handling guide
following table explains the mapping between them.
Extending a Protocol
quick start: extending a protocol this tutorial implements a simple ping-pong style ipdl protocol, which sends a message from the content process (main thread) to the chrome process (ui thread).
Implementing QueryInterface
the ns_get_iid macro you can use the ns_get_iid macro instead of typing out the full getiid expression.
JavaScript-DOM Prototypes in Mozilla
this registration is done with the nsscriptnamespacemanager, which is in charge of keeping track of what names are registered in the global namespace, and what kinds of names those names are (i.e.
DownloadList
removefinished() removes downloads from the list that have finished, have failed, or have been canceled without keeping partial data.
OS.File for the main thread
do something with that file } finally { yield outfile.close(); } }); example of opening file and keeping it locked this uses tasks.jsm to open a file and keep it open.
Promise.jsm
introduction for an introduction to promises, you may start from the add-on sdk documentation, keeping in mind that only the core subset is implemented in this module.
Task.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/task.jsm"); introduction for an introduction to tasks, you may start from the task.js documentation, keeping in mind that only the core subset is implemented in this module.
Mozilla Content Localized in Your Language
enjoy developing your style guide!
Localizing with Mercurial
you can therefore use the one set up for developing firefox, seamonkey and thunderbird without having to pull mozilla-central a second time.
Localization quick start guide
release phase steps to shipping your localization work.
SVN for Localizers
if you have any doubts, ping l10n-drivers on irc in the #l10n channel.
Fonts for Mozilla 2.0's MathML engine
recommended fonts the stix fonts project has been developing a comprehensive set of fonts that cover all the symbols in mathml and also contains glyphs to stretch mathematical operators.
MathML Demo: <mtable> - tables and matrices
these may sound like gimmicks until you want to get a damping effect such as this ---...
Mozilla DOM Hacking Guide
resources of interest the xpidl reference mapping dom objects to their c++ class modularization techniques scriptable helper flags this chapter has not been written yet.
Mozilla Development Strategies
as far as keeping trees up to date goes, the longer you go without updating your tree, the more likely you are to have cvs conflicts.
Mozilla projects on GitHub
opennews the knight-mozilla open news project, helping the journalism/technology community do great work through shared knowledge and code.
Investigating leaks using DMD heap scan mode
clamping is the same kind of analysis that a conservative gc does: if a word-aligned value in a heap block points to somewhere within another heap block, replace that value with the address of the block.
GC and CC logs
in particular, cc logs can be used to understand why the cycle collector is keeping an object alive.
TimerFirings logging
it is sometimes useful to pre-process the output by stripping out certain parts of each line before doing this aggregation step, for example, by inserting one or more of the following commands into the command pipeline.
powermetrics
the grouping of parent and child processes (in coalitions) is obvious.
A brief guide to Mozilla preferences
modifying preferences advanced users can set named preferences via the advanced preferences editor, by typing about:config in the location bar.
Preference reference
er.ui.textselectbackgroundui.textselectbackground saves the color in which the background of a text selection in the user interface or in content will be styled.ui.textselectforegroundui.textselectforeground saves the color in which the text of a text selection in the user interface or the content will be styled.ui.tooltipdelayui.tooltipdelay stores the delay in milliseconds between the mouse stopping over an element and the appearing of its tooltip.view_source.syntax_highlightthe preference view_source.syntax_highlight controls whether markup in the view source view is syntax highlighted.
Preferences
related topics xul, javascript, xpcom, extensions, developing mozilla ...
Crash reporting
see also understanding crash reports a guide to searching crash reports crash-stats crash pings (telemetry) and crash reports (socorro/crash stats) building firefox with debug symbols environment variables affecting crash reporting in-code documentation crash reporter crash manager crash ping ...
AsyncTestUtils extended framework
a function should yield true or return true when the asynchronous driver should continue executing without stopping.
About NSPR
history a good portion of the library's purpose, and perhaps the primary purpose in the gromit environment, was to provide the underpinnings of the java vm, more or less mapping the sys layer that sun defined for the porting of the java vm to various platforms.
Optimizing Applications For NSPR
this environment does bring along some of its own special trappings.
PRFileMap
before actually mapping a file to memory, you must create a memory-mapped file object by calling pr_createfilemap, which returns a pointer to prfilemap.
PR_AttachSharedMemory
flags options for mapping the shared memory.
PR_GetThreadScope
gets the scoping of the current thread.
PR_PushIOLayer
caution keeping the pointer to the stack even as layers are pushed onto the top of the stack is accomplished by swapping the contents of the file descriptor being pushed and the stack's current top layer file descriptor.
PR_Unmap
description pr_memunmap removes the file mapping for the memory region (addr, addr + len).
PR_dtoa
1 like 0, but with steele & white stopping rule.
Threads
getting a thread's scope pr_getthreadscope gets the scoping of the current thread.
Running NSPR tests
they will be invoked by their companion test programs (e.g., pipeping and sockping).
An overview of NSS Internals
there are tools for managing nss databases, for dumping or verifying certificates, for registering pkcs#11 modules with a database, for processing cms encrypted/signed messages, etc.
Building NSS
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.
NSS Certificate Download Specification
it consists of a pkcs#7 contentinfo structure, wrapping a sequence of certificates.
Certificate functions
cert_encodegeneralname mxr 3.4 and later cert_encodeinfoaccessextension mxr 3.12 and later cert_encodeinhibitanyextension mxr 3.12 and later cert_encodenoticereference mxr 3.12 and later cert_encodeocsprequest mxr 3.6 and later cert_encodepolicyconstraintsextension mxr 3.12 and later cert_encodepolicymappingextension mxr 3.12 and later cert_encodesubjectkeyid mxr 3.12 and later cert_encodeusernotice mxr 3.12 and later cert_extractpublickey mxr 3.2 and later cert_findcertbyname mxr 3.2 and later cert_findcrlentryreasonexten mxr 3.12 and later cert_findcrlnumberexten mxr 3.12 and later cert_findname...
Encrypt Decrypt MAC Keys As Session Objects
slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); ...
Encrypt and decrypt MAC using token
slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); ...
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
with that understanding, the best directory to look for sample code is in the org/mozilla/jss/tests directory: http://lxr.mozilla.org/mozilla/source/security/jss/org/mozilla/jss/tests org/mozilla/jss/tests/closedbs.java org/mozilla/jss/tests/keyfactorytest.java org/mozilla/jss/tests/digesttest.java org/mozilla/jss/tests/jcasigtest.java org/mozilla/jss/tests/keywrapping.java org/mozilla/jss/tests/listcerts.java org/mozilla/jss/tests/pk10gen.java org/mozilla/jss/tests/sdr.java org/mozilla/jss/tests/selftest.java org/mozilla/jss/tests/setupdbs.java org/mozilla/jss/tests/sigtest.java org/mozilla/jss/tests/symkeygen.java org/mozilla/jss/tests/testkeygen.java org/mozilla/jss/tests/sslclientauth.java org/mozi...
JSS Provider Notes
; keypair dsapair = dsakpg.generatekeypair(); supported classes cipher dsaprivatekey dsapublickey keyfactory keygenerator keypairgenerator mac messagedigest rsaprivatekey rsapublickey secretkeyfactory secretkey securerandom signature what's not supported the following classes don't work very well: keystore: there are many serious problems mapping the jca keystore interface onto nss's model of pkcs #11 modules.
Mozilla-JSS JCA Provider notes
what's not supported the following classes don't work very well: keystore: there are many serious problems mapping the jca keystore interface onto nss's model of pkcs #11 modules.
NSS_3.12.1_release_notes.html
bug 429716: debug builds of libpkix unconditionally dump socket traffic to stdout bug 430368: vfychain -t option is undocumented bug 430369: vfychain -o succeeds even if -pp is not specified bug 430399: vfychain -pp crashes bug 430405: error log is not produced by cert_pkixverifycert bug 430743: update ssltap to understand the tls session ticket extension bug 430859: pkix: policy mapping fails verification with error invalid arguments bug 430875: document the policy for the order of cipher suites in ssl_implementedciphers.
NSS 3.30 release notes
in ssl.h ssl_alertreceivedcallback - register a callback function, that will be called whenever an ssl/tls alert is received ssl_alertsentcallback - register a callback function, that will be called whenever an ssl/tls alert is sent ssl_setsessionticketkeypair - configures an asymmetric key pair, for use in wrapping session ticket keys, used by the server.
NSS 3.50 release notes
574643 - upgrade hacl* verified implementations of chacha20, poly1305, and 64-bit curve25519 bug 1608327 - two problems with neon-specific code in freebl bug 1575843 - detect aarch64 cpu features on freebsd bug 1607099 - remove the buildbot configuration bug 1585429 - add more hkdf test vectors bug 1573911 - add more rsa test vectors bug 1605314 - compare all 8 bytes of an mp_digit when clamping in windows assembly/mp_comba bug 1604596 - update wycheproof vectors and add support for cbc, p256-ecdh, and cmac tests bug 1608493 - use aes-ni for non-gcm aes ciphers on platforms with no assembly-optimized implementation, such as macos.
NSS 3.51 release notes
bug 1538980 - secu_readderfromfile calls strstr on a string that isn't guaranteed to be null-terminated bug 1561337 - correct a warning for comparison of integers of different signs: 'int' and 'unsigned long' in security/nss/lib/freebl/ecl/ecp_25519.c:88 bug 1609751 - add test for mp_int clamping bug 1582169 - don't attempt to read the fips_enabled flag on the machine unless nss was built with fips enabled bug 1431940 - fix a null pointer dereference in blake2b_update bug 1617387 - fix compiler warning in secsign.c bug 1618400 - fix a openbsd/arm64 compilation error: unused variable 'getauxval' bug 1610687 - fix a crash on unaligned cmaccontext.aes.keyschedule when using aes-ni intri...
Encrypt Decrypt_MAC_Using Token
slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); ...
NSS Sample Code Sample_3_Basic Encryption and MACing
slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); ...
NSS Sample Code Utilities_1
f, int rsize) { char meter[] = { "\r| |" }; int fd, count; int c; secstatus rv = secsuccess; cc_t orig_cc_min; cc_t orig_cc_time; tcflag_t orig_lflag; struct termios tio; fprintf(stderr, "to generate random numbers, " "continue typing until the progress meter is full:\n\n"); fprintf(stderr, "%s", meter); fprintf(stderr, "\r|"); /* turn off echo on stdin & return on 1 char instead of nl */ fd = fileno(stdin); tcgetattr(fd, &tio); orig_lflag = tio.c_lflag; orig_cc_min = tio.c_cc[vmin]; orig_cc_time = tio.c_cc[vtime]; tio.c_lflag &= ~echo; tio.c_lflag &= ~icanon; tio.c_cc[vmin] = 1; ...
EncDecMAC using token object - sample 3
*/ mackey = generatesymkey(slot, ckm_generic_secret_key_gen, 160/8, &mackeyid, pwdata); if (mackey == null) { pr_fprintf(pr_stderr, "generatesymkey for macing returned null.\n"); rv = secfailure; goto cleanup; } /* get the encrypt key cka_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsucce...
Utilities for nss samples
f, int rsize) { char meter[] = { "\r| |" }; int fd, count; int c; secstatus rv = secsuccess; cc_t orig_cc_min; cc_t orig_cc_time; tcflag_t orig_lflag; struct termios tio; fprintf(stderr, "to generate random numbers, " "continue typing until the progress meter is full:\n\n"); fprintf(stderr, "%s", meter); fprintf(stderr, "\r|"); /* turn off echo on stdin & return on 1 char instead of nl */ fd = fileno(stdin); tcgetattr(fd, &tio); orig_lflag = tio.c_lflag; orig_cc_min = tio.c_cc[vmin]; orig_cc_time = tio.c_cc[vtime]; tio.c_lflag &= ~echo; tio.c_lflag &= ~icanon; tio.c_cc[vmin] = 1; ...
NSS sources building testing
as a test, it must be possible to successfully use the command "ping $host.$domsuf" on your computer (ping reports receiving replies).
nss tech note1
sec_quickderdecodeitem supports skipping the decoding of optional components if you define the tag of the component in the template sec_asn1_inner: recurse into the component and saves its content, without the surrounding asn.1 tag and length sec_asn1_save: saves the component data, but does not proceed to the next component if within a sequence template array.
nss tech note4
critical : indicates whether the extension is critical value : the value of the extension looping through all extensions certcertextension** extensions =cert->extensions; if (extensions) { while (*extensions) { secitem *ext_oid = &(*extensions)->id; secitem *ext_critical = &(*extensions)->critical; secitem *ext_value = &(*extensions)->value; /* id attrib...
nss tech note7
both of these functions do the pkcs #1 wrapping of the data.
NSS Tools sslstrength
you can obtain this list of character->cipher mappings by doing 'sslstrength ciphers'.
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
how is the private key stored to the smartcard, and how is the public key sent to the server (with wrapping?).
PKCS #11 Module Specs
values can contain embedded blanks either through quoting the entire value, or by escaping the embedded blanks with '\'.
PKCS11 Implement
it uses a single session for all single-part rsa operations such as logging in, logging out, signing, verifying, generating keys, wrapping keys, and so on.
Python binding for NSS
the design of python-nss follows these basic guiding principles: be a thin layer with almost a one-to-one mapping of nss/nspr calls to python methods and functions.
NSPR functions
pr_getuniqueidentity pr_createiolayerstub pr_getdefaultiomethods pr_getidentitieslayer pr_getlayersidentity pr_pushiolayer pr_popiolayer wrapping a native file descriptor if your current tcp socket code uses the standard bsd socket api, a lighter-weight method than creating your own nspr i/o layer is to simply import a native file descriptor into nspr.
FIPS mode of operation
fc_wrapkey: rsa key wrapping fc_unwrapkey: rsa key wrapping fc_derivekey: diffie-hellman, ec diffie-hellman random number generation functions fc_seedrandom fc_generaterandom: performs continuous random number generator test.
NSS functions
cert_encodegeneralname mxr 3.4 and later cert_encodeinfoaccessextension mxr 3.12 and later cert_encodeinhibitanyextension mxr 3.12 and later cert_encodenoticereference mxr 3.12 and later cert_encodeocsprequest mxr 3.6 and later cert_encodepolicyconstraintsextension mxr 3.12 and later cert_encodepolicymappingextension mxr 3.12 and later cert_encodesubjectkeyid mxr 3.12 and later cert_encodeusernotice mxr 3.12 and later cert_extractpublickey mxr 3.2 and later cert_findcertbyname mxr 3.2 and later cert_findcrlentryreasonexten mxr 3.12 and later cert_findcrlnumberexten mxr 3.12 and later cert_findname...
NSS tools : modutil
nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
NSS tools : pk12util
nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
NSS Tools modutil
saves typing when there is more than one platform using the same settings.
NSS Tools sslstrength
you can obtain this list of character->cipher mappings by doing 'sslstrength ciphers'.
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
NSS tools : pk12util
nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
NSS tools : signver
MozillaProjectsNSStoolssignver
nss has some flexibility that allows applications to use their own, independent database engine while keeping a shared database and working around the access issues.
Necko Architecture
mimetype - mime <-> file extension mapping nkabout - about: protocol nkdata - data: protocol nkfile - file: protocol nkftp - ftp: protocol nkkeyword - keyword: protocol nkresrc - resource: protocol cnvts - stream converters stremcnv - stream converter service these libraries will change with time and illustrate the modularity of necko.
SpiderMonkey Build Documentation
developer (debug) build for developing and debugging spidermonkey itself, it is best to have both a debug build (for everyday debugging) and an optimized build (for performance testing), in separate build directories.
GC Rooting Guide
the simplest approach is to use js::persistentrooted (usable on anything with a trace method with the appropriate signature): js::persistentrooted<myowningstruct> immortalstruct; but note that js::persistentrooted in a struct or class is a rather dangerous thing to use -- it will keep a gc thing alive, and most gc things end up keeping their global alive, so if your class/struct is reachable in any way from that global, then nothing will ever be cleaned up by the gc.
Getting SpiderMonkey source code
downloading gzipped spidermonkey source code you can download gzipped spidermonkey source code from the following urls: http://ftp.mozilla.org/pub/spidermonkey/releases/ http://ftp.mozilla.org/pub/spidermonkey/prereleases/ here is a command-line example of downloading and unzipping spidermonkey source code version 59.0: mkdir mozilla cd mozilla wget http://ftp.mozilla.org/pub/spidermonkey/prereleases/59/pre1/mozjs-59.0a1.0.tar.bz2 tar xvf mozjs-59.0a1.0.tar.bz2 these commands should work on most platforms including windows, as long as on windows you are using the mozillabuild bash shell.
Invariants
the public api for compartment-hopping, jsautoentercompartment, and the internal api, js::autocompartment, both make sure the invariant is maintained.
Tracing JIT
the trace monitor maintains some book-keeping information, as well as the collection of recorded fragments, held in a hashtable keyed by the interpreter's program counter and global object shape at the time of recording.
JS::CompileOptions
the compiler itself just needs to be able to access a collection of options; it doesn't care who owns them, or what's keeping them alive.
JSObject
the javascript engine sometimes uses this relationship to implement lexical scoping.
JSObjectOps.lookupProperty
note: a successful return with non-null *propp means the implementation may have locked *objp and added a reference count associated with *propp, so callers should not risk deadlock by nesting or interleaving other lookups or any obj-bearing ops before dropping *propp.
JS_Enumerate
but, for example, if an application calls back into javascript while it is looping over the property ids in the jsidarray, the script could delete properties from obj.
JS_GetParent
an object's parent serves two purposes in spidermonkey: for some functions, it is used to implement lexical scoping (but this is an implementation detail).
JS_SetDestroyCompartmentCallback
description js_setdestroycompartmentcallback sets callback function which will be called when sweeping each compartment of the runtime, before deleting the compartment.
JS_SetParent
(for some function objects, the parent chain is also used to implement lexical scoping, but this should be considered an implementation detail.) ordinarily an application sets a new object's parent by passing the parent object to js_newobject, and that is the preferred approach.
Shell global objects
if omitted, attach no source map url to the code (although the code may provide one itself, via a //#sourcemappingurl comment).
Mozilla Projects
to that end, this document will be revised over time as we find new and better ways of helping developers.
Redis Tips
(press ctrl-c to quit) 1) "subscribe" 2) "message-channel" 3) (integer) 1 in the same way the blpopping redis-cli blocked, this redis-cli is not capable of doing anything but listen for messages.
Signing Mozilla apps for Mac OS X
firefox and thunderbird releases are both signed before shipping; this article describes the process.
Gecko object attributes
value attributes valuetext a text equivalent to the current value, such as "high" in a slider or "unzipping files" in a progress meter.
AT APIs Support
developing a xul window is not that different from developing a web page, but the elements available to add widgets are more powerful and designed to be similar to desktop widgets.
AT Development
this page includes: aria references - w3c specification reflecting aria mapping into at apis.
Life After XUL: Building Firefox Interfaces with HTML
this page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox.
Places utilities for JavaScript
this is useful for wrapping a container as type_x_moz_url, type_html or type_unicode.
Using the Places history service
when the user starts browsing (for example, by typing in a link or following a bookmark), a new session id is created.
Toolkit API
mation about how to package themes multiple-item extension packaging: specific information about multiple-item extension xpis xul application packaging: specific information about how to package xulrunner applications chrome registration printing in xul apps see also the following developer pages contain examples and discussions of particular topics: xul xul overlays developing extensions xulrunner developing themes dom rdf storage ...
XML Extras
edmond woychowsky has also written articles on xml data islands in mozilla: "make xml data islands work in mozilla", "build cross-browser xml paging code" and "implement a flexible shopping cart with xml and asp".
Aggregating the In-Memory Datasource
also, instead of keeping an nscomptr<nsirdfdatasource>, you'll just want an nscomptr<nsisupports>: class myclass : public nsimyinterface { ...
Fun With XBL and XPConnect
: <property name="autocompletelistener"> <![cdata[ ({ onautocompleteresult: function(aitem, aoriginalstring, amatch) { if ( aitem ) { anonymouscontent[0].value = amatch; } } }) ]]> </property> as long as the js for the value of autocompletelistener evaluates to an object (and wrapping the expression with a set of parens like i did, does this), then the value of autocompletelistener is an object that implements my interface.
XPCOM array guide
MozillaTechXPCOMGuideArrays
it enforces both typesafety and xpcom reference counting by keeping an owning reference to each element in the array.
Building the WebLock UI
grouping radio elements together creates the toggling ui by requiring that one or another of the elements be selected, but not both.
Using XPCOM Components
this service, which is defined in the basic nsisupports interface and implemented by all xpcom components, allows you to query and switch interfaces on a component as part of the runtime object typing capabilities of xpcom.
Creating XPCOM components
al following along with the examples conventions acknowledgements an overview of xpcom the xpcom solution gecko components interfaces interfaces and encapsulation the nsisupports base interface xpcom identifiers cid contract id factories xpidl and type libraries xpcom services xpcom types method types reference counting status codes variable mappings common xpcom error codes using xpcom components component examples cookie manager the webbrowserfind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom components from script component internals creating components in cpp xpcom initialization xpcom registry ma...
Detailed XPCOM hashtable guide
nsdatahashtable/nsinterfacehashtable/nsclasshashtable - high-level c++ wrappers around pldhash; simplifies the common usage pattern mapping a simple keytype to a simple datatype; client does not need to declare or manage an entry class; nsdatahashtable datatype is a scalar such as pruint32; nsinterfacehashtable datatype is an interface; nsclasshashtable datatype is a class pointer owned by the hashtable.
Introduction to XPCOM for the DOM
see also the xpidl reference mapping dom objects to their c class modularization techniques ...
Components.Constructor
it eliminates the clutter of typing components.classes, components.interfaces, createinstance, and so on every time you wish to create an instance.
Observer Notifications
sent by the telemetry service when it's time to start gathering telemetry data, since the telemetry ping is coming soon.
nsACString_internal
@param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsAString_internal
@param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsDependentCSubstring
@param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsDependentSubstring
@param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
IAccessibleHyperlink
an example is an image map which is an image with multiple links each of which is associated with a separate non-overlapping area of the image.
mozIStorageStatementWrapper
return value returns true if the stepping the wrapped statement was successful, otherwise returns false.
mozITXTToHTMLConv
kstructphrase unsigned long enables conversion of text attributes, such as converting "*some text*" to boldfaced "some text" by wrapping in the html <strong> element.
GroupPosition
« nsiaccessible page summary this method returns grouping information.
nsIAccessible
groupposition this method returns grouping information.
nsIAccessibleRelation
when there is more than one object in the group each member may have one and the same target, for example a grouping object.
nsIAuthPromptAdapterFactory
netwerk/base/public/nsiauthpromptadapterfactory.idlscriptable an interface for wrapping nsiauthprompt interfaces to make them usable via an nsiauthprompt2 interface.
nsIChannel
if asyncopen returns successfully, the channel is responsible for keeping itself alive until it has called onstoprequest on alistener or called onchannelredirect.
nsIDBChangeListener
common events should be documented here so we have a hope of keeping the documentation up to date.
nsIDOMFileList
gecko 1.9.2 note starting in gecko 1.9.2, this is also used by the datatransfer object to support dragging and dropping files into web applications.
nsIDynamicContainer
anewindex); void oncontainernodeclosed(in nsinavhistorycontainerresultnode acontainer); void oncontainernodeopening(in nsinavhistorycontainerresultnode acontainer, in nsinavhistoryqueryoptions aoptions); void oncontainerremoving(in long long aitemid); methods oncontainermoved() this method is called when the given container has just been moved, in case the service needs to do any bookkeeping.
nsIFeed
1.0 66 introduced gecko 1.8 inherits from: nsifeedcontainer last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) attributes attribute type description cloud nsiwritablepropertybag2 the cloud element on a feed is used to identify the api endpoint of an rsscloud ping server, which distributes notifications of changes to this feed.
nsIFrameLoaderOwner
ns_error_not_implemented if the swapping logic is not implemented for the either the current frame loader owner or the specified one with which you're trying to swap.
nsIMsgSearchTerm
attribute acstring customid; beginsgrouping attribute boolean beginsgrouping; endsgrouping attribute boolean endsgrouping; methods matchrfc822string boolean matchrfc822string(in string astring, in string charset, in boolean charsetoverride); matchrfc2047string boolean matchrfc2047string(in string astring, in string charset, in boolean charsetoverride); matchdate boolean matchdate(in prtime atime); matchstatus boolean matchst...
nsINavBookmarksService
for example, if i bookmark "mozilla.org" by manually typing it in, and follow the bookmark, i will get redirected to "www.mozilla.org".
nsINavHistoryResultNode
title autf8string title of the web page or of the node's grouping (day, host, folder, and so on.).
nsINavHistoryVisitResultNode
1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 1.9 (firefox 3) attributes attribute type description sessionid long long the session id of the visit, used for session grouping when a tree view is sorted by date.
nsIParserUtils
wrapcol number of characters per line; 0 for no auto-wrapping.
nsIRequestObserver
astatuscode reason for stopping (ns_ok if completed successfully) see also nsistreamlistener ...
nsISocketProviderService
netwerk/socket/nsisocketproviderservice.idlscriptable provides a mapping between a socket type and its associated socket provider instance.
nsISocketTransportService
netwerk/base/public/nsisockettransportservice.idlscriptable this interface provides a mapping between a socket type and its associated socket provider instance.
nsISupports proxies
xpinstall installation scripts are sometimes very complex and can require long execution time due to unzipping or native file system actions.
nsITextInputProcessorNotification
so, nsitextinputprocessorcallback won't be changed for keeping backward compatibility.
nsITreeView
a value of true will result in the tree popping up a text field when the user tries to inline edit the cell.
nsIWebProgressListener
this example here shows you how to detect what flags are popping up where.
nsIWebSocketListener
astatuscode reason for stopping (ns_ok if completed successfully).
nsIZipReader
escaping is required for all special characters unless otherwise specified.
nsIZipWriter
+ dirarr[i].leafname + ' path: ' + dirarr[i].path); var direntries = dirarr[i].directoryentries; while (direntries.hasmoreelements()) { var entry = direntries.getnext().queryinterface(ci.nsifile); //entry is instance of nsifile so here https://developer.mozilla.org/docs/xpcom_interface_reference/nsifile if (entry.path == xpi.path) { cu.reporterror('skipping entry - will not add this entry to the zip file - as this is the zip itself: "' + xpi.path + '" leafname:"' + xpi.leafname + '"'); continue; } if (entry.isdirectory()) { dirarr.push(entry); } var relpath = entry.path.replace(dirarr[0].path, ''); //need relative because we need to use this for telling addentryfile where in the zip it sho...
Setting HTTP request headers
trapping other requests is done with notifications, which are a lot like events or signals found in other languages and frameworks.
Using the Gecko SDK
(<tt>about:buildconfig</tt> can be loaded in mozilla to reveal details about the compiler that was used.) for the remainder of this guide, we'll assume you are developing components under linux.
Weak reference
by now you've probably noticed that this particular weak reference implementation doesn't give you exactly the interface you were hoping for.
Xptcall Porting Status
he is hoping that others will help test the changes using these two compilers on the various platforms where this same code is used.
pyxpidl
generating c++ headers to generate c++ headers, use the header.py utility: sdkdir/sdk/bin/header.py --cachedir=<path> -o <outputfilename.h> <filename.idl> generating typelibs generating typelib files is done using the typelib.py utility: sdkdir/sdk/bin/typelib.py --cachedir=<path> -o <outputfilename.xpt> <filename.idl> comparing pyxpidl to xpidl this table provides a mapping of old xpidl options to pyxpidl.
Mozilla technologies
completed, but the long-term goal is to remove webshell and switch over entirely to docshell.embedded dialog apifeed content access apifirefox 2 and thunderbird 2 introduce a series of interfaces that make it easy for extension authors to access rss and atom feeds.life after xul: building firefox interfaces with htmlthis page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox.morkmork is a database file format invented by david mccusker for the mozilla code since the original netscape database information was proprietary and could not be released open source.
DB Views (message lists)
nsmsggroupview is used when grouping is turned on.
Spam filtering
initially, the training.dat file is empty (there was discussion of shipping with a default file).
The libmime module
the alternative to that involves typing the literal name of the direct superclass of the class defined in this file, which will be a maintenance headache if the class hierarchy changes.
Building a Thunderbird extension 1: introduction
references and resources tools and helper extensions there are many tools available that help with developing thunderbird extensions.
Creating a Custom Column
getting started in this example we will be developing a small extension that will be adding a column that will display the "reply-to:" field of an email (if it exists, it if often not set).
FAQ
mozillazine's getting started tutorial might provide some useful general pointers regarding developing mozilla extensions.
customDBHeaders Preference
getting started to build upon the reply-to column tutorial, i'll describe the process i went through in developing a custom column to display a 'superfluous' column within thunderbird's main view.
Using the Mozilla symbol server
to use only the mozilla symbol server, add the following entry to your symbol path (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols): srv*c:\symcache\*https://symbols.mozilla.org/ set this string as _nt_symbol_path in the environment, using the windbg menus, or by typing the .sympath command.
Working with windows in chrome code
suppose you're developing a browser extension that consists of a browser.xul overlay and an options window.
Add to iPhoto
basic cftype routines handle memory management, dumping cftype objects to the console, comparing cftype values, and so forth.
Memory Management
keeping objects alive the following js-ctypes objects will hold references to objects, keeping them alive.
PKCS #11 Netscape Trust Objects - Network Security Services
cka_trust_time_stamping ck_trust level of trust for time stamping purpose.
Plug-in Basics - Plugins
for details about the html elements and their attributes, go on to: using the object element for plug-in display using the embed element for plug-in display plug-in display modes whether you are writing an html page to display a plug-in or developing a plug-in for an html author to include in a page, you need to understand how the display mode affects the way plug-ins appear.
Plugin Roadmap for Firefox - Plugins
adobe will stop shipping security updates for flash at the end of 2020.
Examine, modify, and watch variables - Firefox Developer Tools
you can filter the variables that are displayed, either by using the "*" modifier in the script filter, or by typing into the filter variables box, if you have enabled this in the debugger settings.
Ignore a source - Firefox Developer Tools
the debugger skips through ignored sources when stepping.
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
console.log("stopping allocation tracking."); dbg.removealldebuggees(); dbg = undefined; // analyze and display the allocation log.
Index - Firefox Developer Tools
found 158 pages: # page tags and summary 1 firefox developer tools developing mozilla, guide, tools, web development, web development:tools, l10n:priority firefox developer tools is a set of web developer tools built into firefox.
All keyboard shortcuts - Firefox Developer Tools
end end end expand currently selected node right arrow right arrow right arrow collapse currently selected node left arrow left arrow left arrow (when a node is selected) move inside the node so you can start stepping through attributes.
Dominators view - Firefox Developer Tools
this enables you to see all the nodes that are keeping the given node from being garbage-collected.
Inspecting web sockets - Firefox Developer Tools
displays messages for control frames (ping, pong, or close).
Network request list - Firefox Developer Tools
you can focus it by clicking in the filter box, or by pressing ctrl + f (or cmd + f on a mac); then start typing.
Page inspector 3-pane mode - Firefox Developer Tools
enabling the 3-pane inspector pre-firefox 62 in earlier versions of firefox (since firefox 59/60), you can enable 3 pane mode in release/beta by going to about:config and flipping the following prefs to true: devtools.inspector.split-rule-enabled — this switches 3-pane mode on and off.
Page inspector keyboard shortcuts - Firefox Developer Tools
end end end expand currently selected node right arrow right arrow right arrow collapse currently selected node left arrow left arrow left arrow (when a node is selected) move inside the node so you can start stepping through attributes.
Intensive JavaScript - Firefox Developer Tools
the function calls are interleaved with the pink blocks from the css animation, and each function is short enough that the browser can handle it without the overall frame rate dropping.
Settings - Firefox Developer Tools
autoclose brackets determines whether typing an opening character like [ or { will cause the editor to insert the matching closing character ] or } for you.
Shader Editor - Firefox Developer Tools
this is useful for focusing on certain shaders or hiding overlapping geometry: if you click the entry, its vertex and fragment shaders are shown in the other two panes, and you can edit them.
Style Editor - Firefox Developer Tools
just start typing, and it will offer you a list of suggestions.
Web Console Helpers - Firefox Developer Tools
pprint() obsolete since gecko 74 formats the specified value in a readable way; this is useful for dumping the contents of objects and arrays.
about:debugging - Firefox Developer Tools
starting in firefox 78, the url bar is editable, so that you can change the url used by the browser on the remote device, by typing in firefox for desktop.
Animation.play() - Web APIs
WebAPIAnimationplay
return value undefined example in the growing/shrinking alice game example, clicking or tapping the cake causes alice's growing animation (alicechange) to play forward, causing her to get bigger, as well as triggering the cake's animation.
Animation.reverse() - Web APIs
WebAPIAnimationreverse
return value undefined example in the growing/shrinking alice game example, clicking or tapping the bottle causes alice's growing animation (alicechange) to play backwards, causing her to get smaller.
Animation - Web APIs
WebAPIAnimation
animation.reverse() reverses playback direction, stopping at the start of the animation.
AudioContext.createMediaStreamDestination() - Web APIs
stopping the mediarecorder causes the dataavailable event to fire, and the event data is pushed into the chunks array.
AudioParam.exponentialRampToValueAtTime() - Web APIs
endtime a double representing the exact time (in seconds) after the ramping starts that the changing of the value will stop.
AudioParam.linearRampToValueAtTime() - Web APIs
endtime a double representing the exact time (in seconds) after the ramping starts that the changing of the value will stop.
AudioParamMap - Web APIs
the web audio api interface audioparammap represents a set of multiple audio parameters, each described as a mapping of a domstring identifying the parameter to the audioparam object representing its value.
AudioTrack.enabled - Web APIs
once those have been found, the values of the two tracks' enabled properties are exchanged, which results in swapping which of the two tracks is currently active.
Background Tasks API - Web APIs
window.requestidlecallback() makes it possible to become actively engaged in helping to ensure that the browser's event loop runs smoothly, by allowing the browser to tell your code how much time it can safely use without causing the system to lag.
BaseAudioContext.createDelay() - Web APIs
if you just press the play buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time.
BaseAudioContext.createDynamicsCompressor() - Web APIs
it is especially important in games and musical applications where large numbers of individual sounds are played simultaneously, where you want to control the overall signal level and help avoid clipping (distorting) of the audio output.
CDATASection - Web APIs
the symbols < and & don’t need escaping as they normally do when inside a cdata section.
CSS.escape() - Web APIs
WebAPICSSescape
--a') // "--a" css.escape(0) // "\30 ", the unicode code point of '0' is 30 css.escape('\0') // "\ufffd", the unicode replacement character in context uses to escape a string for use as part of a selector, the escape() method can be used: var element = document.queryselector('#' + css.escape(id) + ' > img'); the escape() method can also be used for escaping strings, although it escapes characters that don't strictly need to be escaped: var element = document.queryselector('a[href="#' + css.escape(fragment) + '"]'); specification specification status comment css object model (cssom)the definition of 'css.escape()' in that specification.
CSS Object Model (CSSOM) - Web APIs
reference animationevent caretposition css csscharsetrule cssconditionrule csscounterstylerule cssfontfacerule cssfontfeaturevaluesmap cssfontfeaturevaluesrule cssgroupingrule cssimportrule csskeyframerule csskeyframesrule cssmarginrule cssmediarule cssnamespacerule csspagerule cssrule cssrulelist cssstyledeclaration cssstylesheet cssstylerule csssupportsrule cssvariablesmap cssviewportrule elementcssinlinestyle fontface fontfaceset fontfacesetloadevent geometryutils getstyleutils linkstyle medialist mediaquerylist mediaquerylistevent mediaquerylis...
CacheStorage - Web APIs
maintains a mapping of string names to corresponding cache objects.
CanvasRenderingContext2D.drawWindow() - Web APIs
the contents of the window's viewport are rendered, ignoring viewport clipping and scrolling.
CanvasRenderingContext2D.globalCompositeOperation - Web APIs
see also compositing and clipping in the canvas tutorial.
CanvasRenderingContext2D.restore() - Web APIs
the canvasrenderingcontext2d.restore() method of the canvas 2d api restores the most recently saved canvas state by popping the top entry in the drawing state stack.
CanvasRenderingContext2D.save() - Web APIs
the current clipping region.
CanvasRenderingContext2D.scale() - Web APIs
flipping things horizontally or vertically you can use scale(-1, 1) to flip the context horizontally and scale(1, -1) to flip it vertically.
Applying styles and colors - Web APIs
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.
Basic animations - Web APIs
0, 0)'; ctx.arc(0, 0, 3, 0, math.pi * 2, true); ctx.fill(); ctx.restore(); ctx.beginpath(); ctx.linewidth = 14; ctx.strokestyle = '#325fa2'; ctx.arc(0, 0, 142, 0, math.pi * 2, true); ctx.stroke(); ctx.restore(); window.requestanimationframe(clock); } window.requestanimationframe(clock); <canvas id="canvas" width="150" height="150"></canvas> screenshotlive sample a looping panorama in this example, a panorama is scrolled left-to-right.
Drawing shapes with canvas - Web APIs
the two for loops are for looping through the rows and columns of arcs.
Transformations - Web APIs
the current clipping path, which we'll see in the next section.
Using images - Web APIs
this is done simply by looping and placing the scaled images at different positions.
Canvas tutorial - Web APIs
in this tutorial basic usage drawing shapes applying styles and colors drawing text using images transformations compositing and clipping basic animations advanced animations pixel manipulation hit regions and accessibility optimizing the canvas finale ...
Clipboard - Web APIs
WebAPIClipboard
a typical application accesses clipboard functionality by mapping user input such as keybindings, menu selections, etc.
Credential Management API - Web APIs
these capabilities allow users to sign in without typing passwords, see the federated account they used to sign in to a site, and resume a session without the explicit sign-in flow of an expired session.
DelayNode.delayTime - Web APIs
if you just press the play buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time.
DelayNode - Web APIs
WebAPIDelayNode
if you just press the play buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time.
Document.createNSResolver() - Web APIs
to match default elements in a non-null namespace, you either have to refer to a particular element using a form such as *namespace-uri()=http://www.w3.org/1999/xhtml and name()=p[@id='_myid'] (this approach works well for dynamic xpath expressions where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace.
Document.lastModified - Web APIs
t message when the page changes (see also: javascript cookies api): if (date.parse(document.lastmodified) > parsefloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1") || "0")) { document.cookie = "last_modif=" + date.now() + "; expires=fri, 31 dec 9999 23:59:59 gmt; path=" + location.pathname; alert("this page has changed!"); } …the same example, but skipping the first visit: var nlastvisit = parsefloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1")), nlastmodif = date.parse(document.lastmodified); if (isnan(nlastvisit) || nlastmodif > nlastvisit) { document.cookie = "last_modif=" + date.now() + "; expires=fri, 31 dec 9999 23:59:59 gmt; path=" + location.pathname; if (isfinite(nlastvisit)) { alert("th...
DynamicsCompressorNode() - Web APIs
the dynamicscompressornode() constructor creates a new dynamicscompressornode object which provides a compression effect, which lowers the volume of the loudest parts of the signal, in order to help prevent clipping and distortion.
DynamicsCompressorNode - Web APIs
the dynamicscompressornode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once.
EXT_shader_texture_lod - Web APIs
sampler2d sampler, vec2 p, vec2 dpdx, vec2 dpdy) vec4 texture2dprojgradext(sampler2d sampler, vec3 p, vec2 dpdx, vec2 dpdy) vec4 texture2dprojgradext(sampler2d sampler, vec4 p, vec2 dpdx, vec2 dpdy) vec4 texturecubegradext(samplercube sampler, vec3 p, vec3 dpdx, vec3 dpdy) examples enabling the extensions: gl.getextension('ext_shader_texture_lod'); shader code that avoids artifacts when wrapping texture coordinates: <script type="x-shader/x-fragment"> #extension gl_ext_shader_texture_lod : enable #extension gl_oes_standard_derivatives : enable uniform sampler2d mytexture; varying vec2 texcoord; void main(){ gl_fragcolor = texture2dgradext(mytexture, mod(texcoord, vec2(0.1, 0.5)), dfdx(texcoord), dfdy(texcoord)); } </script> specifications ...
EXT_texture_filter_anisotropic - Web APIs
using just mipmapping, these lookups have a tendency to average to grey.
Element: auxclick event - Web APIs
.backgroundcolor = randomcolor(); }; button.onauxclick = function(e) { e.preventdefault(); button.style.color = randomcolor(); } button.oncontextmenu = function(e) { e.preventdefault(); } notice that in addition to capturing the auxclick event using onauxclick, the contextmenu event is also captured, and preventdefault() called on that event, in order to prevent the context menu from popping up after the color change is applied.
Element.classList - Web APIs
WebAPIElementclassList
in all polyfilled browsers (ie6-9), an additional element[" uclp"] property is added to element to ensure standards compliant prototyping, and a domtokenlist[" ucl"] property is added to each element["classlist"] object to ensure that the domtokenlist is bounded to its own element.
Element.msZoomTo() - Web APIs
WebAPIElementmsZoomTo
example /* zooming in on an element while still keeping it centered in the viewport */ var args = { contentx: target.offsetleft + target.offsetwidth/2; contenty: target.offsettop + target.offsetheight/2; scalefactor: 2.0; } zoomer.mszoomto(args); see also microsoft api extensions ...
Event.preventDefault() - Web APIs
<code>preventdefault()</code> won't let you check this!<br>"; event.preventdefault(); }, false); html <p>please click on the checkbox control.</p> <form> <label for="id-checkbox">checkbox:</label> <input type="checkbox" id="id-checkbox"/> </form> <div id="output-box"></div> result stopping keystrokes from reaching an edit field the following example demonstrates how invalid text input can be stopped from reaching the input field with preventdefault().
Event - Web APIs
WebAPIEvent
clicking the mouse button or tapping keyboard, or generated by apis to represent the progress of an asynchronous task.
EventTarget.addEventListener() - Web APIs
actually, regarding memory consumption, the lack of keeping a function reference is not the real issue; rather it is the lack of keeping a static function reference.
Using files from web applications - Web APIs
example: showing thumbnails of user-selected images let's say you're developing the next great photo-sharing website and want to use html to display thumbnail previews of images before the user actually uploads them.
FormData.append() - Web APIs
WebAPIFormDataappend
for example (and being compatible with php's naming conventions by adding [] to the name): formdata.append('userpic[]', myfileinput.files[0], 'chris1.jpg'); formdata.append('userpic[]', myfileinput.files[1], 'chris2.jpg'); this technique makes it simpler to process multi-file uploads because the resultant data structure is more conducive to looping.
Guide to the Fullscreen API - Web APIs
other information the document provides some additional information that can be useful when developing fullscreen web applications: documentorshadowroot.fullscreenelement the fullscreenelement property tells you the element that's currently being displayed fullscreen.
Gamepad.id - Web APIs
WebAPIGamepadid
this information is intended to allow you to find a mapping for the controls on the device as well as display useful feedback to the user.
Gamepad - Web APIs
WebAPIGamepad
gamepad.mapping read only a string indicating whether the browser has remapped the controls on the device to a known layout.
Using the Geolocation API - Web APIs
the geolocation api is used to retrieve the user's location, so that it can for example be used to display their position using a mapping api.
GlobalEventHandlers.onabort - Web APIs
stopping the load of the page?
msAudioCategory - Web APIs
alert looping or longer running alert sounds: alarms ring tones ringing notification sounds that need to attenuate existing audio no backgroundcapablemedia for audio that needs to continue playing in the background.
HTMLButtonElement - Web APIs
htmlbuttonelement.autofocus is a boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control.
HTMLInputElement.stepDown() - Web APIs
the stepdown() method will not allow the input to go out of range, in this case stopping when it reaches 0 and rounding down and floats that are passed as a parameter.
HTMLInputElement.stepUp() - Web APIs
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.
HTMLInputElement - Web APIs
see also readonly autofocus boolean: returns / sets the element's autofocus attribute, which specifies that a form control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control.
HTMLSelectElement - Web APIs
htmlselectelement.autofocus a boolean reflecting the autofocus html attribute, which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control.
HTMLTableCellElement - Web APIs
htmltablecellelement.axis a domstring containing a name grouping cells in virtual.
HTMLTextAreaElement - Web APIs
examples autogrowing textarea example make a textarea autogrow while typing: javascript function autogrow (ofield) { if (ofield.scrollheight > ofield.clientheight) { ofield.style.height = ofield.scrollheight + "px"; } } css textarea.noscrollbars { overflow: hidden; width: 300px; height: 100px; } html <form> <fieldset> <legend>your comments</legend> <p><textarea class="noscrollbars" onkeyup="autogrow(this);"></textarea></p> <p><input type...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
it then runs any pending javascript tasks, then any pending microtasks, then performs any needed rendering and painting before looping again to check for pending tasks.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
javascript promises and the mutation observer api both use the microtask queue to run their callbacks, but there are other times when the ability to defer work until the current event loop pass is wrapping up.
Drag Operations - Web APIs
bug 460801 see also html drag and drop api (overview) dragging and dropping multiple items recommended drag types html5 living standard: drag and drop ...
File drag and drop - Web APIs
note: html drag and drop defines two different apis to support dragging and dropping files.
InputEvent.data - Web APIs
WebAPIInputEventdata
examples in the following simple example we've set up an event listener on the input event so that when any change is made to the contents of the <input> element (either by typing or pasting), the text that was added is retrieved via the inputevent.data property and reported in the paragraph below the input.
IntersectionObserver.observe() - Web APIs
one observer has one set of thresholds and one root, but can watch multiple target elements for visibility changes in keeping with those.
KeyboardEvent - Web APIs
a user may be using one keyboard layout while typing text in a different language.
MediaSessionActionDetails.fastSeek - Web APIs
your handler should take steps to return as quickly as possible by skipping any steps of its operation which are only necessary when the seek operation is complete.
MediaSessionActionDetails - Web APIs
a "fast" seek is a seek being performed in a rapid sequence, such as when fast-forwarding or reversing through the media, rapidly skipping through it.
MediaStreamTrack.stop() - Web APIs
examples stopping a video stream in this example, we see a function which stops a streamed video by calling stop() on every track on a given <video>.
Recording a media element - Web APIs
stopping the input stream the stop() function simply stops the input media: function stop(stream) { stream.gettracks().foreach(track => track.stop()); } this works by calling mediastream.gettracks(), using foreach() to call mediastreamtrack.stop() on each track in the stream.
Using the MediaStream Recording API - Web APIs
keeping the interface constrained to the viewport, regardless of device height, with calc() the calc() function is one of those useful little utility features that's cropped up in css that doesn't look like much initially, but soon starts to make you think "wow, why didn't we have this before?
MediaStream Recording API - Web APIs
} function download() { var blob = new blob(recordedchunks, { type: "video/webm" }); var url = url.createobjecturl(blob); var a = document.createelement("a"); document.body.appendchild(a); a.style = "display: none"; a.href = url; a.download = "test.webm"; a.click(); window.url.revokeobjecturl(url); } // demo: to download after 9sec settimeout(event => { console.log("stopping"); mediarecorder.stop(); }, 9000); examining and controlling the recorder status you can also use the properties of the mediarecorder object to determine the state of the recording process, and its pause() and resume() methods to pause and resume recording of the source media.
MediaTrackConstraints - Web APIs
crop-and-scale means that the user agent can use cropping and downscaling on the camera output in order to satisfy other constraints that affect the resolution.
MediaTrackSettings - Web APIs
"crop-and-scale" the track's resolution might be the result of the user agent using cropping or downscaling from a higher camera resolution.
MutationObserver.takeRecords() - Web APIs
the most common use case for this is to immediately fetch all pending mutation records immediately prior to disconnecting the observer, so that any pending mutations can be processed when stopping down the observer.
Node.nextSibling - Web APIs
WebAPINodenextSibling
element.nextelementsibling may be used to obtain the next element skipping any whitespace nodes, other between-element text, or comments.
Using the Notifications API - Web APIs
to avoid duplicating code, we have stored a few bits of housekeeping code inside the handlepermission() function, which is the first main block inside this snippet.
OES_standard_derivatives - Web APIs
glsl built-in functions the following new functions can be used in glsl shader code, if this extension is enabled: gentype dfdx(gentype) gentype dfdy(gentype) gentype fwidth(gentype) examples enabling the extensions: gl.getextension('oes_standard_derivatives'); gl.getextension('ext_shader_texture_lod'); shader code that avoids artifacts when wrapping texture coordinates: <script type="x-shader/x-fragment"> #extension gl_ext_shader_texture_lod : enable #extension gl_oes_standard_derivatives : enable uniform sampler2d mytexture; varying vec2 texcoord; void main(){ gl_fragcolor = texture2dgradext(mytexture, mod(texcoord, vec2(0.1, 0.5)), dfdx(texcoord), dfdy(texcoord)); } </script> specifications ...
ParentNode.replaceChildren() - Web APIs
you simply call it on the parent node without any argument specified: mynode.replacechildren(); transferring nodes between parents replacechildren() enables you to easily transfer nodes between parents, without having to resort to verbose looping code.
PaymentAddress.country - Web APIs
a-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.
PaymentAddress.organization - Web APIs
this should be the name of the organization that is to receive the shipment for shipping addresses, or which is repsonsible for payment for payment addresses.
PaymentCurrencyAmount.value - Web APIs
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" } verifying a properly formatted price you can ensure that the value entered as a price is formatted correctly prior to submission by matching it against a simple regular expression: function checkpriceformat(price) { let validregex = /^-?[0-9]+(\.[0-9]+...
PaymentCurrencyAmount - Web APIs
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.
PaymentDetailsBase - Web APIs
shippingoptionsoptional an array of paymentshippingoption objects, each describing one available shipping option from which the user may choose.
PaymentItem - Web APIs
this can be used to show items such as shipping or tax amounts that depend upon the selection of shipping address, shipping option, or so forth.
PaymentRequest: merchantvalidation event - Web APIs
related events payerdetailchange, paymentmethodchange, shippingaddresschange, and shippingoptionchange specifications specification status comment payment request apithe definition of 'merchantvalidation' in that specification.
PaymentResponse.details - Web APIs
payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, // payment details as you requested details: paymentresponse.details, // shipping address information address: todict(paymentresponse.shippingaddress) }; // send information to the server }); specifications specification status comment payment request api candidate recommendation initial definition.
PaymentResponse.methodName - Web APIs
payment.show().then(paymentresponse => { var paymentdata = { // payment method string method: paymentresponse.methodname, // payment details as you requested details: paymentresponse.details, // shipping address information address: todict(paymentresponse.shippingaddress) }; // send information to the server }); specifications specification status comment payment request api candidate recommendation initial definition.
PaymentValidationErrors - Web APIs
shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shipping address that failed validation.
Pbkdf2Params - Web APIs
the general guidance here is to use as many iterations as possible, subject to keeping an acceptable level of performance for your application.
PerformanceNavigation.type - Web APIs
possible values are: value constant name meaning 0 type_navigate the page was accessed by following a link, a bookmark, a form submission, a script, or typing the url in the address bar.
PerformanceNavigation - Web APIs
possible values are: type_navigate (0) the page was accessed by following a link, a bookmark, a form submission, or a script, or by typing the url in the address bar.
Performance Timeline - Web APIs
performance observers : as shown in the performanceobserver interface's browser compatibility table, this interface has no shipping implementations.
Multi-touch interaction - Web APIs
move_event(ev) { // remove this event from the target's cache var cache = get_cache(ev); for (var i = 0; i < cache.length; i++) { if (cache[i].pointerid == ev.pointerid) { cache.splice(i, 1); break; } } } update background color the background color of the touch areas will change as follows: no active touches is white; one active touch is yellow; two simultaneous touches is ping and three or more simultaneous touches is lightblue.
Using Pointer Events - Web APIs
this may be a trackpad, a touch screen, or even a virtual mapping of a user's desk surface (or mousepad) with the physical screen.
Pointer events - Web APIs
this mapping of events is called compatibility mouse events.
RTCIceCandidatePairStats.consentExpiredTimestamp - Web APIs
this indicates when the current stun bindings — the mapping of the ip address and port configurations for both peers on the webrtc connection — are due to expire.
RTCIceCandidateStats.priority - Web APIs
1 for rtp, 2 for rtcp) the candidate's priority is computed using the formula (ptype is the priority of the candidate's type and plocal is the priority of the ip address): priority = 224×ptype + 28×plocal + (256 - componentid)priority\quad =\quad { 2 }^{ 24 }\times { p }_{ type }\quad +\quad { 2 }^{ 8 }\times { p }_{ local }\quad +\quad (256\quad -\quad componentid) this is equivalent to mapping the priorities of teh candidate type, the local ip, and the component id into various bit ranges within the 32-bit priority value.
RTCInboundRtpStreamStats.perDscpPacketsReceived - Web APIs
note: due to network bleaching and remapping, the numbers seen on this record are not necessarily going to match the values as they were when the data was sent.
RTCInboundRtpStreamStats.sliCount - Web APIs
in general, what's usually of interest is that the higher this number is, the more the stream data is becoming corrupted between the sender and the receiver, requiring resends or dropping frames.
RTCOutboundRtpStreamStats.perDscpPacketsSent - Web APIs
note: due to network bleaching and remapping, the numbers seen on this record are not necessarily going to match the values as they were when the data was sent.
RTCOutboundRtpStreamStats - Web APIs
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.
RTCPeerConnection.close() - Web APIs
all rtcrtpsender objects are considered to be stopped once this returns (they may still be in the process of stopping, but for all intents and purposes, they're stopped).
RTCRtpContributingSource.audioLevel - Web APIs
this is the amplitude relative to the point at which clipping of the audio begins to occur.
RTCRtpStreamStats - Web APIs
combined with rtcreceivedrtpstreamstats.framesdecoded or rtcsentrtpstreamstats.framesencoded, you can approximate the average qp over those frames, keeping in mind that codecs often vary the quantizer values even within frames.
RTCStatsReport - Web APIs
this statistics report contains a mapping of statistic category string names to objects containing the corresponding statistics data.
RequestDestination - Web APIs
navigator.sendbeacon(), eventsource, <a ping>, <area ping>, fetch(), xmlhttprequest, websocket, cache and more.
Using the Resource Timing API - Web APIs
load some image to trigger "resource" fetch events var image1 = new image(); image1.src = "https://developer.mozilla.org/static/img/opengraph-logo.png"; var image2 = new image(); image2.src = "http://mozorg.cdn.mozilla.net/media/img/firefox/firefox-256.e2c1fc556816.jpg" // set a callback if the resource buffer becomes filled performance.onresourcetimingbufferfull = buffer_full; } coping with cors when cors is in effect, many of the timing properties' values are returned as zero unless the server's access policy permits these values to be shared.
SVGAElement - Web APIs
svgaelement.ping is a domstring that reflects the ping attribute, containing 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 (in the background).
Screen Wake Lock API - Web APIs
there are plenty of use cases for keeping a screen on, including reading an ebook, map navigation, following a recipe, presenting to an audience, scanning a qr/barcode or applications that use voice or gesture control, rather than tactile input (the default way to keep a screen awake).
Service Worker API - Web APIs
it provides a master directory of all the named caches that a serviceworker can access, and maintains a mapping of string names to corresponding cache objects.
Streams API concepts - Web APIs
after the calculation is performed, chunk generation will be slowed down/sped up as appropriate to keep the stream flowing as fast as possible while keeping the desired size above zero.
SubmitEvent.submitter - Web APIs
examples in this example, a shopping cart may have an assortment of different submit buttons depending on factors such as the user's settings, the shop's settings, and any minimum or maximum shopping card totals established by the payment processors.
SubmitEvent - Web APIs
examples in this example, a shopping cart may have an assortment of different submit buttons depending on factors such as the user's settings, the shop's settings, and any minimum or maximum shopping card totals established by the payment processors.
Text.splitText() - Web APIs
WebAPITextsplitText
the text.splittext() method breaks the text node into two nodes at the specified offset, keeping both nodes in the tree as siblings.
TextTrack.mode - Web APIs
WebAPITextTrackmode
the user agent is keeping a list of the active cues (in the track's activecues property) and events are being fired at the corresponding times, even though the text isn't being displayed.
URLSearchParams.set() - Web APIs
line #41: comment out this line to stop dumping the search parameters to the console (debug).
VideoPlaybackQuality.droppedVideoFrames - Web APIs
this information can be used to determine whether or not to downgrade the video stream to avoid dropping frames.
VideoPlaybackQuality.totalVideoFrames - Web APIs
var videoelem = document.getelementbyid("my_vid"); var quality = videoelem.getvideoplaybackquality(); if ((quality.corruptedvideoframes + quality.droppedvideoframes)/quality.totalvideoframes > 0.1) { lostframesthresholdexceeded(); } a similar algorithm might be used to attempt to switch to a lower-resolution video that requires less bandwidth, in order to avoid dropping frames.
WEBGL_draw_buffers - Web APIs
amebuffer, fb); gl.framebuffertexture2d(gl.framebuffer, ext.color_attachment0_webgl, gl.texture_2d, tx[0], 0); gl.framebuffertexture2d(gl.framebuffer, ext.color_attachment1_webgl, gl.texture_2d, tx[1], 0); gl.framebuffertexture2d(gl.framebuffer, ext.color_attachment2_webgl, gl.texture_2d, tx[2], 0); gl.framebuffertexture2d(gl.framebuffer, ext.color_attachment3_webgl, gl.texture_2d, tx[3], 0); mapping the color attachments to draw buffer slots that the fragment shader will write to using gl_fragdata: ext.drawbufferswebgl([ ext.color_attachment0_webgl, // gl_fragdata[0] ext.color_attachment1_webgl, // gl_fragdata[1] ext.color_attachment2_webgl, // gl_fragdata[2] ext.color_attachment3_webgl // gl_fragdata[3] ]); shader code that writes to multiple textures: <script type="x-shader/x-f...
WaveShaperNode - Web APIs
it is an audionode that uses a curve to apply a wave shaping distortion to the signal.
Basic scissoring - Web APIs
scissoring establishes a clipping region outside which drawing will not occur.
Simple color animation - Web APIs
a click event handler additionally enables the basic user interaction of starting and stopping the animation.
Animating textures in WebGL - Web APIs
= 0; const internalformat = gl.rgba; const width = 1; const height = 1; const border = 0; const srcformat = gl.rgba; const srctype = gl.unsigned_byte; const pixel = new uint8array([0, 0, 255, 255]); // opaque blue gl.teximage2d(gl.texture_2d, level, internalformat, width, height, border, srcformat, srctype, pixel); // turn off mips and set wrapping to clamp to edge so it // will work regardless of the dimensions of the video.
WebGL tutorial - Web APIs
animating textures in webgl shows how to animate textures; in this case, by mapping an ogg video onto the faces of a rotating cube.
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
good for quick prototyping and experimenting.
WebRTC connectivity - Web APIs
lots of info here is good but the organization is a mess since this is sort of a dumping ground right now.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
keeping latency to a minimum is especially important for webrtc, since face-to-face communication needs to be performed with as little latency as possible.
Lifetime of a WebRTC session - Web APIs
this is like trying to mail a package to your friend michelle by labeling it “michelle” and dropping it in a mailbox when you don't know her address.
Signaling and video calling - Web APIs
ending the call the closevideocall() function, shown below, is responsible for stopping the streams, cleaning up, and disposing of the rtcpeerconnection object: function closevideocall() { var remotevideo = document.getelementbyid("received_video"); var localvideo = document.getelementbyid("local_video"); if (mypeerconnection) { mypeerconnection.ontrack = null; mypeerconnection.onremovetrack = null; mypeerconnection.onremovestream = null; mypeerconnection.oni...
A simple RTCDataChannel sample - Web APIs
the rest of this method is just some user experience sugar -- the input box is emptied and re-focused so the user can immediately begin typing another message.
Using DTMF with WebRTC - Web APIs
this is done by stopping each stream on both the caller and the receiver by iterating over each rtcpeerconnection's track list (as returned by its gettracks() method) and calling each track's stop() method.
WebRTC Statistics API - Web APIs
mapping of statistic category names to the dictionaries they implement statistic category name (rtcstatstype) description dictionaries implemented candidate-pair statistics describing the change from one rtcicetransport to another, such as during an ice restart.
Writing a WebSocket server in C# - Web APIs
it allows usage of a namespace's classes without typing the full namespace every time.
Using bounded reference spaces - Web APIs
it's difficult (and would probably be fairly confusing) to create a virtual world that's larger than the physical space available to the user if you're mapping their real-world movement into the virtual environment.
Web Animations API Concepts - Web APIs
effects for grouping and sequencing, not unlike features we had in flash.
Visualizations with Web Audio API - Web APIs
set up the buffer: analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); next, we clear the canvas of what had been drawn on it before to get ready for the new visualization display: canvasctx.clearrect(0, 0, width, height); we now define the draw() function: function draw() { in here, we use requestanimationframe() to keep looping the drawing function once it has been started: var drawvisual = requestanimationframe(draw); next, we grab the time domain data and copy it into our array analyser.getbytetimedomaindata(dataarray); next, fill the canvas with a solid colour to start canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); set a line width and stroke colour for the wave we will dra...
Web audio spatialization basics - Web APIs
think sounds flying over you, creeping up behind you, moving across in front of you.
Using Web Workers - Web APIs
chrome workers are a firefox-only type of worker that you can use if you are developing add-ons and want to use workers in extensions and have access to js-ctypes in your worker.
Web Workers API - Web APIs
chrome workers are a firefox-only type of worker that you can use if you are developing add-ons and want to use workers in extensions and have access to js-ctypes in your worker.
Window.captureEvents() - Web APIs
in order for events to "bubble up" in the way that they normally do, you must call window.releaseevents() ( ) on the window to keep it from trapping events.
Window.open() - Web APIs
WebAPIWindowopen
the purpose is to warn users in advance of context changes to minimize confusion on the user's part: changing the current window or popping up new windows can be very disorienting to users (back toolbar button is disabled).
window.postMessage() - Web APIs
web context scripts can use custom events to communicate with content scripts (with randomly generated event names, if needed, to prevent snooping from the guest page).
Window.releaseEvents() - Web APIs
summary releases the window from trapping events of a specific type.
Window - Web APIs
WebAPIWindow
window.releaseevents() releases the window from trapping events of a specific type.
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
you'll see a message popping up in a second.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
the prefs that control this behaviour are: dom.min_tracking_timeout_value: 4 dom.min_tracking_background_timeout_value: 10000 dom.timeout.tracking_throttling_delay: 30000 late timeouts in addition to "clamping", the timeout can also fire later when the page (or the os/browser itself) is busy with other tasks.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
the code shows how to obtain the raw header string, as well as how to convert it into an array of individual headers and then how to take that array and create a mapping of header names to their values.
XRInputSourceEvent() - Web APIs
selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like.
XRInputSourceEvent.frame - Web APIs
examples this code shows a handler for the selectstart event which gets the target ray's pose from the frame, mapping the pose representing the ray (event.inputsource.targetrayspace) to the overall reference space myrefspace.
XRInputSourceEvent - Web APIs
selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like.
XRPermissionDescriptor - Web APIs
if the permission request promise is rejected, the error is handled (currently by just dumping it to the console using domxref("console.log()")}}).
XRReferenceSpace: reset event - Web APIs
however, if that kind of "teleportation" is being used, you actually want to avoid jumping the user's position after tracking recovery, this can introduce additional and potentially jarring jumping.
XRSession.onsqueeze - Web APIs
these actions represent the user squeezing or gripping an object or controller.
XRSession.onsqueezestart - Web APIs
these actions represent the user squeezing or tightly gripping an object or controller.
XRSession: select event - Web APIs
examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
XRSession: selectend event - Web APIs
primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
XRSession: selectstart event - Web APIs
primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
XRSession: squeeze event - Web APIs
examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
XRSession: squeezeend event - Web APIs
primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.
XRSession: squeezestart event - Web APIs
primary squeeze actions are actions which are meant to represent gripping or squeezing using your hands, and may be simulated using triggers on hand controllers.
XRTargetRayMode - Web APIs
targeting may be done by looking at the target using a gaze-tracking system, pointing at the target with a hand controller, glove, or motion-tracking system, or by tapping or clicking on the target using a finger on a screen or with a mouse.
XRView - Web APIs
WebAPIXRView
it's possible to have xrview objects which represent overlapping regions as well as entirely disparate regions; in a game, you might have views that can be presented to observe a remote site using a security camera or other device, for example.
XRWebGLLayerInit.ignoreDepthValues - Web APIs
the depth buffer is typically used to assist in ordering vertices and, by extension, polygons while compositing, to ensure that the scene is correctly composited, with objects the correct distance away and with clipping and other distance-related computations performed as accurately as possible.
Using the aria-label attribute - Accessibility
<button aria-label="close" onclick="mydialog.close()">x</button> notes the most common accessibility api mapping for a label is the accessible name property.
Using the aria-labelledby attribute - Accessibility
</div> notes the most common accessibility api mapping for a label is the accessible name property used by aria roles all elements of the base markup related aria techniques using the aria-label attribute using the aria-describedby attribute compatibility tbd: add support information for common ua and at product combinations additional resources wai-aria specification for aria-labelledby ...
ARIA annotations - Accessibility
this is the job of role="suggestion", which should be set on an element wrapping both of them like so: <p>freida’s pet is a <span role="suggestion"><span role="deletion">black cat called luna</span><span role="insertion">purple tyrannosaurus rex called tiny</span></span>.
ARIA: form role - Accessibility
ideally, use the <form> element as the wrapping element and do not declare role="form".
ARIA: grid role - Accessibility
uses fall into two categories: presenting tabular information (data grids) and grouping other widgets (layout grids).
ARIA: List role - Accessibility
a shopping list, recipe steps, driving directions.
ARIA: Listitem role - Accessibility
a shopping list, recipe steps, driving directions.
ARIA: Navigation Role - Accessibility
examples <div role="navigation" aria-label="customer service"> <ul> <li><a href="#">help</a></li> <li><a href="#">order tracking</li> <li><a href="#">shipping &amp; delivery</a></li> <li><a href="#">returns</a></li> <li><a href="#">contact us</a></li> <li><a href="#">find a store</a></li> </ul> </div> accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document.
ARIA: row role - Accessibility
if the element with the aria-expanded attribute controls the expansion of another grouping container that is not 'owned by' the element, the author should reference the container by using the aria-controls attribute.
ARIA: Suggestion role - Accessibility
this is the job of role="suggestion", which should be set on an element wrapping both of them like so: <p>freida’s pet is a <span role="suggestion"> <span role="deletion">black cat called luna</span> <span role="insertion">purple tyrannosaurus rex called tiny</span> </span>.
ARIA: dialog role - Accessibility
in other words, the dialog's label acts like a grouping label for the controls inside it (similar to how a <legend> element provides a grouping label for the controls inside a <fieldset> element).
ARIA: listbox role - Accessibility
typing one or more letters will navigate the list items (same letter goes to each item starting with that, different letters go to the first item starting with that entire string).
WAI-ARIA Roles - Accessibility
it is intended to mimic the functionality of the html td element for table-style grouping of information.aria: heading rolethe heading role defines this element as a heading to a page or section.
Web applications and ARIA FAQ - Accessibility
it also provides additional structural information, helping authors identify landmarks, regions, and grids on their pages.
Accessibility: What users can do to browse more safely - Accessibility
usually they are quite easy to find by simply typing ( or saying) in the word, "accessibility" in the search finder of the operating system.
Architecture - Accessibility
keeping the link name of the interface is unfortunate but necessary for backwards compatibility, without introducing superfluous interfaces.
Accessibility FAQ - Accessibility
i'm interested in helping promote the fine accessibility features that firefox provides, what can i do?
Keyboard-navigable JavaScript widgets - Accessibility
grouping controls for grouping widgets such as menus, tablists, grids, or tree views, the parent element should be in the tab order (tabindex="0"), and each descendent choice/tab/cell/row should be removed from the tab order (tabindex="-1").
Operable - Accessibility
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.
Understandable - Accessibility
guideline 3.3 — input assistance: help users avoid and correct mistakes this guideline centers around helping users enter correct information when required with the minimum of mistakes.
Accessibility
accessibility means developing content to be as accessible as possible no matter an individual's physical and cognitive abilities and no matter how they access the web.
-moz-image-rect - CSS: Cascading Style Sheets
clicking on their container causes the four segments to rotate around by swapping the background-image property values among the four <div> blocks.
-moz-image-region - CSS: Cascading Style Sheets
it will not work with xul <image src="url" />.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image #example-button { /* display only the 4x4 area from the top left of this image */ list-style-image: url("chrome://example/skin/example.png"); -moz-image-region: rect(0px, 4px, 4px, 0px); } #example-button:hover { /* use the 4x4 area to the right of the first for the hovered button */ -moz-image-region: rect(0px, 8px, 4px, 4px); } specifications not part of any standard.
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
the highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on.
-webkit-text-security - CSS: Cascading Style Sheets
examples obscuring a text input try typing in the field below.
::before (:before) - CSS: Cascading Style Sheets
WebCSS::before
html <ol> <li>crack eggs into bowl</li> <li>add milk</li> <li>add flour</li> <li aria-current='step'>mix thoroughly into a smooth batter</li> <li>pour a ladleful of batter onto a hot, greased, flat frying pan</li> <li>fry until the top of the pancake loses its gloss</li> <li>flip it over and fry for a couple more minutes</li> <li>serve with your favorite topping</li> </ol> css li { padding:0.5em; } li[aria-current='step'] { font-weight:bold; } li[aria-current='step']::after { content: " \21e6"; /* hexadecimal for unicode leftwards white arrow*/ display: inline; } result specifications specification status comment css pseudo-elements level 4the definition of '::before' in that specification.
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
shazaam</p> <span slot="person-age">immortal</span> <span slot="person-occupation">superhero</span> </person-details> specifications specification status comment css scoping module level 1the definition of '::slotted' in that specification.
:focus-within - CSS: Cascading Style Sheets
html <p>try typing into this form.</p> <form> <label for="given_name">given name:</label> <input id="given_name" type="text"> <br> <label for="family_name">family name:</label> <input id="family_name" type="text"> </form> css form { border: 1px solid; color: gray; padding: 4px; } form:focus-within { background: #ff8; color: black; } input { margin: 4px; } result specifications ...
:host() - CSS: Cascading Style Sheets
WebCSS:host()
specifications specification status comment css scoping module level 1the definition of ':host()' in that specification.
:host-context() - CSS: Cascading Style Sheets
specifications specification status comment css scoping module level 1the definition of ':host-context()' in that specification.
:host - CSS: Cascading Style Sheets
WebCSS:host
specifications specification status comment css scoping module level 1the definition of ':host' in that specification.
:read-only - CSS: Cascading Style Sheets
input:read-only, textarea:read-only { background-color: #ccc; } p:read-only { background-color: #ccc; } syntax :read-only examples confirming form information in read-only/read-write controls one use of readonly form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form.
:read-write - CSS: Cascading Style Sheets
input:read-write, textarea:read-write { background-color: #bbf; } p:read-write { background-color: #bbf; } syntax :read-write examples confirming form information in read-only/read-write controls one use of readonly form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form.
font-stretch - CSS: Cascading Style Sheets
keyword to numeric mapping the table below shows the mapping between keyword values and numeric percentages: keyword percentage ultra-condensed 50% extra-condensed 62.5% condensed 75% semi-condensed 87.5% normal 100% semi-expanded 112.5% expanded 125% extra-expanded 150% ultra-expanded 200% v...
unicode-range - CSS: Cascading Style Sheets
we could also have done this by wrapping the ampersand in a <span> and applying a different font just to that, but that is an extra element and rule set.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
of course, we also need to add an event handler to our "run" button so it'll actually do something: document.queryselector(".runbutton").addeventlistener("click", play, false); result stopping an animation simply removing the animation-name applied to an element will make it jump or cut to its next state.
Using CSS animations - CSS: Cascading Style Sheets
the rendering engine can use frame-skipping and other techniques to keep the performance as smooth as possible.
Border-image generator - CSS: Cascading Style Sheets
.54%; } .span_8 { width: 66.08%; } .span_7 { width: 57.62%; } .span_6 { width: 49.16%; } .span_5 { width: 40.7%; } .span_4 { width: 32.24%; } .span_3 { width: 23.78%; } .span_2 { width: 15.32%; } .span_1 { width: 6.86%; } /* sections * ========================================================================== */ .section { clear: both; padding: 0px; margin: 0px; } /* grouping * ========================================================================== */ .group:before, .group:after { content: ""; display: table; } .group:after { clear:both; } .group { zoom: 1; /* for ie 6/7 (trigger haslayout) */ } /* grid column setup * ========================================================================== */ .col { display: block; float:left; margin: ...
Border-radius generator - CSS: Cascading Style Sheets
4%; } .span_8 { width: 66.08%; } .span_7 { width: 57.62%; } .span_6 { width: 49.16%; } .span_5 { width: 40.7%; } .span_4 { width: 32.24%; } .span_3 { width: 23.78%; } .span_2 { width: 15.32%; } .span_1 { width: 6.86%; } /* sections * ========================================================================== */ .section { clear: both; padding: 0px; margin: 0px; } /* grouping * ========================================================================== */ .group:before, .group:after { content: ""; display: table; } .group:after { clear:both; } .group { zoom: 1; /* for ie 6/7 (trigger haslayout) */ } /* grid column setup * ========================================================================== */ .col { display: block; float:left; margin: ...
Box-shadow generator - CSS: Cascading Style Sheets
.54%; } .span_8 { width: 66.08%; } .span_7 { width: 57.62%; } .span_6 { width: 49.16%; } .span_5 { width: 40.7%; } .span_4 { width: 32.24%; } .span_3 { width: 23.78%; } .span_2 { width: 15.32%; } .span_1 { width: 6.86%; } /* sections * ========================================================================== */ .section { clear: both; padding: 0px; margin: 0px; } /* grouping * ========================================================================== */ .group:before, .group:after { content: ""; display: table; } .group:after { clear:both; } .group { zoom: 1; /* for ie 6/7 (trigger haslayout) */ } /* grid column setup * ========================================================================== */ .col { display: block; float:left; margin: ...
CSS Display - CSS: Cascading Style Sheets
cy> guides css flow layout (display: block, display: inline) block and inline layout in normal flow flow layout and overflow flow layout and writing modes formatting contexts explained in flow and out of flow display: flex basic concepts of flexbox aligning items in a flex container controlling ratios of flex items along the main axis cross-browser flexbox mixins mastering wrapping of flex items ordering flex items relationship of flexbox to other layout methods backwards compatibility of flexbox typical use cases of flexbox display: grid basic concepts of grid layout relationship to other layout methods line-based placement grid template areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and ...
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
this set uses: fallbacks using 2009 'box' syntax (ff and older webkit) and prefixed syntaxes (ie10, webkit browsers without flex wrapping) final standards syntax (ff, safari, chrome, ie11+, edge, opera) this was inspired by: http://dev.opera.com/articles/view/advanced-cross-browser-flexbox/ with help from: http://w3.org/tr/css3-flexbox/ http://the-echoplex.net/flexyboxes/ 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.
Ordering Flex Items - CSS: Cascading Style Sheets
therefore if a user is tabbing between the items, they could find themselves jumping around your layout in a very confusing way.
Typical use cases of Flexbox - CSS: Cascading Style Sheets
.media .content { flex: 3; padding: 10px; } .image { flex: 1; } flipping the media object to switch the display of the media object so that the image is on the right and the content is on the left we can use the flex-direction property set to row-reverse.
CSS Flexible Box Layout - CSS: Cascading Style Sheets
mastering wrapping of flex items how to create flex containers with multiple lines and control the display of the items in those lines.
Flow Layout and Overflow - CSS: Cascading Style Sheets
these correspond to overflow-x and overflow-y but the mapping depends on the writing mode of the document.
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
the css logical properties and values specification includes logical versions of the properties that control margins, padding and borders as well as other mappings for things that we have typically used physical directions to specify.
Variable fonts guide - CSS: Cascading Style Sheets
the w3c has undertaken mapping them to existing css attributes, and in one case introduced a new one, which you'll see below.
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
this can become an issue when developing a site that has to work in multiple languages, including languages that have text starting on the right, rather than the left.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
that can create some nice effects, however you can also end up with things overlapping incorrectly if you specify the wrong start or end line.
Using CSS gradients - CSS: Cascading Style Sheets
90px, rgba(0, 255, 0, 0.5) 120px, rgba(0, 0, 255, 0.5) 150px, rgba(75, 0, 130, 0.5) 180px, rgba(238, 130, 238, 0.5) 210px, rgba(255, 0, 0, 0.5) 230px), repeating-linear-gradient(23deg, red 50px, orange 100px, yellow 150px, green 200px, blue 250px, indigo 300px, violet 350px, red 370px); } plaid gradient to create plaid we include several overlapping gradients with transparency.
CSS Images - CSS: Cascading Style Sheets
implementing image sprites in css describes the common technique grouping several images in one single document to save download requests and speed up the availability of a page.
CSS Logical Properties and Values - CSS: Cascading Style Sheets
css logical properties and values is a module of css introducing logical properties and values that provide the ability to control layout through logical, rather than physical, direction and dimension mappings.
CSS Masking - CSS: Cascading Style Sheets
css masking is a css module that defines means, including masking and clipping, for partially or fully hiding portions of visual elements.
Stacking context example 3 - CSS: Cascading Style Sheets
level #1 this problem can be avoided by removing overlapping between different level menus, or by using individual (and different) z-index values assigned through the id selector instead of class selector, or by flattening the html hierarchy.
Understanding CSS z-index - CSS: Cascading Style Sheets
in the most basic cases, html pages can be considered two-dimensional, because text, images, and other elements are arranged on the page without overlapping.
CSS selectors - CSS: Cascading Style Sheets
grouping selectors selector list the , is a grouping method, it selects all the matching nodes.
CSS values and units - CSS: Cascading Style Sheets
if unquoted, it is parsed as a <url-token>, which has extra requirements including the escaping of certain characters.
Layout mode - CSS: Cascading Style Sheets
float layout, designed to cause an item to position itself left or right with the rest of the content in normal flow wrapping around it.
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
contain case background: url(100px-height-3x4-ratio.svg); background-size: contain; the rendered output looks like this: notice how the entire image is rendered, fitting as best as possible into the box without clipping any of it away.
animation-iteration-count - CSS: Cascading Style Sheets
the animation-iteration-count css property sets the number of times an animation sequence should be played before stopping.
border-bottom-left-radius - CSS: Cascading Style Sheets
a background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property.
border-bottom-right-radius - CSS: Cascading Style Sheets
a background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property.
border-image - CSS: Cascading Style Sheets
finally, a repeat value of round will make the border slices fit evenly, i.e., without clipping or gaps.
border-radius - CSS: Cascading Style Sheets
the radius applies to the whole background, even if the element has no border; the exact position of the clipping is defined by the background-clip property.
border-top-left-radius - CSS: Cascading Style Sheets
a background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property.
border-top-right-radius - CSS: Cascading Style Sheets
a background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property.
box-decoration-break - CSS: Cascading Style Sheets
clone each box fragment is rendered independently with the specified border, padding, and margin wrapping each fragment.
clip - CSS: Cascading Style Sheets
WebCSSclip
formal definition initial valueautoapplies toabsolutely positioned elementsinheritednocomputed valueauto if specified as auto, otherwise a rectangle with four values, each of which is auto if specified as auto or the computed length otherwiseanimation typea rectangle formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image css .dotted-border { border: dotted; position: relative; width: 536px; height: 350px; } #top-left, #middle, #bottom-right { position: absolute; top: 0; } #top-left { left: 360px; clip: rect(0 175px 113px 0); } #middle { left: 280px; clip: rect(119px 255px 229px 80px); } #bottom-right { left: 200px; clip: rect(235px 335px 345px 160px); } html <p class="dot...
<display-legacy> - CSS: Cascading Style Sheets
inline-table the inline-table value does not have a direct mapping in html.
<easing-function> - CSS: Cascading Style Sheets
syntax steps(number_of_steps, direction) where: number_of_steps is a strictly positive <integer>, representing the amount of equidistant treads composing the stepping function.
flex-flow - CSS: Cascading Style Sheets
WebCSSflex-flow
the flex-flow css shorthand property specifies the direction of a flex container, as well as its wrapping behavior.
flex-wrap - CSS: Cascading Style Sheets
WebCSSflex-wrap
if wrapping is allowed, it sets the direction that lines are stacked.
font-stretch - CSS: Cascading Style Sheets
keyword to numeric mapping the table below shows the mapping between keyword values and numeric percentages: keyword percentage ultra-condensed 50% extra-condensed 62.5% condensed 75% semi-condensed 87.5% normal 100% semi-expanded 112.5% expanded 125% extra-expanded 150% ultra-expanded 200% ...
font-style - CSS: Cascading Style Sheets
when the specified style is not available, both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use font-synthesis to control this behavior).
font-variant-caps - CSS: Cascading Style Sheets
language-specific rules this property accounts for language-specific case mapping rules.
hyphens - CSS: Cascading Style Sheets
WebCSShyphens
manual words are broken for line-wrapping only where characters inside the word suggest line break opportunities.
mask-border - CSS: Cascading Style Sheets
a repeat value of round will make the mask slices fit evenly, i.e., without clipping or gaps.
mask-clip - CSS: Cascading Style Sheets
WebCSSmask-clip
-boxapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ <geometry-box> | no-clip ]#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples clipping a mask to the border box css #masked { width: 100px; height: 100px; background-color: #8cffa0; margin: 20px; border: 20px solid #8ca0ff; padding: 20px; mask-image: url(https://mdn.mozillademos.org/files/12668/mdn.svg); mask-size: 100% 100%; mask-clip: border-box; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="clipbox"> <option value="...
mask-composite - CSS: Cascading Style Sheets
exclude the non-overlapping regions of source and destination are combined.
max-block-size - CSS: Cascading Style Sheets
how writing-mode affects directionality the values of writing-mode affect the mapping of max-block-size to max-width or max-height as follows: values of writing-mode max-block-size is equivalent to horizontal-tb, lr , lr-tb , rl , rb , rb-rl max-height vertical-rl, vertical-lr, sideways-rl , sideways-lr , tb , tb-rl max-width the writing-mode values sideways-lr and sideways-rl were removed from the css writing modes level...
outline-color - CSS: Cascading Style Sheets
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).
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
in about:config, set layout.css.overflow.moz-scrollbars.enabled to true description overflow options include clipping, showing scrollbars, or displaying the content flowing out of its container into the surrounding area.
pointer-events - CSS: Cascading Style Sheets
to help us in deciding how pointer-events should be further extended for html, if you have any particular things that you would like to be able to do with this property, then please add them to the use cases section of this wiki page (don't worry about keeping it tidy).
scroll-margin-block-end - CSS: Cascading Style Sheets
the scroll-margin-block-end property defines the margin of the scroll snap area at the end of the block dimension that is used for snapping this box to the snapport.
scroll-margin-block-start - CSS: Cascading Style Sheets
the scroll-margin-block-start property defines the margin of the scroll snap area at the start of the block dimension that is used for snapping this box to the snapport.
scroll-margin-block - CSS: Cascading Style Sheets
description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport.
scroll-margin-bottom - CSS: Cascading Style Sheets
the scroll-margin-bottom property defines the bottom margin of the scroll snap area that is used for snapping this box to the snapport.
scroll-margin-left - CSS: Cascading Style Sheets
the scroll-margin-left property defines the left margin of the scroll snap area that is used for snapping this box to the snapport.
scroll-margin-right - CSS: Cascading Style Sheets
the scroll-margin-right property defines the right margin of the scroll snap area that is used for snapping this box to the snapport.
scroll-margin-top - CSS: Cascading Style Sheets
the scroll-margin-top property defines the top margin of the scroll snap area that is used for snapping this box to the snapport.
scroll-snap-align - CSS: Cascading Style Sheets
the two values specify the snapping alignment in the block axis and inline axis, respectively.
scrollbar-width - CSS: Cascading Style Sheets
while swiping gestures or mouse wheels can enable scrolling on such content, some devices have no scroll alternative.
shape-image-threshold - CSS: Cascading Style Sheets
formal definition initial value0.0applies tofloatsinheritednocomputed valuethe same as the specified value after clipping the <number> to the range [0.0, 1.0].animation typea number formal syntax <alpha-value>where <alpha-value> = <number> | <percentage> examples aligning text to a gradient this example creates a <div> block with a gradient background image.
<string> - CSS: Cascading Style Sheets
WebCSSstring
examples /* simple strings */ "this string is demarcated by double quotes." 'this string is demarcated by single quotes.' /* character escaping */ "this is a string with \" an escaped double quote." "this string also has \22 an escaped double quote." 'this is a string with \' an escaped single quote.' 'this string also has \27 an escaped single quote.' "this is a string with \\ an escaped backslash." /* new line in a string */ "this string has a \aline break in it." /* string spanning two lines of code (these two strings will have iden...
text-decoration-skip - CSS: Cascading Style Sheets
formal definition initial valueobjectsapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ objects | [ spaces | [ leading-spaces | trailing-spaces ] ] | edges | box-decoration ] examples skipping edges html <p>hey, grab a cup of <em>coffee!</em></p> css p { margin: 0; font-size: 3em; text-decoration: underline; text-decoration-skip: edges; } result specifications specification status comment css text decoration module level 4the definition of 'text-decoration-skip' in that specification.
transform-box - CSS: Cascading Style Sheets
formal definition initial valueview-boxapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box | fill-box | stroke-box | view-box examples svg transform-origin scoping in this example we have an svg: <svg id="svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 50 50"> <g> <circle id="center" fill="red" r="1" transform="translate(25 25)" /> <circle id="boxcenter" fill="blue" r=".5" transform="translate(15 15)" /> <rect id="box" x="10" y="10" width="10" height="10" rx="1" ry="1" stroke="black" fill="none" /> </g> </svg> in the css we have an a...
skew() - CSS: Cascading Style Sheets
this transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the horizontal and vertical directions.
skewX() - CSS: Cascading Style Sheets
this transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the horizontal direction.
skewY() - CSS: Cascading Style Sheets
this transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the vertical direction.
user-select - CSS: Cascading Style Sheets
inherit; user-select: initial; user-select: unset; /* mozilla-specific values */ -moz-user-select: none; -moz-user-select: text; -moz-user-select: all; /* webkit-specific values */ -webkit-user-select: none; -webkit-user-select: text; -webkit-user-select: all; /* doesn't work in safari; use only "none" or "text", or else it will allow typing in the <html> container */ /* microsoft-specific values */ -ms-user-select: none; -ms-user-select: text; -ms-user-select: element; note: user-select is not an inherited property, though the initial auto value makes it behave like it is inherited most of the time.
z-index - CSS: Cascading Style Sheets
WebCSSz-index
overlapping elements with a larger z-index cover those with a smaller one.
Demos of open web technologies
notifications (source code) web audio api web audio fireworks oscope.js - javascript oscilloscope html5 web audio showcase (source code) html5 audio visualizer (source code) graphical filter editor and visualizer (source code) file api slide my text - presentation from plain text files web workers web worker fractals photo editor coral generator raytracer hotcold touch typing ...
Event reference
canplaythrough the browser estimates it can play the media up to its end without stopping for content buffering.
Live streaming web audio and video - Developer guides
the idea is that the data transfer rate is monitored and if it looks like it's not keeping up, we drop down to a lower bandwidth (and consequently lower quality) stream.
Media buffering, seeking, and time ranges - Developer guides
this will work with <audio> or <video>; for now let's consider a simple audio example: <audio id="my-audio" controls src="music.mp3"> </audio> we can access these attributes like so: var myaudio = document.getelementbyid('my-audio'); var bufferedtimeranges = myaudio.buffered; timeranges object timeranges are a series of non-overlapping ranges of time, with start and stop times.
Audio and Video Delivery - Developer guides
other tips for audio/video stopping the download of media while stopping the playback of media is as easy as calling the element's pause() method, the browser keeps downloading the media until the media element is disposed of through garbage collection.
Audio and video manipulation - Developer guides
an impulse response will signify the environment in which the impulse was created (for example, an echo created by clapping your hands in a tunnel).
Media events - Developer guides
playing sent when the media has enough data to start playing, after the play event, but also when recovering from being stalled, when looping media restarts, and after seeked, if it was playing before seeking.
Orientation and motion data explained - Developer guides
beta rotation around the x axis -- that is, tipping the device away from or toward the user -- causes the beta rotation angle to change: the beta angle is 0° when the device's top and bottom are the same distance from the earth's surface; it increases toward 180° as the device is tipped forward toward the user, and it decreases toward -180° as the device is tipped backward away from the user.
Content categories - Developer guides
this is a loose grouping (it doesn't actually create a relationship among elements of these categories), but they help define and describe the categories' shared behavior and their associated rules, especially when you come upon their intricate details.
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
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).
HTML5 - Developer guides
WebGuideHTMLHTML5
drag and drop the html5 drag and drop api allows support for dragging and dropping items within and between web sites.
Localizations and character encodings - Developer guides
the mapping from locales onto fallback encodings is now built into gecko itself.
A hybrid approach - Developer guides
approaches to mobile web development see the following articles for background and other approaches to developing for mobile platforms.
Separate sites for mobile and desktop - Developer guides
approaches to mobile web development see the following articles for background and other approaches to developing for mobile platforms.
Printing - Developer guides
this article provides tips and techniques for helping your web content print better.
HTML attribute: min - HTML: Hypertext Markup Language
WebHTMLAttributesmin
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.
Date and time formats used in HTML - HTML: Hypertext Markup Language
the adjustments to the algorithm (taking a leap year when the year can be divided by 400, and skipping leap years when the year is divisible by 100) help to bring the average even closer to the correct number of days (365.2425 days).
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
WebHTMLElementabbr
used to create the semantics and structure of a web page.</p> <p>a <dfn id="spec">specification</dfn> (<abbr title="specification">spec</abbr>) is a document that outlines in detail how a technology or api is intended to function and how it is accessed.</p> result accessibility concerns spelling out the acronym or abbreviation in full the first time it is used on a page is beneficial for helping people understand it, especially if the content is technical or industry jargon.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
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 (in the background).
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
canplaythrough the browser estimates it can play the media up to its end without stopping for content buffering.
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
the result will be garbled: 1 - embedded-textst place if you know the directionality of embedded-text in advance, you can fix this problem by wrapping embedded-text in a <span> with the dir attribute set to the known directionality.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
as the example above shows, the <fieldset> element provides a grouping for a part of an html form, with a nested <legend> element providing a caption for the <fieldset>.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
you can use the object-position property to position the image within the element's box, and the object-fit property to adjust the sizing of the image within the box (for example, whether the image should fit the box or fill it even if clipping is required).
<isindex> - HTML: Hypertext Markup Language
WebHTMLElementisindex
kevin replies that he doesn't like the boolean nature of isindex and would prefer a system where everything is searchable and proposes to extend the current www framework with a specific httpd configuration and defined that some uris mapping create search queries.
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
note: you don't need to do all this wrapping; you can choose to simplify it by leaving out the external <kbd> element.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
autofocus this boolean attribute lets you specify that the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control.
<listing> - HTML: Hypertext Markup Language
WebHTMLElementlisting
instead use the <pre> element or if semantically adequate the <code> element, eventually escaping the html '<' and '>' so that they don't get interpreted.
<nobr>: The Non-Breaking Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnobr
the non-standard, obsolete html <nobr> element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text.
<optgroup> - HTML: Hypertext Markup Language
WebHTMLElementoptgroup
the html <optgroup> element creates a grouping of options within a <select> element.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but html paragraphs can be any structural grouping of related content, such as images or form fields.
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
cropping or modifying images for different media conditions (for example, loading a simpler version of an image which has too many details, on smaller displays).
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
this is a purely visual grouping, its visualization generally consists of the group name being bolded, and the options being indented.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
notice how it disappears when you start typing into the box.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
usage notes the <ul> element is for grouping a collection of items that do not have a numerical ordering, and their order in the list is meaningless.
autocapitalize - HTML: Hypertext Markup Language
lization is applied (all letters default to lowercase) on or sentences: the first letter of each sentence defaults to a capital letter; all other letters default to lowercase words: the first letter of each word defaults to a capital letter; all other letters default to lowercase characters: all letters should default to uppercase the autocapitalize attribute doesn’t affect behavior when typing on a physical keyboard.
dropzone - HTML: Hypertext Markup Language
it can have the following values: copy, which indicates that dropping will create a copy of the element that was dragged.
itemref - HTML: Hypertext Markup Language
for example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the properties in the cells.
Global attributes - HTML: Hypertext Markup Language
it can have the following values: copy, which indicates that dropping will create a copy of the element that was dragged move, which indicates that the element that was dragged will be moved to this new location.
Data URLs - HTTP
[convert]::tobase64string([text.encoding]::utf8.getbytes("hello")) # outputs to console: agvsbg8= bash -c "echo -n hello`|base64" # outputs to console: agvsbg8= # the backtick (`) is used to escape the piping (|) character here common problems this section describes problems that commonly occur when creating and using data urls.
Evolution of HTTP - HTTP
developed by tim berners-lee and his team between 1989-1991, http has seen many changes, keeping most of the simplicity and further shaping its flexibility.
Content Security Policy (CSP) - HTTP
WebHTTPCSP
example 4 a web site administrator for an online banking site wants to ensure that all its content is loaded using tls, in order to prevent attackers from eavesdropping on requests.
Compression in HTTP - HTTP
for better performance of a web site, it is ideal to compress as much as possible, while keeping an acceptable level of quality.
Cross-Origin Resource Policy (CORP) - HTTP
as this policy is expressed via a response header, the actual request is not prevented—rather, the browser prevents the result from being leaked by stripping the response body.
Using Feature Policy - HTTP
for new content, you can start developing with a policy that disables all the features.
Access-Control-Request-Headers - HTTP
examples access-control-request-headers: x-pingother, content-type specifications specification status comment fetchthe definition of 'access-control-request-headers' in that specification.
Cache-Control - HTTP
see "keeping things fresh with stale-while-revalidate" for more information.
Content-Location - HTTP
then the client could remember that the json version is available at that particular url, skipping content negotation the next time it requests that document.
CSP: style-src - HTTP
if 'unsafe-eval' isn't specified with the style-src directive, the following methods are blocked and won't have any effect: cssstylesheet.insertrule() cssgroupingrule.insertrule() cssstyledeclaration.csstext specifications specification status comment content security policy level 3the definition of 'style-src' in that specification.
CSP: upgrade-insecure-requests - HTTP
the upgrade-insecure-requests directive will not ensure that users visiting your site via links on third-party sites will be upgraded to https for the top-level navigation and thus does not replace the strict-transport-security (hsts) header, which should still be set with an appropriate max-age to ensure that users are not subject to ssl stripping attacks.
Sec-Fetch-Site - HTTP
directly entering a url in the address bar, opening a bookmark, or draging-and-dropping a file into the browser window.
Proxy Auto-Configuration (PAC) file - HTTP
in chrome (versions 52 to 73), you can disable this by setting pachttpsurlstrippingenabled to false in policy or by launching with the --unsafe-pac-url command-line flag (in chrome 74, only the flag works, and from 75 onward, there is no way to disable path-stripping; as of chrome 81, path-stripping does not apply to http urls, but there is interest in changing this behavior to match https); in firefox, the preference is network.proxy.autoconfig_url.include_path.
Redirections in HTTP - HTTP
keeping links alive when you restructure web sites, urls change.
CSS Houdini
css typed om reference css typed om guide css layout api designed to improve the extensibility of css, this api enables developers to write their own layout algorithms, like masonry or line snapping.
Equality comparisons and sameness - JavaScript
here's a non-exhaustive list of built-in methods and operators that might cause a distinction between -0 and +0 to manifest itself in your code: - (unary negation) let stoppingforce = obj.mass * -obj.velocity; if obj.velocity is 0 (or computes to 0), a -0 is introduced at that place and propogates out into stoppingforce.
Expressions and operators - JavaScript
ues: function validate(obj, lowval, hival) { if ((obj.value < lowval) || (obj.value > hival)) console.log('invalid value!'); } you could call validate in each form element's onchange event handler, using this to pass it to the form element, as in the following example: <p>enter a number between 18 and 99:</p> <input type="text" name="age" size=3 onchange="validate(this, 18, 99);"> grouping operator the grouping operator ( ) controls the precedence of evaluation in expressions.
Loops and iteration - JavaScript
when you use continue with a label, it applies to the looping statement identified with that label.
Regular expressions - JavaScript
escaping if you need to use any of the special characters literally (actually searching for a "*", for instance), you must escape it by putting a backslash in front of it.
TypeError: invalid assignment to const "x" - JavaScript
let columns = 120; scoping check if you are in the correct scope.
JavaScript error reference - JavaScript
peerror: invalid array.prototype.sort argumenttypeerror: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x insteadwarning: expression closures are deprecatedwarning: unreachable code after return statement ...
Arrow function expressions - JavaScript
a : b; // easy array filtering, mapping, ...
Array.prototype.flatMap() - JavaScript
the flatmap() method first maps each element using a mapping function, then flattens the result into a new array.
Array.from() - JavaScript
if mapfn is undefined, then let mapping be false.
Array.prototype.indexOf() - JavaScript
// this version tries to optimize by only checking for "in" when looking for undefined and // skipping the definitely fruitless nan search.
Atomics.wait() - JavaScript
examples using wait() given a shared int32array: const sab = new sharedarraybuffer(1024); const int32 = new int32array(sab); a reading thread is sleeping and waiting on location 0 which is expected to be 0.
Atomics - JavaScript
omics.islockfree(3); // false atomics.islockfree(4); // true atomics.or(ta, 0, 1); atomics.load(ta, 0); // 5 atomics.store(ta, 0, 12); // 12 atomics.sub(ta, 0, 2); atomics.load(ta, 0); // 3 atomics.xor(ta, 0, 1); atomics.load(ta, 0); // 4 waiting and notifiying given a shared int32array: const sab = new sharedarraybuffer(1024); const int32 = new int32array(sab); a reading thread is sleeping and waiting on location 0 which is expected to be 0.
Function.prototype.apply() - JavaScript
const array = ['a', 'b']; const elements = [0, 1, 2]; array.push.apply(array, elements); console.info(array); // ["a", "b", 0, 1, 2] using apply and built-in functions clever usage of apply allows you to use built-in functions for some tasks that would probably have otherwise been written by looping over the array values.
Intl.Locale - JavaScript
intl.locale.prototype.hourcycle returns the time keeping format convention used by the locale.
Intl.NumberFormat() constructor - JavaScript
"long" (e.g., 16 litres) "short" (e.g., 16 l) "narrow" (e.g., 16l) usegrouping whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators.
Math.min() - JavaScript
examples using math.min() this finds the min of x and y and assigns it to z: var x = 10, y = -20; var z = math.min(x, y); clipping a value with math.min() math.min() is often used to clip a value so that it is always less than or equal to a boundary.
Object.create() - JavaScript
for example: a simple common debugging function: // display top-level property name:value pairs of given object function showproperties(obj){ for(var prop in obj){ console.log(prop + ": " + obj[prop] + "\n" ); } } not such simple results: (especially if silent error-trapping had hidden the error messages) ob={}; ob.po=oco; ob.pn=ocn; // create a compound object using the test objects from above as property values > showproperties( ob ) // display top-level properties - po: [object object] - error: cannot convert object to primitive value note that only first property gets shown.
Object.entries() - JavaScript
the ordering of the properties is the same as that given by looping over the property values of the object manually.
Object.keys() - JavaScript
the ordering of the properties is the same as that given by looping over the properties of the object manually.
Object.values() - JavaScript
the ordering of the properties is the same as that given by looping over the property values of the object manually.
Object - JavaScript
o = new object(undefined) let o = new object(null) using object to create boolean objects the following examples store boolean objects in o: // equivalent to o = new boolean(true) let o = new object(true) // equivalent to o = new boolean(false) let o = new object(boolean()) object prototypes when altering the behavior of existing object.prototype methods, consider injecting code by wrapping your extension before or after the existing logic.
handler.apply() - JavaScript
examples trapping a function call the following code traps a function call.
handler.construct() - JavaScript
examples trapping the new operator the following code traps the new operator.
handler.defineProperty() - JavaScript
examples trapping of defineproperty the following code traps object.defineproperty().
handler.deleteProperty() - JavaScript
examples trapping the delete operator the following code traps the delete operator.
handler.getOwnPropertyDescriptor() - JavaScript
examples trapping of getownpropertydescriptor the following code traps object.getownpropertydescriptor().
handler.has() - JavaScript
examples trapping the in operator the following code traps the in operator.
handler.isExtensible() - JavaScript
examples trapping of isextensible the following code traps object.isextensible().
handler.ownKeys() - JavaScript
examples trapping of getownpropertynames the following code traps object.getownpropertynames().
handler.preventExtensions() - JavaScript
examples trapping of preventextensions the following code traps object.preventextensions().
RegExp() constructor - JavaScript
flags may contain any combination of the following characters: g (global match) find all matches rather than stopping after the first match.
RegExp.prototype.source - JavaScript
empty regular expressions and escaping starting with ecmascript 5, the source property no longer returns an empty string for empty regular expressions.
RegExp.prototype.toString() - JavaScript
examples using tostring() the following example displays the string value of a regexp object: var myexp = new regexp('a+b+c'); console.log(myexp.tostring()); // logs '/a+b+c/' var foo = new regexp('bar', 'g'); console.log(foo.tostring()); // logs '/bar/g' empty regular expressions and escaping starting with ecmascript 5, an empty regular expression returns the string "/(?:)/" and line terminators such as "\n" are escaped: new regexp().tostring(); // "/(?:)/" new regexp('\n').tostring() === '/\n/'; // true, prior to es5 new regexp('\n').tostring() === '/\\n/'; // true, starting with es5 specifications specification ecmascript (ecma-262)the definition of 'regexp.
String.prototype.charAt() - JavaScript
string and // the current iteration and returning an array with the individual character // and 'i' value (only changed if a surrogate pair) console.log(chr) } function getwholecharandi(str, i) { let code = str.charcodeat(i) if (number.isnan(code)) { return '' // position not found } if (code < 0xd800 || code > 0xdfff) { return [str.charat(i), i] // normal character, keeping 'i' the same } // high surrogate (could change last hex to 0xdb7f to treat high private // surrogates as single characters) if (0xd800 <= code && code <= 0xdbff) { if (str.length <= (i + 1)) { throw 'high surrogate without following low surrogate' } let next = str.charcodeat(i + 1) if (0xdc00 > next || next > 0xdfff) { throw 'high surrogate without followi...
String.prototype.codePointAt() - JavaScript
operty) { defineproperty(string.prototype, 'codepointat', { 'value': codepointat, 'configurable': true, 'writable': true }); } else { string.prototype.codepointat = codepointat; } }()); } examples using codepointat() 'abc'.codepointat(1) // 66 '\ud800\udc00'.codepointat(0) // 65536 'xyz'.codepointat(42) // undefined looping with codepointat() for (let codepoint of '\ud83d\udc0e\ud83d\udc71\u2764') { console.log(codepoint.codepointat(0).tostring(16)) } // '1f40e', '1f471', '2764' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.codepointat' in that specification.
Symbol.unscopables - JavaScript
property attributes of symbol.unscopables writable no enumerable no configurable no examples scoping in with statements the following code works fine in es5 and below.
WeakMap - JavaScript
native weakmaps can be particularly useful constructs when mapping keys to information about the key that is valuable only if the key has not been garbage collected.
WeakRef - JavaScript
examples using a weakref object this example starts a counter shown in a dom element, stopping when the element doesn't exist anymore: class counter { constructor(element) { // remember a weak reference to the dom element this.ref = new weakref(element); this.start(); } start() { if (this.timer) { return; } this.count = 0; const tick = () => { // get the element from the weak reference, if it still exists const element = this.ref.dere...
escape() - JavaScript
note: this function was used mostly for url queries (the part of a url following ?)—not for escaping ordinary string literals, which use the format "\xhh".
Iteration protocols - JavaScript
this makes multiple // iterations over the iterable safe for non-trivial cases, // such as use of break or nested looping over the same iterable.
Lexical grammar - JavaScript
*/ console.log('hello world!'); } comment(); you can also use it in the middle of a line, if you wish, although this can make your code harder to read so it should be used with caution: function comment(x) { console.log('hello ' + x /* insert the value of x */ + ' !'); } comment('world'); in addition, you can use it to disable code to prevent it from running, by wrapping code in a comment, like this: function comment() { /* console.log('hello world!'); */ } comment(); in this case, the console.log() call is never issued, since it's inside a comment.
Expressions and operators - JavaScript
( ) grouping operator.
async function - JavaScript
return promisevalue the implicit wrapping of return values in promise.resolve does not imply that return await promisevalue is functionally equivalent to return promisevalue.
const - JavaScript
my_fav = 20; // my_fav is 7 console.log('my favorite number is: ' + my_fav); // trying to redeclare a constant throws an error // uncaught syntaxerror: identifier 'my_fav' has already been declared const my_fav = 20; // the name my_fav is reserved for constant above, so this will fail too var my_fav = 20; // this throws an error too let my_fav = 20; block scoping it's important to note the nature of block scoping.
label - JavaScript
break can be used with any labeled statement, and continue can be used with looping labeled statements.
switch - JavaScript
we can easily fix this by wrapping our case clauses with brackets: const action = 'say_hello'; switch (action) { case 'say_hello': { // added brackets let message = 'hello'; console.log(message); break; } // added brackets case 'say_hi': { // added brackets let message = 'hi'; console.log(message); break; } // added brackets default: { // added brackets console.log('empty action received.'); ...
JavaScript shells - JavaScript
they are extremely useful for developing and debugging code.
Authoring MathML - MathML
in particular, the mozilla mathml team has been developing texzilla, a javascript unicode latex-to-mathml converter that is intended to be used in many scenarios described here.
<mrow> - MathML
WebMathMLElementmrow
proper grouping helps the rendering of the expression in several ways: it can improve the display by possibly affecting spacing.
The "codecs" parameter in common media types - Web media technologies
this value indicates which set of coefficients to use when mapping from the native red, blue, and green primaries to the luma and chroma signals.
Using images in HTML - Web media technologies
WebMediaimages
mapping the width and height attributes of media container elements to their aspect-ratio this changes how browsers load images so their aspect ratios are calculated by the browser early on and can later be used to correct the display size of an image before it's loaded.
CSS and JavaScript animation performance - Web Performance
even if an element is in the middle of a transition, the new transition starts from the current style immediately instead of jumping to the end css state.
Performance fundamentals - Web Performance
keeping the data in a javascript object instead of accessing the dom can vastly improve your app's performance.
Populating the page: how browsers work - Web Performance
compositing when sections of the document are drawn in different layers, overlapping each other, compositing is necessary to ensure they are drawn to the screen in the right order and the content is rendered correctly.
Navigation and resource timings - Web Performance
keeping this at 50ms or faster helps ensure a responsive user interface.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
if an issue arises in production, synthetic monitoring can provide insight, helping identify, isolate, and resolve problems before they negatively user experience.
Progressive web app structure - Progressive web apps (PWAs)
the website feels like a native app with instant interaction and solid performance while keeping all the benefits of the web.
Progressive loading - Progressive web apps (PWAs)
you could try to make your apps more bulletproof by making them work without javascript — either using <noscript> to show the image with final src already assigned, or by wrapping <img> tags with <a> elements pointing at the target images, so the user can click and access them when desired.
The building blocks of responsive design - Progressive web apps (PWAs)
using web fonts for displaying icons is an effective technique for keeping file size and http requests down, and this is supported well across modern and older browsers.
Structural overview of progressive web apps - Progressive web apps (PWAs)
the website feels like a native app with instant interaction and solid performance while keeping all the benefits of the web.
Progressive web apps (PWAs)
progressive web apps: escaping tabs without losing our soul by alex russell.
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: <funciri>|none|inherit; animatable: yes mask it alters the visibility of an element by either masking or clipping the image at specific points.
enable-background - SVG: Scalable Vector Graphics
those values act as a clipping rectangle on the background image canvas.
fill - SVG: Scalable Vector Graphics
WebSVGAttributefill
ns="http://www.w3.org/2000/svg"> <!-- simple color fill --> <circle cx="50" cy="50" r="40" fill="pink" /> <!-- fill circle with a gradient --> <defs> <radialgradient id="mygradient"> <stop offset="0%" stop-color="pink" /> <stop offset="100%" stop-color="black" /> </radialgradient> </defs> <circle cx="150" cy="50" r="40" fill="url(#mygradient)" /> <!-- keeping the final state of an animated circle which is a circle with a radius of 40.
operator - SVG: Scalable Vector Graphics
xor this value indicates that the non-overlapping regions of the source graphic defined in the in attribute and the destination graphic defined in the in2 attribute are combined.
overflow - SVG: Scalable Vector Graphics
it has the same parameter values and meaning as the css overflow property, however, the following additional points apply: if it has a value of visible, the attribute has no effect (i.e., a clipping rectangle is not created).
stemv - SVG: Scalable Vector Graphics
WebSVGAttributestemv
the measurement is meant for the dominant vertical stem in the font because there might be different groupings of vertical stems (e.g., one main one, and one lighter weight one as for an uppercase "m" or "n").
text-anchor - SVG: Scalable Vector Graphics
the text-anchor attribute is used to align (start-, middle- or end-alignment) a string of pre-formatted text or auto-wrapped text where the wrapping area is determined from the inline-size property relative to a given point.
textLength - SVG: Scalable Vector Graphics
html the html is also simple, with only two displayed elements contained inside a grouping <div>: <div class="controls"> <input type="range" id="widthslider" min="80" max="978"> <span id="widthdisplay"></span> </div> the <input> element, of type "range", is used to create the slider control the user will manipulate to change the width of the text.
visibility - SVG: Scalable Vector Graphics
it may receive pointer events depending on the pointer-events attribute, may receive focus depending on the tabindex attribute, contributes to bounding box calculations and clipping paths, and does affect text layout.
writing-mode - SVG: Scalable Vector Graphics
candidate recommendation mainly refers to the definition in css writing modes 3 and defines a mapping between the deprecated svg 1.1 values and the new values.
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
marker-end marker-mid marker-start markerheight markerunits markerwidth mask maskcontentunits maskunits mathematical max media method min mode n name numoctaves o offset opacity operator order orient orientation origin overflow overline-position overline-thickness p panose-1 paint-order path pathlength patterncontentunits patterntransform patternunits ping pointer-events points pointsatx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r r radius referrerpolicy refx refy rel rendering-intent repeatcount repeatdur requiredextensions requiredfeatures restart result rotate rx ry s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stdd...
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
value type: <string> ; default value: none; animatable: yes ping 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 (in the background).
<feComponentTransfer> - SVG: Scalable Vector Graphics
th <fecomponenttransfer> svg filter primitive performs color-component-wise remapping of data for each pixel.
<feComposite> - SVG: Scalable Vector Graphics
example svg <svg width="330" height="195" viewbox="0 0 1100 650" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>example fecomposite - examples of fecomposite operations</title> <desc>four rows of six pairs of overlapping triangles depicting the six different fecomposite operators under different opacity values and different clearing of the background.</desc> <defs> <desc>define two sets of six filters for each of the six compositing operators.
<filter> - SVG: Scalable Vector Graphics
WebSVGElementfilter
the <filter> svg element defines a custom filter effect by grouping atomic filter primitives.
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
it's possible to apply a gradient, pattern, clipping path, mask, or filter to <text>, like any other svg graphics element.
Basic Transformations - SVG: Scalable Vector Graphics
that means, the units you specify for the element and its children might not follow the 1:1 pixel mapping, but are also distorted, skewed, translated and scaled according to the transformation.
Positions - SVG: Scalable Vector Graphics
the current mapping (for a single element or the whole image) of user units to screen units is called user coordinate system.
SVG Filters Tutorial - SVG: Scalable Vector Graphics
this element has different attributes that help us create the clipping region.
Tools for SVG - SVG: Scalable Vector Graphics
snap.svg is designed for modern browsers and therefore supports the newest svg features like masking, clipping, patterns, full gradients, groups.
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
for files loaded locally, it first looks in a cache of filename extension to media type mappings (stored in a mozilla profile file called mimetypes.rdf), and if it doesn't find a media type there, it asks the operating system.
SVG: Scalable Vector Graphics
WebSVG
some real eye-candy svg at svg-wow.org firefox extension (grafox) to add a subset of smil animation support interactive photos manipulation html transformations using svg's foreignobject mapping, charting, games & 3d experiments while a little svg can go a long way to enhanced web content, here are some examples of heavy svg usage.
Insecure passwords - Web security
the https protocol is designed to protect user data from eavesdropping (confidentiality) and from modification (integrity) on the network.
Features restricted to secure contexts - Web security
<a ping> attribute disabled in non-secure contexts support has been added since firefox 3, but never been enabled by default (behind the browser.send_pings pref).
How to turn off form autocompletion - Web security
this enables the browser to offer autocompletion (that is, suggest possible completions for fields that the user has started typing in) or autofill (that is, pre-populate certain fields upon load).
Web security
typically, it's used to tell if two requests came from the same browser — keeping a user logged-in, for example.
number - XPath
notes strings are converted to a number by stripping the leading whitespace in the string before the number and ignoring whitespace after the number.
Introduction to using XPath in JavaScript - XPath
to match default elements in a non-null namespace, you either have to refer to a particular element using a form such as ['namespace-uri()='http://www.w3.org/1999/xhtml' and name()='p' and @id='_myid'] (this approach works well for dynamic xpath's where the namespaces might not be known) or use prefixed name tests, and create a namespace resolver mapping the prefix to the namespace.
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
if namespace is empty, the prefix mapping is removed.
An Overview - XSLT: Extensible Stylesheet Language Transformations
because typing "http://www.w3.org/1999/xsl/transform" repeatedly would be tedious and would render the markup difficult to read, there is a standard mechanism for assigning a shorthand name to the namespace in the stylesheet heading.
Web technology for developers
developing web applications documentation for web application developers; web apps are true write-once, deploy anywhere apps for mobile, desktop, and firefox os.
Compiling an Existing C Module to WebAssembly - WebAssembly
but this is a fair shortuct for keeping things simple: int result[2]; emscripten_keepalive void encode(uint8_t* img_in, int width, int height, float quality) { uint8_t* img_out; size_t size; size = webpencodergba(img_in, width, height, width * 4, quality, &img_out); result[0] = (int)img_out; result[1] = size; } emscripten_keepalive void free_result(uint8_t* result) { webpfree(result); } emscripten_keepalive int get_res...