Search completed in 0.91 seconds.
Unicode property escapes - JavaScript
unicode property escapes regular expressions allows for matching characters based on their
unicode properties. a character is described by several properties which are either binary ("boolean-like") or non-binary. for instance,
unicode property escapes can be used to match emojis, punctuations, letters (even letters from specific languages or scripts), etc. note: for
unicode property escapes to work, a regular expression must use the u flag which indicates a string must be considered as a series of
unicode code points. see also regexp.prototype.
unicode. note: some
unicode properties encompasses much more characters than some character classes (such as \w which matches only latin letters, a to z) but the latter is better supported among browsers (as of january 2020). syntax the followin...
...oints. see also regexp.prototype.
unicode. note: some
unicode properties encompasses much more characters than some character classes (such as \w which matches only latin letters, a to z) but the latter is better supported among browsers (as of january 2020). syntax the following section is also duplicated on this cheatsheet. do not forget to edit it as well, thanks! // non-binary values \p{
unicodepropertyvalue} \p{
unicodepropertyname=
unicodepropertyvalue} // binary and non-binary values \p{
unicodebinarypropertyname} // negation: \p is negated \p \p{
unicodepropertyvalue} \p{
unicodebinarypropertyname} general_category (gc) script (sc) script_extensions (scx) see also propertyvaluealiases.txt
unicodebinarypropertyname the name of a binary property. e.g.: ascii, alpha, math, dia...
...alue} // binary and non-binary values \p{
unicodebinarypropertyname} // negation: \p is negated \p \p{
unicodepropertyvalue} \p{
unicodebinarypropertyname} general_category (gc) script (sc) script_extensions (scx) see also propertyvaluealiases.txt
unicodebinarypropertyname the name of a binary property. e.g.: ascii, alpha, math, diacritic, emoji, hex_digit, math, white_space, etc. see
unicode data proplist.txt for more info.
unicodepropertyname the name of a non-binary property:
unicodepropertyvalue one of the tokens listed in the values section, below. many values have aliases or shorthand (e.g. the value decimal_number for the general_category property may be written nd, digit, or decimal_number). for most values, the
unicodepropertyname part and equals sign may be omitted. if a...
...And 8 more matches
nsIScriptableUnicodeConverter
using the lower haft of each 16-bit code unit in a javascript string. if the other apis you are reading data from or writing data to don't require you to use this legacy representation, you should use textdecoder and textencoder (available to chrome javascript via components.utils.importglobalproperties) instead of this api. ...
... you should use textdecoder and textencoder (available to chrome javascript via components.utils.importglobalproperties) instead of this api. intl/uconv/idl/nsiscriptableuconv.idlscriptable this interface is a
unicode encoder for use by scripts. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/scriptable
unicodeconverter. ...
...operties) instead of this api. intl/uconv/idl/nsiscriptableuconv.idlscriptable this interface is a
unicode encoder for use by scripts. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/scriptable
unicodeconverter. ...
...And 7 more matches
FontFace.unicodeRange - Web APIs
working draft initial definition. ...
... working draft initial definition. ...
... working draft initial definition. ...
...And 5 more matches
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
for example, one character set would store japanese characters, and another would store the arabic alphabet. if it was not clearly marked which parts of the data were in which character set, other programs and computers would display the text incorrectly, or damage it during processing. ...
...for example, one character set would store japanese characters, and another would store the arabic alphabet. if it was not clearly marked which parts of the data were in which character set, other programs and computers would display the text incorrectly, or damage it during processing. ...
...nother would store the arabic alphabet. if it was not clearly marked which parts of the data were in which character set, other programs and computers would display the text incorrectly, or damage it during processing. ...
...And 2 more matches
unicode-bidi - CSS: Cascading Style Sheets
the
unicode-bidi css property, together with the direction property, determines how bidirectional text in a document is handled. for example, if a block of content contains both left-to-right and right-to-left text, the user-agent uses a complex
unicode algorithm to decide how to display the text. the
unicode-bidi property overrides this algorithm and allows the developer to control the text embedding. the
unicode-bidi and direction properties are the only properties that are not affected by the all shorthand. note: this property is intended for document type definition (dtd) designers. web designers and similar authors should not override it. ...
...w to display the text. the
unicode-bidi property overrides this algorithm and allows the developer to control the text embedding. the
unicode-bidi and direction properties are the only properties that are not affected by the all shorthand. note: this property is intended for document type definition (dtd) designers. web designers and similar authors should not override it. /* keyword values */
unicode-bidi: normal;
unicode-bidi: embed;
unicode-bidi: isolate;
unicode-bidi: bidi-override;
unicode-bidi: isolate-override;
unicode-bidi: plaintext; /* global values */
unicode-bidi: inherit;
unicode-bidi: initial;
unicode-bidi: unset; syntax values normal the element does not offer an additional level of embedding with respect to the bidirectional algorithm. for inline elements, implicit reorde...
... this keyword applies the isolation behavior of the isolate keyword to the surrounding content and the override behavior of the bidi-override keyword to the inner content. plaintext this keyword makes the elements directionality calculated without considering its parent bidirectional state or the value of the direction property. the directionality is calculated using the p2 and p3 rules of the
unicode bidirectional algorithm. this value allows the display of data that is already formatted using a tool following the
unicode bidirectional algorithm. formal definition initial valuenormalapplies toall elements, though some values have no effect on non-inline elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | embed | isolate | bidi-override | isolate-ov...
...And 2 more matches
The Unicode Bidirectional Text Algorithm - Developer guides
understanding this algorithm in at least basic terms is helpful when you're striving to produce localization-ready web content or apps. in this guide, we'll take a look at the bidi algorithm and learn in general what it does and how it applies to your content, so that you'll be better prepared when using the features of html and css to which the algorithm applies while determining the order and directionality of text during rendering. ...
...nality of text during rendering. fundamentals (base direction, character types, etc) the algorithm character level directionality directional runs (what they are, how base direction applies) handling neutral characters overriding the algorithm content about using html and css to override the default behavior of the algorithm; include info about isolating ranges etc. ...
...ing. fundamentals (base direction, character types, etc) the algorithm character level directionality directional runs (what they are, how base direction applies) handling neutral characters overriding the algorithm content about using html and css to override the default behavior of the algorithm; include info about isolating ranges etc. ...
...And 2 more matches
unicode-range - CSS: Cascading Style Sheets
the
unicode-range css descriptor sets the specific range of characters to be used from a font defined by @font-face and made available for use on the current page. if the page doesn't use any character in this range, the font is not downloaded; if it uses at least one, the whole font is downloaded. syntax /* <
unicode-range> values */
unicode-range: u+26; /* single codepoint */
unicode-range: u+0-7f;
unicode-range: u+0025-00ff; /* codepoint range */
unicode-range: u+4??; /* wildcard range */
unicode-range: u+0025-00ff, u+4??; /* multiple values */ values single codepoint a single
unicode character code point, for example u+26. codepoint range a range of
unicode code points. so for example, u+0025-00ff means include all characters in the range u+0025 to ...
... description the purpose of this descriptor is to allow the font resources to be segmented so that a browser only needs to download the font resource needed for the text content of a particular page. ...
...ent of a particular page. for example, a site with many localizations could provide separate font resources for english, greek and japanese. for users viewing the english version of a page, the font resources for greek and japanese fonts wouldn't need to be downloaded, saving bandwidth. formal definition related at-rule@font-faceinitial valueu+0-10ffffcomputed valueas specified formal syntax <
unicode-range># examples using a different font for a single character in this example we create a simple html containing a single <div> element, including an ampersand, that we want to style with a different font. to make it obvious, we will use a sans-serif font, helvetica, for the text, and a serif font, times new roman, for the ampersand. in the css we are in effect defining a completely separate...
...ly separate @font-face that only includes a single character in it, meaning that only this character will be styled with this font. 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. html <div>me & you = us</div> css @font-face { font-family: 'ampersand'; src: local('times new roman');
unicode-range: u+26; } div { font-size: 4em; font-family: ampersand, helvetica, sans-serif; } result specifications specification status comment css fonts module level 3the definition of '
unicode-range' in that specification. candidate recommendation initial definition ...
unicode - SVG: Scalable Vector Graphics
the
unicode attribute specifies one or more
unicode characters indicating the sequence of
unicode characters which corresponds to a glyph. if a character is provided, then this glyph corresponds to the given
unicode character. if multiple characters are provided, then this glyph corresponds to the given sequence of
unicode characters. one use of a sequence of characters is ligatures. for example, if
unicode="ffl", then the given glyph will be used to render the sequence of characters "f", "f", and "l". it is often useful to refer to characters using xml character references expressed in hexadecimal notation or decimal notation. ...
...e provided, then this glyph corresponds to the given sequence of
unicode characters. one use of a sequence of characters is ligatures. for example, if
unicode="ffl", then the given glyph will be used to render the sequence of characters "f", "f", and "l". it is often useful to refer to characters using xml character references expressed in hexadecimal notation or decimal notation. for example,
unicode="ffl" could be expressed as xml character references in hexadecimal notation as
unicode="ffl" or in decimal notation as
unicode="ffl". the
unicode attribute contributes to the process for deciding which glyph(s) are used to represent which character(s). if the attribute is not provided for a given <glyph>, then the only way to use this glyph is via an <altglyph> r...
...ss for deciding which glyph(s) are used to represent which character(s). if the attribute is not provided for a given <glyph>, then the only way to use this glyph is via an <altglyph> reference. only one element is using this attribute: <glyph> context notes value <string> default value none animatable no <string> this value specifies one or more
unicode characters corresponding to a glyph. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '
unicode' in that specification. recommendation initial definition ...
RegExp.prototype.unicode - JavaScript
the
unicode property indicates whether or not the "u" flag is used with a regular expression.
unicode is a read-only property of an individual regular expression instance. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of regexp.prototype.
unicode writable no enumerable no configurable yes description the value of
unicode is a boolean and true if the "u" flag was used; otherwise false. the "u" flag enables various
unicode-related features. ...
...mples and send us a pull request. property attributes of regexp.prototype.
unicode writable no enumerable no configurable yes description the value of
unicode is a boolean and true if the "u" flag was used; otherwise false. the "u" flag enables various
unicode-related features. with the "u" flag, any
unicode code point escapes will be interpreted as such, for example. you cannot change this property directly. it is read-only. examples using the
unicode property var regex = new regexp('\u{61}', 'u'); console.log(regex.
unicode); // true specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.
unicode' in that specification. ...
unicode-bidi - SVG: Scalable Vector Graphics
the
unicode-bidi attribute specifies how the accumulation of the background image is managed. note: as a presentation attribute,
unicode-bidi can be used as a css property. see the css
unicode-bidi property for more information. as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a description of the values, please refer to the css
unicode-bidi property. ...
...>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a description of the values, please refer to the css
unicode-bidi property. specifications specification status comment css writing modes module level 3the definition of '
unicode-bidi' in that specification. proposed recommendation svg 2 only refers to css writing modes. introduced isolate, isolate-override, and plaintext keywords. scalable vector graphics (svg) 1.1 (second edition)the definition of '
unicode-bidi' in that specification. recommendation initial definition ...
unicode-range - SVG: Scalable Vector Graphics
the
unicode-range attribute defines the range of iso 10646 characters possibly covered by the glyphs in a font. only one element is using this attribute: <font-face> usage notes value <urange># default value none animatable no <urange># this value is a comma-separated list of iso 10646 characters possibly covered by the glyphs in the font. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '
unicode-range' in that specification. recommendation initial definition ...
Mozilla internal string guide
. the string retains ownership over the buffer at all times. in other words, there is no way to "grab" the internal char * from a string, i.e. have the string "forget" about it and hand off ownership to other code. sorry. if you wish to make a copy of a string into a new character buffer (char16_t*/char*), the preferred way is to allocate it with one of the following methods: char16_t* tonew
unicode(nsastring&) - allocates a char16_t*buffer from an nsastring. char *tonewcstring(nsacstring&) - allocates a char*buffer from an nsacstring. note that this method will also work on nsastrings, but it will do an implicit lossy conversion. this function should only be used if the input is known to be strictly ascii. often a conversion to utf-8 is more appropriate. see tonewutf8string below. char* t...
...om an nsacstring. note that this method will also work on nsastrings, but it will do an implicit lossy conversion. this function should only be used if the input is known to be strictly ascii. often a conversion to utf-8 is more appropriate. see tonewutf8string below. char* tonewutf8string(nsastring&) - allocates a new char* buffer containing the utf-8 encoded version of the given nsastring. see
unicode conversion for more details and for better ways that don't require you to manage the memory yourself. these methods return a buffer allocated using xpcom's allocator instead of the traditional allocator (malloc, etc.). outside of libxul you should use ns_free to deallocate the result when you no longer need it, inside libxul free() is preferred.. substrings (string fragments) it is very simpl...
...er to a substring of an existing string without actually allocating new space and copying the characters into that substring. substring() is the preferred method to create a reference to such a string. void processstring(const nsastring& str) { const nsastring& firstfive = substring(str, 0, 5); // from index 0, length 5 // firstfive is now a string representing the first 5 characters }
unicode conversion ns*cstring vs. ns*string strings can be stored in two basic formats: 8-bit code unit (byte/char) strings, or 16-bit code unit (char16_t) strings. any string class with a capital "c" in the classname contains 8-bit bytes. these classes include nscstring, nsdependentcstring, and so forth. any string class without the "c" contains 16-bit code units. a 8-bit string can be in one of many ...
...And 15 more matches
Using the clipboard
ntil the application has decided what it needs. this allows the clipboard to be used by another application right away. let's break down the steps needed to copy data to the clipboard. first, we need to create an xpcom object to wrap what we want to copy. we'll assume that we want to copy some text. we will use the interface nsisupportsstring which can be used to represent strings (specifically,
unicode strings). the following boilerplate utility functions will be used in all later code examples. // import the services module for future use, if we're not in // a browser window where it's already loaded. components.utils.import('resource://gre/modules/services.jsm'); // create a constructor for the built-in supports-string class. const nssupportsstring = components.constructor("@mozilla.org/su...
... .getinterface(ci.nsiwebnavigation); res.init(source); } return res; } here, the string "text to copy" will be copied but you can replace this with the text string that you want to copy. now that we have the object to copy, a transferring object needs to be created: var str = "text to copy"; var trans = transferable(sourcewindow); trans.adddataflavor("text/
unicode"); // we multiply the length of the string by 2, since it's stored in 2-byte utf-16 // format internally. trans.settransferdata("text/
unicode", supportsstring(str), str.length * 2); the first line gets the transferring component which implements nsitransferable. next we need to initialize it with a "privacy context", which will ensure that source data from inside private browsing mode will be c...
...that is unrelated to web content the user is viewing, you can pass a null privacy context to the init method. the next step is to tell the transferable what type of data we want to use. the type of data is referred to as a data flavor. the function adddataflavor is used to tell the transferable that it needs to transfer data of a certain flavor. ...
...And 12 more matches
Index
r jsfreeop structure or its library-private counterpart freeop. these structures wrap parameters that are passed to the finalizers removing most of explicit dependencies on jscontext in the finalization code. 109 jsfunction api, guide, jsapi, needscontent, spidermonkey jsfunction is a type in the jsapi. the apis js_newfunction, js_definefunction, js_compilefunction, and their
unicode equivalents return values of type jsfunction *. 110 jsfunctionspec jsapi reference, spidermonkey jsfunctionspec defines the attributes for a single js function to associate with an object. an application typically has an array of jsfunctionspec to define all the functions for an object and calls js_definefunctions or js_initclass to create the functions and assign them to an ...
...erwise return true. the intent is to support interactive compilation - accumulate lines in a buffer until js_bufferiscompilableunit is true, then pass it to the compiler. 194 js_cstringsareutf8 jsapi reference, obsolete, spidermonkey by default, all c/c++ strings passed into the jsapi are treated as iso/iec 8859-1, also known as iso-latin-1. that is, each byte is treated as a
unicode character, and there is no way to pass in a string containing characters beyond u+00ff. 195 js_callfunction jsapi reference, spidermonkey calls a specified js function. 196 js_checkaccess jsapi reference, spidermonkey check whether a running script may access a given object property. 197 js_checkforinterrupt jsapi_reference, reference, réf...
...s function. 208 js_compilefilehandleforprincipalsversion jsapi reference, needscontent, obsolete, spidermonkey please provide a description for this function. 209 js_compilefunction jsapi reference, spidermonkey js_compilefunction compiles a function from a text string, bytes, and optionally associates it with a js object, obj. js_compileucfunction is the
unicode version of the function. 210 js_compilefunctionforprincipals jsapi reference, obsolete, spidermonkey js_compilefunctionforprincipals compiles a security-enabled function from a text string, bytes, and associates it with a js object, obj. js_compileucfunctionforprincipals is the
unicode version of the function. 211 js_compilescript jsapi reference, spidermonkey ...
...And 10 more matches
Index - Web APIs
the drag data item's file object. if the item is not a file, this method returns null. 804 datatransferitem.getasstring() api, datatransferitem, html dom, html drag and drop api, method, reference, drag and drop, getasstring the datatransferitem.getasstring() method invokes the given callback with the drag data item's string data as the argument if the item's kind is a plain
unicode string (i.e. kind is string). 805 datatransferitem.kind api, datatransferitem, html dom, html drag and drop api, property, reference, drag and drop, kind the read-only datatransferitem.kind property returns a datatransferitem representing the drag data item kind: some text or some file. 806 datatransferitem.type api, datatransferitem, html dom, html drag and dr...
...em.kind property returns a datatransferitem representing the drag data item kind: some text or some file. 806 datatransferitem.type api, datatransferitem, html dom, html drag and drop api, property, reference, type, drag and drop the read-only datatransferitem.type property returns the type (format) of the datatransferitem object representing the drag data item. the type is a
unicode string generally given by a mime type, although a mime type is not required. 807 datatransferitem.webkitgetasentry() api, datatransferitem, file system api, file and directory entries api, files, method, non-standard, offline, reference, drag and drop, getasentry if the item described by the datatransferitem is a file, webkitgetasentry() returns a filesystemfileentry or files...
...serves as a getter and setter for the actual values of the cookies. 877 simple cookie framework cookies, cookie as cookies are just specially formatted strings it is sometimes difficult to manage them. the following library aims to abstract the access to document.cookie by defining an object (doccookies) that is partially consistent with a storage object. it also offers full
unicode support. 878 document.createattribute() api, dom, method, reference the document.createattribute() method creates a new attribute node, and returns it. the object created a node implementing the attr interface. the dom does not enforce what sort of attributes can be added to a particular element in this manner. 879 document.createcdatasection() api, dom, method...
...And 9 more matches
filter - CSS: Cascading Style Sheets
<image xlink:href="/files/3710/test_form_2.jpeg" filter="url(#svgblur)" width="212px" height="161px"/> </svg> </div> </td> <td><img alt="test_form_s.jpg" id="img4" class="internal default" src="/files/3711/test_form_2_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande", "lucida sans
unicode", "dejavu sans", lucida, arial, helvetica, sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -webkit-filter:blur(5px); -ms-filter:blur(5px); filter:blur(5px); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0; margin: 0 0 1.286em; height: 100%; width: 85%; } tab...
...componenttransfer> </filter> <image xlink:href="/files/3708/test_form.jpg" filter="url(#brightness)" width="286px" height="217px" /> </svg><div></td> <td><img alt="test_form_s.jpg" id="img4" class="internal default" src="/files/3709/test_form_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande","lucida sans
unicode","dejavu sans",lucida,arial,helvetica,sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -moz-filter:brightness(2); -webkit-filter:brightness(2); -ms-filter:brightness(2); filter:brightness(2); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0px; margin: 0px 0px 1.
...ponenttransfer> </filter> <image xlink:href="/files/3712/test_form_3.jpeg" filter="url(#contrast)" width="240px" height="151px" /> </svg><div></td> <td><img alt="test_form_s.jpg" id="img4" class="internal default" src="/files/3713/test_form_3_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande","lucida sans
unicode","dejavu sans",lucida,arial,helvetica,sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -moz-filter:contrast(200%); -webkit-filter:contrast(200%); -ms-filter:contrast(200%); filter:contrast(200%); } table.standard-table { border: 1px solid rgb(187, 187, 187); border-collapse: collapse; border-spacing: 0px; margin: 0px 0p...
...And 8 more matches
SVG documentation index - SVG: Scalable Vector Graphics
the phong lighting model. in svg, this can be any non-negative number. 58 direction svg, svg attribute the direction attribute specifies the inline-base direction of a <text> or <tspan> element. it defines the start and end points of a line of text as used by the text-anchor and inline-size properties. it also may affect the direction in which characters are positioned if the
unicode-bidi property's value is either embed or bidi-override. 59 display svg, svg attribute the display attribute lets you control the rendering of graphical or container elements. 60 divisor filters, svg, svg attribute the divisor attribute specifies the value by which the resulting number of applying the kernelmatrix of a <feconvolvematrix> element to the inp...
... svg attribute the transform-origin svg attribute sets the origin for an item’s transformations. 225 type needscompattable, needsexample, svg, svg attribute, filter the type attribute is a generic attribute and it has different meaning based on the context in which it's used. ...
...ute sets the origin for an item’s transformations. 225 type needscompattable, needsexample, svg, svg attribute, filter the type attribute is a generic attribute and it has different meaning based on the context in which it's used. ...
...And 7 more matches
StringView - Archive of obsolete content
in the past, this ha...
...in front of a 5/6-byte sequence stringview tries to * encode it in any case. */ var nlen = achars.length, npart = achars[nidx]; return npart > 251 && npart < 254 && nidx + 5 < nlen ? /* (npart - 252 << 30) may be not safe in ecmascript! so...: */ /* six bytes */ (npart - 252) * 10...
...eachchar() syntax stringview.foreachchar(callback[, thisobject[, characteroffset[, characterslength]]]) description repeatedly invokes a function for each character of the stringview. arguments callback (required) a function to be invoked for each character. it will be called with four arguments, expressing respectively: charcode a number expressing the
unicode representation of the actual character (codepoint). characteroffset a number expressing the position, in codepoints, of the passed character. rawoffset a number expressing the position, in codepoints parts, of the passed character. rawdataarray the array containing the raw data of the stringview. it will look something like this: callback.call(thisobject, charcode, ...
...And 6 more matches
Reading textual data - Archive of obsolete content
s.interfaces.nsiunicharlineinputstream) { var line = {}; var cont; do { cont = is.readline(line); // now you can do something with line.value } while (cont); } the above example reads an entire stream until eof. see nsiconverterinputstream for nsiconverterinputstream.init() arguments. ...
... // now you can do something with line.value } while (cont); } the above example reads an entire stream until eof. see nsiconverterinputstream for nsiconverterinputstream.init() arguments. earlier versions reading strings earlier versions of gecko do not provide easy ways to read
unicode data from a stream. you will have to manually read a block of data and convert it using nsiscriptable
unicodeconverter. ...
...putstream for nsiconverterinputstream.init() arguments. earlier versions reading strings earlier versions of gecko do not provide easy ways to read
unicode data from a stream. you will have to manually read a block of data and convert it using nsiscriptable
unicodeconverter. ...
...And 6 more matches
Intl - JavaScript
g comparison. intl.datetimeformat() constructor for objects that enable language-sensitive date and time formatting. intl.displaynames() constructor for objects that enable the consistent translation of language, region and script display names. intl.listformat() constructor for objects that enable language-sensitive list formatting. intl.locale() constructor for objects that represents a
unicode locale identifier. intl.numberformat() constructor for objects that enable language-sensitive number formatting. intl.pluralrules() constructor for objects that enable plural-sensitive formatting and language-specific rules for plurals. intl.relativetimeformat() constructor for objects that enable language-sensitive relative time formatting. static methods intl.getcanonicallocales() r...
...d options arguments, and negotiate the requested locale(s) against the locales they support using an algorithm specified in the options.localematcher property. locales argument the locales argument requests that a particular locale (or a locale from a list of them) be considered for use in a given operation. ...
...ing that is a
unicode bcp 47 locale identifier. multiple locales may be specified (and a best-supported locale determined by evaluating each of them in order and comparing against the locales supported by the implementation) by passing an array (or array-like object, with a length property and corresponding indexed elements) whose elements are either intl.locale objects or values that convert to
unicode bcp 47 locale identifier strings. if the locales argument is not provided or is undefined, the runtime's default locale is used. ...
...And 6 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
n japanese, you'll need to convert the character codes. text file input listing 15 shows an example of opening a text file encoded as shift-jis (a double-byte character encoding for japanese). copy some japanese text into a text file, save it as shift-jis, and put in the path to that file. the text will be displayed as-is. the text that you've read in is actually being represented internally as
unicode (utf-16). listing 15: reading a shift-jis text file file.initwithpath('c:\\temp\\temp.txt'); var charset = 'shift_jis'; var filestream = components.classes['@mozilla.org/network/file-input-stream;1'] .createinstance(components.interfaces.nsifileinputstream); filestream.init(file, 1, 0, false); var converterstream = components.classes['@mozilla.org/intl/converter-input-stream;1'...
...open the output file to check your results. note that if you set the character encoding to null it will default to utf-8 for both input and output. listing 16: writing text to a file ...
...open the output file to check your results. note that if you set the character encoding to null it will default to utf-8 for both input and output. ...
...And 5 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
me in two flavors, the file itself and the text name of the file. if the file is dragged and dropped onto a directory, the file flavor will be used. if the file is dropped onto a textbox, the text name flavor will be used. the text is therefore used to insert the name of the file when files can't be dropped directly. a flavor object has a name, which is a formatted like a mime type, such as 'text/
unicode'. within the ondragstart function, you specify what flavours are available for the item being dragged. to do this, add data and flavours to the transferdata object, which is the second argument to ondragstart. an example should help here. the ondragstart function adds data to the transferdata object. var textobserver = { ondragstart: function (event, transferdata, action) { var htmltext = ...
...n example should help here. the ondragstart function adds data to the transferdata object. var textobserver = { ondragstart: function (event, transferdata, action) { var htmltext = "<strong>cabbage</strong>"; var plaintext = "cabbage"; transferdata.data = new transferdata(); transferdata.data.adddataforflavour("text/html",htmltext); transferdata.data.adddataforflavour("text/
unicode",plaintext); } } here, an observer has been declared and stored in the variable textobserver. it has one property called ondragstart. (in javascript, properties can be declared with the syntax name : value). this property is a function which sets the data that is being dragged. once called, it starts a drag for the string data "cabbage". of course, you would want to calculate this value from t...
... flavour will be used and the text will appear bold. otherwise, the plain text version will be used instead. usually you will want to provide a text version of the data so that more applications can accept the data. the order that you define the flavours should be from the best match to the weakest match. ...
...And 5 more matches
Text formatting - JavaScript
o not include any characters above u+ffff, until mdn bug 857438 is fixed ( https://bugzilla.mozilla.org/show_bug.cgi?id=857438 ). string literals you can create simple strings using either single or double quotes: 'foo' "bar" more advanced strings can be created using escape sequences: hexadecimal escape sequences the number after \x is interpreted as a hexadecimal number. ...
...bove u+ffff, until mdn bug 857438 is fixed ( https://bugzilla.mozilla.org/show_bug.cgi?id=857438 ). string literals you can create simple strings using either single or double quotes: 'foo' "bar" more advanced strings can be created using escape sequences: hexadecimal escape sequences the number after \x is interpreted as a hexadecimal number. ...
... string literals you can create simple strings using either single or double quotes: 'foo' "bar" more advanced strings can be created using escape sequences: hexadecimal escape sequences the number after \x is interpreted as a hexadecimal number. '\xa9' // "©"
unicode escape sequences the
unicode escape sequences require at least four hexadecimal digits following \u. '\u00a9' // "©"
unicode code point escapes new in ecmascript 2015. with
unicode code point escapes, any character can be escaped using hexadecimal numbers so that it is possible to use
unicode code points up to 0x10ffff. with simple
unicode escapes it is often necessary to write the surrogate halves separately to achieve the same result. see also string.fromcodepoint() or string.prototype.codepointat(). '\u{2f804}' ...
...And 5 more matches
Writing textual data - Archive of obsolete content
this article describes how to write textual data to streams, files and sockets in an internationalization-aware way. when writing textual data to an output stream or to a file, you need to pick a character encoding. some character encodings (utf-8, utf-16, utf-32) can represent "all" characters (the full repertoire of
unicode) while others can only represent a subset of the full repertoire. when the file is to be read only by the application/extension itself, using utf-8 is often the best choice — it can represent all characters, and ascii characters are represented efficiently. writing to a stream in gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverteroutputstream: var charset = "utf-8"; // can be any character encoding name that mozilla supports var os = components.
...00 means that writing unsupported characters throws an exception (with an error code of ns_error_loss_of_significant_data), and no data will be written. to instead write a replacement character in such cases, specify the character instead of 0x00: os.init(fos, charset, 0, "?".charcodeat(0)); you can, of course, replace the "?" in that example with any other character. you can also specify any
unicode character u+abcd directly as 0xabcd. note: if the replacement character is not a supported character in the chosen character encoding, attempts to write unsupported characters will fail with ns_error_loss_of_significant_data. versions before gecko 1.8 firefox 1.0.x, mozilla 1.7.x and older versions do not support nsiconverteroutputstream. alternative ways usable from javascript do not support...
...ers will fail with ns_error_loss_of_significant_data. versions before gecko 1.8 firefox 1.0.x, mozilla 1.7.x and older versions do not support nsiconverteroutputstream. alternative ways usable from javascript do not support character encodings that use embedded nulls (such as utf-16 and utf-32). ...
...And 4 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
of ascii characters be used in url/uri. if end users input non-ascii characters as part of a domain name or if a web page contains a link using a non-ascii domain name, the application must convert such input into a special encoded format using only the usual ascii subset characters. ...
...special encoded format using only the usual ascii subset characters. rfc 3490 (internationalizing domain names in applications (idna)) defines characters used in idn to be drawn from
unicode standard 3.2. it also defines how an application should process non-ascii characters in such a way to conform to existing host name character restrictions. how mozilla browsers handle non-ascii domain names
unicode and nameprep when mozilla receives idn input from the user via the location bar or a request to process non-ascii host name links, it first turns them into
unicode, then normalizes the input string to make it conform to general uri requirement. the process will convert uppercase characters to lowercase ones (case folding), unify characters with multiple representation, e.g. conversion of half-w...
...ent. the process will convert uppercase characters to lowercase ones (case folding), unify characters with multiple representation, e.g. conversion of half-width kana characters in japanese into full-width ones (normalization), eliminate prohibited characters (e.g. space), eliminate ambiguities in bi-directional text (e.g. arabic and hebrew), and check whether or not unassigned characters in the
unicode repertoire are used -- allowing them for "query strings" but disallowing them for "stored strings" such as the data input for domain name registration. this process is called "nameprep" and is performed according to rfc 3491 (nameprep: a stringprep profile for internationalized domain names (idn)) and rfc 3454 (preparation of internationalized strings ("stringprep")). ascii-compatible encoding ...
...And 4 more matches
JSAPI User Guide
engine call(s) in your application to compile and execute the script. you have two choices: 1.) compile and execute a script with a single call to js_evaluatescript, js_evaluateucscript or 2.) compile the script once with a call to js_compilescript or js_compileucscript, and then execute it repeatedly with individual calls to js_executescript. the "uc" versions of these calls provide support for
unicode-encoded scripts. an object you create using a script only can be made available only during the lifetime of the script, or can be created to persist after the script completes execution. ordinarily, once script execution is complete, its objects are destroyed. in many cases, this behavior is just what your application needs. in other cases, however, you will want object persistence across scrip...
...l c void pointer variable. call js_setprivate, specify the object for which to establish private data, and specify the pointer to the data. for example: js_setprivate(cx, obj, pdata); to retrieve the data at a later time, call js_getprivate, and pass the object as an argument. this function returns the pointer to an object's private data: pdata = js_getprivate(cx, obj); special topics
unicode to pass
unicode data between javascript and native code, represent the data in utf-16 in memory. javascript strings, property names, and programs are all made up of jschars, which are 16-bit unsigned integers. many jsapi functions operate on null-terminated, 8-bit char strings. these functions convert their char * arguments to 16-bit strings by zero-extending each 8-bit char to 16 bits—unless...
..., and programs are all made up of jschars, which are 16-bit unsigned integers. many jsapi functions operate on null-terminated, 8-bit char strings. ...
...And 4 more matches
Regular expression syntax cheatsheet - JavaScript
a-za-z0-9_]. for example, /\w/ matches "a" in "apple", "5" in "$5.28", and "3" in "3d". \w matches any character that is not a word character from the basic latin alphabet. equivalent to [^a-za-z0-9_]. for example, /\w/ or /[^a-za-z0-9_]/ matches "%" in "50%". \s matches a single white space character, including space, tab, form feed, line feed, and other
unicode spaces. equivalent to [ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches " bar" in "foo bar". \s matches a single character other than white space. equivalent to [^ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches "foo" in "foo bar". \t matches a horizon...
..., where "x" is a letter from a–z (corresponding to codepoints u+0001–u+001f). for example, /\cm/ matches "\r" in "\r\n". \xhh matches the character with the code hh (two hexadecimal digits). \uhhhh matches a utf-16 code-unit with the value hhhh (four hexadecimal digits). \u{hhhh} or \u{hhhhh} (only when the u flag is set.) matches the character with the
unicode value u+hhhh or u+hhhhh (hexadecimal digits). \ indicates that the following character should be treated specially, or "escaped". it behaves one of two ways. for characters that are usually treated literally, indicates that the next character is special and not to be interpreted literally. for example, /b/ matches the character "b". by placing a backslash in front of "...
.../ means match 0 or more "a"s. to match * literally, precede it with a backslash; for example, /a\*/ matches "a*". note that some characters like :, -, @, etc. neither have a special meaning when escaped nor when unescaped. escape sequences like \:, \-, \@ will be equivalent to their literal, unescaped character equivalents in regular expressions. however, in regular expressions with the
unicode flag, these will cause an invalid identity escape error. this is done to ensure backward compatibility with existing code that uses new escape sequences like \p or \k. to match this character literally, escape it with itself. in other words to search for \ use /\\/. assertions if you are looking to contribute to this document, please also edit the original article boun...
...And 4 more matches
Lexical grammar - JavaScript
left to right and is converted into a sequence of input elements which are tokens, control characters, line terminators, comments or white space. ecmascript also defines certain keywords and literals and has rules for automatic insertion of semicolons to end statements. control characters control characters have no visual representation but are used to control the interpretation of the text.
unicode format-control characters code point name abbreviation description u+200c zero width non-joiner <zwnj> placed between characters to prevent being connected into ligatures in certain languages (wikipedia). u+200d zero width joiner <zwj> placed between characters that would not normally be connected in order to cause the characters to be rend...
...haracters to prevent being connected into ligatures in certain languages (wikipedia). u+200d zero width joiner <zwj> placed between characters that would not normally be connected in order to cause the characters to be rendered using their connected form in certain languages (wikipedia). u+feff byte order mark <bom> used at the start of the script to mark it as
unicode and the text's byte order (wikipedia). white space white space characters improve the readability of source text and separate tokens from each other. these characters are usually unnecessary for the functionality of the code. minification tools are often used to remove whitespace in order to reduce the amount of data that needs to be transferred. white space characters code poi...
...cter tabulation <ht> horizontal tabulation \t u+000b line tabulation <vt> vertical tabulation \v u+000c form feed <ff> page breaking control character (wikipedia). \f u+0020 space <sp> normal space u+00a0 no-break space <nbsp> normal space, but no point at which a line may break others other
unicode space characters <usp> spaces in
unicode on wikipedia line terminators in addition to white space characters, line terminator characters are used to improve the readability of the source text. however, in some cases, line terminators can influence the execution of javascript code as there are a few places where they are forbidden. line terminators also affect the process of auto...
...And 4 more matches
Regular expressions - JavaScript
ds, and other patterns indicating in some way that a match is possible (including look-ahead, look-behind, and conditional expressions). character classes distinguish different types of characters. for example, distinguishing between letters and digits. groups and ranges indicate groups and ranges of expression characters. quantifiers indicate numbers of characters or expressions to match.
unicode property escapes distinguish based on
unicode character properties, for example, upper- and lower-case letters, math symbols, and punctuation. if you want to look at all the special characters that can be used in regular expressions in a single table, see the following: special characters in regular expressions. characters / constructs corresponding article \, ., \cx...
... 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. for instance, to search for "a" followed by "*" followed by...
... 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. for instance, to search for "a" followed by "*" followed by "b", you'd use /a\*b...
...And 3 more matches
String.prototype.normalize() - JavaScript
if omitted or undefined, "nfc" is used. these values have the following meanings: "nfc" canonical decomposition, followed by canonical composition. "nfd" canonical decomposition. "nfkc" compatibility decomposition, followed by canonical composition. "nfkd" compatibility decomposition. ...
... returns the
unicode normalization form of the string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.normalize([form]) parameters form optional one of "nfc", "nfd", "nfkc", or "nfkd", specifying the
unicode normalization form. if omitted or undefined, "nfc" is used. these values have the following meanings: "nfc" canonical decomposition, followed by canonical composition. "nfd" canonical decomposition. "nfkc" compatibility decomposition, followed by canonical composition. "nfkd" compatibility decomposition. ...
...for example, the code point for "a" is given as u+0041. ...
...And 3 more matches
Template literals (Template strings) - JavaScript
e string.raw() method exists to create raw strings—just like the default template function and string concatenation would create. ...
...just like the default template function and string concatenation would create. ...
...the ecmascript proposal template literal ...
...And 3 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
num.hasmoreelements()) { var file = fileenum.getnext().queryinterface(components.interfaces.nsifile); file.remove(false); // debug dump("sessionstore> clear: " + file.leafname + "\n"); } }, _readfile method reads the nslfile object passed as a parameter, and returns its contents as a text string. when the file is read in, its contents are converted from utf-8 to
unicode. listing 22: content for _readfile method _readfile: function(afile) { try { var stream = components.classes["@mozilla.org/network/file-input-stream;1"]. createinstance(components.interfaces.nsifileinputstream); stream.init(afile, 0x01, 0, 0); var cvstream = components.classes["@mozilla.org/intl/converter-input-stream;1"]. createin...
...r data = {}; while (cvstream.readstring(4096, data)) { content += data.value; } cvstream.close(); return content.replace(/\r\n?/g, "\n"); } catch (ex) { } return null; }, _writefile method creates a new file for the nslfile object passed as a parameter, and writes the text string, also passed as a parameter. upon writing, the text is converted from
unicode to utf-8. listing 23: content for _writefile method _writefile: function(afile, adata) { // init stream var stream = components.classes["@mozilla.org/network/safe-file-output-stream;1"]. createinstance(components.interfaces.nsifileoutputstream); stream.init(afile, 0x02 | 0x08 | 0x20, 0600, 0); // convert to utf-8 var converter = components.classes["@mozill...
...3: content for _writefile method _writefile: function(afile, adata) { // init stream var stream = components.classes["@mozilla.org/network/safe-file-output-stream;1"]. ...
...And 2 more matches
Fonts for Mozilla 2.0's MathML engine
nstall math fonts (stix, asana or mathjax fonts) from your package manager or get them from this zip archive. on android, firefox os and other platforms where the instructions above do not work: install the mathml-fonts add-on. this requires gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) or higher. overview mathematical formulas make use of various symbols represented by specific
unicode characters. mozilla can display any of these symbols provided suitable
unicode fonts are installed. furthermore, in accordance with the w3c css2 recommendation on fonts, authors can specify an ordered list of particular fonts which they prefer (using the font-family property of css), with the assurance that mozilla's font engine will hunt for alternate fonts whenever their specified fonts are not...
...fy an ordered list of particular fonts which they prefer (using the font-family property of css), with the assurance that mozilla's font engine will hunt for alternate fonts whenever their specified fonts are not found on a particular user's system. if no appropriate font is ultimately found for a given character, mozilla will instead display a box containing the hexadecimal representation of the
unicode code point for the character. some mathematical operators are also drawn by using glyphs for larger variants of the character (e.g. summation symbol) or by assembling glyphs for a few pieces of the character (e.g braces). these variant or part glyphs do not in general have
unicode assignments, and so font-specific support is required for some characters. mozilla has general support for the common...
...for other characters, mozilla has font-specific support. ...
...And 2 more matches
JS_GetLocaleCallbacks
st. in a js_threadsafe build, the caller must be in a request on this jscontext. callbacks jslocalecallbacks * pointer to a jslocalecallbacks struct. ...
... build, the caller must be in a request on this jscontext. callbacks jslocalecallbacks * pointer to a jslocalecallbacks struct. ...
... jslocaletolowercase implementation of string.prototype.tolocalelowercase() function. jslocalecompare implementation of string.prototype.localecompare() function. ...
...And 2 more matches
text-transform - CSS: Cascading Style Sheets
se; text-transform: full-width; text-transform: full-size-kana; /* global values */ text-transform: inherit; text-transform: initial; text-transform: unset; capitalize is a keyword that converts the first letter of each word to uppercase. other characters remain unchanged (they retain their original case as written in the element's text). a letter is defined as a character that is part of
unicode's letter or number general categories ; thus, any punctuation marks or symbols at the beginning of a word are ignored. authors should not expect capitalize to follow language-specific title casing conventions (such as skipping articles in english). the capitalize keyword was under-specified in css 1 and css 2.1. this resulted in differences between browsers in the way the first letter was ca...
...for» *the* _css_ ¿capitalize? ?¡transform!</strong> </p> <p>text-transform: capitalize <strong><span>(this) “is” [a] –short– -test- «for» *the* _css_ ¿capitalize? ?¡transform!</span></strong> </p> span { text-transform: capitalize; } strong { float: right; } this demostrates how initial punctuations of a word are ignored. the keyword target the first letter, that is the first
unicode character part of the letter or number general category. capitalize (symbols) <p>initial string <strong>ⓐⓑⓒ (ⓓⓔⓕ) —ⓖⓗⓘ— ⓙkl</strong> </p> <p>text-transform: capitalize <strong><span>ⓐⓑⓒ (ⓓⓔⓕ) —ⓖⓗⓘ— ⓙkl</span></strong> </p> span { text-transform: capitalize; } strong { float: right; } this demonstrates how initial symbols are ignored. the...
...gory. capitalize (symbols) <p>initial string <strong>ⓐⓑⓒ (ⓓⓔⓕ) —ⓖⓗⓘ— ⓙkl</strong> </p> <p>text-transform: capitalize <strong><span>ⓐⓑⓒ (ⓓⓔⓕ) —ⓖⓗⓘ— ⓙkl</span></strong> </p> span { text-transform: capitalize; } strong { float: right; } this demonstrates how initial symbols are ignored. the keyword target the first letter, that is the first
unicode character part of the letter or number general category. capitalize (dutch ij digraph) <p>initial string <strong lang="nl">the dutch word: "ijsland" starts with a digraph.</strong> </p> <p>text-transform: capitalize <strong><span lang="nl">the dutch word: "ijsland" starts with a digraph.</span></strong> </p> span { text-transform: capitalize; } strong { float: right; } this demonstrat...
...And 2 more matches
String - JavaScript
thors need not worry about the distinction. a string object can always be converted to its primitive counterpart with the valueof() method. ...
...7) iso-8859-1 character /
unicode code point between u+0000 and u+00ff \' single quote \" double quote \\ backslash \n new line \r carriage return \v vertical tab \t tab \b backspace \f form feed \uxxxx (where xxxx is 4 hex digits; range of 0x0000–0xffff) utf-16 code unit /
unicode code point between u+0000 and u+ffff \u{x} ... ...
...n new line \r carriage return \v vertical tab \t tab \b backspace \f form feed \uxxxx (where xxxx is 4 hex digits; range of 0x0000–0xffff) utf-16 code unit /
unicode code point between u+0000 and u+ffff \u{x} ... \u{xxxxxx} (where x…xxxxxx is 1–6 hex digits; range of 0x0–0x10ffff) utf-32 code unit /
unicode code point between u+0000 and u+10ffff \xxx (where xx is 2 hex digits; range of 0x00–0xff) iso-8859-1 character /
unicode code point between u+0000 and u+00ff long literal strings sometimes, your code will include strings which are very long. rather than having lines that go on endlessly, or wrap at the whim of your editor, you may wish to specifically break the string i...
...And 2 more matches
Preferences - Archive of obsolete content
[iid_is(atype), retval] out nsqiresult avalue); void setcomplexvalue(in string aprefname, in nsiidref atype, in nsisupports avalue); as you can see, both of them take a parameter, atype, which can have one of the following values (to be precise, you should pass components.interfaces.nsiwhatever instead of just nsiwhatever, which is undefined). nsisupportsstring used to handle
unicode strings in preferences. use this when the preference value may contain non-ascii characters (for example, a user's name). nsipreflocalizedstring almost the same as nsisupportsstring, but it is handled differently in getcomplexvalue() when there's no user value for the given preference; see below for details. nsilocalfile and nsirelativefilepref store paths in preferences. nsilocalfile is used...
...ndled differently in getcomplexvalue() when there's no user value for the given preference; see below for details. nsilocalfile and nsirelativefilepref store paths in preferences. nsilocalfile is used to store absolute paths, while nsirelativefilepref is used to store paths relative to a "special" directory, such as the profile folder. ...
...e below for details. nsilocalfile and nsirelativefilepref store paths in preferences. nsilocalfile is used to store absolute paths, while nsirelativefilepref is used to store paths relative to a "special" directory, such as the profile folder. nsisupportsstring as noted above, this is used to handle
unicode strings in preferences. ...
... is used to store paths relative to a "special" directory, such as the profile folder. nsisupportsstring as noted above, this is used to handle
unicode strings in preferences. example: // prefs is an nsiprefbranch // example 1: getting
unicode value var value = prefs.getcomplexvalue("preference.with.non.ascii.value", components.interfaces.nsisupportsstring).data; // example 2: setting
unicode value var str = components.classes["@mozilla.org/supports-string;1"] .createinstance(components.interfaces.nsisupportsstring); str.data = "some non-ascii text"; prefs.setcomplexvalue("preference.with.non.ascii.value", components.interfaces.nsisupportsstring, str); nsipreflocalizedstring another complex type supported by mozilla is nsipreflocalizedstring. it is similar to nsisupport...
Documentation for BiDi Mozilla - Archive of obsolete content
s is preliminary documentation of the changes introduced to mozilla as part of the bidi support contributed by ibm (a.k.a. ibmbidi), written by simon montagu and posted to the mozilla-layout mailing list. while it was published in 2001 and might not be totally accurate, it does help understanding the internals of the bidi code. overview of bidi processing bidi text is reordered according to the
unicode bidi algorithm (uba). the implementation is based on ibm's international components for
unicode (icu), which was chosen after comparing and testing the available open-source implementations. as far as we could discover, icu is the only one which is 100% compatible with uba, including support for explicit directional controls (lro, rlo, etc, and their html equivalents). bidi processing for a give...
...t-to-right text from left to right or right-to-left text from right to left. in some circumstances, even on a platform with bidi capability, the layout code has to reverse text fragments or to allow for the fact that they are displayed in reverse. in general, this happens whenever we are dealing with less than a whole frame. examples of this are in nstextframe::painttextslowly; nstextframe::paint
unicodetext when a selection is displayed; nstextframe::getposition; nstextframe::getpointfromoffset. text in visual mode must also be reversed before display on a bidi platform. text fields and composer the specification of the bidi changes to composer was posted in the editor and i18n newsgroups, and responses there were taken into account. the implementation is mostly in layout code, especially in n...
...rt where necessary. some support added for alignment in tables and lists, and fixes for problems with different combinations of dir and align. ...
... nsibidikeyboard widget/public/nsibidikeyboard.idl widget/src/%platform%/nsbidikeyboard.cpp sets and queries the directionality of the current keyboard language. ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
roviding metadata. 26 bandwidth glossary, infrastructure bandwidth is the measure of how much information can pass through a data connection in a given amount of time. it is usually measured in multiples of bits-per-second (bps), for example megabits-per-second (mbps) or gigabits-per-second (gbps). 27 base64 advanced, base64, javascript, typed arrays, uri, url,
unicode problem, atob(), btoa() base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ascii string format by translating it into a radix-64 representation. the term base64 originates from a specific mime content transfer encoding. 28 baseline css, glossary, svg, alignment, typography the baseline is a term used in european and west asian ...
...ether it exists. this example comes from rfc3986: urn:oasis:names:specification:docbook:dtd:xml:4.1.2 473 utf-8 codingscripting, glossary, html, javascript, utf-8 utf-8 (ucs transformation format 8) is the world wide web's most common character encoding. each character is represented by one to four bytes. ...
... 476 usenet glossary, webmechanics usenet is an internet discussion system where each post is duplicated on many servers. ...
... 476 usenet glossary, webmechanics usenet is an internet discussion system where each post is duplicated on many servers. ...
Python binding for NSS
object. enumerated constants used in the nss/nspr api's are available in the python module under the exact same name as they appear in the c header files of nss/nspr. convenience functions are provided to translate between the numeric value of an enumerated constant and it's string representation and visa versa. python-nss internally supports utf-8. strings may be python str objects or python
unicode objects. if a python
unicode object is passed to a nss/nspr function it will be encoded as utf-8 first before being passed to nss/nspr. python-nss tries to be flexible when generating a print representation of complex objects. for simplicity you can receive a block of formatted text but if you need more control, such as when building gui elments you can access a list of "lines", each line is pai...
...16-02-16 scm tag pynss_release_1_0_0beta1 source download https://ftp.mozilla.org/pub/mozilla.org/security/python-nss/releases/pynss_release_1_0_0beta1/src/ change log the primary enhancement in this version is support for python3. a single code base supports both py2 (minimum version 2.7) and py3 when built for py2: text will be a
unicode object binary data will be a str object ints will be python long object when built for py3: text will be a str object binary data will be a bytes object ints will be a python int object all pure python tests and examples have been ported to py3 syntax but should continue to run under py2. the following class method...
... add repr_kind parameter to cert_trust_flags_str() add support for repr_kind asenumname to bitstring table lookup. add cert_type_bitstr_to_tuple() lookup function add prtimeconvert(), used to convert python time values to prtime, centralizes conversion logic, reduces duplication add utf8ornoneconvert to better handle
unicode parameters which are optional. add certificate_summary_format_lines() utility to generate concise certificate identification info for output. certificate_new_from_certcertificate now takes add_reference parameter to properly reference count certs, should fix shutdown busy problems. add print_traceback(), print_cert() debugging support. ...
... test/setup_certs.py release 0.9.0 release date 2010-05-28 scm tag pynss_release_0_9_0 source download change log general modifications: correct definciencies in auth_certificate_callback found in several of the example files and documentation. if you've copied that code you should merge those changes in.
unicode objects now accepted as well as str objects for interfaces expecting a string. sockets were enhanced thusly: threads will now yield during blocking io. socket.makefile() reimplemented file object methods that had been missing (readlines(), sendall(), and iteration) were implemented makefile now just returns the same socket object but i...
JSErrorReport
h it is loaded. callers should set this flag for cross-origin scripts, and it will be propagated appropriately to child scripts and passed back in jserrorreports. linebuf const char * text of the line that caused the error, minus the trailing newline character. tokenptr const char * pointer to the error token in *linebuf. uclinebuf const char16_t *
unicode line buffer. this is the buffer that contains the original data. uctokenptr const char16_t * pointer to the error token in *uclinebuf. flags unsigned the logical or of zero or more of the following flags: jsreport_warning this "error" is really only a warning. it will not cause the current operation to fail. jsreport_exce...
... all. we check the strictness of the context's top frame's script; where that isn't appropriate, the caller should do the right checks itself instead of using this flag. the constant jsreport_error is 0 and can be used to indicate an error report without any of the above flags. errornumber unsigned the error number. ucmessage const char16_t * the default
unicode error message. messageargs const char16_t ** arguments for the error message. exntype int16_t one of the jsexntype constants. description jserrorreport describes a single error that occurs in the execution of script. in the event of an error, filename will either contain the name of the external source file or url containing the script (script src=) or null, in...
...in a script embedded in the html page, lineno indicates the html lineno where the script error is located. linebuf is a pointer to a user-defined buffer into which js copies the offending line of the script. tokenptr is a pointer into linebuf that identifies the precise location line of the problem within the offending line. uclinebuf is a pointer to a user-defined buffer into which js copies the
unicode (original) version of the offending line of script. uctokenptr is a pointer into uclinebuf that identifies the precise location line of the problem within the offending
unicode (original) version of the offending line. to use jserrorreport, your application must define a variable of type jserrorreport and allocate a buffer to hold the text that generated the error condition. set linebuf to point ...
...tr is a pointer into uclinebuf that identifies the precise location line of the problem within the offending
unicode (original) version of the offending line. to use jserrorreport, your application must define a variable of type jserrorreport and allocate a buffer to hold the text that generated the error condition. set linebuf to point at the buffer before your application executes a script. for
unicode scripts, define a second buffer that holds the
unicode version of the text the generated the error. for application that do not use
unicode, set uclinebuf and uctokenptr to null. macros name description jsreport_is_warning(flags) returns true if flags has jsreport_warning. jsreport_is_exception(flags) returns true if flags has jsreport_exception. jsrep...
XPCOM Stream Guide
tstream); var data = "hello world"; instream.setdata(data, data.length); while (instream.available()) { outstream.writefrom(instream, instream.available()); } note this is an inefficient example: the only important part is how to feed the output stream. this is also a synchronous (blocking) operation, so if you're in javascript, consider using netutil.jsm as described below. a note about
unicode strings versus nsiinputstream nsiinputstream and nsioutputstream work with 8-bit characters. however, javascript strings contain 16-bit characters. this can mean if you have characters beyond ascii code 255, you risk losing data using nsstringstream, for example. to get an input stream for javascript strings safely, try this. var converter = components.classes["@mozilla.org/intl/scriptableun...
... however, javascript strings contain 16-bit characters. this can mean if you have characters beyond ascii code 255, you risk losing data using nsstringstream, for example. to get an input stream for javascript strings safely, try this. var converter = components.classes["@mozilla.org/intl/scriptable
unicodeconverter"] .createinstance(components.interfaces.nsiscriptable
unicodeconverter); converter.charset = "utf-8"; var stream = converter.converttoinputstream(string); javascript modules are your friends there are several useful javascript modules at your disposal. for streams, the most obvious are netutil.jsm and fileutils.jsm. netutil.jsm provides apis for copying an input stream to an output stream (the asynccopy() method), getting an input stream from another sou...
... binary data from the underlying stream, in "big-endian" order. nsbinaryinputstream @mozilla.org/binaryinputstream;1 nsibinaryinputstream .setinputstream(stream) object read a nsisupports object from the underlying stream. nsbinaryinputstream @mozilla.org/binaryinputstream;1 nsiobjectinputstream (inherits from nsibinaryinputstream) converter convert
unicode characters from an underlying stream. nsconverterinputstream @mozilla.org/intl/converter-input-stream;1 nsiconverterinputstream .init(stream, charset, buffersize, replacechar) mime separate headers from data. nsmimeinputstream @mozilla.org/network/mime-input-stream;1 nsimimeinputstream .setdata(stream) similarly, there are complex output streams which bu...
...der. nsbinaryoutputstream @mozilla.org/binaryoutputstream;1 nsibinaryoutputstream .setoutputstream(stream) object write an nsisupports object to the underlying stream. nsbinaryoutputstream @mozilla.org/binaryoutputstream;1 nsiobjectoutputstream (inherits from nsibinaryoutputstream) converter write to an underlying stream with automatic conversion of
unicode characters. nsconverteroutputstream @mozilla.org/intl/converter-output-stream;1 nsiconverteroutputstream .init(stream, charset, buffersize, replacechar) additional stream interfaces the nsilineinputstream interface supports a .readline() method for reading a single line from an input stream. the nsfileinputstream and nspartialfileinputstream classes implement this interface.
XPIDL
array<t> const nstarray<t>& nstarray<t>& array the c++-exposed type t will be an owned variant. (e.g. ns[c]string, refptr<t>, or uint32_t) string, wstring, [ptr] native and [ref] native ar...
... want to use this type but autf8string or acstring unsigned long uint32_t uint32_t* number unsigned long long uint64_t uint64_t* number unsigned short uint16_t uint16_t* number wchar char16_t char16_t* string full
unicode set permitted wstring const char16_t* char16_t** string full
unicode set permitted most of the time you don't want to use this type but astring. array<t> const nstarray<t>& nstarray<t>& array the c++-exposed type t will be an owned variant. (e.g. ns[c]string, refptr<t>, or uint32_t) string, wstring, [ptr] native and [ref] native are unsupported as element types. in addition to this list, nearly every idl file incl...
...d** ? nscidptr const nscid* nscid** ? nsiid const nsiid nsiid* ? nsid const nsid nsid* ? nscid const nscid nscid* ? ...
...types can of course be one of the fundamental ty...
Intl.Collator() constructor - JavaScript
if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.collator([locales[, options]]) parameters locales optional. a string with a bcp 47 language tag, or an array of such strings. for the general form and interpretation of the locales argument, see the intl page. the following
unicode extension keys are allowed: co variant collations for certain locales. possible values include: "big5han", "dict", "direct", "ducet", "gb2312", "phonebk", "phonetic", "pinyin", "reformed", "searchjl", "stroke", "trad", "unihan". the "standard" and "search" values are ignored; they are replaced by the options property usage (see below). kn whether numeric collation should be used, such ...
...ect", "ducet", "gb2312", "phonebk", "phonetic", "pinyin", "reformed", "searchjl", "stroke", "trad", "unihan". the "standard" and "search" values are ignored; they are replaced by the options property usage (see below). kn whether numeric collation should be used, such that "1" < "2" < "10". possible values are "true" and "false". this option can be set through an options property or through a
unicode extension key; if both are provided, the options property takes precedence. kf whether upper case or lower case should sort first. possible values are "upper", "lower", or "false" (use the locale's default). this option can be set through an options property or through a
unicode extension key; if both are provided, the options property takes precedence. options optional. an object wit...
... is "variant" for usage "sort"; it's locale dependent for usage "search". ignorepunctuation whether punctuation should be ignored. possible values are true and false; the default is false. numeric whether numeric collation should be used, such that "1" < "2" < "10". possible values are true and false; the default is false. ...
...implementations are not required to support this property. ...
JSON.stringify() - JavaScript
c references by serializable values. issue with plain json.stringify for use as javascript historically, json was not a completely strict subset of javascript. the literal code points u+2028 line separator and u+2029 paragraph separator could appear literally in string literals and property names in json text. but they could not appear literally in similar context in javascript text, only using
unicode escapes as \u2028 and \u2029. this recently changed: now both code points may appear literally in strings in json and javascript both. therefore, if compatibility with older javascript engines is required, it is perilous to directly substitute the string returned by json.stringify into a javascript string to be passed to eval or new function or as part of a jsonp url, and the following utility ...
... replace(/\u2028/g, '\\u2028'). replace(/\u2029/g, '\\u2029'); } var s = { a: string.fromcharcode(0x2028), b: string.fromcharcode(0x2029) }; try { eval('(' + json.stringify(s) + ')'); } catch (e) { console.log(e); // "syntaxerror: unterminated string literal" } // no need for a catch eval('(' + jsfriendlyjsonstringify(s) + ')'); // console.log in firefox unescapes the
unicode if // logged to console, so we use alert alert(jsfriendlyjsonstringify(s)); // {"a":"\u2028","b":"\u2029"} note: properties of non-array objects are not guaranteed to be stringified in any particular order. do not rely on ordering of properties within the same object within the stringification. var a = json.stringify({ foo: "bar", baz: "quux" }) //'{"foo":"bar","baz":"quux"}' var b = json.
...before this change json.stringify would output lone surrogates if the input contained any lone surrogates; such strings could not be encoded in valid utf-8 or utf-16: json.stringify("\ud800"); // '"�"' but with this change json.stringify represents lone surrogates using json escape sequences that can be encoded in valid utf-8 or utf-16: json.stringify(...
...only if you are directly interpreting the result of json.stringify do you need to carefully handle json.stringify's two possible encodings of these code points. specifications specification ecmascript (ecma-262)the definition of 'json.stringify' in that specification. ...
Drag and Drop Example - Archive of obsolete content
that we know what type of element to create when dragging. next, we'll define the two listener objects. first, the listobserver which needs a function to handle the start of the drag. var listobserver = { ondragstart: function (event, transferdata, action) { var txt = event.target.getattribute("elem"); transferdata.data = new transferdata(); transferdata.data.adddataforflavour("text/
unicode", txt); } } one function has been defined, ondragstart, which will be called by the nsdraganddrop object when necessary. the function adds the data to be dragged to the transfer object. the elem attribute is retrieved from the target of the drag event. the target will be the element that had the drag start on. we'll use the value of this attribute as the data of the drag. the boardobserver wil...
... on. we'll use the value of this attribute as the data of the drag. the boardobserver will need three functions, getsupportedflavours, ondragover and ondrop. the ondrop function will grab the data from the drag session and create a new element of the appropriate type. ...
...artdrag(event, listobserver)"/> <button label="text box" elem="textbox" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> </vbox> </window> var listobserver = { ondragstart: function (event, transferdata, action) { var txt = event.target.getattribute("elem"); transferdata.data = new transferdata(); transferdata.data.adddataforflavour("text/
unicode", txt); } }; var boardobserver = { getsupportedflavours : function () { var flavours = new flavourset(); flavours.appendflavour("text/
unicode"); return flavours; }, ondragover: function (event, flavour, session) {}, ondrop: function (event, dropdata, session) { if (dropdata.data != "") { var elem = document.createelement(dropdata.data); event.target.append...
LiveConnect Overview - Archive of obsolete content
ray.newinstance(java.lang.string, 5); arguments of type char in javascript 1.4 and later, you can pass a one-character string to a java method which requires an argument of type char. for example, you can pass the string "h" to the character constructor as follows: var c = new java.lang.character("h"); in javascript 1.3 and earlier, you must pass such methods an integer which corresponds to the
unicode value of the character. for example, the following code also assigns the value "h" to the variable c: var c = new java.lang.character(72); handling java exceptions in javascript when java code fails at run time, it throws an exception. if your javascript code accesses a java data member or method and fails, the java exception is passed on to javascript for you to handle. beginning with javascrip...
...sion with other string values. string values when you pass javascript string types as parameters to java methods, java converts the values according to the rules described in the following table: java parameter type conversion rules java.lang.string java.lang.object javascript 1.4: a javascript string is converted to an instance of java.lang.string with a
unicode value. javascript 1.3 and earlier: a javascript string is converted to an instance of java.lang.string with an ascii value. byte double float int long short all values are converted to numbers as described in ecma-262. the javascript string value is converted to a number according to the rules described in ecma-262. char j...
...ipt string is converted to an instance of java.lang.string with an ascii value. byte double float int long short all values are converted to numbers as described in ecma-262. the javascript string value is converted to a number according to the rules described in ecma-262. char javascript 1.4: one-character strings are converted to
unicode characters. all other values are converted to numbers. javascript 1.3 and earlier: all values are converted to numbers. boolean the empty string becomes false. all other values become true. undefined values when you pass undefined javascript values as parameters to java methods, java converts the values according to the r...
Localization content best practices
ngs are temporary, they shouldn't be exposed to the localization process. this would waste everybody's time and create unnecessary frustration: localizers have to translate strings that are destined to change, developers will need to use new ids later to update them. if you're reviewing a patch, check also strings for grammar errors, capitalization or inconsistencies. ...
... u+2018 and u+2019 (\u2018 and \u2019 in javascript) are the left and right single quotation marks, respectively. the right single quotation mark should be used as an apostrophe. ...
... be replaced at run-time # by an active link. string with id 'privacy-link' will be used as text # for this link. privacy-text = by proceeding you accept the {{link}}. privacy-link = privacy terms and then replace {{link}} at run-time with the link. don't hardcode characters typically white spaces, commas, or other separators (":", "|"). if you need a trailing white space in a string, use the
unicode character \u0020 (that's usually a bad sign, you're concatenating it to another string). at some point, someone will accidentally trim that whitespace. remove unused strings if you're removing features, don't leave around unused strings in the .properties file. tooltips if a string is used as a tooltip, it should not end in a period (in english). tooltips are never written in imperative mood ...
Mozilla Web Developer FAQ
ype and opentype formats (.ttf and .otf) are supported since firefox 3.5. the fonts have to be served from the same origin (protocol, host, port) as the content that uses them unless the fonts are served with the appropriate cross-origin resource sharing http headers. downloadable fonts in the eot format are not supported. if you use downloadable fonts, please make sure the fonts have the right
unicode mappings and the content uses the right
unicode characters. the past practice of displaying non-latin text by assigning non-latin glyphs to latin code points breaks copying and pasting, breaks searching on the page, breaks indexing by search engines and breaks readability in browsers that do not support downloadable fonts (e.g. legacy browsers or mobile browsers that opt not to download fonts due...
...on-latin glyphs to latin code points breaks copying and pasting, breaks searching on the page, breaks indexing by search engines and breaks readability in browsers that do not support downloadable fonts (e.g. legacy browsers or mobile browsers that opt not to download fonts due to file size). why aren’t symbol/dingbat fonts working? they are working. characters in html 4 and xml documents are
unicode characters (even if the document has been encoded using a legacy encoding for transfer)—not font glyph indexes. <font face="symbol">a</font> means the character latin small letter a (u+0061) preferably displayed using the symbol font. since the symbol font does not have glyph for that character, another font is used. if you mean α, you should use greek small letter alpha (u+03b1). if you are ...
...all letter a (u+0061) preferably displayed using the symbol font. since the symbol font does not have glyph for that character, another font is used. if you mean α, you should use greek small letter alpha (u+03b1). if you are using a legacy encoding that cannot represent that character, you can use a numeric character reference: α. likewise, to use a dingbat, you should use the appropriate
unicode character instead of trying to apply a dingbat font to an ascii character. for example, to represent ☺, you should use white smiling face (u+263a). why isn’t mozilla rendering my page as i intended? so my page isn’t standards-compliant, but good browsers should render pages as the author intended anyway! authors are supposed to communicate their intentions using the web standards. otherwi...
Places utilities for JavaScript
for instance, normally in order to get access to the bookmarks service, you have to run something like: components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); with places utils all you need to wr...
...for instance, normally in order to get access to the bookmarks service, you have to run something like: components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); with places utils all you need to write is: place...
...lt node according to the rules of the specified content type. string wrapnode(anode, string atype, nsiuri aoverrideuri) parameters anode the result node to wrap (serialize) atype the content type to serialize as aoverrideurioptional used instead of the node's uri if provided. this is useful for wrapping a container as type_x_moz_url, type_html or type_
unicode. return type returns a string serialization of the node unwrapnodes() unwraps data from the clipboard or the current drag session. array object unwrapnodes(blob, type) parameters blob a blob (string) of data, in some format we potentially know how to parse. type the content type of the blob. return type returns an array of objects representing each item...
XPCOM array guide
erating a list of any xpcom object. there are many implementations of nsisimpleenumerator, including one that enumerates nsiarray objects, and another one for nscomarray. it is very common for other interfaces which support nsisimpleenumerator to make their own implementations. nsistringenumerator string enumerators provide an easy way to pass a list of strings around with minimal copying. ...
... to create an nsistringenumerator for an nstarray<nsstring>, you can use one of the variations of ns_newstringenumerator. there are also corresponding enumerators and helpers for utf8 strings. ...
...ring>; resultarray->appendstring(str1); resultarray->appendstring(str2); // enumerator will free resultarray return ns_newadoptingstringenumerator(aresult, resultarray); } as noted above, these implementations of nsistringenumerator can also be queryinterface'd between nsistringenumerator and nsiutf8stringenumerator. the implementations will properly convert back and forth between utf8 and
unicode. to ensure that you get the right implementation and the conversion is done in the right direction, make sure that you call the version of ns_newstringenumerator or ns_newutf8stringenumerator that corresponds to the array type, not the enumerator type. for example, if a class has an internal nstarray<nscstring> of utf8 strings, but needs to implement an interface which returns an nsistringenumer...
Index
, controllers this interface is used to manage instances of the nsicontroller interface. windows and text inputs have default controllers that allow commands such as cmd_copy to act on the focused element or window. xul elements can also have controllers, although they do not have any default controllers. 446 nsiconverterinputstream interfaces, interfaces:scriptable, streams,
unicode, xpcom, xpcom api reference, xpcom interface reference implemented by: @mozilla.org/intl/converter-input-stream;1. to create an instance, use: 447 nsiconverteroutputstream interfaces, interfaces:scriptable, streams, xpcom, xpcom interface reference implemented by: @mozilla.org/intl/converter-output-stream;1. to create an instance, use: 448 nsicookie cooki...
...the stream. 883 available no summary! 884 close no summary! 885 init no summary! 886 read no summary! 887 nsiscriptableunescapehtml interfaces, interfaces:scriptable, xpcom, xpcom interface reference implemented by: @mozilla.org/feed-unescapehtml;1 as a service: 888 nsiscriptable
unicodeconverter interfaces, interfaces:scriptable,
unicode, xpcom, xpcom interface reference this legacy api represents binary data using the lower haft of each 16-bit code unit in a javascript string. if the other apis you are reading data from or writing data to don't require you to use this legacy representation, you should use textdecoder and textencoder (available to chrome javascript via...
...ly of functions. 1164 nsacstring (external) needscontent, reference, référence(2), strings class declaration 1165 nsacstring_internal class declaration 1166 nsastring xpcom, xpcom api reference the nsastring abstract class represents a character string composed of double-byte storage units. this class is typically used to represent
unicode character arrays. 1167 append xpcom, xpcom api reference the append family of functions appends a value to the end of a string's internal buffer. 1168 assign xpcom, xpcom api reference the assign family of functions sets the value of a string's internal buffer. 1169 beginreading xpcom, xpcom api reference the beginreading function ret...
nsIIDNService
autf8string convertacetoutf8( in acstring input ); parameters input the ace encoded hostname to convert into utf-8 format. return value the utf-8 encoded equivalent of the hostname. converttod...
...tf8string converttodisplayidn(in autf8string input, out boolean isascii); acstring convertutf8toace(in autf8string input); boolean isace(in acstring input); autf8string normalize(in autf8string input); methods convertacetoutf8() converts an ace (ascii compatible encoding) hostname into
unicode format, returning a utf-8 format string. this combines two operations: running the rfc 3490 "to
unicode" operation on the original string, then converting the resulting
unicode string into utf-8 format. autf8string convertacetoutf8( in acstring input ); parameters input the ace encoded hostname to convert into utf-8 format. return value the utf-8 encoded equivalent of the hostname. converttodisplayidn() normalizes a hostname into utf-8 format if the hostname is in the idn whitelist. if the hos...
...f8string input ); parameters input the hostname to convert to ace format. return value the ace encoded version of the hostname. isace() determines whether or not the specified hostname is ace encoded. boolean isace( in acstring input ); parameters input the string to check. return value returns true if the specified string is ace encoded; otherwise, returns false. normalize() performs the
unicode normalization needed for hostnames in idn. this is useful if you need to normalize a hostname separately from converting it to display format. autf8string normalize( in autf8string input ); parameters input the hostname to normalize. return value the normalized hostname. see also idn charter idn site idna specification ...
nsIWindowsRegKey
f the value to query. return value the 64-bit integer contents of the named value. readintvalue() this method reads the integer contents of the named value. unsigned long readintvalue( in astring name ); parameters name the name of the value to query. return value the integer contents of the named value. readstringvalue() this method reads the string contents of the named value as a
unicode string. astring readstringvalue( in astring name ); parameters name the name of the value to query. this parameter can be the empty string to request the key's default value. return value the string contents of the named value as a
unicode string. note: unlike writestringvalue(), readstringvalue() will work with reg_multi_sz and reg_expand_sz types. note: in gecko 2.0, readstringva...
...of the key initiated by a call to startwatching(). this method does nothing if the key is not being watched. void stopwatching(); parameters none. writebinaryvalue() this method writes the binary contents of the named value. the value will be created if it does not already exist. javascript callers should take care with the value passed to this method since it will be truncated from a js string (
unicode) to a iso-latin-1 string. (the binary data will be treated as an iso-latin-1 character string, which it is not). so, javascript callers should only pass character values in the range \u0000 to \u00ff, or else data loss will occur. void writebinaryvalue( in astring name, in acstring data ); parameters name the name of the value to modify. data the data for the value to modify...
...ify. data the data for the value to modify. writeintvalue() this method writes the integer contents of the named value. the value will be created if it does not already exist. void writeintvalue( in astring name, in unsigned long data ); parameters name the name of the value to modify. data the data for the value to modify. writestringvalue() this method writes the
unicode string contents of the named value. the value will be created if it does not already exist. void writestringvalue( in astring name, in astring data ); parameters name the name of the value to modify. this parameter can be the empty string to modify the key's default value. data the data for the value to modify. ...
Add to iPhoto
a look at one of these. this.cfstringcreatewithcharacters = this.lib.declare("cfstringcreatewithcharacters", ctypes.default_abi, this.cfstringref, // returns a new cfstringref ctypes.voidptr_t, // allocator ctypes.jschar.ptr, // pointer to the
unicode string ctypes.int32_t); // length of the string cfstringcreatewithcharacters() is used to create a new cfstring object using a
unicode string as the source string, which is copied into the new cfstring object. it returns a cfstringref, which is a pointer to the new string, and accepts, as input, three parameters: an allocator, which is a pointer to a rou...
... cfurl the cfurl type is used to describe a url. ...
... cfurl the cfurl type is used to describe a url. ...
KeyboardEvent - Web APIs
you should use the keyboardevent() constructor. keyboardevent.initkeyboardevent() initializes a keyboardevent object. this is now deprecated. you should instead use the keyboardevent() constructor. obsolete properties keyboardevent.char read only returns a domstring representing the character value of the key. ...
...in firefox 26 this returns codes for printable characters. ...
...in firefox 26 this returns codes for printable characters. ...
@font-face - CSS: Cascading Style Sheets
r's computer. to provide the browser with a hint as to what format a font resource is — so it can select a suitable one — it is possible to include a format type inside a format() function: src: url(ideal-sans-serif.woff) format("woff"), url(basic-sans-serif.ttf) format("truetype"); the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg".
unicode-range the range of
unicode code points to be used from the font. description if the local() function is provided, specifying a font name to look for on the user's computer, and the user agent finds a match, that local font is used. otherwise, the font resource specified using the url() function is downloaded and used. by allowing authors to provide their own fonts, @font-face makes it possib...
...riction. @font-face cannot be declared within a css selector. ...
...face cannot be declared within a css selector. ...
direction - CSS: Cascading Style Sheets
ntribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note that text direction is usually defined within a document (e.g., with html's dir attribute) rather than through direct use of the direction property. ...
... syntax /* keyword values */ direction: ltr; direction: rtl; /* global values */ direction: inherit; direction: initial; direction: unset; values ltr text and other elements go from left to right. this is the default value. rtl text and other elements go from right to left. ...
...ected by the all shorthand property. syntax /* keyword values */ direction: ltr; direction: rtl; /* global values */ direction: inherit; direction: initial; direction: unset; values ltr text and other elements go from left to right. this is the default value. rtl text and other elements go from right to left. for the direction property to have any effect on inline-level elements, the
unicode-bidi property's value must be embed or override. formal definition initial valueltrapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax ltr | rtl examples setting right-to-left direction blockquote { direction: rtl; } specifications specification status comment css writing modes module level 3the definition of 'di...
<string> - CSS: Cascading Style Sheets
for example, \22 represents a double quote, \27 a single quote ('), and \a9 the copyright symbol (©). ...
...for example, \22 represents a double quote, \27 a single quote ('), and \a9 the copyright symbol (©). ...
...ome string" specifications specification status comment css values and units module level 3the definition of '<string>' in that specification. candidate recommendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the definition of '<string>' in that specification. recommendation explicit definition; allows 6-digit
unicode escaped characters. css level 1the definition of '<string>' in that specification. recommendation implicit definition; allows 4-digit
unicode escaped characters. ...
Localizations and character encodings - Developer guides
the <meta> element's charset attribute is used to specify the page's character encoding. it must be used within a <head> block. ...
... the <meta> element's charset attribute is used to specify the page's character encoding. it must be used within a <head> block. ...
...ared by web content like the html specification requires, firefox will use that encoding for turning the bytes into the internal representation. unfortunately, using utf-8 and declaring that utf-8 was used was not always the prevalent way of offering web content. in the 1990s, it was common to leave the encoding undeclared and to use a region-specific encoding that wasn't able to represent all of
unicode. firefox needs a fallback encoding that it uses for non-conforming legacy content that doesn't declare its encoding. for most locales, the fallback encoding is windows-1252 (often called iso-8859-1), which was the encoding emitted by most windows applications in the 1990s and a superset of the encoding emitted by most unix applications in the 1990s as a deployed in the america has and in western...
Grammar and types - JavaScript
for example, the word früh (which means "early" in german) could be used as a variable name. ...
...n your application. the names of variables, called identifiers, conform to certain rules. a javascript identifier must start with a letter, underscore (_), or dollar sign ($). subsequent characters can also be digits (0–9). because javascript is case sensitive, letters include the characters "a" through "z" (uppercase) as well as "a" through "z" (lowercase). you can use most of iso 8859-1 or
unicode letters such as å and ü in identifiers. (for more details, see this blog post.) you can also use the
unicode escape sequences as characters in identifiers. some examples of legal names are number_hits, temp99, $credit, and _name. declaring variables you can declare a variable in two ways: with the keyword var. for example, var x = 42. this syntax can be used to declare both local and glob...
...er with the latin-1 encoding specified by up to three octal digits xxx between 0 and 377. for example, \251 is the octal sequence for the copyright symbol. \xxx the character with the latin-1 encoding specified by the two hexadecimal digits xx between 00 and ff. for example, \xa9 is the hexadecimal sequence for the copyright symbol. \uxxxx the
unicode character specified by the four hexadecimal digits xxxx. for example, \u00a9 is the
unicode sequence for the copyright symbol. see
unicode escape sequences. \u{xxxxx}
unicode code point escapes. for example, \u{2f804} is the same as the simple
unicode escapes \ud87e\udc04. escaping characters for characters not listed in the table, a preceding backslash is ignored, but...
Character classes - JavaScript
a-za-z0-9_]. for example, /\w/ matches "a" in "apple", "5" in "$5.28", and "3" in "3d". \w matches any character that is not a word character from the basic latin alphabet. equivalent to [^a-za-z0-9_]. for example, /\w/ or /[^a-za-z0-9_]/ matches "%" in "50%". \s matches a single white space character, including space, tab, form feed, line feed, and other
unicode spaces. equivalent to [ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches " bar" in "foo bar". \s matches a single character other than white space. equivalent to [^ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. for example, /\s\w*/ matches "foo" in "foo bar". \t matches a horizon...
..., where "x" is a letter from a–z (corresponding to codepoints u+0001–u+001f). for example, /\cm/ matches "\r" in "\r\n". \xhh matches the character with the code hh (two hexadecimal digits). \uhhhh matches a utf-16 code-unit with the value hhhh (four hexadecimal digits). \u{hhhh} or \u{hhhhh} (only when the u flag is set.) matches the character with the
unicode value u+hhhh or u+hhhhh (hexadecimal digits). \ indicates that the following character should be treated specially, or "escaped". it behaves one of two ways. for characters that are usually treated literally, indicates that the next character is special and not to be interpreted literally. for example, /b/ matches the character "b". by placing a backslash in front of "...
......
Intl.Collator.prototype.resolvedOptions() - JavaScript
e https://github.com/mdn/interactive-examples and send us a pull request. syntax collator.resolvedoptions() return value a new object with properties reflecting the locale and collation options computed during the initialization of the given collator object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. ...
...if the implementation does not support these properties, they are omitted. ...
...if the implementation does not support these properties, they are omitted. ...
Intl.Locale.prototype.collation - JavaScript
from search query results to ordering records in a database. while the idea of placing strings in order might seem trivial, the idea of order can vary from region to region and language to language. the collation property helps to make it easier for javascript programmers to access the collation type used by a particular locale. below is a table with the available collation types, taken from the
unicode collation specification. valid collation types collation type description big5han pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected.
...an pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected. do not use. ...
... ordering for cjk characters (used in chinese) zhuyin pinyin ordering for latin, zhuyin order for bopomofo and cjk characters (used in chinese) examples like other locale subtags, the collation type can be added to the intl.locale object via the locale string, or a configuration object argument to the constructor. adding a collation type via the locale string in the
unicode locale string spec, collation types are locale key "extension subtags". these subtags add additional data about the locale, and are added to locale identifiers by using the -u extension. thus, the collation type can be added to the inital locale identifier string that is passed into the locale constructor. to add the collation type, first add the -u extension to the string. next, add the -co exte...
RegExp - JavaScript
regular expression against all possible matches in a string, or only against the first. regexp.prototype.ignorecase whether to ignore case while attempting a match in a string. regexp.prototype.multiline whether or not to search in strings across multiple lines. regexp.prototype.source the text of the pattern. regexp.prototype.sticky whether or not the search is sticky. regexp.prototype.
unicode whether or not
unicode features are enabled. instance methods regexp.prototype.compile() (re-)compiles a regular expression during execution of a script. regexp.prototype.exec() executes a search for a match in its string parameter. regexp.prototype.test() tests for a match in its string parameter. regexp.prototype.tostring() returns a string representing the specified object. overri...
...nsole.log(r, "and re.lastindex", re.lastindex); // [ '1', index: 0, input: '123 456', groups: undefined ] and re.lastindex 1 // [ '2', index: 1, input: '123 456', groups: undefined ] and re.lastindex 2 // [ '3', index: 2, input: '123 456', groups: undefined ] and re.lastindex 3 // ... and no more match. with the global flag g, all 6 digits would be matched, not just 3. regular expression and
unicode characters \w and \w only matches ascii based characters; for example, a to z, a to z, 0 to 9, and _. to match characters from other languages such as cyrillic or hebrew, use \uhhhh, where hhhh is the character's
unicode value in hexadecimal. this example demonstrates how one can separate out
unicode characters from a word. let text = 'Образец text на русском языке' let r...
...acters from a word. let text = 'Образец text на русском языке' let regex = /[\u0400-\u04ff]+/g let match = regex.exec(text) console.log(match[0]) // logs 'Образец' console.log(regex.lastindex) // logs '7' let match2 = regex.exec(text) console.log(match2[0]) // logs 'на' [did not log 'text'] console.log(regex.lastindex) // logs '15' // and so on the
unicode property escapes feature introduces a solution, by allowing for a statement as simple as \p{scx=cyrl}. extracting sub-domain name from url let url = 'http://xxx.domain.com' console.log(/[^.]+/.exec(url)[0].substr(7)) // logs 'xxx' instead of using regular expressions for parsing urls, it is usually better to use the browsers built-in url parser by using the url api. specifications ...
String.prototype.charCodeAt() - JavaScript
the charcodeat() method returns an integer between 0 and 65535 representing the utf-16 code unit at the given index. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the utf-16 code unit matches the
unicode code point for code points which can be represented in a single utf-16 code unit. if the
unicode code point cannot be represented in a single utf-16 code unit (because its value is greater than 0xffff) then the code unit returned will be the first part of a surrogate pair for the code point. if you want the entire code point value, use codepointat(). syntax str.charcodeat(index) parameters index an integer gre...
...you want the entire code point value, use codepointat(). syntax str.charcodeat(index) parameters index an integer greater than or equal to 0 and less than the length of the string. if index is not a number, it defaults to 0. return value a number representing the utf-16 code unit value of the character at the given index. if index is out of range, charcodeat() returns nan. description
unicode code points range from 0 to 1114111 (0x10ffff). the first 128
unicode code points are a direct match of the ascii character encoding. (for information on
unicode, see the javascript guide.) note: charcodeat() will always return a value that is less than 65536. this is because the higher code points are represented by a pair of (lower valued) "surrogate" pseudo-characters which are used to compr...
... than the length of the string. backward compatibility: in historic versions (like javascript 1.2) the charcodeat() method returns a number indicating the iso-latin-1 codeset value of the character at the given index. the iso-latin-1 codeset ranges from 0 to 255. the first 0 to 127 are a direct match of the ascii character set. examples using charcodeat() the following example returns 65, the
unicode value for a. 'abc'.charcodeat(0) // returns 65 fixing charcodeat() to handle non-basic-multilingual-plane characters if their presence earlier in the string is unknown this version might be used in for loops and the like when it is unknown whether non-bmp characters exist before the specified index position. function fixedcharcodeat(str, idx) { // ex. fixedcharcodeat('\ud800\udc00', 0); /...
SVG fonts - SVG: Scalable Vector Graphics
this bears an id attribute, to enable it to be referenced via a uri (see below). the horiz-adv-x attribute determines how wide a character is on average compared to the path definitions of the single glyphs.
... cap-height="600" x-height="400" ascent="700" descent="300" alphabetic="0" mathematical="350" ideographic="400" hanging="500"> <font-face-src> <font-face-name name="super sans bold"/> </font-face-src> </font-face> <missing-glyph><path d="m0,0h200v200h-200z"/></missing-glyph> <glyph
unicode="!" horiz-adv-x="300"><!-- outline of exclam. pt. glyph --></glyph> <glyph
unicode="@"><!-- outline of @ glyph --></glyph> <!-- more glyphs --> </font> we start with the <font> element. this bears an id attribute, to enable it to be referenced via a uri (see below). the horiz-adv-x attribute determines how wide a character is on average compared to the path definitions of the single glyphs. the value 1000 sets a reasonable value to work with. there are several accompanying ...
...o shows how glyphs are created: by simply adding any graphical svg content inside. you can use literally any other svg elements in here, even <filter>, <a> or <script>. for simple glyphs, however, you can simply add a d attribute — this defines a shape for the glyph exactly like how standard svg paths work. the actual glyphs are then defined by <glyph> elements. the most important attribute is
unicode. it defines the
unicode codepoint represented by this glyph. if you also specify the lang attribute on a glyph, you can further restrict it to certain languages (represented by xml:lang on the target) exclusively. again, you can use arbitrary svg to define the glyph, which allows for great effects in supporting user agents. there are two further elements that can be defined inside font: <hkern> ...
base64 - Archive of obsolete content
/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data, charset) creates a base-64 encoded ascii string from a string of binary data. parameters data : string the data to encode charset : string the charset of the string to encode (optional). the only accepted value is "utf-8". in order to encode and decode
unicode strings, the charset parameter needs to be set: var base64 = require("sdk/base64"); var encodeddata = base64.encode(
unicodestring, "utf-8"); returns string : the encoded string decode(data, charset) decodes a string of data which has been encoded using base-64 encoding. parameters data : string the encoded data charset : string the charset of the string to encode (optional). the only ...
...e64 = require("sdk/base64"); var encodeddata = base64.encode(
unicodestring, "utf-8"); returns string : the encoded string decode(data, charset) decodes a string of data which has been encoded using base-64 encoding. parameters data : string the encoded data charset : string the charset of the string to encode (optional). the only accepted value is "utf-8". ...
Localization - Archive of obsolete content
in this scheme a language maps each distinct range of numbers on to one of up to six forms, identified by the following categories: zero, one, two, few, many, and other. english has two forms, whic...
... tomato no tomatoes two tomatoes but russian has different forms for numbers ending in 1 (except 11), numbers ending in 2-4 (except 12-14) and other numbers: один помидор // one tomato два помидора // two tomatoes пять помидоров // five tomatoes the sdk uses the
unicode cldr data to describe the different plural forms used by different languages.
unicode cldr plural forms the
unicode cldr project defines a scheme for describing a particular language's plural rules. in this scheme a language maps each distinct range of numbers on to one of up to six forms, identified by the following categories: zero, one, two, few, many, and other. english has two forms, which can be described by mapping "1" to "one" and "everything else" to "other": one →...
How to convert an overlay extension to restartless - Archive of obsolete content
turn; case "number": branch.setintpref(prefname,prefvalue); return; case "boolean": branch.setboolpref(prefname,prefvalue); return; } } function setdefaultpref(prefname,prefvalue) { var defaultbranch = services.prefs.getdefaultbranch(null); setgenericpref(defaultbranch,prefname,prefvalue); } function getucharpref(prefname,branch) //
unicode getcharpref { branch = branch ? branch : services.prefs; return branch.getcomplexvalue(prefname, components.interfaces.nsisupportsstring).data; } function setucharpref(prefname,text,branch) //
unicode setcharpref { var string = components.classes["@mozilla.org/supports-string;1"] .createinstance(components.interfaces.nsisupportsstring); string.data = te...
...e is one line. i'd generally still recommend using the type specific functions for each pref individually, but to load the defaults just use the generic functions above and it's quite simple. the other generic functions are provided above in case you need them. unfortunately, the built in apis for dealing with preferences are missing this basic stuff, and its plain text handling doesn't work with
unicode properly. step 4a: another way to handle default preferences if you want to keep your preference file in defaults/preferences/, the approach above only works as long as your extension is unpacked. for packed extensions (the default), you can either load a module similar to firebug’s prefloader.js or load this workaround module (n.b. as of may 29, 2017, that module does not work with packed ex...
Index - Archive of obsolete content
os and account settings.) 621 pydom this is the documentation for the binding of python and the mozilla dom. this allows you to use python code (almost) anywhere you can use javascript. 622 rdf api no summary! 623 rdf datasource how-to rdf no summary! 624 reading textual data add-ons, extensions, internationalization,
unicode this article describes how to read textual data from streams, files and sockets. 625 remote xul xul how to use xul delivered from a webserver, not as part of chrome. 626 remote debugging when a bug is reproducible by a community member, but not on a developer's computer, a last-resort strategy is to debug it on the community member's computer. the ...
...ozilla the mozilla codebase is used for many different projects and products, including firefox, thunderbird, xulrunner, and many others. sometimes the same basic code is used for multiple projects, but there are small differences needed. "ifdefs", or conditional instructions, are used to build different code 693 writing textual data add-ons, extensions, internationalization,
unicode this article describes how to write textual data to streams, files and sockets in an internationalization-aware way. 694 xbl landing, mozilla, reference, xbl xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents. the element that the binding is attached to,...
International characters in XUL JavaScript - Archive of obsolete content
loaded from xul files. this means that such script files can use any character from virtually any language of the world. for example, they can contain a line: var text = "ein schönes beispiel eines mehrsprachigen textes: 日本語"; this mixes german and japanese characters. earlier versions always interpreted js files loaded from xul as iso-8859-1 (latin-1), in both local and remote cases.
unicode escapes, as discussed below, have always worked. how the character encoding is determined in gecko 1.8 and later when the javascript file is loaded from a chrome:// url, a byte order mark (fixme: )(bom) is used to determine the character encoding of the script. otherwise, the character encoding will be the same as the one used by the xul file (which can be specified using an encoding attribute ...
... http, the http header can contain a character encoding declaration as part of the content-type header, for example: content-type: application/javascript; charset=utf-8 if no charset parameter is specified, the same rules as above apply. cross-version compatibility if you want the same code to work in both gecko 1.8 and earlier versions, you must limit yourself to ascii. however, you can use
unicode escapes – the earlier example rewritten using them would be: var text = "ein sch\u00f6nes beispiel eines mehrsprachigen textes: \u65e5\u672c\u8a9e"; an alternative might be to use property files via nsistringbundle or the xul <stringbundle> element; this would allow for localization of the xul. this can not be done in xul files loaded from the web, only in privileged code, e.g. in extensions...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
...
...tf-8 encoding. to check your text editor, create a plain text file named test.txt. in the file, type some of the special characters that your language uses. save the file. open the file in seamonkey (for example, by dragging it and dropping it in the navigator window, or by choosing file – open file... from seamonkey's menu bar). from seamonkey's menu bar, choose view – character encoding –
unicode (utf-8). check that the text you typed looks ok with this setting. if your text editor does not support utf-8, search the internet for a better one that you can download. optional tools you can optionally use any image editor to customize the images. you can optionally use a jar tool or zip tool to package your button as a cross-platform installable (xpi) for other people to install and use. maki...
Custom toolbar button - Archive of obsolete content
al are not appropriate for them. required tools you will need two tools. your operating system normally provides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding. if your language uses only plain latin (ascii) characters, set your text editor to use any encoding except
unicode. if your language uses accents or other non-latin characters, set your text editor to save files using the utf-8 encoding. to check your text editor, create a plain text file named test.txt. in the file, type some of the special characters that your language uses. save the file. open the file in firefox (for example, by dragging it and dropping it in firefox, or by choosing file – open file.
...iles using the utf-8 encoding. to check your text editor, create a plain text file named test.txt. in the file, type some of the special characters that your language uses. save the file. open the file in firefox (for example, by dragging it and dropping it in firefox, or by choosing file – open file... from firefox's menu bar). from firefox's menu bar, choose view – character encoding –
unicode (utf-8). check that the text you typed looks ok with this setting. if your text editor does not support utf-8, search the internet for a better one that you can download. optional tools you can optionally use any image editor to customize the images. you can optionally use a jar tool or zip tool to package your button as a cross-platform installable (xpi) for other people to install and use. ...
Browser Feature Detection - Archive of obsolete content
peak true false true speakheader true false false speaknumeral true false false speakpunctuation true false false speechrate true false true stress true false false tablelayout true true true textshadow true false true top true true true
unicodebidi true true true visibility true true true voicefamily true false true volume true false true widows true false true zindex true true true test code // document properties that are used to determine // support levels var _features = { 'domcore1': [ {name: 'doctype', 'supported': false},...
... {name: 'speak', 'supported': false}, {name: 'speakheader', 'supported': false}, {name: 'speaknumeral', 'supported': false}, {name: 'speakpunctuation', 'supported': false}, {name: 'speechrate', 'supported': false}, {name: 'stress', 'supported': false}, {name: 'tablelayout', 'supported': false}, {name: 'textshadow', 'supported': false}, {name: 'top', 'supported': false}, {name: '
unicodebidi', 'supported': false}, {name: 'visibility', 'supported': false}, {name: 'voicefamily', 'supported': false}, {name: 'volume', 'supported': false}, {name: 'widows', 'supported': false}, {name: 'zindex', 'supported': false} ] }; function supports(object, featureset) { var i; var features = _features[featureset]; var level = 0; if (!features) return level; for (i = 0; i < ...
New in JavaScript 1.3 - Archive of obsolete content
the following is a changelog for javascript from netscape navigator 4.0 to 4.5. the old netscape documentation can be found on archive.org. netscape navigator 4.5 was released on october 19, 1998. the most significant change in javascript 1.3 was compliance with ecma-262 and
unicode by removing inconsistencies between javascript 1.2 and the new ecma standard (which was published in june 1997). additional features of version 1.2, at the time not specified by ecma-262 were kept in the javascript language (see below for a list of differences). javascript versions netscape communicator and navigator 4.06 and 4.5 executes javascript language versions up to 1.3. note that communicator and navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "javascript1.3" and higher. ...
... changed functionality in javascript 1.3 changes to date to conform with ecma-262 new constructor date(year, month, day, [,hours [, minutes [, seconds [, milliseconds ]]]]) additional method parameters: setmonth(month[, date]) sethours(hours[, min[, sec[, ms]]]) setminutes(min[, sec[, ms]]) setseconds(sec[, ms]) ...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
primitive] (firefox 44) new promise object promise (firefox 24, enabled by default in firefox 29) new proxy object proxy (firefox 18) preventextensions() trap (firefox 22) isextensible() trap (firefox 31) getprototypeof() and setprototypeof() traps (firefox 49) new reflect object reflect (firefox 42) additions to the regexp object regexp sticky (y) flag (firefox 38) regexp
unicode (u) flag (firefox 46) generic regexp.prototype.tostring (firefox 39) regexp.prototype[@@match]() (firefox 49) regexp.prototype[@@replace]() (firefox 49) regexp.prototype[@@search]() (firefox 49) regexp.prototype[@@split]() (firefox 49) get regexp[@@species] (firefox 49) additions to the string object string.fromcodepoint() (firefox 29) string.prototype.codepointat() (firefox 29) stri...
...tions to the string object string.fromcodepoint() (firefox 29) string.prototype.codepointat() (firefox 29) string.prototype.startswith(), string.prototype.endswith() (firefox 17) string.prototype.includes() (firefox 40) (formerly string.prototype.contains() (firefox 17)) string.prototype.repeat() (firefox 24) string.prototype.normalize() (firefox 31) string.raw() (firefox 34) \u{xxxxxx}
unicode code point escapes (firefox 40) new symbol object symbol (firefox 36) symbol.iterator (firefox 36) symbol.for() - global symbol registry (firefox 36) symbol.match (firefox 40) symbol.species (firefox 41) symbol.toprimitive (firefox 44) symbol.prototype[@@toprimitive] (firefox 44) symbol.replace (firefox 49) symbol.search (firefox 49) symbol.split (firefox 49) symbol.hasinstance (fi...
UTF-8 - MDN Web Docs Glossary: Definitions of Web-related terms
utf-8 (ucs transformation format 8) is the world wide web's most common character encoding. each character is represented by one to four bytes. utf-8 is backward-compatible with ascii and can represent any standard
unicode character. the first 128 utf-8 characters precisely match the first 128 ascii characters (numbered 0-127), meaning that existing ascii text is already valid utf-8. all other characters use two to four bytes. each byte has some bits reserved for encoding purposes. ...
... (numbered 0-127), meaning that existing ascii text is already valid utf-8. all other characters use two to four bytes. each byte has some bits reserved for encoding purposes. since non-ascii characters require more than one byte for storage, they run the risk of being corrupted if the bytes are separated and not recombined. learn more general knowledge utf-8 on wikipedia faq about utf-8 on
unicode website ...
JS::DeflateStringToUTF8Buffer
string* src, mozilla::rangedptr<char> dst); name type description src jsflatstring * the pointer to the string to deflate. dst mozilla::rangedptr<char> the ranged pointer to the buffer. dstlenp size_t* the pointer to receive the number of bytes written to the buffer. numcharsp size_t* the pointer to receive the number of
unicode characters written to the buffer. description js::deflatestringtoutf8buffer encodes src as utf8. the caller must either ensure dst has enough space to encode the entire string, or pass the length of the buffer as dstlenp. in which case, the function will encode characters from the string until the buffer is exhausted. does not write the null terminator. if dstlenp is provided, it will be...
...r ensure dst has enough space to encode the entire string, or pass the length of the buffer as dstlenp. in which case, the function will encode characters from the string until the buffer is exhausted. does not write the null terminator. if dstlenp is provided, it will be updated to hold the number of bytes written to the buffer. if numcharsp is provided, it will be updated to hold the number of
unicode characters written to the buffer. this can be less than the length of the string, if the buffer is exhausted before the string is fully encoded. examples char16_t uchars[] = { 0xd83e, 0xdd8a, 0 }; js::rootedstring str(cx, js_newucstringcopyn(cx, uchars, 2)); if (!str) return false; js::rooted<jsflatstring*> flatstr(cx, js_flattenstring(cx, str)); if (!flatstr) return false; size_t length = j...
JS_ConvertArguments
ion. argv is a pointer to the array of js values to convert. format is a null-terminated c string. each element of the array indicates the c type into which to convert the next available js value. ...
... c uint16_t ecma uint16_t,
unicode character i int32_t ecma int32_t j int32_t ecma int32_t (used to be different, behaves like i now) obsolete since jsapi 28 u uint32_t ecma uint32_t d double ieee double i double integral ieee double s char * (c string) bug 607292 s jsstring *
unicode string, accessed by a jsstring pointer w char16_t *
unicode character vector, 0-terminated (w for wide) o jsobject * object reference f jsfunction * the argument is converted to a function as though by a call to js_valuetofunction. this conversion is dangerous and almost entirely useless, because the resulting jsfunction is not a real function o...
JS_PushArguments
any asterisks (*) in format are ignored. this function also takes in consideration any additional custom types defined in cx using js_addargumentformatter. for example, if format is "biob", then there must be four arguments after format. their types must be...
...any asterisks (*) in format are ignored. this function also takes in consideration any additional custom types defined in cx using js_addargumentformatter. for example, if format is "biob", then there must be four arguments after format. their types must be jsbool, jsdouble, jsobject *, and jsboo...
nsIContentSniffer
how to read content from adata. ...
... try { // this pref has been removed, see bug 910192 charset = services.prefs.getcomplexvalue("intl.charset.default", ci.nsipreflocalizedstring).data; } catch (e) { } let conv = cc["@mozilla.org/intl/scriptable
unicodeconverter"] .createinstance(ci.nsiscriptable
unicodeconverter); conv.charset = charset; try { let str = conv.convertfrombytearray(adata, alength); if (str.substring(0, 5) == "%pdf-") return "application/pdf"; // we detected a pdf file } catch (e) { // try to get information from arequest } ...
nsICryptoHash
rns the hash as a base 64 encoded string. in this example we take the binary data and produce a hexadecimal string of the result, as is commonly output by hashing programs. computing the hash of a string another common operation is computing the hash value of a string. since hash functions are computed over bytes, you will first need to convert the string to a series of bytes using nsiscriptable
unicodeconverter and a
unicode encoding that you specify. note: different encodings will produce different hash values! you should always use the same encoding if you intend to compare results. the example below shows how to convert a string to bytes in the utf-8 encoding, and then compute the sha256 hash of it. the result is computed as a hex string as in the previous example. in this example, we use...
... a string to bytes in the utf-8 encoding, and then compute the sha256 hash of it. the result is computed as a hex string as in the previous example. in this example, we use the update() method to pass an array of bytes to be hashed. as in the previous example, we convert the binary result to a hex string. var str = "hello world"; var converter = components.classes["@mozilla.org/intl/scriptable
unicodeconverter"]. createinstance(components.interfaces.nsiscriptable
unicodeconverter); // we use utf-8 here, you can choose other encodings. converter.charset = "utf-8"; // result is an out parameter, // result.value will contain the array length var result = {}; // data is an array of bytes var data = converter.converttobytearray(str, result); var ch = components.classes["@mozilla.org/security/ha...
nsIFile
a string containing characters encoded in the native charset cannot be safely passed to javascript via xpconnect. therefore, the utf-16 forms are scriptable, but the "native methods" are not. in addition, the native form cannot deal with files whose name contains characters outside the default system code page on windows. using the native form limits the ability of your code to deal with the full
unicode support on windows 2000 or later where the os itself does not have such a limitation. therefore, you must not use the native form unless it is guaranteed that the path passed to a native form function is always ascii. to create an nsifile from a path you can use fileutils.jsm: var fileutils = cu.import("resource://gre/modules/fileutils.jsm").fileutils var nsifile = new fileutils.file( filena...
...ns_error_file_dir_not_empty indicates that an attempt was made to remove a directory that is not empty. ns_error_file_access_denied indicates that an attempt was made to remove a file in a way that exceeded your permissions. details depend on your file system and how its permissions work. remarks all string-valued methods and attributes have two forms. the preferred form operates on utf-16 (
unicode) encoded character strings. the alternate form operates on character strings encoded in the "native" multibyte character set. the native character encoding is defined as the single-byte character encoding used with the standard fopen function on the host system. the native character encoding is determined using platform specific methods. as of gecko 1.7, it is utf-8 on mac os x. on linux and oth...
nsIScriptableIO
: a transport object such as a socket. nsiinputstream: a stream returned by a previous call to this method, or any other object that implements nsiinputstream. string: a string from which to read data. amode a space-delineated string of mode terms controlling the manner in which the stream is accessed. if none of these modes are desired, specify an empty string. text: read
unicode-converted text. the default character set is utf-8; to read text in another character set, set the acharset argument to the desired character set. buffered: a stream that uses a buffer to hold a block of the next piece of the data to be read. this mode is generally used as a wrapper for other streams. by default, the buffer size is 1024 bytes; however, the size may be changed by specifying the ...
...ing the nsifile interface. nsitransport: a transport object such as a socket. nsioutputstream: a stream returned by a previous call to this method, or any other object that implements nsioutputstream. amode a space-delineated string of mode terms controlling the manner in which the stream is accessed. if none of these modes are desired, specify an empty string. text: write
unicode-converted text. the default character set is utf-8; to write text in another character set, set the acharset argument to the desired character set. buffered: a stream that buffers the data being written. this mode is generally used as a wrapper for other streams. by default, the buffer size is 1024 bytes; however, the size may be changed by specifying the abuffersize parameter. if the text mode...
nsIStringBundle
erator getsimpleenumeration(); wstring getstringfromid(in long aid); wstring getstringfromname(in wstring aname); methods formatstringfromid() returns a formatted string with the given id from the string bundle, where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. you may also use other formatting codes. you can only pass
unicode strings in. the id should refer to a string in the bundle that uses %s, and the number of strings you pass must be the same here and in the properties file (that is you can't omit %1 and use only %2). do not try to use any other types. this uses nstextformatter::smprintf. wstring formatstringfromid( in long aid, [array, size_is(length)] in wstring params, in unsigned long length ); param...
...ve. params parameters to pass in to the string. length the length of the parameter list. return value returns the formatted string. formatstringfromname() returns a formatted string with the given key name from the string bundle, where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. you may also use other formatting codes, but can only pass
unicode strings in. the name should refer to a string in the bundle that uses %s, and the number of strings you pass must be the same here and in the properties file (that is you can't omit %1 and use only %2). do not try to use any other types. this uses nstextformatter::smprintf to do the dirty work. wstring formatstringfromname( in wstring aname, [array, size_is(length)] in wstring params, in u...
nsIUTF8ConverterService
character sets like iso-2022-jp, hz or utf-7 (in its original form or a modified form used in imap folder names). aallowsubstitution when true, allow the decoder to substitute invalid input sequences by replacement characters. return value the converted string in utf-8. exceptions thrown ns_error_uconv_noconv when there is no decoder for acharset or error code of nsi
unicodedecoder in case of conversion failure. converturispectoutf8() ensure that aspec (after url-unescaping it) is encoded in utf-8. if not, convert it to utf-8, assuming it's encoded in acharset, and return the result. make sure that all characters outside us-ascii in your input spec are url-escaped if your spec is not in utf-8 (before url-escaping) because the presence of non-ascii characters is blind...
... mozilla code would break this assumption. autf8string converturispectoutf8( in acstring aspec, in string acharset ); parameters aspec an url-escaped uri spec to ensure its utf8ness. acharset the character set to convert from if aspec is not in utf-8. return value the converted spec in utf-8. exceptions thrown ns_error_uconv_noconv when there is no decoder for acharset or error code of nsi
unicodedecoder in case of conversion failure. ...
CSS.escape() - Web APIs
ssomstring containing the escaped string passed as parameter, mostly for use as part of a css selector. syntax escapedstr = css.escape(str); parameters str the cssomstring to be escaped. ...
... part of a css selector. syntax escapedstr = css.escape(str); parameters str the cssomstring to be escaped. ...
FontFace.FontFace() - Web APIs
name that will be used as the font face value for font properties. takes the same type of values as the font-family descriptor of @font-face . source the font source. this can be either: a url binary font data descriptors optional a set of optional descriptors passed as an object. ...
... be used as the font face value for font properties. takes the same type of values as the font-family descriptor of @font-face . source the font source. this can be either: a url binary font data descriptors optional a set of optional descriptors passed as an object. ...
HTMLInputElement - Web APIs
using previously stored value off: the user must explicity enter a value max string: returns / sets the element's max attribute, containing the maximum (numeric or date-time) value for this item, which must not be less than its minimum (min attribute) value. maxlength long: returns / sets the element's maxlength attribute, containing the maximum number of characters (in
unicode code points) that the value can have. (if you set this to a negative number, an exception will be thrown.) min string: returns / sets the element's min attribute, containing the minimum (numeric or date-time) value for this item, which must not be greater than its maximum (max attribute) value. minlength long: returns / sets the element's minlength attribute, containing th...
...ve. (if you set this to a negative number, an exception will be thrown.) min string: returns / sets the element's min attribute, containing the minimum (numeric or date-time) value for this item, which must not be greater than its maximum (max attribute) value. minlength long: returns / sets the element's minlength attribute, containing the minimum number of characters (in
unicode code points) that the value can have. (if you set this to a negative number, an exception will be thrown.) pattern string: returns / sets the element's pattern attribute, containing a regular expression that the control's value is checked against. use the title attribute to describe the pattern to help the user. this attribute applies when the value of the type attribute is text, sear...
KeyboardEvent.charCode - Web APIs
the charcode read-only property of the keyboardevent interface returns the
unicode value of a character key pressed during a keypress event. do not use this property, as it is deprecated. use the key property instead. syntax var code = event.charcode; return value a number that represents the
unicode value of the character key that was pressed. ...
...if the key pressed generates a character (e.g., 'a'), charcode is set to the code of that character; charcode respects the letter case (in other words, charcode takes into account whether the shift key is held down). otherwise, the code of the pressed key is stored in keycode. when one or more modifier...
WindowOrWorkerGlobalScope.btoa() - Web APIs
in. for example, you can encode control characters such as ascii values 0 through 31. syntax var encodeddata = scope.btoa(stringtoencode); parameters stringtoencode the binary string to encode. return value an ascii string containing the base64 representation of stringtoencode. exceptions invalidcharactererror the string contained a character that did not fit in a single byte. see "
unicode strings" below for more detail. example const encodeddata = window.btoa('hello, world'); // encode a string const decodeddata = window.atob(encodeddata); // decode the string
unicode strings the btoa() function takes a javascript string as a parameter. in javascript strings are represented using the utf-16 character encoding: in this encoding, strings are represented as a sequence of 16-bit...
... containing characters that occupy more than one byte, you will get an error, because this is not considered binary data: const ok = "a"; console.log(ok.codepointat(0).tostring(16)); // 61: occupies < 1 byte const notok = "✓" console.log(notok.codepointat(0).tostring(16)); // 2713: occupies > 1 byte console.log(btoa(ok)); // yq== console.log(btoa(notok)); // error if you need to encode
unicode text as ascii using btoa(), one option is to convert the string such that each 16-bit unit occupies only one byte. for example: // convert a
unicode string to a string in which // each 16-bit unit occupies only one byte function tobinary(string) { const codeunits = new uint16array(string.length); for (let i = 0; i < codeunits.length; i++) { codeunits[i] = string.charcodeat(i); } retu...
Architecture - Accessibility
ally just another text container with more embedded objects. however in accessibility hierarchies such as atk and iaccessible2, text is not exposed in leaf nodes as it is in a w3c dom. the text is actually exposed via a special text interface in the parent of the text nodes. it is concatenated together with all its sibling text nodes, and embedded objects between the text nodes are exposed as the
unicoded embedded object character '\xfffc'. one reason for this is that there are fewer nodes to pass across process, and that improves performance. node types text content (role_text) objects are implemented by nstextaccessible. their text is actually exposed in their parent nshypertextaccessible via nsiaccessibletext. when the hierarchy is finally exposed to atk they are stripped out. they are in t...
...essible. when the hierarchy is finally exposed to atk they are stripped out as leaf nodes, but the \n remains in the containing text. they are in the nsiaccessible hierarchy to make it easy for nshypertextaccessible to piece its text representation together. everything else uses whatever nsaccessible-derived implementation that's appropriate. if it has text siblings, then it gets exposed as the
unicode char for an embedded object, which is '\xfffc' within the parent nshypertextaccessible. in addition, nsiaccessiblehyperlink is implemented on any non-text child inside a container that also has text. this allows at's to find its position within that text, because the hyperlink interface exposes a start and end index. in fact, the end index will always be 1 larger than the start index, because the...
::before (:before) - CSS: Cascading Style Sheets
re is the above code example running live. note that there are no icons used, and the check-mark is actually the ::before that has been styled in css. go ahead and get some stuff done. result special characters as this is css; not html, you can not use markup entities in content values. if you need to use a special character, and can not enter it literally into your css content string, use a
unicode escape sequence, consisting of a backslash followed by the hexadecimal
unicode value. 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 ...
... working draft no significant changes to the previous specification. css animations working draft allows animations on properties defined on pseudo-elements. se...
@charset - CSS: Cascading Style Sheets
side the <style> element where the character set of the html page is relevant. @charset "utf-8"; this at-rule is useful when using non-ascii characters in some css properties, like content. as there are several ways to define the character encoding of a style sheet, the browser will try the following methods in the following order (and stop as soon as one yields a result) : the value of the
unicode byte-order character placed at the beginning of the file. the value given by the charset attribute of the content-type: http header or the equivalent in the protocol used to serve the style sheet. the @charset css at-rule. use the character encoding defined by the referring document: the charset attribute of the <link> element. this method is obsoleted in html5 and must not be used. assume th...
...d in the iana-registry, and must be double-quoted, following exactly one space character (u+0020), and immediately terminated with a semicolon. if several names are associated with an encoding, only the one marked with preferred must be used. ...
all - CSS: Cascading Style Sheets
the all shorthand css property resets all of an element's properties except
unicode-bidi, direction, and css custom properties. it can set properties to their initial or inherited values, or to the values specified in another stylesheet origin. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* global values */ all: initial; all: inherit; all: unset; /* css cascading and inheritance level 4 */ all: revert; the all property is specified as one of the css global keyword values. note that none of these values affect the
unicode-bidi and direction properties. values initial specifies that all the element's ...
...les were specified for the element. for purposes of revert, the author origin includes the override and animation origins. formal definition initial valuethere is no practical initial value for it.applies toall elementsinheritednocomputed valueas the specified value applies to each property this is a shorthand for.animation typeas each of the properties of the shorthand (all properties but
unicode-bidi and direction) formal syntax initial | inherit | unset | revert examples html <blockquote id="quote"> lorem ipsum dolor sit amet, consectetur adipiscing elit. </blockquote> phasellus eget velit sagittis. css body { font-size: small; background-color: #f0f0f0; color: blue; } blockquote { background-color: skyblue; color: red; } result no all property <blockquote id="q...
<custom-ident> - CSS: Cascading Style Sheets
event ambiguity. syntax the syntax of <custom-ident> is similar to css identifiers (such as property names), except that it is case-sensitive. it consists of one or more characters, where characters can be any of the following: any alphabetical character (a to z, or a to z), any decimal digit (0 to 9), a hyphen (-), an underscore (_), an escaped character (preceded by a backslash, \), a
unicode character (in the format of a backslash, \, followed by one to six hexadecimal digits, representing its
unicode code point) note that id1, id1, id1 and id1 are all different identifiers as they are case-sensitive. on the other hand, as there are several ways to escape a character, toto\? and toto\3f are the same identifiers. forbidden values a <custom-ident> must not be placed between single ...
...initial, and inherit), as well as the values will-change, auto, scroll-position, and contents. examples valid identifiers nono79 a mix of alphanumeric characters and numbers ground-level a mix of alphanumeric characters and a dash -test a dash followed by alphanumeric characters _internal an underscore followed by alphanumeric characters \22 toto a
unicode character followed by a sequence of alphanumeric characters bili\.bob a correctly escaped period invalid identifiers 34rem it must not start with a decimal digit. -12rad it must not start with a dash followed by a decimal digit. bili.bob only alphanumeric characters, _, and - needn't be escaped. --toto it must not start with two dashes. this w...
ident - CSS: Cascading Style Sheets
s an identifier. syntax the syntax of <custom-ident> is similar to css identifiers (such as property names), except that it is case-sensitive. it consists of one or more characters, where characters can be any of the following: any alphabetical character (a to z, or a to z), any decimal digit (0 to 9), a hyphen (-), an underscore (_), an escaped character (preceded by a backslash, \), a
unicode character (in the format of a backslash, \, followed by one to six hexadecimal digits, representing its
unicode code point) note that id1, id1, id1 and id1 are all different identifiers as they are case-sensitive. on the other hand, as there are several ways to escape a character, toto\? and toto\3f are the same identifiers. examples valid identifiers nono79 a mix of alphanumeric chara...
... ways to escape a character, toto\? and toto\3f are the same identifiers. examples valid identifiers nono79 a mix of alphanumeric characters and numbers ground-level a mix of alphanumeric characters and a dash -test a dash followed by alphanumeric characters --toto a custom-property like identifier _internal an underscore followed by alphanumeric characters \22 toto a
unicode character followed by a sequence of alphanumeric characters bili\.bob a correctly escaped period invalid identifiers 34rem it must not start with a decimal digit. -12rad it must not start with a dash followed by a decimal digit. bili.bob only alphanumeric characters, _, and - needn't be escaped. 'bilibob' this would be a <string>. "bilibob" this would be a <string>. specifications ...
Index - Developer guides
ment beginner, css, codingscripting, development, html, javascript, web whether you're just getting started with web development, or are just expanding your horizons into new realms of web awesomeness, the links here should help you get started. 31 localizations and character encodings character encodings, html, localization, needsmarkupwork browsers process text as
unicode internally. however, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. the html specification recommends the use of the utf-8 encoding (which can represent all of
unicode) and regardless of the encoding used requires web content to declare what encoding was used. 32 mobile web development intermedi...
... application would like to improve the user's experience when printing content. there are a number of possible scenarios: 39 svg-in-opentype draft, fonts, guide, needscontent the svg-in-opentype work is currently in the hands of the mpeg group. once we're ready for wider adoption the information from wiki.mozilla.org will be moved here, updated and expanded. 40 the
unicode bidirectional text algorithm algorithm, bidi, guide, internationalization, introduction, localization, text,
unicode, direction, i18n, l10n, ltr, rtl the
unicode® bidirectional algorithm (also known as the bidi algorithm) is part of the
unicode text standard that describes how the user agent should order characters while rendering
unicode text. 41 the web open font format (w...
Developer guides
the application faster and more responsive to user actions. graphics on the web modern web sites and applications often need to present graphics of varying sophistication. guide to web apis a list of all web apis and what they do. javascript javascript is the powerful scripting language used to create applications for the web. localizations and character encodings browsers process text as
unicode internally. however, a way of representing characters in terms of bytes (character encoding) is used for transferring text over the network to the browser. the html specification recommends the use of the utf-8 encoding (which can represent all of
unicode), and regardless of the encoding used requires web content to declare that encoding. mobile web development this article provides an overview...
...ur content work quickly and efficiently. this lets it perform effectively for both powerful desktop systems and weaker handheld devices. parsing and serializing xml the web platform provides different methods of parsing and serializing xml, each with its pros and cons. the web open font format (woff) woff (web open font format) is a font file format that is free for anyone to use on the web.
unicode bidirectional text algorithm (bidi) the
unicode® bidi algorithm is part of the
unicode text standard. it describes how the browser should order characters while rendering
unicode text. this guide covers the algorithm in general and how it applies to content you create—especially when you build properly localized and internationalized content. using formdata objects the formdata object lets ...
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
ke to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. bidirectional text is text that may contain both sequences of characters that are arranged left-to-right (ltr) and sequences of characters that are arranged right-to-left (rtl), such as an arabic quotation embedded in an english string. browsers implement the
unicode bidirectional algorithm to handle this. in this algorithm, characters are given an implicit directionality: for example, latin characters are treated as ltr while arabic characters are treated as rtl. some other characters (such as spaces and some punctuation) are treated as neutral and are assigned directionality based on that of their surrounding characters. usually, the bidirectional algorith...
...oblem by wrapping embedded-text in a <span> with the dir attribute set to the known directionality. but if you don't know the directionality - for example, because embedded-text is being read from a database or entered by the user - you should use <bdi> to prevent the directionality of embedded-text from affecting its surroundings. though the same visual effect can be achieved using the css rule
unicode-bidi: isolate on a <span> or another text-formatting element, html authors should not use this approach because it is not semantic and browsers are allowed to ignore css styling. embedding the characters in <span dir="auto"> has the same effect as using <bdi>, but its semantics are less clear. content categories flow content, phrasing content, palpable content. permitted co...
<input type="email"> - HTML: Hypertext Markup Language
n the pattern attribute, when specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of
unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also i...
...a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use
unicode bidirectional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using
unicode control characters in the
unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your cont...
<input type="password"> - HTML: Hypertext Markup Language
n the pattern attribute, when specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of
unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also i...
...a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use
unicode bidirectional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using
unicode control characters in the
unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your cont...
<input type="search"> - HTML: Hypertext Markup Language
n the pattern attribute, when specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of
unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also i...
...a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use
unicode bidirectional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using
unicode control characters in the
unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your cont...
<input type="tel"> - HTML: Hypertext Markup Language
n the pattern attribute, when specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of
unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also i...
...a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use
unicode bidirectional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using
unicode control characters in the
unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your cont...
<input type="text"> - HTML: Hypertext Markup Language
the pattern attribute, when specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of
unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also i...
...a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use
unicode bidirectional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using
unicode control characters in the
unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your cont...
<input type="url"> - HTML: Hypertext Markup Language
n the pattern attribute, when specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of
unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also i...
...a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use
unicode bidirectional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using
unicode control characters in the
unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your cont...
Array.prototype.sort() - JavaScript
a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.sort([comparefunction]) parameters comparefunction optional specifies a function that defines the sort order. if omitted, the array elements are converted to strings, then sorted according to each character's
unicode code point value. firstel the first element for comparison. secondel the second element for comparison. return value the sorted array. note that the array is sorted in place, and no copy is made. description if comparefunction is not supplied, all non-undefined array elements are sorted by converting them to strings and comparing strings in utf-16 code units order. for example,...
...array. note that the array is sorted in place, and no copy is made. description if comparefunction is not supplied, all non-undefined array elements are sorted by converting them to strings and comparing strings in utf-16 code units order. for example, "banana" comes before "cherry". in a numeric sort, 9 comes before 80, but because numbers are converted to strings, "80" comes before "9" in the
unicode order. all undefined elements are sorted to the end of the array. note : in utf-16,
unicode characters above \uffff are encoded as two surrogate code units, of the range \ud800-\udfff. the value of each code unit is taken separately into account for the comparison. thus the character formed by the surrogate pair \ud655\ude55 will be sorted before the character \uff3a. if comparefunction is su...
Intl.Locale() constructor - JavaScript
examples basic usage at its very simplest, the intl.locale constructor takes a locale identifier string as its argument: let us = new intl.locale('en-us'); using the locale constructor with an options object the constructor also takes an optional configuration object argument, which can contain any of several extension types. ...
... examples basic usage at its very simplest, the intl.locale constructor takes a locale identifier string as its argument: let us = new intl.locale('en-us'); using the locale constructor with an options object the constructor also takes an optional configuration object argument, which can contain any of several extension types. ...
Intl.Locale.prototype.calendar - JavaScript
the intl.locale.prototype.calendar property is an accessor property which returns the type of calendar used in the locale. description the calendar property returns the part of the locale that indicates the locale's calendar era. while most of the world uses the gregorian calendar, there are several regional calendar eras used around the world. ...
... the type of calendar used in the locale. description the calendar property returns the part of the locale that indicates the locale's calendar era. while most of the world uses the gregorian calendar, there are several regional calendar eras used around the world. the following table shows all the valid
unicode calendar key strings, along with a description of the calendar era they represent.
unicode calendar keys
unicode calendar keys calendar key (name) description buddhist thai buddhist calendar chinese traditional chinese calendar coptic coptic calendar dangi traditional korean calendar ethioaa ethiopic calendar, amete alem (epoch approx. 5493 b.c.e) ethiopic ethiopic calendar, amete mihret (epoch ap...
Intl.Locale.prototype.language - JavaScript
the intl.locale.prototype.language property is an accessor property that returns the language associated with the locale. description language is one of the core features of a locale. the
unicode specification treats the language identifier of a locale as the language and the region together (to make a distiction between dialects and variations, e.g. british english vs. american english). the language property of a locale returns strictly the locale's language subtag. ...
...s of a locale. the
unicode specification treats the language identifier of a locale as the language and the region together (to make a distiction between dialects and variations, e.g. british english vs. american english). the language property of a locale returns strictly the locale's language subtag. examples setting the language in the locale identifer string argument in order to be a valid
unicode locale identifier, a string must start with the language subtag. the main argument to the locale constructor must be a valid
unicode locale identifier, so whenever the constructor is used, it must be passed an identifier with a language subtag. let langstr = new intl.locale("en-latn-us"); console.log(langstr.language); // prints "en" overriding language via the configuration object while the ...
Intl.Locale.prototype.numberingSystem - JavaScript
rns the numeral system used by the locale. description a numeral system is a system for expressing numbers. the numberingsystem property helps to represent the different numeral systems used by various countries, regions, and cultures around the world. as with most internationalization schemas, the numeral systems that can be represented in a locale object by numberingsystem are standardized by
unicode. a table of the standard
unicode numeral systems can be seen below. value description adlm adlam digits ahom ahom digits arab arabic-indic digits arabext extended arabic-indic digits armn armenian upper case numerals — algorithmic armnlow armenian lower case numerals — algorithmic bali balinese di...
...nu is considered a locale string "extension subtag". these subtags add additional data about the locale, and are added to locale identifiers by first adding the -u key. to set the numberingsystem value via the string argument to the locale constructor, first add the -u extension key. next, add the -nu extensi...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
eractive-examples and send us a pull request. syntax relativetimeformat.resolvedoptions() return value a new object with properties reflecting the locale and number formatting options computed during the initialization of the given relativetimeformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any
unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the length of the internationalized message. possible values are: "long" (default, e.g., in 1 month) "short" (e.g., in 1 mo.), or "narrow" (e.g., in 1 mo.). the narrow style could be similar to t...
... "short" (e.g., in 1 mo.), or "narrow" (e.g., in 1 mo.). the narrow style could be similar to the short style for some locales. numeric the format of output message. possible values are: "always" (default, e.g., 1 day ago), or "auto" (e.g., yesterday). the "auto" value allows to not always have to use numeric values in the output. numberingsystem the value requested using the
unicode extension key "nu" or filled in as a default. examples using the resolvedoptions method var de = new intl.relativetimeformat('de-de'); var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de-de" usedoptions.style; // "long" usedoptions.numeric; // "always" usedoptions.numberingsystem; // "latn" specifications specification status commen...
String.prototype.split() - JavaScript
ill has the effect of splitting. the result is an empty (i.e. zero length) string, which appears at the first (or last) position of the returned array. if separator is an empty string (""), str is converted to an array of each of its utf-16 "characters". warning: when the empty string ("") is used as a separator, the string is not split by user-perceived characters (grapheme clusters) or
unicode characters (codepoints), but by utf-16 codeunits. this destroys surrogate pairs. see “how do you get a string to a character array in javascript?” on stackoverflow. limit optional a non-negative integer limiting the number of pieces. if provided, splits the string at each occurrence of the specified separator, but stops when limit entries have been placed in the array. any leftover te...
...." ] note: \d matches the character class for digits between 0 and 9. reversing a string using split() this is not a robust way to reverse a string: const str = 'asdfghjkl' const strreverse = str.split('').reverse().join('') // 'lkjhgfdsa' // split() returns an array on which reverse() and join() can be applied it doesn't work if the string contains grapheme clusters, even when using a
unicode-aware split. (use, for example, esrever instead.) const str = 'résumé' const strreverse = str.split(/(?:)/u).reverse().join('') // => "́emuśer" bonus: use === operator to test if the original string was a palindrome. specifications specification ecmascript (ecma-262)the definition of 'string.prototype.split' in that specification. ...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical|inherit; animatable: yes baseline-shift it allows repositioning of the do...
...value: none|underline|overline|line-through|blink|inherit; animatable: yes text-rendering hints about what tradeoffs to make as the browser renders text. value: auto|optimizespeed|optimizelegibility|geometricprecision|inherit; animatable: yes transform defines a list of transform definitions that are applied to an element and the element's children. value: <transform-list>; animatable: yes
unicode-bidi - value:; animatable: - vector-effect specifies the vector effect to use when drawing an object. value: default|non-scaling-stroke|inherit|<uri>; animatable: yes visibility lets you control the visibility of graphical elements. value: visible|hidden|collapse|inherit; animatable: yes word-spacing specifies spacing behavior between words. value: <length>|inherit; animatable: yes wr...
glyph-name - SVG: Scalable Vector Graphics
the glyph names can be referenced in kerning definitions created by <hkern> and <vkern> elements. ...
... the glyph names can be referenced in kerning definitions created by <hkern> and <vkern> elements. ...
u1 - SVG: Scalable Vector Graphics
the u1 attribute specifies list of
unicode characters (refer to the description of the
unicode attribute of the <glyph> element for a description of how to express individual
unicode characters) and/or ranges of
unicode characters, which identify a set of possible first glyphs in a kerning pair. if a given
unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same
unicode attribute value but different glyph-name values), then all such glyphs are included in the set. comma is the separator character; thus, to kern a comma, specify the comma as part of a range of
unicode characters or as a glyph name using the g1 attribute. the total set of possible first glyphs in the kerning pair is the union of glyphs specified by the ...
...tribute. the total set of possible first glyphs in the kerning pair is the union of glyphs specified by the u1 and g1 attributes. two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of
unicode characters and/or ranges of
unicode characters, which identify a set of possible first glyphs in a kerning pair. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'u1' in that specification. recommendation initial definition ...
u2 - SVG: Scalable Vector Graphics
the u2 attribute specifies list of
unicode characters (refer to the description of the
unicode attribute of the <glyph> element for a description of how to express individual
unicode characters) and/or ranges of
unicode characters, which identify a set of possible second glyphs in a kerning pair. if a given
unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same
unicode attribute value but different glyph-name values), then all such glyphs are included in the set. comma is the separator character; thus, to kern a comma, specify the comma as part of a range of
unicode characters or as a glyph name using the g2 attribute. the total set of possible second glyphs in the kerning pair is the union of glyphs specified by th...
...ribute. the total set of possible second glyphs in the kerning pair is the union of glyphs specified by the u2 and g2 attributes. two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of
unicode characters and/or ranges of
unicode characters, which identify a set of possible second glyphs in a kerning pair. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'u2' in that specification. recommendation initial definition ...
SVG Attribute reference - SVG: Scalable Vector Graphics
kethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage t tabindex tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to transform transform-origin type u u1 u2 underline-position underline-thickness
unicode unicode-bidi
unicode-range units-per-em v v-alphabetic v-hanging v-ideographic v-mathematical values vector-effect version vert-adv-y vert-origin-x vert-origin-y viewbox viewtarget visibility w width widths word-spacing writing-mode x x x-height x1 x2 xchannelselector xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type x...
...ntation-vertical, image-rendering, kerning, letter-spacing, lighting-color, marker-end, marker-mid, marker-start, mask, opacity, overflow, pointer-events, shape-rendering, stop-color, stop-opacity, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, text-decoration, text-rendering, transform, transform-origin,
unicode-bidi, vector-effect, visibility, word-spacing, writing-mode filters attributes filter primitive attributes height, result, width, x, y transfer function attributes type, tablevalues, slope, intercept, amplitude, exponent, offset animation attributes animation attribute target attributes attributetype, attributename animation timing attributes begin, dur, end, min, max, restart, repeatco...
<glyph> - SVG: Scalable Vector Graphics
example svg <svg width="400px" height="300px" version="1.1" xmlns="http://www.w3.org/2000/svg"> <!-- example copied from https://www.w3.org/tr/svg/fonts.html#glyphelement --> <defs> <font id="font1" horiz-adv-x="1000"> <font-face font-family="super sans" font-wei...
...d" font-style="normal" units-per-em="1000" cap-height="600" x-height="400" ascent="700" descent="300" alphabetic="0" mathematical="350" ideographic="400" hanging="500"> <font-face-src> <font-face-name name="super sans bold"/> </font-face-src> </font-face> <missing-glyph><path d="m0,0h200v200h-200z"/></missing-glyph> <glyph
unicode="!" horiz-adv-x="80" d="m0,0h200v200h-200z"></glyph> <glyph
unicode="@" d="m0,50l100,300l400,100z"></glyph> </font> </defs> <text x="100" y="100" style="font-family: 'super sans', helvetica, sans-serif; font-weight: bold; font-style: normal">text using embe@dded font!</text> </svg> result specifications specification status comment ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
polygon implemented. text module text implemented. various presentation attributes don't work (alignment-baseline, baseline-shift, dominant-baseline, kerning, letter-spacing, word-spacing, writing-mode, glyph-orientation-horizontal, glyph-orientation-vertical) recently implemented presentation attributes: direction,
unicode-bidi, font-variant, text-decoration svgtextelement recently imlemented bindings: selectsubstring recently implemented attributes: textlength, lengthadjust tspan implemented. various presentation attributes don't work (alignment-baseline, baseline-shift, dominant-baseline, kerning, letter-spacing, word-spacing, writing-...
...recently implemented attributes: textlength, lengthadjust tspan implemented. various presentation attributes don't work (alignment-baseline, baseline-shift, dominant-baseline, kerning, letter-spacing, word-spacing, writing-mode, glyph-orientation-horizontal, glyph-orientation-vertical) recently implemented presentation attributes: direction,
unicode-bidi, font-variant, text-decoration svgtspanelement recently implemented bindings: selectsubstring recently implemented attributes: textlength, lengthadjust tref this feature, present in early draft of the spec, has been removed from it and is therefor not implemented (bug 273171). textpath im...
File I/O - Archive of obsolete content
/gre/modules/netutil.jsm"); components.utils.import("resource://gre/modules/fileutils.jsm"); // file is nsifile, data is a string // you can also optionally pass a flags parameter here. it defaults to // fileutils.mode_wronly | fileutils.mode_create | fileutils.mode_truncate; var ostream = fileutils.opensafefileoutputstream(file); var converter = components.classes["@mozilla.org/intl/scriptable
unicodeconverter"]. createinstance(components.interfaces.nsiscriptable
unicodeconverter); converter.charset = "utf-8"; var istream = converter.converttoinputstream(data); // the last argument (the callback) is optional. netutil.asynccopy(istream, ostream, function(status) { if (!components.issuccesscode(status)) { // handle error! return; } // data has been written to the f...
Examples and demos from articles - Archive of obsolete content
ible to simulate an editable <select> through a fieldset of radioboxes and textboxes. [article] expandable elements [html] this example shows how it is possible to show/hide classes of elements in pure css. in this demo there is also an example of a "toggle button" rendered through a <label> element. [article] code snippets and tutorials javascript complete cookies reader/writer with full
unicode support this little framework consists of a complete cookies reader/writer with
unicode support. xml to json conversion snippets (jxon) jxon (lossless javascript xml object notation) is a generic name by which is defined the representation of javascript objects using xml. there are no real standards for this conversion, but some conventions begin to appear on the web. autogrowing <textarea> ...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
ou cannot mix string variables and literals in comparison operators. in particular you may need to use ns_literal_(c)string("") instead of empty(c)string. the equalsignorecase method does not take a length parameters. you may be able to use stringbeginswith instead. the findinreadable methods do not exist in the external api. you may be able to use the find methods instead. the tonewcstring, tonew
unicode methods only work on the appropriate string class. you need to supply the appropriate conversion yourself. the adopt and getter_copies methods do not work on abstract strings. instead of passing getter_copies(astring) to a method expecting a character pointer out parameter, you will need to use a temporary variable and copy the result.missing headers some headers are included from idl files only ...
XML data - Archive of obsolete content
ock; } depth:before { content: "mean depth: "; } depth:after { content: " m"; } open the document in your browser: oceans arctic area: 13,000 million km² mean depth: 1,200 m atlantic area: 87,000 million km² mean depth: 3,900 m . . . notes about this demonstration: the superscript 2 (in "million km²") a
unicode character, coded as \b2 in the css file. the heading, "oceans", has a negative top margin, moving it up so it is displayed on top of the border. challenge change the stylesheet so that it displays the document as a table. (see the tables chapter in the css specification for examples that you can adapt.) what next? if you had difficulty understanding this page, or if ...
CSS3 - Archive of obsolete content
t values for properties. the css all property. the scoping mechanism. clarifies: interaction of media-dependent @import statements and style sheet loading requirements. css writing modes module level 3 proposed recommendation defines the writing modes of both horizontal and vertical scripts and clarifies how the css direction and
unicode-bidi properties interact with the new css text-orientation property, and extends them where needed. css counter styles level 3 candidate recommendation testing modules css images module level 3 candidate recommendation defines the <image> data type. extends the url() syntax to support image slices using media fragments. adds...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
file "test.html" and begin testing. make sure the mimetypes of your html embed tags match the mimetype specified in your nprt.rc file and the top of your npp_gate.cpp file version issues if vc++ compiler throws you error c2664 on 'drawtext' function call, you may replace it by 'drawtexta'. in fact, all win32 api functions dealing with character strings can be added an 'a' to the end to avoid
unicode cast errors. visual c++ 2008 express don't support c99 standard about int32_t, uint32_t. you have to add #include "nptypes.h" in top of plugin.h file. feel free to append here your issues fixes if the above guide helped you. ...
Clipboard - Archive of obsolete content
ethods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. contentthe content to be copied to the clipboard. if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/
unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard");// in text formatjetpack.clipboard.set("hello world");// in other clipboard get(flavor string)returns data to jetpack from the clipboard. if flavor is provided, the data is returned in that format. flavorreturns data to jetpack from the clipboard. if flav...
Clipboard Test - Archive of obsolete content
ethods set(contentstringflavorstring)writes data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. string contentthe content to be copied to the clipboard. if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/
unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard");// in text formatjetpack.clipboard.set("hello world");// in other clipboard get(flavor string)returns data to jetpack from the clipboard. if flavor is provided, the data is returned in that format. flavorreturns data to jetpack from the clipboard. if flav...
Clipboard - Archive of obsolete content
methods set(contentstringflavorstring)writes data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. string contentthe content to be copied to the clipboard. if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/
unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard"); // in text format jetpack.clipboard.set("hello world"); // in other clipboard get(flavor string)returns data to jetpack from the clipboard. if flavor is provided, the data is returned in that format. flavorreturns data to jetpack from the clipboard. if f...
Clipboard - Archive of obsolete content
methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. contentthe content to be copied to the clipboard. if no other arguments are specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/
unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard"); // in text format jetpack.clipboard.set("hello world"); // in other clipboard get(flavor string)returns data to jetpack from the clipboard. if flavor is provided, the data is returned in that format. flavorreturns data to jetpack from the clipboard. if f...
open - Archive of obsolete content
tail here. type a string describing the type of file being opened. description this method opens the file, preparing its resources for use by subsequent methods to examine or modify the file. certain methods of file, such as read and write should not be used when the file is not open. other methods, such as remove may not be used when the file is open. valid file types are text, binary and
unicode. text indicates ascii text without nul characters. binary indicates utf-8 files.
unicode indicates ucs-2 files. for all file types, carriage returns and linefeeds are treated in a platform-agnostic way. examples example: using open in the following example, myfile is a file object: myfile.open("read", "text"); see also ...
File object - Archive of obsolete content
true if the file exists. file.canread true if the file can be read. file.canwrite true if the file can be written. file.canappend true if the file is in append mode. file.canreplace true if the file is in replace mode. file.isopen true if the file is open. file.type a string specifying the type of data or encoding contained in the file. currently "ascii" (ascii), "binary" (utf-8) or "
unicode" (ucs-2). (xxx note -- ascii might imply asciiz) file.mode a string describing the mode used to open the file. file.creationtime a date object representing the time when the file was created. file.lastmodified a date object representing the time when the file was last modified. file.size the length of the file in bytes; undefined(?) for directories and pipelines. file.hasrandomaccess tr...
String Quick Reference - Archive of obsolete content
why: avoid copying and conversion from literal char-based strings to utf16 strings. old way: use nsautostring and assignwithconversion() nsautostring widestring; widestring.assignwithconversion("some string"); callwidefunction(widestring); // use widestring again, but need a const prunichar* callwidewithflatstring(widestri...
preference.type - Archive of obsolete content
« xul reference home type type: one of the values below the preference type which should be one of the following values. bool a boolean set to either true or false. usually a checkbox would be connected to these preferences. int an integer string a string unichar a
unicode string wstring a localized string. in this situation the preference will save the path to a property file which contains the actual value of the preference. file a file. the file path will be stored in the preferences. ...
Keyboard Shortcuts - Archive of obsolete content
dow tag. normally though, if you want to respond to keys globally, you will use a keyboard shortcut as described earlier. the key event object has two properties which hold the key that was pressed. the keycode property holds the key code and may be compared to one of the constants from the key table earlier in this section. the charcode is used for printable characters and will hold the numeric
unicode character code value for the key that was pressed. our find files example so far : source view next, we'll find out how to handle focus and the selection. « previousnext » ...
Property Files - Archive of obsolete content
acters directly without escape sequences, and save the file as utf-8 without bom. double-check the save options of your text editor, because many don't do this by default. see localizing extension descriptions for more details. in some cases, it may be useful or needed to use escape sequences to express some characters. property files support escape sequences of the form: \uxxxx , where xxxx is a
unicode character code. for example, to put a space at the beginning or end of a string (which would normally be stripped by the properties file parser), use \u0020 . in the next section, we will look at xbl, which can be used to define the behavior of an element. « previousnext » see also how to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: bootstrapped extensi...
XUL Coding Style Guidelines - Archive of obsolete content
l version="1.0" encoding='utf-8'?> <!-- do not localize this file: [reason...] it isn't part of the build; --> when translators see this line, they won't bother to look at the rest of the file. references xul is discussed in depth in xul language spec and xul window language. xul localizability issues xhtml 1.1 recommendation namespaces in xml extensible markup language (xml) 1.0 euro sign the
unicode standard®, version 2.1 "xml applications" by frank boumphrey. published by wrox press inc. isbn 1-861001-52-5. author: tao cheng newsgroup discussion mailing list original document information author(s): tao cheng last updated date: december 10, 2004 copyright information: copyright (c) tao cheng ...
preference - Archive of obsolete content
which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. type type: one of the values below the preference type which should be one of the following values. bool a boolean set to either true or false. usually a checkbox would be connected to these preferences. int an integer string a string unichar a
unicode string wstring a localized string. in this situation the preference will save the path to a property file which contains the actual value of the preference. file a file. the file path will be stored in the preferences. properties defaultvalue (readonly) returns the default value of the preference. the type of the property depends on the value of the type property. if the pre...
External resources for plugin creation - Archive of obsolete content
straction provided. framework: firebreath project home page project history description (from the project creators): firebreath is a cross-platform browser plugin framework written in c++. plugins created with firebreath work on all major browsers, including firefox 3.0 and later. platforms supported include windows, linux, and mac os x (intel). feature highlights include thread safety checks,
unicode support (with std::wstring), activex support, built-in drawing model negotiation for mac, automatic type conversion (including javascript arrays and objects), advanced security features, and more. supported development environments are visual studio on windows, xcode on mac, and gcc on linux. all platforms rely on cmake for easy cross-platform builds. project: nixysa project home page descriptio...
NPN_GetValue - Archive of obsolete content
s. the value parameter should point to a npbool, which will be set appropriately if the function returns nperr_no_error. npnvprivatemodebool: indicates whether or not the browser is currently in private browsing mode. the value parameter should point to an npbool, which will be set appropriately if the function returns nperr_no_error. npnvdocumentorigin: the value for this variable is the
unicode serialization of the origin converted to nfkc-encoded (normalized) utf-8. memory for this string must be freed by the plugin via npn_memfree(). for more information, see the document origin specification. npnvplugindrawingmodel: (mac only) npnvsupportsquickdrawbool : (mac only) npnvsupportscoregraphicsbool : (mac only) value function returns the name of the plug-in in th...
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
unction parameter lists (firefox 52) ecmascript 2018 spread in object literals and rest parameters (firefox 55) for await...of (firefox 57) global_objects/sharedarraybuffer (firefox 57, with flags) global_objects/promise/finally (firefox 58) global_objects/regexp/dotall (not yet implemented; in other browsers) regexp lookbehind assertions (not yet implemented; in other browsers) regexp
unicode property escapes (not yet implemented; in other browsers) regexp named capture groups (not yet implemented; in other browsers) ecmascript 2019 array.flat() (firefox 62) array.flatmap() (firefox 62) object.fromentries() (firefox 63) string.trimstart() and string.trimend() (firefox 61) optional catch binding (firefox 58) function.tostring() revision (firefox 54) symbol.description (fire...
Gecko FAQ - Gecko Redirect 1
d for a future release. xml 1.0: full support, except for processing to manipulate default attributes rdf: full support, except for abouteach, abouteachprefix, and parsetype javascript 1.5, including ecma-262 edition 3 (ecmascript) compliance, except for date.todatestring and date.totimestring, which are not implemented transfer protocols: http 1.1 (including gzip compression), ftp ssl
unicode oji (open java interface) image formats png gif jpeg, pjpeg does "full support" mean that gecko has zero bugs today or will have zero bugs at some point in the future? of course not. as robert o'callahan notes in bug 25707, "full html4/css1 compliance can't mean '100% bug free'. if it does, no-one will ever ship a fully compliant browser." because web pages can be arbitrari...
Plug-in Development Overview - Gecko Plugin API Reference
npn_posturl, except that it notifies the plug-in of the result when the operation completes. for information about using these methods, see urls. starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), you can get the origin of the document in a secure, convenient way by calling npn_getvalue() to retrieve the value of the variable npnvdocumentorigin. the returned value is the
unicode serialization of the document's origin converted to nfkc-encoded (that is, normalized) utf-8. your plug-in must free the returned string's memory by calling npn_memfree() when you're done with it. getting version and ui information the netscape group of plug-in api methods provides some basic services to the plug-in. you can use these netscape methods: to identify the browser in which your p...
I18N - MDN Web Docs Glossary: Definitions of Web-related terms
the best practice that enables products or services to be readily adapted to any target culture. internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language. ...
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
000d cr, and u+0020 space. in the form of text, they are treated as normal space characters and sequential whitespaces are collapsed as a single space in many cases (this behavior can be changed by the white-space css property. they are also used as a separator of an element name and its parameters, class names, and so on. in javascript ecmascript® 2015 language specification specifies several
unicode codepoints as white space: u+0009 character tabulation <tab>, u+000b line tabulation <vt>, u+000c form feed <ff>, u+0020 space <sp>, u+00a0 no-break space <nbsp>, u+feff zero width no-break space <zwnbsp> and other category “zs” any other
unicode “separator, space” code point <usp>. these characters are usually unnecessary for the functionality of the code. ...
Character - MDN Web Docs Glossary: Definitions of Web-related terms
a character is either a symbol (letters, numbers, punctuation) or non-printing "control" (e.g., carriage return or soft hyphen). utf-8 is the most common character set and includes the graphemes of the most popular human languages. learn more general knowledge character (computing) on wikipedia character encoding on wikipedia ascii on wikipedia utf-8 on wikipedia
unicode on wikipedia ...
Character set - MDN Web Docs Glossary: Definitions of Web-related terms
a character set is an encoding system to let computers know how to recognize character, including letters, numbers, punctuation marks, and whitespace. in earlier times, countries developed their own character sets due to their different languages used, such as kanji jis codes (e.g. shift-jis, euc-jp, etc.) for japanese, big5 for traditional chinese, and koi8-r for russian. however,
unicode gradually became most acceptable character set for its universal language support. if a character set is used incorrectly (for example,
unicode for an acticle encoded in big5), you may see nothing but broken characters, which are called mojibake. ...
MDN Web Docs Glossary: Definitions of Web-related terms
time to first byte time to interactive tld tofu transmission control protocol (tcp) transport layer security (tls) tree shaking trident truthy ttl turn type type coercion type conversion u udp (user datagram protocol) ui undefined
unicode uri url urn usenet user agent utf-8 ux v validator value variable vendor prefix viewport visual viewport voip w w3c wai wcag web performance web server web standards webassembly ...
Web fonts - Learn web development
nt-weight/font-style to choose between them, rather than having to call all the different members of the font family different names. @font-face tip: define font-weight and font-style to keep your css simple by roger johansson shows what to do in more detail. note: you can also specify particular font-variant and font-stretch values for your web fonts. in newer browsers, you can also specify a
unicode-range value, which is a specific range of characters you want to use out of the web font — in supporting browsers, only the specified characters will be downloaded, saving unnecessary downloading. creating custom font stacks with
unicode-range by drew mclellan provides some useful ideas on how to make use of this. variable fonts there is a newer font technology available in browsers called v...
How to build custom form controls - Learn web development
lay an ellipsis */ display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow: ellipsis; vertical-align: top; } we don't need an extra element to design the down arrow; instead, we're using the :after pseudo-element. it could also be implemented using a simple background image on the select class. ...
Server-side web frameworks - Learn web development
ents this idea using bleeding edge technologies. some of the features provided by mojolicious are: a real-time web framework, to easily grow single-file prototypes into well-structured mvc web applications. restful routes, plugins, commands, perl-ish templates, content negotiation, session management, form validation, testing framework, static file server, cgi/psgi detection, and first-class
unicode support. a full-stack http and websocket client/server implementation with ipv6, tls, sni, idna, http/socks5 proxy, unix domain socket, comet (long polling), keep-alive, connection pooling, timeout, cookie, multipart, and gzip compression support. json and html/xml parsers and generators with css selector support. very clean, portable and object-oriented pure-perl api with no hidden magic. fr...
Embedding API for Accessibility
moz 0.8 fonts setcharpref("font.name.monospace.x-western", newfontname); setcharpref("font.name.serif.x-western", newfontname); setcharpref("font.name.sans-serif.x-western", newfontname); /* for other i18n charsets, change x-western to x-central-euro, x-cyrillic, x-
unicode, x-user-def, x-baltic, el, tr, he, ar, th, ja, zh-cn or zh-tw */ setintpref("font.size.fixed.x-western", newfontsize); setintpref("font.size.variable.x-western", newfontsize); /* for other i18n charsets, change the name as explained above for font face*/ se...
Mozilla’s UAAG evaluation report
(p1) c can be changed through preferences or user style sheet the prefs are at preferences, appearances, fonts 4.3 configure text colors. (p1) vg can be changed through preferences or by editing the prefs.js file the prefs are at preferences, appearances, colors to us...
Choosing the right memory allocator
s_free() == nsimemory::free() nsmemory::clone() (note: not part of nsimemory) see infallible memory allocation for information about how to allocate memory infallibly; that is, how to use memory allocators that will only return valid memory buffers, and never return null. allocating strings in xpcom code see "callee-allocated parameters" in the xpcom strings guide; use tonewcstring() or tonew
unicode() to allocate strings that will be passed out. these methods convert ns*string to nsimemory allocated, unowned [pruni]char* buffers. do not use nscrt::strdup for returning values from an xpcom object, as that uses a different allocator. nspr memory allocators you should only use the nspr allocators within nspr or the security code located in the /security/ subtree of the source code. avoid usi...
mach
are relative paths in the source repository. simply find one you are interested in and dig in! mach command providers a mach command provider is simply a python module. when these modules are loaded, mach looks for specific signatures to detect mach commands. currently, this is implemented through python decorators. ...
Experimental features in Firefox
ails on the status of this feature, see bug 1639607. release channel version added enabled by default? nightly 78 yes developer edition 78 yes beta 78 yes release 78 no preference name network.preload css display stray control characters in css as hex boxes this feature renders control characters (
unicode category cc) other than tab (u+0009), line feed (u+000a), form feed (u+000c), and carriage return (u+000d) as a hexbox when they are not expected. see bug 1099557 for more details. release channel version added enabled by default? nightly 43 yes developer edition 43 no beta 43 no release 43 no preference n...
Overview of Mozilla embedding APIs
ty classes are available from the xpcom dll. they provide some basic functionality which should be leveraged when building new xpcom components. nscomptr<interface-type> these are templatized smart pointers which transparently deal with xpcom reference counting issues. see the nscomptr user's manual for more information. nsstring there are a collection of string classes which support both
unicode and ascii strings. these classes provide a variety of string operations as well as dealing with the memory management issues of storing the underlying data. see the string guide for more details. nsweakptr this is an nscomptr which encapsulates xpcom weak reference support. see the nsiweakreference document for more information. public return codes ns_succeeded ns_error_failure ns_erro...
Gecko Keypress Event
ch they depend). the changes were risky so late in the release schedule, but they were necessary for fixing the many key handling bugs. charcode of dom keypress event if a keypress event is fired without any modifier keys (ctrl/alt(option)/meta(win/command)), then the properties of the event are the same as they were in gecko1.8.1. that is, when the currently selected keyboard layout produces a
unicode character (according to the current state of capslock and numlock), the charcode property contains that character. when the keypress event includes modifier keys, sometimes the charcode value is replaced with an ascii character according to the following rules. the accel key depends on the platform. ctrl is the accel key on windows and linux, while meta (i.e. command) is the accel key on mac. ...
HTML parser threading
safe to release except from the main thread. the runnables use nshtml5refptr<nshtml5streamparser>. nshtml5refptr sends runnables back to the main thread to call release on nshtml5streamparser on the main thread. normal (non-speculative) parsing initially, dodataavailable performs character encoding sniffing on the data if an encoding wasn't declared on the enclosing protocol (http) level. once a
unicode decoder has been set up, dodataavailable passes the byte data to the decoder whose output is accumulated into a linked list of nshtml5owningutf16buffer objects. nshtml5owningutf16buffer objects are then passed to the tokenizer in sequence by the parseavailabledata() method. the tokenizer calls into the tree builder which outputs nshtml5treeoperation objects (tree ops) into a queue. each tree op r...
Initial setup
ts are written. you can find the source files and install instructions here. locale switcher or quick locale switcher both locale switcher and quick locale switcher are add-ons for mozilla applications. either one is necessary to enable you to see your work within a mozilla application. you can install either by searching for them in firefox's add-ons manager or following these links. a solid,
unicode-based, text editor here are some suggestions: windows: notepad++ or notepad2 gnu/linux: vim, gedit or kate mac os x: textwrangler gnu make make is a tool which controls the generation of executables. you can find version 3.79.1 or higher here. unfortunately, other varieties of make won't do. end of initial setup now that you've finished your initial setup, it's time for the best...
QA phase
a web service called bit bucket to start the learning process. note: you must have mercurial configured before you begin. that step is back on the initial setup page. if you haven't done that yet, don't worry, we'll wait for you! pushing to your repository there are a couple of things you should take note of before you push to your repository: make sure that your files have been encoded in
unicode without bom (byte order mark). remember that here you are pushing an entire directory, not a .zip archive file or an .xpi lang pack. the instructions below will help you learn how to use your hg repository. after your new repository is created by the l10n-drivers, please visit the url for your repo. we'll use x-testing here for our example. you can do this by entering the following url into...
Translation phase
add-ons l10n for add-ons is handled by at least two other organizations/services called babelzilla and adofex. they both have created comprehensive programs and l10n tools for localizing any and all third-party add-ons for mozilla applications. visit their websites to learn how to get involved. babelzilla adofex tool-independent localization are you a command-line master? do you prefer
unicode text editors to any other applications on earth? do you have a pet cat (computer-assisted translation) tool, like omegat? then you may not be interested in using any of the tools listed above for your localizations. if that is the case, then this section is for you! for localizers who prefer localizing without a specialized tool the workflows for localizing mozilla applications and mozilla websi...
Fonts for Mozilla's MathML engine
this wiki page describes how users can install and use such math fonts with mozilla's mathml engine. note that most of these instructions may as well apply to other web rendering engines. installation instructions windows install the latin modern math and stix fonts as follows: download latinmodern-math-1959.zip. open the zip archive, move inside the latinmodern-math-1959 directory and then inside the otf directory. you will find a latinmodern-math font file. open the latinmodern-math font file and click the install button. download stixv2.0.2.zip. open the zip archive, move inside the /stixv2.0.0/fonts/otf/ directory. ...
MathML Demo: <mo> - operator, fence, separator, or accent
he following table contains instances of all arrows found on the swp arrows panel. the symbols occur in the context of a simple expression. in general, the lspace and rspace around arrows should be similar to the spacing around relations. there is an issue with the markup of "long" latex arrows in mathml. there are entities from these arrows, ⟵ ⟵ ⟶ etc. but they have no standard
unicodes. they can be viewed as stretched versions of short arrows. \longleftarrow can be scripted as <mo>⟵</mo> or as <mo stretchy="true" minsize="1.8">←</mo>. a ↑ b ← c a ⇑ b ⇐ c a ↓ b → c a ⇓ b ⇒ c a ↕ b ↔ c a ⇕ b ⇔ c a ↗ b ↦ c a ↘ b ↩ c ...
Index
is to return information in a pretty-print ascii format, which displays the information about the certificates and public keys in the p12 file. ...
NSS tools : pk12util
keys in the p12 file. -v enable debug logging when importing. -w p12filepasswordfile specify the text file containing the pkcs #12 file password. -w p12filepassword specify the pkcs #12 file password. ...
NSS Tools pk12util
likely to be the default. if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the error message. ...
NSS tools : pk12util
is to return information in a pretty-print ascii format, which displays the information about the certificates and public keys in the p12 file. ...
JSDeletePropertyOp
access is taking place. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). obj js::handleobject the object whose properties are being deleted. id js::handleid the name or index of the property being deleted. this is either a string (
unicode property identifier) or an integer (element index). succeeded bool * out parameter. receives the result of deletion. description jsdeletepropertyop callback is a hook that applications may install to be called at some point during property access. a jsdeletepropertyop may be installed on a jsclass to hook property deletes. if a jsdeletepropertyop does nothing and returns t...
JSFunction
for native functions and jsapi-compiled functions - that is, functions returned by the apis listed above-there is a simple one-to-one relationship between the jsfunction and the corresponding javascript function object. to get a jsfunction * given the jsobject * of a function object, use js_valuetofunction. to get the jsobject * given the jsfunction *, use js_getfunctionobject. ...
JSPropertyOp
is taking place. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). obj js::handleobject the object whose properties are being accessed. id js::handleid the name or index of the property being accessed. this is either a string (
unicode property identifier) or an integer (element index). strict bool (jsstrictpropertyop only) if strict is true, treating the assignment as strict mode code. vp js::mutablehandlevalue in/out parameter. points to a js::value variable. the meaning of this variable is different for each of the hooks; see below. description jspropertyop and jsstrictpropertyop callbac...
JS_CStringsAreUTF8
ns which take utf-8 explicitly or handle their own string encoding and decoding. option to have the jsapi treat char strings as utf-8. syntax jsbool js_cstringsareutf8(void); void js_setcstringsareutf8(void); // added in spidermonkey 1.8 description by default, all c/c++ strings passed into the jsapi are treated as iso/iec 8859-1, also known as iso-latin-1. that is, each byte is treated as a
unicode character, and there is no way to pass in a string containing characters beyond u+00ff. however, spidermonkey can optionally interpret these strings as utf-8. there are two ways to enable this: at compile time, by building spidermonkey with js_c_strings_are_utf8 defined; or at run time, by calling js_setcstringsareutf8 before the first call to js_newruntime. enabling this option also causes js_ge...
JS_CompareStrings
s, the same order imposed by the javascript string comparison operators (<, <=, >, >=), as described in ecma 262-3 § 11.8.5. as the standard says: the comparison of strings uses a simple lexicographic ordering on sequences of code point value values. there is no attempt to use the more complex, semantically oriented definitions of character or string equality and collating order defined in the
unicode specification. therefore strings that are canonically equal according to the
unicode standard could test as unequal. see also mxr id search for js_comparestrings js_convertvalue js_getstringchars js_getstringlength js_valuetostring ...
JS_CompileFunction
const char * name of file or url containing the function. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs. description js_compilefunction compiles a function from a text string, bytes, and optionally associates it with a js object, obj. js_compileucfunction is the
unicode version of the function. name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments specified in nargs. body is a string containing the source code of the function. length is the length ...
JS_CompileFunctionForPrincipals
r url containing the function. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs. description js_compilefunctionforprincipals compiles a security-enabled function from a text string, bytes, and associates it with a js object, obj. js_compileucfunctionforprincipals is the
unicode version of the function. principals is a pointer to the jsprincipals structure that contains the security information to associate with this function. name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match ...
JS_CompileScript
char16_t * string containing the script to compile. length size_t the length, in characters, of source. options js::compileoptions & compile options. script js::mutablehandlescript out parameter. on success, script receives the result script. description js_compilescript compiles a script, source, for execution. js_compileucscript is the
unicode version of the function. the script is associated with a js object. ascii and chars are the string containing the text of the script. length indicates the size of the text version of the script in characters. on success, js_compilescript and js_compileucscript stores the newly compiled script to *script and returns true. otherwise, they report an error, stores null to *script, and return false.
JS_CompileScriptForPrincipals
g the function. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs. version jsversion javascript version for the script. description js_compilescriptforprincipals compiles a security-enabled script, src, for execution. js_compileucscriptforprincipals is the
unicode version of the function. the script is associated with a js object. principals is a pointer to the jsprincipals structure that contains the security information to associate with this script. src is the string containing the text of the script. length indicates the length of the script, in characters. filename is the name of the file (or url) containing the script. this information is included...
JS_DefineFunction
hen it is called. flags unsigned the logical or of zero or more property attributes. description js_definefunction exposes a c/c++ function to scripts by defining a new method on an existing javascript object. it creates the new function object as though by calling js_newfunction, then makes it a method of obj as though by calling js_defineproperty. js_defineucfunction is the
unicode version of the function. name is the name of the property to create in obj. that is, it is the method name that scripts can use to call the new function. it also becomes the name property of the new function object and can be accessed using js_getfunctionid. call is a pointer to the c/c++ function that is to be exposed to javascript. nargs indicates the number of arguments the function expects to...
JS_DefineProperty
ned; or null. attrs unsigned property attributes. desc js::handle<jspropertydescriptor> the property descriptor for the property to be defined. result js::objectopresult & (out parameter) receives the result of the operation. description js_defineproperty defines a single property in a specified object, obj. js_defineucproperty is the
unicode version of the function. js_definepropertybyid is the same but takes a js::handleid for the property name. js_defineproperty is the fundamental operation on which several more convenient, higher-level functions are based, including js_definefunction, js_definefunctions, js_defineproperties, js_defineconstdoubles, js_defineobject, and js_initclass. it differs from js_setproperty in that: it do...
JS_DefinePropertyWithTinyId
value for the new property. getter jspropertyop getproperty method for retrieving the current property value. setter jspropertyop setproperty method for specifying a new property value. attrs unsigned int property attributes. description js_definepropertywithtinyid defines an object property with a tiny id. js_defineucpropertywithtinyid is the
unicode version of the function. except for the tinyid parameter, these functions behave exactly as js_defineproperty and js_defineucproperty. see those functions for more details. tinyid is a signed 8-bit integer that affects the id value passed to certain callbacks. any time the javascript engine would pass the name of the property as a string to the id parameter of a tiny-id-aware callback, it passes...
JS_DeleteProperty2
ll-terminated. succeeded bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise. description js_deleteproperty2 removes a specified property, name, from an object, obj, and stores true or false in *succeeded. it behaves like the javascript expression delete obj[name]. js_deleteucproperty2 is the
unicode version of the function. js_deletepropertybyid2 is the same but takes a js::handleid for the property name. first, a property lookup is performed. then one of the following cases applies: if obj has no property with the given name or id, or if obj inherits the specified property from its prototype, then *succeeded is set to true and obj's jsclass.delproperty hook is called (which may change *...
JS_EvaluateScript
to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs. rval jsval * out parameter. on success, if rval is not null, *rval receives the result value. description js_evaluatescript compiles and executes a script in the specified scope, obj. js_evaluateucscript is the
unicode version of the function. src is the string containing the text of the script. length indicates the size of the text version of the script in characters. filename is the name of the file (or url) containing the script. this information is used in messages if an error occurs during compilation. similarly, lineno is used to report the line number of the script or file where an error occurred durin...
JS_EvaluateScriptForPrincipals
ne in the file or url if an error occurs. rval jsval * out parameter. on success, *rval receives the value from the last-executed expression statement in the script. version jsversion javascript version for the script. description js_evaluatescriptforprincipals compiles and executes a script in the specified scope, obj. js_evaluateucscriptforprincipals is the
unicode version of the function. principals is a pointer to the jsprincipals structure that contains the security information to associate with this script. src is the string containing the text of the script. length is the length of the script, in characters. filename is the name of the file (or url) containing the script. this information is used in messages if an error occurs during compilation. si...
JS_GetProperty
that name is null-terminated. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the property, or undefined if no such property is found. description js_getproperty examines a specified js object obj and its prototype chain for a property with the specified name. it behaves like the javascript expression obj[name]. js_getucproperty is the
unicode version of the function. js_getpropertybyid is the same but takes a js::handleid for the property name. in the simplest case, js_getproperty stores the value of the property in *vp and returns true. however, several different hooks can affect property gets. the full algorithm is described below. details first, a property lookup is performed. if the lookup proceeds without error, exactly one of...
JS_GetPropertyAttributes
utes. foundp jsbool * out parameter. if no error occurs, *foundp receives js_true if the specified property is found and js_false if it is not found. if an error occurs, the value left in *foundp is unspecified. description js_getpropertyattributes retrieves the property attributes of the property with the given name on a given object, obj. js_getucpropertyattributes is the
unicode version of the function. if an error occurs, the return value is js_false, and the values left in *attrsp and *foundp are unspecified. if obj does not have the specified property, or if it inherits it from some other object (on its prototype chain, for example), then *foundp is set to js_false. the value left in *attrsp is unspecified. the return value is js_true (to indicate that no error occu...
JS_GetStringLength
size_t js_getstringlength(jsstring *str); name type description str jsstring * the string to examine. description js_getstringlength reports the length, in 16-bit code units, of the string str. this is the same as the length property of the string. this is the same as the length of the array returned by js_getstringchars, in char16_ts (not bytes). because some
unicode characters are represented using two 16-bit code units, the result is not necessarily the same as the number of
unicode characters in the string. see also mxr id search for js_getstringlength js_comparestrings js_convertvalue js_getemptystringvalue js_getstringbytes js_internstring js_newstringcopyn js_newstringcopyz js_valuetostring ...
JS_HasProperty
foundp bool * non-null pointer to a variable of type bool. on success, js_hasproperty stores true in this variable if obj has a property with the given name, and false if not. description js_hasproperty searches an object, obj, and its prototype chain, for a property with the specified name. it behaves like the javascript expression name in obj. js_hasucproperty is the corresponding
unicode api. js_haspropertybyid is the same but takes a js::handleid for the property name. if the property exists, this function sets *foundp to true and returns true. if the object obj has no such property, the function sets *foundp to false and returns true (to indicate that no error occurred). if an error occurs during the search, the function returns false, and the value of *foundp is undefined. se...
JS_InternString
r array containing the data for the string. in js_internstring and js_internucstring, the string must be null-terminated. length size_t (only in js_internstringn and js_internucstringn) the length of s in characters. description js_internstring and js_internstringn return an interned javascript string with a specified value, s. js_internucstring and js_internucstringn are the
unicode versions of the function. each jsruntime keeps a table of all existing interned strings. if an interned string already exists with the desired value, these functions return the existing string. otherwise a new string is created and added to the table. strings created with these functions are protected from garbage collection for the lifetime of the jsruntime. on success, these functions return a ...
JS_LookupProperty
d the return value is true (to indicate no error occurred). on error or exception (such as running out of memory during the search), the return value is false, and the value left in *vp is undefined. there is no way to tell the difference between not finding any property and finding a property whose value is undefined. sorry. use js_getpropertydescriptorbyid instead. js_lookupucproperty is the
unicode version of js_lookupproperty. flags js_lookuppropertywithflags and js_lookuppropertywithflagsbyid allow the caller to specify flags requesting special lookup behavior. when executing javascript code that uses properties, spidermonkey looks up properties using slightly different rules depending on the syntactic context in which the property name appears. (the javascript engine simply passes these ...
JS_NewUCString
* pointer to a character array, allocated with js_malloc, containing the characters for the js string to create. the javascript engine adopts the buffer. length size_t number of characters in the text string. description js_newstring creates and returns a new string, using the memory starting at buf and ending at buf + length as the character storage. js_newucstring is the
unicode version of the function. the character array, buf, must be allocated on the heap using js_malloc. on success, the javascript engine adopts responsibility for memory management of this region. the application must not read, write, or free the buffer. this allows the javascript engine to avoid needless data copying. on success, js_newstring and js_newucstring return a pointer to the new string. on ...
JS_NewStringCopyN
har* or const char16_t * pointer to the array of characters containing the text for the js string to create. n size_t number of characters to copy from s into the new string. description js_newstringcopyn allocates space for a javascript string and its underlying storage, and copies n characters from a c character array, s, into the new jsstring. js_newucstringcopyn is the
unicode version of the function. the two functions differ only in the type of the character array s; both functions create ordinary javascript strings, and all javascript strings are made up of 16-bit characters. if the array s contains more than n characters, the new string contains a truncated version of the original string. the string may contain null characters ('\0'). they are copied into the new st...
JS_SetProperty
v js::handlevalue in/out parameter. *vp is the value to assign to the property. ordinarily this function leaves v unchanged, but it is possible for a jsclass.addproperty hook or a non-default setter to assign to v. description js_setproperty assigns the value v to the property name of the object obj. it behaves like the javascript expression obj[name] = v. js_setucproperty is the
unicode version of the function. js_setpropertybyid is the same but takes a js::handleid for the property name. if obj is a proxy, the js_setproperty [[set]] internal method defined in es2015 (rev 29 9.5.9) is performed. if obj is a native object with custom setgeneric op, the op is called with (cx, obj, id, &v, false)). otherwise, [[set]] internal method defined in es2015 (rev 29 9.1.9) is performed.
JS_SetPropertyAttributes
ze_t (in js_setucpropertyattributes only) the length of name, in characters. attrs unsigned int attribute values to set. foundp jsbool * out parameter. flag indicating whether or not the specified property was located. description js_setpropertyattributes sets the attributes for a specified property, name of an object obj. js_setucpropertyattributes is the
unicode version of the function. attrs is an unsigned integer containing the attribute value to set. it is the bitwise or of zero or more of the following values: flag purpose jsprop_enumerate property is visible in for and in loops. jsprop_readonly property is read only. jsprop_permanent property cannot be deleted. jsprop_exported property ca...
JSAPI reference
n spidermonkey 1.8.1 obsolete since jsapi 16 js_entercrosscompartmentcall added in spidermonkey 1.8.1 obsolete since jsapi 18 js_leavecrosscompartmentcall added in spidermonkey 1.8.1 obsolete since jsapi 18 locale callbacks: struct jslocalecallbacks js_getlocalecallbacks js_setlocalecallbacks locale callback types: jslocaletouppercase jslocaletolowercase jslocalecompare jslocaleto
unicode scripts just running some javascript code is straightforward: class js::compileoptions added in spidermonkey 17 class js::owningcompileoptions added in spidermonkey 31 class js::readonlycompileoptions added in spidermonkey 31 class js::sourcebufferholder added in spidermonkey 31 js::evaluate added in spidermonkey 17 js_evaluatescript obsolete since jsapi 36 js_evaluateucscript obso...
Accessing the Windows Registry Using XPCOM
dows registry values can have several data types, so you need to ensure that you read the correct type. you can check the type of a value using the method getvaluetype(). this method returns an integer indicating the data type of the value. the data types supported by this interface are defined as named constants on the interface as follows: type_none — probably not useful type_string — a
unicode string value type_binary — binary data type_int — a 32 bit integer type_int64 — a 64 bit integer each of these types (except type_none) has a corresponding method to read the value data: readstringvalue() readbinaryvalue() readintvalue() readint64value() since javascript is a dynamically-typed language, you may wish to use the following code to handle all types of data. in this...
Creating a Python XPCOM component
this is the same as the nsisimple interface used here. theoretically, because several components can share an interface, the same file could be used. pay special attention to types here - python and javascript are both loosely-typed, so it's fairly easy to pass information from one to the other. note: there are exceptions; see this discussion for information on the use of string and wstring for
unicode transfer. see here for info on describing interfaces, and on which types can be used. registering the interface in the "components" directory, execute : ../xpidl -m typelib -w -v -i /usr/share/idl/mozilla/ nsipysimple.idl on windows you must point to the idl directory as part of your mozilla build. for example: xpidl.exe -m typelib -w -v -i c:\source\mozilla\obj-i686-pc-mingw32\dist\idl foo.idl ...
Using XPCOM Utilities to Make Things Easier
ule(nssamplemodule, components) string classes in xpcom strings are usually thought of as linear sequences of characters. in c++, the string literal "xpcom", for example, consists of 6 consecutive bytes, where `x' is at byte offset zero and a null character is at byte offset 5. other kinds of strings like "wide" strings use two bytes to represent each character, and are often used to deal with
unicode strings. the string classes in xpcom are not just limited to representing a null terminated sequence of characters, however. they are fairly complex because they support the gecko layout engine and other subsystems that manage large chunks of data. additionally, in some versions of mozilla the string classes support sequences of characters broken up into multiple fragments (fragments which may o...
nsAString
#include "nsstringapi.h" class nsastring { ... }; typedefs char_type [prunichar] storage unit for this class. self_type [nsastring] an alias for the type of this class. size_type [pruint32] type used to represent the number of double-byte units stored in the string. index_type [pruint32] type used to represent an offset into the string. ...
XPCOM glue classes
posed of single-byte storage units. this class is typically used to represent ascii or utf-8 character arrays.nsacstring (external)class declarationnsacstring_internalclass declarationnsadoptingcstringclass declarationnsadoptingstringclass declarationnsastringthe nsastring abstract class represents a character string composed of double-byte storage units. ...
mozIPersonalDictionary
d the incorrect spelling of the word to add to the list of corrections. correction the correct spelling of the word. lang the language of the word. addword() add a word to the personal dictionary. void addword( in wstring word, in wstring lang ); parameters word the word to add to the dictionary. lang the language of the word. note that this parameter is currently unused. check() checks a
unicode string. boolean check( in wstring word, in wstring lang ); parameters word the word to check. lang the language of the word. note that this parameter is currently ignored. return value true if the word is in either the dictionary or the ignore list, false if it is not in either list. endsession() clears the ignore list. void endsession(); parameters none. getcorrection() gets a list of pr...
nsIAccessibleText
ts around the given offset. this accessible get return the dom node and layout frame with the uniform attributes for this range of text. nsiaccessible getattributerange( in long offset, out long rangestartoffset, out long rangeendoffset ); parameters offset rangestartoffset rangeendoffset return value getcharacteratoffset() it would be better to return an unsigned long here, to allow
unicode chars > 16 bits. wchar getcharacteratoffset( in long offset ); parameters offset return value getcharacterextents() returns the bounding box of the specified position. the virtual character after the last character of the represented text, that is the one at position length is a special case. it represents the current input position and will therefore typically be queried by at more often ...
nsIConverterInputStream
1.0 66 introduced gecko 1.8 inherits from: nsiunicharinputstream last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-input-stream;1. ...
nsIDOMSerializer
ream. if this string is empty and root is a document, the document's character set will be used. serializetostring() the subtree rooted by the specified element is serialized to a string. astring serializetostring( in nsidomnode root ); parameters root the root of the subtree to be serialized. this could be any node, including a document. return value the serialized subtree in the form of a
unicode string. ...
nsIDocShell
me rather than an element. obsolete since gecko 1.9.2 channelisunsafe boolean find out if the currently loaded document came from a suspicious channel (such as a jar channel where the server-returned content type is not a known jar type). read only. charset string the converter to use when reading the document's data. in mozilla code, all text is encoded as
unicode. when reading a document, a converter is used to translate the text from its original format into
unicode. this attribute lets you: see what converter was used when retrieving the document's data. override that character set for documents for which the specified fallback or auto-detected character set is incorrect. reading this value reports the encoding that was used when...
nsIDragSession
mdropitems. isdataflavorsupported() checks to see if any of the native data on the clipboard matches a given data flavor. if numdropitems is greater than one, there is no indication as to which of the items matches the data flavor. boolean isdataflavorsupported( in string adataflavor ); parameters adataflavor a string representing the mime type of the data to be matched, such as "text/
unicode". return value true if the specified flavor matches any of the native data on the clipboard, otherwise false. ...
nsIJSON
e. return value a json string representing the value. encodetostream() encodes a javascript object into json format, writing it to a stream. void encodetostream( in nsioutputstream stream, in string charset, in boolean writebom in jsobject value ); parameters stream the nsioutputstream to which to write the json string. charset the string encoding to use. only the five
unicode encodings "utf-8", "utf-16le", "utf-16be", "utf-32le" and "utf-32be" are supported. writebom specify true if you wish to write a byte-order mark (bom) into the stream, otherwise specify false. value the javascript object to encode. legacydecode() decodes a json string. this method accepts slightly more than the exact json syntax; details of extra accepted syntax are deliberately not descr...
nsIMarkupDocumentViewer
iditextdirection octet options for bidi presentation. use these attributes to access the individual bidi options. the default direction for the layout of bidirectional text. 1 - left to right 2 - right to left. biditexttype octet the ordering of bidirectional text. this may be either "logical" or "visual". logical text will be reordered for presentation using the
unicode bidi algorithm. visual text will be displayed without reordering. 1 - the default order for the charset 2 - logical order 3 - visual order. defaultcharacterset acstring forcecharacterset acstring fullzoom float the amount by which to scale all lengths. default is 1.0. hintcharacterset acstring hintcharactersetsource pr...
nsIMsgIdentity
nu item on the compose window will be checked. methods clearallvalues() note: this is really dangerous! this destroys all pref values; do not call this unless you know what you're doing! void clearallvalues(); parameters none. copy() copy the attributes of the identity we pass in. void copy(in nsimsgidentity identity); parameters identity getunicharattribute() getter for
unicode attributes. note: these attributes persist across sessions. astring getunicharattribute(in string name); parameters name setunicharattribute() setter for
unicode attributes. void setunicharattribute(in string name, in astring value); parameters name name of the attribute to set. value value to set the attribute to. getcharattribute() getter for char attributes. acstring g...
nsIProtocolHandler
municating with, for example, the origin server of the uri string. (many servers do not support utf-8 iris at the present time, so we must be careful about tracking the native charset of the origin server.) nsiuri newuri( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aspec the uri string in utf-8 encoding. depending on the protocol's implementation,
unicode character sequences may or may not be %xx escaped. aorigincharset the character set of the document from which this uri string originated. this corresponds to the character set that should be used when communicating this uri to an origin server. if this is null, then utf-8 encoding is assumed and no character transformation is not performed. abaseuri if null, aspec must specify an absolute ur...
nsIScriptableInputStream
( in nsiinputstream ainputstream ); parameters ainputstream the nsiinputstream to be wrapped. read() read data from the stream. warning: if the data contains a null byte, then this method will return a truncated string. note: it is also important to consider how a language bindings may interpret the string data type. in particular, some bindings may convert the byte values into
unicode code points, by assuming the byte values are encoded as iso-latin-1. this is the case for the javascript bindings. string read( in unsigned long acount ); parameters acount the maximum number of bytes to read from the stream. return value the data read as a string, which will be an empty string if the stream is at eof. exceptions thrown ns_error_not_initialized if init() was...
nsISupportsString
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data astring provides access to the native type represented by the object. methods tostring() this methods returns a string valued representation of the object. string tostring(); parameters none. return value a string valued representation of the object. remarks this interface was frozen for gecko 1.2. ...
nsITransferable
constants kflavorhasdataprovider (that title needs to be better) constant value description kflavorhasdataprovider 0 a description is needed here. common mime types some of these need better descriptions, especially the mozilla-specific ones. constant value description ktextmime text/plain plain text. k
unicodemime text/
unicode unicode text. kmoztextinternal text/x-moz-text-internal text data that isn't meant to be used by non-mozilla code. khtmlmime text/html html. kaolmailmime aolmail aol mail. need details. kpngimagemime image/png png image. kjpegimagemime image/jpeg jpeg image. kjpgimagemime image/jpg jpe...
XPCOM Interface Reference
ocolproxyservicensiproxyinfonsipushmessagensipushservicensipushsubscriptionnsiradiointerfacelayernsirandomgeneratornsirequestnsirequestobservernsiresumablechannelnsirunnablensishentrynsishistorynsishistorylistenernsisockssocketinfonsisslerrorlistenernsisslsocketcontrolnsiscreennsiscreenmanagernsiscripterrornsiscripterror2nsiscriptableionsiscriptableinputstreamnsiscriptableunescapehtmlnsiscriptable
unicodeconverternsiscrollablensisearchenginensisearchsubmissionnsisecuritycheckedcomponentnsiseekablestreamnsiselectionnsiselection2nsiselection3nsiselectioncontrollernsiselectionimageservicensiselectionprivatensiserversocketnsiserversocketlistenernsiservicemanagernsisessionstartupnsisessionstorensisimpleenumeratornsismsdatabaseservicensismsrequestmanagernsismsservicensisocketprovidernsisocketproviderser...
XPCOM Interface Reference by grouping
iaccessiblehypertext nsiaccessibleimage nsiaccessibleprovider nsiaccessibleretrieval nsiaccessiblerole nsiaccessiblescrolltype nsiaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptable
unicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistene...
Working with out parameters
hod from javascript via xpconnect, you have to follow a specific rule. to get at the out parameters, you have to pass in an object. after the call, this object will have a new property called value, which contains the out values. assuming you have an object called transferable, you would invoke gettransferdata() as follows: var adata = {}; var adatalen = {}; transferable.gettransferdata("text/
unicode", adata, adatalen); var data = adata.value; var datalen = adatalen.value; as you can see, after the call to gettransferdata(), the out values are then contained in the value properties of adata and adatalen. implementation when implementing a method which has out parameters in javascript, you have to set a new property called value to the out parameter which will hold the required value. you...
Mail event system
example, a listener will be set up to be notified when the message count changes in a folder: // our variable to know if the listener fired var listenerhasfired = false; var totalmessageslistenerhasfired = false; // the listening function that will react to changes function myonintpropertychanged(item, property, oldvalue, newvalue) { listenerhasfired=true; var propertystring = property.get
unicode(); dump("onintpropertychanged has fired with property + " + propertystring + "!\n"); if (propertystring == "totalmessages") { totalmessageslistenerhasfired=true; //now show us visually var folder = item.queryinterface(components.interfaces.nsimsgfolder); dump("the folder " + folder.prettyname + " now has " + newvalue + " messages."); } else if (propertystrin...
Using js-ctypes
s function messageboxw. line 15 calls the msgbox() routine, which displays the alert. the last thing we do is call lib.close() to close the library when we're done using it. instead of defining the whole path, you may also just give the file name. about declaring the function how we knew how to declare the function was by going to msdn site and looking at the messagebox (messageboxw is just a
unicode version of same function) function. also learn about the lib.declare function used here: lib.declare. learn about the data types used here: data types. we see that it needs to be defined like this: int winapi messagebox( _in_opt_ hwnd hwnd, _in_opt_ lpctstr lptext, _in_opt_ lpctstr lpcaption, _in_ uint utype ); so we read this article here on defining types and replicate it: dec...
ctypes
uint64 javascript objects; see 64-bit integers for details. type description size_t a platform-dependent size type. ssize_t a platform-dependent size type. intptr_t a platform-dependent integer representation of a pointer. uintptr_t a platform-dependent unsigned integer representation of a pointer. javascript characters 16-bit c
unicode characters are handled by js-ctypes using the jschar type. type description jschar a 16-bit unsigned character. this is different from uint16_t in that c jschar values are automatically converted into 1-character javascript strings. these are
unicode characters. special c types these types represent c types that have special meanings. type description...
Plug-in Development Overview - Plugins
npn_posturl, except that it notifies the plug-in of the result when the operation completes. for information about using these methods, see urls. starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), you can get the origin of the document in a secure, convenient way by calling npn_getvalue() to retrieve the value of the variable npnvdocumentorigin. the returned value is the
unicode serialization of the document's origin converted to nfkc-encoded (that is, normalized) utf-8. your plug-in must free the returned string's memory by calling npn_memfree() when you're done with it. getting version and ui information the netscape group of plug-in api methods provides some basic services to the plug-in. you can use these netscape methods: to identify the browser in which your p...
DataTransfer.types - Web APIs
some values that are not mime types are special-cased for legacy reasons (for example "text"). syntax datatransfer.types; return value an array of the data formats used in the drag operation. each format is string. ...
DataTransferItem.getAsString() - Web APIs
kind is string). syntax datatransferitem.getasstring(callback); parameters callback a callback function that has access to the data transfer item's string data. see callback below for details. return value undefined callback the callback parameter is a callback function which accepts one parameter: domstring the drag data item's string data. the callback return value is undefined. ...
DataTransferItem.kind - Web APIs
the read-only datatransferitem.kind property returns a datatransferitem representing the drag data item kind: some text or some file. syntax var itemkind = datatransferitem.kind; return value a domstring representing the drag data item's kind. it must be one of the following values: 'file' if the drag data item is a file. 'string' if the kind of drag data item is a plain
unicode string. example this example shows the use of the kind property. function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(do...
DataTransferItem.type - Web APIs
some example types are: text/plain and text/html. syntax dataitem.type; return value a domstring representing the drag data item's type. example this example shows the use of the type property. ...
DataTransferItemList.add() - Web APIs
ext/plain. file a file object. no type needs to be given in this case. return value a datatransferitem containing the specified data. if the drag item couldn't be created (for example, if the associated datatransfer object has no data store), null is returned. exceptions notsupportederror a string data parameter was provided, and the list already contains an item whose kind is "plain
unicode string" and whose type is equal to the specified type parameter. example this example shows the use of the add() method. html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(even...
Document.createEntityReference() - Web APIs
is feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. prior to gecko 7.0 this method showed up as present, due to bug bug 9850, it always only returned null. the only workaround is to create a text node, cdata section, attribute node value, etc. which has the value referred to by the entity, using
unicode escape sequences or fromcharcode() as necessary. specifications createentityreference ...
FontFace - Web APIs
e.status read only returns an enumerated value indicating the status of the font, one of "unloaded", "loading", "loaded", or "error". fontface.stretch a cssomstring that retrieves or sets how the font stretches. it is equivalent to the font-stretch descriptor. fontface.style a cssomstring that retrieves or sets the style of the font. it is equivalent to the font-style descriptor. fontface.
unicoderange a cssomstring that retrieves or sets the range of
unicode codepoints encompassing the font. it is equivalent to the
unicode-range descriptor. fontface.variant a cssomstring that retrieves or sets the variant of the font. it is equivalent to the font-variant descriptor. fontface.weight a cssomstring that contains the weight of the font. it is equivalent to the font-weight descriptor. m...
FontFaceSet.check() - Web APIs
method of the fontfaceset returns whether all fonts in the given font list have been loaded and are available. syntax bool = afontfaceset.check(font); bool = afontfaceset.check(font, text); returns a boolean that is true if the font list is available parameters font: a font specification using the css value syntax, e.g. "italic bold 16px roboto" text: limit the font faces to those whose
unicode range contains at least one of the characters in text. this does not check for individual glyph coverage. examples document.fonts.check("12px courier"); // returns true if the font courier is available at 12px document.fonts.check("12px myfont", "ß"); // returns true if the font 'myfont' has a ß character. specifications specification status comment css font loadi...
FontFaceSet.load() - Web APIs
be loaded. syntax result = afontfaceset.load(font); result = afontfaceset.load(font, text); returns a promise of an array of fontface loaded. the promise is fulfilled when all the fonts are loaded; it is rejected if one of the fonts failed to load. parameters font: a font specification using the css value syntax, e.g. "italic bold 16px roboto" text: limit the font faces to those whose
unicode range contains at least one of the characters in text. this does not check for individual glyph coverage. examples // returns a promise that will be fulfilled or rejected according the success to load myfont // the code in 'then' can assume the availability of that font. document.fonts.load("12px myfont", "ß").then(…); specifications specification status comment ...
Recommended Drag Types - Web APIs
done automatically by the browser, so you do not need to handle it yourself. it is recommended to always add data of the text/plain type as a fallback for applications or drop targets that do not support other types, unless there is no logical text alternative. always add this text/plain type last, as it is the least specific and shouldn’t be preferred. note: in older code, you may find text/
unicode or the text types. these are equivalent to text/plain, and will store and retrieve plain text data. dragging links dragged hyperlinks should include data of two types: text/uri-list, and text/plain. both types should use the link’s url for their data. for example: var dt = event.datatransfer; dt.setdata("text/uri-list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozill...
KeyboardEvent.initKeyEvent() - Web APIs
rated is a combination of keys containing the shift key. metakeyarg is a boolean that is true if the virtual key to be generated is a combination of keys containing the meta key. keycodearg is a unsigned long representing the virtual key code value of the key which was depressed, otherwise 0. see keyboardevent.keycode for the list of key codes. charcodearg is a unsigned long representingthe
unicode character associated with the depressed key otherwise 0. example var event = document.createevent('keyboardevent'); // create a key event // define the event event.initkeyevent("keypress", // typearg, true, // canbubblearg, true, // cancelablearg, null, // viewarg, specifies uievent.view. this v...
Key Values - Web APIs
y_multiplecandidate (0x0100113d) "alphanumeric" the alphanumeric key. 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). gdk_key_codeinput (0xff37) qt::key_codeinput (0x01001137) "compose" the compose key. gdk_key_multi_key (0xff20) [1] qt::key_multi_key (0x01001120) "convert" [4] the convert key, which instructs the ime to convert the current input method sequence into the resulting character. vk_convert (0x1c) g...
KeyboardEvent.key - Web APIs
the keyboardevent interface's key read-only property returns the value of the key pressed by the user, taking into consideration the state of modifier keys such as shift as well as the keyboard locale and layout. its value is determined as follows: key values see a full list of key values. if the pressed key has a printed representation, the returned value is a non-empty
unicode character string containing the printable representation of the key. if the pressed key is a control or special character, the returned value is one of the pre-defined key values. if the keyboardevent represents the press of a dead key, the key value must be "dead". some specialty keyboard keys (such as the extended keys for controlling media on multimedia keyboards) don't generate key codes on windows; instead...
Location: origin - Web APIs
e.g "blob:https://mozilla.org" will have "https://mozilla.org". note: this feature is available in web workers. ...
MediaStreamAudioSourceNode - Web APIs
has better-defined rules for how it chooses the track to output. if you do chooose to use mediastreamaudiosourcenode, you should keep the following in mind. track ordering for the purposes of the mediastreamtrackaudiosourcenode interface, the order of the audio tracks on the stream is determined by taking the tracks whose kind is audio, then sorting the tracks by their id property's values, in
unicode code point order (essentially, in alphabetical or lexicographical order, for ids which are simple alphanumeric strings). the first track, then, is the track whose id comes first when the tracks' ids are all sorted by
unicode code point. however, it's important to note that the rule establishing this ordering was added long after this interface was first introduced into the web audio api. as suc...
TextDecoder() - Web APIs
ing algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown. syntax decoder = new textdecoder(utflabel, options); parameters utflabeloptional is a domstring, defaulting to "utf-8", containing the label of the encoder. ...
URL.origin - Web APIs
the exact structure varies depending on the type of url: for http or https urls, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified). for file: urls, the value is browser dependant. for blob: urls, the origin of the url following blob: will be used, e.g "blob:https://mozilla.org" will be returned as "https://mozilla.org". note: this feature is available in web workers. syntax const originstring = url.origin value a usvstring. ...
URLSearchParams.sort() - Web APIs
this method uses a stable sorting algorithm (i.e. the relative order between key/value pairs with equal keys will be preserved). note: this feature is available in web workers. syntax searchparams.sort(); parameters none. return value undefined. ...
URLUtilsReadOnly.origin - Web APIs
for url using file: scheme, the value is browser dependant. this version of origin is implemented by workerlocation for use on workers. ...
USVString - Web APIs
usvstring corresponds to the set of all possible sequences of
unicode scalar values. usvstring maps to a string when returned in javascript; it's generally only used for apis that perform text processing and need a string of
unicode scalar values to operate on. usvstring is equivalent to domstring except for not allowing unpaired surrogate codepoints. unpaired surrogate codepoints present in usvstring are converted by the browser to
unicode 'replacement character' u+fffd, (�). specifications specification status comment web idlthe definition of 'usvstring' in that specification. candidate recommendation initial definition. ...
Controlling multiple parameters with ConstantSourceNode - Web APIs
g them again when the play button is clicked again to toggle them back on. let's look at the code. function toggleplay(event) { if (playing) { playbutton.innerhtml = "▶️"; stoposcillators(); } else { playbutton.innerhtml = "⏸"; startoscillators(); } } if the playing variable indicates we're already playing the oscillators, we change the playbutton's content to be the
unicode character "right-pointing triangle" (▶️) and call stoposcillators() to shut down the oscillators. see stopping the oscillators below for that code. if playing is false, indicating that we're currently paused, we change the play button's content to be the
unicode character "pause symbol" (⏸) and call startoscillators() to start the oscillators playing their tones. that code is covered under...
window.postMessage() - Web APIs
if postmessage() is invoked in an event handler, that event handler will run to completion, as will any remaining handlers for that same event, before the messageevent is dispatched. the value of the origin property of the dispatched event is not affected by the current value of document.domain in the calling window. for idn host names only, the value of the origin property is not consistently
unicode or punycode; for greatest compatibility check for both the idn and punycode values when using this property if you expect messages from idn sites. this value will eventually be consistently idn, but for now you should handle both idn and punycode forms. the value of the origin property when the sending window contains a javascript: or data: url is the origin of the script that loaded the url. u...
WindowOrWorkerGlobalScope.atob() - Web APIs
workerglobalscope.atob() function decodes a string of data which has been encoded using base64 encoding. you can use the btoa() method to encode and transmit data which may otherwise cause communication problems, then transmit it and use the atob() method to decode the data again. for example, you can encode, transmit, and decode control characters such as ascii values 0 through 31. for use with
unicode or utf-8 strings, see the note on "
unicode strings" in the page for btoa(). syntax var decodeddata = scope.atob(encodeddata); parameters encodeddata a binary string contains an base64 encoded data. return value an ascii string containing decoded data from encodeddata. exceptions domexception (name: invalidcharactererror) throws if encodeddata is not valid base64. example const e...
Text labels and names - Accessibility
vide the same title in both places. example <iframe title="mdn web docs" width="300" height="200" src="https://developer.mozilla.org"> </iframe> use alt attribute to label mglyph elements when writing equations with mathml, give each <mglyph> element an alt attribute containing a name that describes the symbol. since mglyph elements are used for non-standard symbols without
unicode definitions, screen readers won't automatically be able to name them. alternative text helps users of screen readers understand the symbol. headings must be labeled make sure that your headings have non-empty text content, and are not hidden, such as with css display:none or aria-hidden=true. users of screen readers rely on headings to understand the structure and content of a document. also, ...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
st letter of the first line of a block-level element, but only when not preceded by other content (such as images or inline tables). /* selects the first letter of a <p> */ p::first-letter { font-size: 130%; } the first letter of an element is not always trivial to identify: punctuation that precedes or immediately follows the first letter is included in the match. punctuation includes any
unicode character defined in the open (ps), close (pe), initial quote (pi), final quote (pf), and other punctuation (po) classes. some languages have digraphs that are always capitalized together, like the ij in dutch. in these cases, both letters of the digraph should be matched by the ::first-letter pseudo-element. (this is poorly supported by browsers; see the browser compatibility table below.) a c...
::marker - CSS: Cascading Style Sheets
f a list item, which typically contains a bullet or number. it works on any element or pseudo-element set to display: list-item, such as the <li> and <summary> elements. ::marker { color: blue; font-size: 1.2em; } allowable properties only certain css properties can be used in a rule with ::marker as a selector: all font properties the white-space property color text-combine-upright,
unicode-bidi and direction properties the content property all animation and transition properties the specification states that additional css properties may be supported in future. syntax ::marker examples html <ul> <li>peaches</li> <li>apples</li> <li>plums</li> </ul> css ul li::marker { color: red; font-size: 1.5em; } result specifications specification status ...
:lang() - CSS: Cascading Style Sheets
r <language-code> a <string> representing the language you want to target. acceptable values are specified in the html spec. examples in this example, the :lang() pseudo-class is used to match the parents of quote elements (<q>) using child combinators. note that this doesn't illustrate the only way to do this, and that the best method to use depends on the type of document. also note that
unicode values are used to specify some of the special quote characters. html <div lang="en"><q>this english quote has a <q>nested</q> quote inside.</q></div> <div lang="fr"><q>this french quote has a <q>nested</q> quote inside.</q></div> <div lang="de"><q>this german quote has a <q>nested</q> quote inside.</q></div> css :lang(en) > q { quotes: '\201c' '\201d' '\2018' '\2019'; } :lang(fr) > q { quot...
prefers-reduced-data - CSS: Cascading Style Sheets
sorigin> <link rel="stylesheet" href="style.css"> </head> css @media (prefers-reduced-data: no-preference) { @font-face { font-family: montserrat; font-style: normal; font-weight: 400; font-display: swap; /* latin */ src: local('montserrat regular'), local('montserrat-regular'), url('fonts/montserrat-regular.woff2') format('woff2');
unicode-range: u+0000-00ff, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+2000-206f, u+2074, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215, u+feff, u+fffd; } } body { font-family: montserrat, -apple-system, blinkmacsystemfont, "segoe ui", roboto, helvetica, arial, "microsoft yahei", sans-serif, "apple color emoji", "segoe ui emoji", "segoe ui symbol"; } result specifications ...
CSS Writing Modes - CSS: Cascading Style Sheets
ule that defines various international writing modes, such as left-to-right (e.g. used by latin and indic scripts), right-to-left (e.g. used by hebrew or arabic scripts), bidirectional (used when mixing left-to-right and right-to-left scripts) and vertical (e.g. used by some asian scripts). ...
CSS reference - CSS: Cascading Style Sheets
ntext-overflowtext-renderingtext-shadowtext-transformtext-underline-offsettext-underline-position<time><time-percentage><timing-function>top@top-centertouch-actiontransformtransform-box<transform-function>transform-origintransform-styletransitiontransition-delaytransition-durationtransition-propertytransition-timing-functiontranslatetranslate()translate3d()translatex()translatey()translatez()turnu
unicode-bidi
unicode-range (@font-face)unset<url>url()user-zoom (@viewport)v:validvar()vertical-alignvh@viewportviewport-fit (@viewport)visibility:visitedvmaxvminvwwwhite-spacewidowswidthwidth (@viewport)will-changeword-breakword-spacingword-wrapwriting-modexxzz-indexzoom (@viewport)others--* selectors the following are the various selectors, which allow styles to be conditional based on various featur...
content - CSS: Cascading Style Sheets
*/ content: open-quote chapter_counter; /* global values */ content: inherit; content: initial; content: unset; syntax values none the pseudo-element is not generated. normal computes to none for the ::before and ::after pseudo-elements. <string> specifies the "alt text" for the element. this value can be any number of text characters. non-latin characters must be encoded using their
unicode escape sequences: for example, \000a9 represents the copyright symbol. <image> an <image>, denoted by the <url> or <gradient> data type, or part of the webpage, defined by the element() function, denoting the content to display. <counter>() the value of a css counter, generally a number. it can be displayed using either the counter() or counters() function. the counter() function has two f...
counters() - CSS: Cascading Style Sheets
unter-style> a counter style name or symbols() function, where a counter style name is a numeric, alphabetic, or symbolic simple predefined counter style, a complex longhand east asian or ethiopic predefined counter style, or other predefined counter style. if omitted, the counter-style defaults to decimal <string> any number of text characters. non-latin characters must be encoded using their
unicode escape sequences: for example, \000a9 represents the copyright symbol. formal syntax counters( <custom-ident>, <string>, <counter-style>? )where <counter-style> = <counter-style-name> | symbols()where <counter-style-name> = <custom-ident> examples default value compared to upper roman html <ol> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> <li...
font-family - CSS: Cascading Style Sheets
e last item in the list of font family names. the following keywords are defined: serif glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings. e.g. lucida bright, lucida fax, palatino, "palatino linotype", palladio, "urw palladio", serif. sans-serif glyphs have stroke endings that are plain. e.g. "open sans", "fira sans", "lucida sans", "lucida sans
unicode", "trebuchet ms", "liberation sans", "nimbus sans l", sans-serif. monospace all glyphs have the same fixed width. e.g. "fira mono", "dejavu sans mono", menlo, consolas, "liberation mono", monaco, "lucida console", monospace. cursive glyphs in cursive fonts generally have either joining strokes or other cursive characteristics beyond those of italic typefaces. the glyphs are partially or...
font-variant-alternates - CSS: Cascading Style Sheets
mapped to a number. it corresponds to the opentype values swsh and cswh, like swsh 2 and cswh 2. ornaments() this function enables ornaments, like fleurons and other dingbat glyphs. the parameter is a font-specific name mapped to a number. it corresponds to the opentype value ornm, like ornm 2. note: in order to preserve text semantics, font designers should include ornaments that don't match
unicode dingbat characters as ornamental variants of the bullet character (u+2022). be aware that some existing fonts don't follow this advice. annotation() this function enables annotations, like circled digits or inverted characters. the parameter is a font-specific name mapped to a number. it corresponds to the opentype value nalt, like nalt 2. formal definition initial valuenormalapplies toall...
hyphens - CSS: Cascading Style Sheets
line break opportunities below) will override automatic break point selection when present. note: the auto setting's behavior depends on the language being properly tagged to select the appropriate hyphenation rules. you must specify a language using the lang html attribute to guarantee that automatic hyphenation is applied in that language. suggesting line break opportunities there are two
unicode characters used to manually specify potential line break points within text: u+2010 (hyphen) the "hard" hyphen character indicates a visible line break opportunity. even if the line is not actually broken at that point, the hyphen is still rendered. u+00ad (shy) an invisible, "soft" hyphen. this character is not rendered visibly; instead, it marks a place where the browser should break the ...
<integer> - CSS: Cascading Style Sheets
egative integer 0 zero +0 zero, with a leading + -0 zero, with a leading - invalid integers 12.0 this is a <number>, not an <integer>, though it represents an integer. 12. decimal points are not allowed. +---12 only one leading +/- is allowed. ten letters are not allowed. _5 special characters are not allowed. \35 escaped
unicode characters are not allowed, even if they are an integer (here: 5). \4e94 non-arabic numerals are not allowed, even when escaped (here: the japanese 5, 五). 3e4 scientific notation is not allowed. specifications specification status comment css values and units module level 4the definition of '<integer>' in that specification. editor's draft no s...
<length> - CSS: Cascading Style Sheets
in an element or its parent. note: these units, especially em and rem, are often used to create scalable layouts, which maintain the vertical rhythm of the page even when the user changes the font size. cap represents the "cap height" (nominal height of capital letters) of the element’s font. ch represents the width, or more precisely the advance measure, of the glyph "0" (zero, the
unicode character u+0030) in the element's font. in the cases where it is impossible or impractical to determine the measure of the “0” glyph, it must be assumed to be 0.5em wide by 1em tall. em represents the calculated font-size of the element. if used on the font-size property itself, it represents the inherited font-size of the element. ex represents the x-height of the element's font. on ...
<ratio> - CSS: Cascading Style Sheets
the <ratio> css data type, used for describing aspect ratios in media queries, denotes the proportion between two unitless values. syntax in media queries level 3, the <ratio> data type consisted of a strictly positive <integer> followed by a forward slash ('/',
unicode u+002f solidus) and a second strictly positive <integer>. spaces before and after the slash are optional. the first number represents the width, while the second represents the height. in media queries level 4, the <ratio> date type is updated to consist of a strictly positive <number> followed by a forward slash ('/',
unicode u+002f solidus) and a second strictly positive <number>. in addition a single <number> as a value is allowable. examples use in a media query @media screen and (min-aspect-ratio: 16/9) { ... } common...
text-decoration-skip - CSS: Cascading Style Sheets
global values */ text-decoration-skip: inherit; text-decoration-skip: initial; text-decoration-skip: unset; syntax values none nothing is skipped. thus, text decoration is drawn for all text content and across atomic inline-level boxes. objects the entire margin box of the element is skipped if it is an atomic inline such as an image or inline-block. spaces all spacing is skipped: all
unicode white space characters and all word separators, plus any adjacent letter-spacing or word-spacing. leading-spaces the same as spaces, except that only leading spaces are skipped. trailing-spaces the same as spaces, except that only trailing spaces are skipped. edges the start and end of the text decoration is inset slightly (e.g., by half of the line thickness) from the content edge of the d...
HTML attribute: pattern - HTML: Hypertext Markup Language
the pattern attribute, when specified, is a regular expression which the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of
unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also include othe...
<input type="number"> - HTML: Hypertext Markup Language
a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. the text must not include carriage returns or line feeds. if the control's content has one directionality (ltr or rtl) but needs to present the placeholder in the opposite directionality, you can use
unicode bidirectional algorithm formatting characters to override directionality within the placeholder; see overriding bidi using
unicode control characters in the
unicode bidirectional text algorithm for those characters. note: avoid using the placeholder attribute if you can. it is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your cont...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
the pattern attribute, when specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of
unicode code points, instead of as ascii. no forward slashes should be specified around the pattern text. if the pattern attribute is present but is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. if the pattern attribute is valid and a non-empty value does not match the pattern, constraint validation will prevent form submission. tip: if usin...
<wbr> - HTML: Hypertext Markup Language
tag. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. notes on utf-8 encoded pages, <wbr> behaves like the u+200b zero-width space code point. in particular, it behaves like a
unicode bidi bn code point, meaning it has no effect on bidi-ordering: <div dir=rtl>123,<wbr>456</div> displays, when not broken on two lines, 123,456 and not 456,123. for the same reason, the <wbr> element does not introduce a hyphen at the line break point. to make a hyphen appear only at the end of a line, use the soft hyphen character entity (­) instead. this element was first implemen...
dir - HTML: Hypertext Markup Language
the element until it finds a character with a strong directionality, then applies that directionality to the whole element. usage notes: this attribute is mandatory for the <bdo> element where it has a different semantic meaning. this attribute is not inherited by the <bdi> element. if not set, its value is auto. this attribute can be overridden by the css properties direction and
unicode-bidi, if a css page is active and the element supports these properties. as the directionality of the text is semantically related to its content and not to its presentation, it is recommended that web developers use this attribute instead of the related css properties when possible. that way, the text will display correctly even on a browser that doesn't support css or has the css deactiva...
A re-introduction to JavaScript (JS tutorial) - JavaScript
a character that isn't valid for the specified number format, then return the number parsed up to that point. however the "+" operator simply converts the string to nan if there is an invalid character contained within it. just try parsing the string "10.2abc" with each method by yourself in the console and you'll understand the differences better. strings strings in javascript are sequences of
unicode characters. this should be welcome news to anyone who has had to deal with internationalization. more accurately, they are sequences of utf-16 code units; each code unit is represented by a 16-bit number. each
unicode character is represented by either 1 or 2 code units. if you want to represent a single character, you just use a string consisting of that single character. to find the length of...
Expressions and operators - JavaScript
destructuring var one = foo[0]; var two = foo[1]; var three = foo[2]; // with destructuring var [one, two, three] = foo; comparison operators a comparison operator compares its operands and returns a logical value based on whether the comparison is true. the operands can be numerical, string, logical, or object values. strings are compared based on standard lexicographical ordering, using
unicode values. in most cases, if the two operands are not of the same type, javascript attempts to convert them to an appropriate type for the comparison. this behavior generally results in comparing the operands numerically. the sole exceptions to type conversion within comparisons involve the === and !== operators, which perform strict equality and inequality comparisons. these operators do not attemp...
SyntaxError: invalid regular expression flag "x" - JavaScript
them in ecmascript. to include a flag with the regular expression, use this syntax: var re = /pattern/flags; or var re = new regexp('pattern', 'flags'); regular expression flags flag description g global search. i case-insensitive search. m multi-line search. s allow . to match newlines (added in ecmascript 2018) u
unicode; treat pattern as a sequence of
unicode code points y perform a "sticky" search that matches starting at the current position in the target string. see sticky examples there are only six valid regular expression flags. /foo/bar; // syntaxerror: invalid regular expression flag "b" did you intend to create a regular expression? an expression containing two slashes is interpr...
RangeError: argument is not a valid code point - JavaScript
er than 0x10ffff (1114111) are used with string.fromcodepoint(). message rangeerror: {0} is not a valid code point (firefox) rangeerror: invalid code point {0} (chromium) error type rangeerror what went wrong? string.fromcodepoint() throws this error when passed nan values, negative integers (-1), non-integers (5.4), or values larger than 0x10ffff (1114111). a code point is a value in the
unicode codespace; that is, the range of integers from 0 to 0x10ffff. examples invalid cases string.fromcodepoint('_'); // rangeerror string.fromcodepoint(infinity); // rangeerror string.fromcodepoint(-1); // rangeerror string.fromcodepoint(3.14); // rangeerror string.fromcodepoint(3e-2); // rangeerror string.fromcodepoint(nan); // rangeerror valid cases string.fromcodepoint(...
Intl.DateTimeFormat() constructor - JavaScript
github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.datetimeformat([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings. to use the browser's default locale, omit this argument or pass undefined.
unicode extension are supported (for example "en-us-u-ca-buddhist"). for the general form and interpretation of the locales argument, see the intl page. the following
unicode extension keys are allowed: nu numbering system. possible values include: "arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
teractive-examples and send us a pull request. syntax datetimeformat.resolvedoptions() return value a new object with properties reflecting the locale and date and time formatting options computed during the initialization of the given datetimeformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any
unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. calendar e.g. "gregory" numberingsystem the values requested using the
unicode extension keys "ca" and "nu" or filled in as default values. timezone the value provided for this property in the options argu...
Intl.DisplayNames() constructor - JavaScript
you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.displaynames([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings. for the general form and interpretation of the locales argument, see the intl page. the following
unicode extension key is allowed: nu the numbering system to be used. possible values include: "arab", "arabext", "bali", "beng", "deva", "fullwide", "gujr", "guru", "hanidec", "khmr", "knda", "laoo", "latn", "limb", "mlym", "mong", "mymr", "orya", "tamldec", "telu", "thai", "tibt". options optional an object with some or all of the following properties: localematcher the locale mat...
Intl.DisplayNames.prototype.of() - JavaScript
meters code the code to provide depends on the type: if the type is "region", code should be either an iso-3166 two letters region code, or a three digits un m49 geographic regions. if the type is "script", code should be an iso-15924 four letters script code. if the type is "language", code should be a languagecode ["-" scriptcode] ["-" regioncode ] *("-" variant ) subsequence of the
unicode_language_id grammar in uts 35's
unicode language and locale identifiers grammar. languagecode is either a two letters iso 639-1 language code or a three letters iso 639-2 language code. if the type is "currency", code should be a 3-letter iso 4217 currency code. return value a language-specific formatted string. examples using the of method let regionnames = new intl.displaynames(['en...
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
construction of the current displaynames object. syntax displaynames.resolvedoptions() return value an object with properties reflecting the locale and formatting options computed during the construction of the given displaynames object. description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any
unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the value provided for this property in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this propert...
Intl.ListFormat.prototype.resolvedOptions() - JavaScript
ng the construction of the current listformat object. syntax listformat.resolvedoptions() return value an object with properties reflecting the locale and formatting options computed during the construction of the given listformat object. description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any
unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. style the value provided for this property in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this propert...
Intl.Locale.prototype.baseName - JavaScript
ocale object represents a parsed local and options for that locale. the basename property returns basic, core information about the locale in the form of a substring of the complete data string. specifically, the property returns the substring containing the language, and the script and region if available. basename returns the language ["-" script] ["-" region] *("-" variant) subsequence of the
unicode_language_id grammar. examples basic example let myloc = new intl.locale("fr-latn-ca"); // sets locale to canadian french console.log(myloc.tostring()); // prints out "fr-latn-ca-u-ca-gregory" console.log(myloc.basename); // prints out "fr-latn-ca" example with options in the input string // sets language to japanese, region to japan, // calendar to gregorian, hour cycle to 24 hours let japa...
Intl.Locale.prototype.caseFirst - JavaScript
asefirst property. there are 3 values that the casefirst property can have, outlined in the table below. casefirst values value description upper upper case to be sorted before lower case. lower lower case to be sorted before upper case. false no special case ordering. examples setting the casefirst value via the locale string in the
unicode locale string spec, the values that casefirst represents correspond to the key kf. kf is treated as a locale string "extension subtag". these subtags add additional data about the locale, and are added to locale identifiers by using the -u extension key. thus, the casefirst value can be added to the inital locale identifier string that is passed into the locale constructor. to add the casefirst v...
Intl.Locale.prototype.hourCycle - JavaScript
h11 hour system using 0–11; corresponds to 'k' in patterns. the 12 hour clock, with midnight starting at 0:00 am. h24 hour system using 1–24; corresponds to 'k' in pattern. the 24 hour clock, with midnight starting at 24:00. examples these examples will show you how to add hour cycle data to your locale object. adding an hour cycle via the locale string in the
unicode locale string spec, the hour cycle is a locale string "extension subtag". these subtags add additional data about the locale, and are added to locale identifiers by using the -u extension key. thus, the hour cycle type can be added to the inital locale identifier string that is passed into the locale constructor. to add the hour cycle type, first add the -u extension key to the string. next, add ...
Intl.Locale.prototype.numeric - JavaScript
ill be no special handling of numeric values in strings. if numeric is set to true, then the locale will take numeric characters into account when collating strings. this special numeric handling means that sequences of decimal digits will be compared as numbers. for example, the string "a-21" will be considered less than "a-123". examples setting the numeric value via the locale string in the
unicode locale string spec, the values that numeric represents correspond to the key kn. kn is considered a locale string "extension subtag". these subtags add additional data about the locale, and are added to locale identifiers by using the -u extension key. thus, the numeric value can be added to the inital locale identifier string that is passed into the locale constructor. to set the numeric value, ...
Intl.Locale.prototype.region - JavaScript
a, but there are differences in spelling and other language conventions between those two countries. knowing the locale's region helps javascript programmers make sure that the content from their sites and applications is correctly displayed when viewed from different areas of the world. examples setting the region in the locale identifer string argument the region is the third part of a valid
unicode language identifier string, and can be set by adding it to the locale identifier string that is passed into the locale constructor. the region is a mandatory part of a let regionstr = new intl.locale("en-latn-us"); console.log(regionstr.region); // prints "us" setting the region via the configuration object the locale constructor takes a configuration object, which can be used to set the regi...
Intl.Locale.prototype.script - JavaScript
nguage. for instance, the script associated with english is latin, whereas the script typically associated with korean is hangul. in many cases, denoting a script is not strictly necessary, since the language (which is necessary) is only written in a single script. there are exceptions to this rule, however, and it is important to indicate the script whenever possible, in order to have a complete
unicode language identifier. examples setting the script in the locale identifer string argument the script is the second part of a valid
unicode language identifier string, and can be set by adding it to the locale identifier string that is passed into the locale constructor. note that the script is not a required part of a locale identifier. let scriptstr = new intl.locale("en-latn-us"); console.l...
Intl.Locale.prototype.toString() - JavaScript
the intl.locale.prototype.tostring() returns the locale's full locale identifier string. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax locale.tostring() return value the locale's
unicode locale identifier string. description the locale object is a javascript representation of a concept
unicode locale identifier. information about a particular locale (language, script, calendar type, etc.) can be encoded in a locale identifier string. to make it easier to work with these locale identifiers, the locale object was introduced to javascript. calling the tostring method on a locale object will return the identi...
Intl.Locale - JavaScript
the intl.locale object is a standard built-in property of the intl object that represents a
unicode locale identifier. description the intl.locale object was created to allow for easier manipulation of
unicode locales.
unicode represents locales with a string, called a locale identifier. the locale identifier consists of a language identifier and extension tags. language identifiers are the core of the locale, consisting of language, script, and region subtags. additional information about the locale is stored in the optional extension tags. extension tags hold information about locale aspects such as calendar type, clock type, and numbering system type. traditionally, the intl api used strings to represent locales, just as
unicode does. this is a simple and lightweight solution that works ...
Intl.NumberFormat() constructor - JavaScript
you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new intl.numberformat([locales[, options]]) parameters locales optional a string with a bcp 47 language tag, or an array of such strings. for the general form and interpretation of the locales argument, see the intl page. the following
unicode extension key is allowed: nu the numbering system to be used. possible values include: "adlm", "ahom", "arab", "arabext", "bali", "beng", "bhks", "brah", "cakm", "cham", "deva", "diak", "fullwide", "gong", "gonm", "gujr", "guru", "hanidec", "hmng", "hmnp", "java", "kali", "khmr", "knda", "lana", "lanatham", "laoo", "latn", "lepc", "limb", "mathbold", "mathdbl", "mathmono", "mathsanb", "mat...
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
.com/mdn/interactive-examples and send us a pull request. syntax numberformat.resolvedoptions() return value a new object with properties reflecting the locale and number formatting options computed during the initialization of the given numberformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any
unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. numberingsystem the value provided for this properties in the options argument, if present, or the value requested using the
unicode extension key "nu" or filled in as a default. notation the value provided ...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
s computed during initialization of this pluralrules object. syntax pluralrule.resolvedoptions() return value a new object with properties reflecting the locale and plural formatting options computed during the initialization of the given pluralrules object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any
unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. pluralcategories an array of plural categories used by the given locale, seleced from the list "zero", "one", "two", "few", "many" and "other". type the type used (cardinal or ordinal). only one of the fol...
JSON.parse() - JavaScript
if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } } return reviver.call(holder, key, value); } // parsing happens in four stages. in the first stage, we replace certain //
unicode characters with escape sequences. javascript handles many characters // incorrectly, either silently deleting them, or treating them as line endings. text = string(text); rx_dangerous.lastindex = 0; if (rx_dangerous.test(text)) { text = text.replace(rx_dangerous, function(a) { return ( "\\u" + ("0...
Proxy - JavaScript
ctic purposes, we will try to proxify a non-native object that is particularly suited to this type of operation: the doccookies global object created by the "little framework" published on the document.cookie page. /* var doccookies = ... ...
RegExp() constructor - JavaScript
ct's flags (and lastindex will be reset to 0) (as of es2015). if flags is not specified and a regular expressions object is supplied, that object's flags (and lastindex value) will be copied over. flags may contain any combination of the following characters: g (global match) find all matches rather than stopping after the first match. i (ignore case) if u flag is also enabled, use
unicode case folding. m (multiline) treat beginning and end characters (^ and $) as working over multiple lines. in other words, match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole input string. s ("dotall") allows . to match newlines. u (
unicode) treat pattern as a sequence of
unicode code points. (see also binary strings). y (st...
RegExp.prototype.dotAll - JavaScript
was used; otherwise, false. the "s" flag indicates that the dot special character (".") should additionally match the following line terminator ("newline") characters in a string, which it would not match otherwise: u+000a line feed (lf) ("\n") u+000d carriage return (cr) ("\r") u+2028 line separator u+2029 paragraph separator this effectively means the dot will match any character on the
unicode basic multilingual plane (bmp). to allow it to match astral characters, the "u" (
unicode) flag should be used. using both flags in conjunction allows the dot to match any
unicode character, without exceptions. you cannot change this property directly. examples using dotall var str1 = 'bar\nexample foo example'; var regex1 = new regexp('bar.example','s'); console.log(regex1.dotall); // outpu...
String.prototype.codePointAt() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.codepointat(pos) parameters pos position of an element in str to return the code point value from. return value a number representing the code point value of the character at the given pos. if there is no element at pos, returns undefined. description if there is no element at the specified position, undefined is returned. ...
String.fromCharCode() - JavaScript
omcharcode() is a static method of string, you always use it as string.fromcharcode(), rather than as a method of a string object you created. returning supplementary characters in utf-16, the most common characters can be represented by a single 16-bit value (i.e. a code unit). however, this set of characters, known as the base multilingual plane (bmp), is only 1/17th of the total addressable
unicode code points. the remaining code points, in the range of 65536 (0x010000) to 1114111 (0x10ffff) are known as supplementary characters. in utf-16, supplementary characters are represented by two 16-bit code units, known as surrogates, that were reserved for this purpose. a valid combination of two surrogates used to represent a supplementary character is known as a surrogate pair. because fromchar...
String.fromCodePoint() - JavaScript
itory. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax string.fromcodepoint(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of code points. return value a string created by using the specified sequence of code points. exceptions a rangeerror is thrown if an invalid
unicode code point is given (e.g. "rangeerror: nan is not a valid code point"). description this method returns a string (and not a string object). because fromcodepoint() is a static method of string, you must call it as string.fromcodepoint(), rather than as a method of a string object you created. polyfill the string.fromcodepoint() method has been added to ecmascript 2015 and may not be suppor...
String length - JavaScript
nts. previously, no maximum length was specified. in firefox, strings have a maximum length of 2**30 - 2 (~1gb). in versions prior to firefox 65, the maximum length was 2**28 - 1 (~256mb). for an empty string, length is 0. the static property string.length is unrelated to the length of strings, it's the arity of the string function (loosely, the number of formal parameters it has), which is 1. ...
String.prototype.toLocaleLowerCase() - JavaScript
type string. description the tolocalelowercase() method returns the value of the string converted to lower case according to any locale-specific case mappings. tolocalelowercase() does not affect the value of the string itself. in most cases, this will produce the same result as tolowercase(), but for some locales, such as turkish, whose case mappings do not follow the default case mappings in
unicode, there may be a different result. examples using tolocalelowercase() 'alphabet'.tolocalelowercase(); // 'alphabet' '\u0130'.tolocalelowercase('tr') === 'i'; // true '\u0130'.tolocalelowercase('en-us') === 'i'; // false let locales = ['tr', 'tr', 'tr-tr', 'tr-u-co-search', 'tr-x-turkish']; '\u0130'.tolocalelowercase(locales) === 'i'; // true specifications specification ...
String.prototype.toLocaleUpperCase() - JavaScript
type string. description the tolocaleuppercase() method returns the value of the string converted to upper case according to any locale-specific case mappings. tolocaleuppercase() does not affect the value of the string itself. in most cases, this will produce the same result as touppercase(), but for some locales, such as turkish, whose case mappings do not follow the default case mappings in
unicode, there may be a different result. also notice that conversion is not necessarily a 1:1 character mapping, as some characters might result in two (or even more) characters when transformed to upper-case. therefore the length of the result string can differ from the input length. this also implies that the conversion is not stable, so i.e. the following can return false: x.tolocalelowercase() ===...
escape() - JavaScript
writing new ecmascript code. … the escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. 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". (hh are two hexadecimal digits, and the form \xhh\xhh is used for higher-plane
unicode characters.) escaped characters in string literals can be expanded by replacing the \x with %, then using the decodeuricomponent() function. syntax escape(str) parameters str a string to be encoded. return value a new string in which certain characters have been escaped. description the escape function is a property of the global object. special characters are encoded with the excep...
Less than (<) - JavaScript
ples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax x < y description the operands are compared using the abstract relational comparison algorithm, which is roughly summarised below: first, objects are converted to primitives using symbol.toprimitive. if both values are strings, they are compared as strings, based on the values of the
unicode code points they contain. otherwise javascript attempts to convert non-numeric types to numeric values: boolean values true and false are converted to 1 and 0 respectively. null is converted to 0. undefined is converted to nan. strings are converted based on the values they contain, and are converted as nan if they do not contain numeric values. if either value is nan, the o...
dir - Web app manifests
together with the lang member, it helps to correctly display right-to-left languages. the dir member can be set to one of the following values: auto — text direction is determined by the user agent ltr — left to right rtl — right to left the directionality-capable members are: name short_name description note: if the value is omitted or set to auto, the browser will use the
unicode bidirectional algorithm to make a best guess about the text's direction. example "dir": "rtl", "lang": "ar", "short_name": "!أنا من التطبيق" specification specification status comment feedback web app manifestthe definition of 'dir' in that specification. working draft initial definition. web app manifest wor...
Authoring MathML - MathML
editors and other content management systems to help writing web pages. mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to require their own tags. as a consequence, good mathml authoring tools are more important and we describe some tools below. 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. of course, the list is by no means exhaustive and you are invited to check out the w3c mathml software list where you can find various other tools. note that by design, mathml is well-integrated in html5 and in particular you can use usual web features like css, dom, javascript or svg. this is out of the scop...
<mglyph> - MathML
it may be used within token elements. attributes alt this attribute defines the alternative text describing the image. users will see this displayed if the image url is wrong, the image is not in one of the supported formats, or until the image is downloaded. class, id, style provided for use with stylesheets. height the height of the image. href used to set a hyperlink to a specified uri. mathbackground the background color (if the image has transparency). you can use #rgb, #rrggbb and html color names. src the image url. ...
MathML documentation index - MathML
emoved from the latest mathml standard and modern browsers no longer support it. 15 <mfrac> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mfrac> element is used to display fractions. 16 <mglyph> mathml, mathml reference, mathml:element the mathml <mglyph> element is used to display non-standard symbols where existing
unicode characters are not available. it may be used within token elements. 17 <mi> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants. you can also have arbitrary text in it to mark up terms. 18 <mlabeledtr> mathml...
direction - SVG: Scalable Vector Graphics
the direction attribute specifies the inline-base direction of a <text> or <tspan> element. it defines the start and end points of a line of text as used by the text-anchor and inline-size properties. it also may affect the direction in which characters are positioned if the
unicode-bidi property's value is either embed or bidi-override. it applies only to glyphs oriented perpendicular to the inline-base direction, which includes the usual case of horizontally-oriented latin or arabic text and the case of narrow-cell latin or arabic characters rotated 90 degrees clockwise relative to a top-to-bottom inline-base direction. in many cases, the bidirectional
unicode algorithm produces the desired result automatically, so this attribute doesn't need to be specified in those cases. for other cases, ...
writing-mode - SVG: Scalable Vector Graphics
the writing-mode attribute specifies whether the initial inline-progression-direction for a <text> element shall be left-to-right, right-to-left, or top-to-bottom. the writing-mode attribute applies only to <text> elements; the attribute is ignored for <tspan>, <tref>, <altglyph> and <textpath> sub-elements. (note that the inline-progression-direction can change within a <text> element due to the
unicode bidirectional algorithm and properties direction and
unicode-bidi.) note: as a presentation attribute, writing-mode can be used as a css property. see the css writing-mode property for more information. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> usage notes de...
Content type - SVG: Scalable Vector Graphics
> a <transform-list> is used to specify a list of coordinate system transformations. a detailed description of the possible values for a <transform-list> is given in the transform attribute definition. within the svg dom, a <transform-list> value is represented using an svgtransformlist or svganimatedtransformlist object. url url a uniform resource locator. a url is a sequence of
unicode characters, building an address to an internal or external resource. before svg 2, the more limited iri content type was used instead, because the url specification was not standardized before. ...
<font-face> - SVG: Scalable Vector Graphics
e <font-face> svg element corresponds to the css @font-face rule. it defines a font's outer properties. usage context categoriesfont elementpermitted contentany number of descriptive elements » and at most one <font-face> element, in any order. ...