Search completed in 1.01 seconds.
1309 results for "language":
Your results are loading. Please wait...
NavigatorLanguage.languages - Web APIs
the navigatorlanguage.languages read-only property returns an array of domstrings representing the user's preferred languages. the language is described using bcp 47 language tags. in the returned array they are ordered by preference with the most preferred language first. the value of navigator.language is the first element of the returned array. when its value changes, as the user's preferred languages are changed a languagechange event is fired on the window object. the accept-language http header in every http request from the user's browser uses the same value for the navigator.languages property except for the extra qvalues (quality values) field (e.g. en-us;q=0.8). ...
...uage is the first element of the returned array. when its value changes, as the user's preferred languages are changed a languagechange event is fired on the window object. the accept-language http header in every http request from the user's browser uses the same value for the navigator.languages property except for the extra qvalues (quality values) field (e.g. en-us;q=0.8). syntax preferredlanguages = globalobj.navigator.languages examples navigator.language //"en-us" navigator.languages //["en-us", "zh-cn", "ja-jp"] specifications specification status comment html living standardthe definition of 'navigatorlanguage: languages' in that specification. living standard initial definition ...
NavigatorLanguage.language - Web APIs
the navigatorlanguage.language read-only property returns a string representing the preferred language of the user, usually the language of the browser ui. syntax const lang = navigator.language value a domstring. lang stores a string representing the language version as defined in bcp 47. examples of valid language codes include "en", "en-us", "fr", "fr-fr", "es-es", etc. note that in safari on ios prior to 10.2, the country code returned is lowercase: "en-us", "fr-fr" etc. example if (/^en\b/.test(navigator.language)) { dolangselect(window.navigator.language); } specifications specification status comment html living standardthe definition of 'navigatorlanguage: language' in that specification. living standard initial definition ...
Mozilla Content Localized in Your Language
this section of the style guide is for you to author. the content here should be what you and your localization team have decided, together, to follow when localizing mozilla products and web sites. you are free to add, edit, remove, and localize everything in this section according to how the localization team for your language agrees. ...
...ded, together, to follow when localizing mozilla products and web sites. you are free to add, edit, remove, and localize everything in this section according to how the localization team for your language agrees. all we ask is that you name this page according to this example, "mozilla content in spanish (es-mx)" and add your locale code tag at the bottom. enjoy developing your style guide! your language's style guide abbreviations how are abbreviations expressed in your language? numerals and metrics how are numerals and metrics expressed in your language? formal and informal forms, and separators (, or .) date format what are the date formats for weeks and months are expressed in the following forms: 1)fully spelled out, 2). 2 or 3 letters and 3). single letter. and what is the order o...
...and months are expressed in the following forms: 1)fully spelled out, 2). 2 or 3 letters and 3). single letter. and what is the order of year, month and day? reference material can be find here calendar calendar view: which date is considered the first day of the week, sunday or monday? is lunar calendar observed? other regional calendar observed? time format how is time expressed in your language? including 0-24 hr expression, hour, minute and second. percentages how are percentages expressed in your language? digit groups how are digit groups expressed in your language? example: 1.23 (decimal separator) or 1,000 (thousand separator) using comma or period. acronyms do you translate widely accepted acronyms such as cd, dvd, mb? if translated, is there an equavilent acronym and wid...
...And 9 more matches
Videotrack.language - Web APIs
for brazilian portuguese, the value would be "pt-br". ...
...for brazilian portuguese, the value would be "pt-br". ...
...for brazilian portuguese, the value would be "pt-br". ...
...And 7 more matches
Accept-Language - HTTP
the accept-language request http header advertises which languages the client is able to understand, and which locale variant is preferred. (by languages, we mean natural languages, such as english, and not programming languages.) using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-language response header. browsers set adequate values for this header according to their user interface language and even if a user can change it, this happens rarely (and is frowned upon as it leads to fingerprinting). this header is a hint to be used when the server has no way of determining the language via another way, like a specific url, that is controlled by an explicit user decision. it is recommended that the server never over...
...interface language and even if a user can change it, this happens rarely (and is frowned upon as it leads to fingerprinting). this header is a hint to be used when the server has no way of determining the language via another way, like a specific url, that is controlled by an explicit user decision. it is recommended that the server never overrides an explicit decision. the content of the accept-language is often out of the control of the user (like when traveling and using an internet cafe in a different country); the user may also want to visit a page in another language than the locale of their user interface. if the server cannot serve any matching language, it can theoretically send back a 406 (not acceptable) error code. but, for a better user experience, this is rarely done and more commo...
...f the user (like when traveling and using an internet cafe in a different country); the user may also want to visit a page in another language than the locale of their user interface. if the server cannot serve any matching language, it can theoretically send back a 406 (not acceptable) error code. but, for a better user experience, this is rarely done and more common way is to ignore the accept-language header in this case. header type request header forbidden header name no cors-safelisted request header yes, with the additional restriction that values can only be 0-9, a-z, a-z, space or *,-.;=. ...
...And 7 more matches
Content-Language - HTTP
the content-language entity header is used to describe the language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language. for example, if "content-language: de-de" is set, it says that the document is intended for german language speakers (however, it doesn't indicate the document is written in german. for example, it might be written in english as part of a language course for german speakers. if you want to indicate which language the document is written in, use the lang attribute instead). if no content-language is specified, the default is that the content is intended for all language audiences. ...
... header type entity header forbidden header name no cors-safelisted response header yes cors-safelisted request header yes, with the additional restriction that values can only be 0-9, a-z, a-z, space or *,-.;=. ...
...is written in german. for example, it might be written in english as part of a language course for german speakers. if you want to indicate which language the document is written in, use the lang attribute instead). if no content-language is specified, the default is that the content is intended for all language audiences. multiple language tags are also possible, as well as applying the content-language header to various media types and not only to textual documents. ...
...And 6 more matches
JavaScript language resources - JavaScript
ecmascript is the scripting language that forms the basis of javascript. ecmascript standardized by the ecma international standards organization in the ecma-262 and ecma-402 specifications. ...
... of javascript. ecmascript standardized by the ecma international standards organization in the ecma-262 and ecma-402 specifications. ...
...this was the first version of the ecmascript standard. ecma-262 2nd edition pdf august 1998 ecm...
...And 6 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Index
2 common xslt errors xslt your server needs to send both the source and the stylesheet with a xml mime type, text/xml or application/xml. ...
... 2 common xslt errors xslt your server needs to send both the source and the stylesheet with a xml mime type, text/xml or application/xml. ...
... 2 common xslt errors xslt your server needs to send both the source and the stylesheet with a xml mime type, text/xml or application/xml. ...
...And 4 more matches
font-language-override - CSS: Cascading Style Sheets
the font-language-override css property controls the use of language-specific glyphs in a typeface. /* keyword value */ font-language-override: normal; /* <string> values */ font-language-override: "eng"; /* use english glyphs */ font-language-override: "trk"; /* use turkish glyphs */ /* global values */ font-language-override: initial; font-language-override: inherit; font-language-override: unset; by default, html's lang attribute tells browsers to display glyphs designed specifically for that language. ...
...rride: "trk"; /* use turkish glyphs */ /* global values */ font-language-override: initial; font-language-override: inherit; font-language-override: unset; by default, html's lang attribute tells browsers to display glyphs designed specifically for that language. for example, a lot of fonts have a special character for the digraph fi that merge the dot on the "i" with the "f." however, if the language is set to turkish the typeface will likely know not to use the merged glyph; turkish has two versions of the "i," one with a dot (i) and one without (ı), and using the ligature would incorrectly transform a dotted "i" into a dotless "i." the font-language-override property lets you override the typeface behavior for a specific language. this is useful, for example, when the typeface you're usin...
... will likely know not to use the merged glyph; turkish has two versions of the "i," one with a dot (i) and one without (ı), and using the ligature would incorrectly transform a dotted "i" into a dotless "i." the font-language-override property lets you override the typeface behavior for a specific language. this is useful, for example, when the typeface you're using lacks proper support for the language. for instance, if a typeface doesn't have proper rules for the azeri language, you can force the font to use turkish glyphs, which follow similar rules. syntax the font-language-override property is specified as the keyword normal or a <string>. values normal tells the browser to use font glyphs that are appropriate for the language specified by the lang attribute. this is the default valu...
...And 3 more matches
lang - HTML: Hypertext Markup Language
the lang global attribute helps define the language of an element: the language that non-editable elements are written in, or the language that the editable elements should be written in by the user. the attribute contains a single “language tag” in the format defined in tags for identifying languages (bcp47). the default value of lang is unknown, therefore it is recommended to always specify this attribute with the appropriate value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...lue of lang is unknown, therefore it is recommended to always specify this attribute with the appropriate value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. if the attribute value is the empty string (lang=""), the language is set to unknown; if the language tag is not valid according to bcp47, it is set to invalid. language tag syntax the full bcp47 syntax is in-depth enough to mark extremely specific language dialects, but most usage is much simpler. a language tag is made of hyphen-separated language subtags, where each subtag indicates a certain property of the language. the 3 most common subtags are: lan...
..., it is set to invalid. language tag syntax the full bcp47 syntax is in-depth enough to mark extremely specific language dialects, but most usage is much simpler. a language tag is made of hyphen-separated language subtags, where each subtag indicates a certain property of the language. the 3 most common subtags are: language subtag required. a 2-or-3-character code that defines the basic language, typically written in all lowercase. for example, the language code for english is en, and the code for badeshi is bdz. script subtag optional. this subtag defines the writing system used for the language, and is always 4 characters long, with the first letter capitalized. ...
...And 3 more matches
systemLanguage - SVG: Scalable Vector Graphics
the systemlanguage attribute represents a list of supported language tags. this list is matched against the language defined in the user preferences. 35 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <audio>, <canvas>, <circle>, <clippath>, <cursor>, <defs>, <discard>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <unknown>, <use>, and <video> usage notes value <language-tags> default value none animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47. systemlanguag...
... animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47. systemlanguage is often used in conjunction with the <switch> element. if the attribute is used in other situations, then it represents a simple switch on the given element whether to render the element or not. note: if several alternative language objects are enclosed in a <switch> and none of them matches, this may lead to situations where no content is displayed. it is thus recommended to include a "catch-all" choice at the end of such a <switch> which is acceptable in all cases. ...
...simple switch on the given element whether to render the element or not. note: if several alternative language objects are enclosed in a <switch> and none of them matches, this may lead to situations where no content is displayed. it is thus recommended to include a "catch-all" choice at the end of such a <switch> which is acceptable in all cases. the attribute evaluates to "true" if one of the language tags indicated by user preferences is a case-insensitive match or prefix (followed by a "-") of one of the language tags given in the value of this parameter. otherwise it evaluates to "false". note: the prefix matching rule does not imply that if a user understands a language with a certain tag, that the user will also understand all languages with the tag as prefix. if the attribute is not pr...
...And 3 more matches
XML: Extensible Markup Language
Web › XML
xml:basexml:base is like the html baseelement but can specify the base uri per element as well as the entire document. ...
... xml:basexml:base is like the html baseelement but can specify the base uri per element as well as the entire document. ...
... xml:basexml:base is like the html baseelement but can specify the base uri per element as well as the entire document. ...
...And 3 more matches
Creating a Language Pack
pre-build steps in the .mozconfig, you want to have mk_add_options moz_objdir=@topsrcdir@/obj-firefox-build ac_add_options --disable-compile-environment ac_add_options --with-l10n-base=../l10n-central # path relative to moz_objdir ac_add_options --enable-application=[browser or mail] the given path should have your localization directory as child (i.e., a subdirectory ab-cd where ab-cd is your locale code). ...
...un this if the version number of firefox changes. windows: replace make with mozmake in the commands below! creating a langpack we will now merge the localized files from x-testing locale with the en-us files from the original source. every time you want to create a langpack, you need to be in the directory obj-firefox-build/browser/locales. it is likely that you will continue to generate language packs as your progress just to test your work. while in that directory, issue the following command: $ make merge-x-testing locale_mergedir=$(pwd)/mergedir x-testing: browser chrome browser aboutcerterror.dtd // add and localize this file ... // lots of notifications about missing entities ... x-testing: changed: 6 missinginfiles: 6124 m...
... following command: $ make merge-x-testing locale_mergedir=$(pwd)/mergedir x-testing: browser chrome browser aboutcerterror.dtd // add and localize this file ... // lots of notifications about missing entities ... x-testing: changed: 6 missinginfiles: 6124 missing: 5 0% of entries changed this step is not necessary anymore to create the language pack, because it is included in the next command. it is only useful if you want to preview the contents of the mergedir. you'll see that it contains the files which in your localization were missing some entities. all other files will be taken from x-testing directly. it's now time to create a langpack with: $ make langpack-x-testing locale_mergedir=$(pwd)/mergedir each time you need to generat...
...-build/browser/locales. $ make langpack-x-testing locale_mergedir=$(pwd)/mergedir now go to the dist directory to find your langpack ready to use! $ cd ../../dist the xpi file can be found in the directory win32/xpi on windows, linux-i686/xpi or linux-x86_64 on linux or mac/xpi on mac. open the xpi file contained in this directory with firefox to see your work. you have to set your selected language still. you can either use the locale switcher extension, or set it in about:config. add the preference intl.locale.requested and set it to your language code, in this case, x-testing, or add it in front of the current setting, seperated with a comma. before gecko 59 you had to set the preference general.useragent.locale to your language code. l10n binary repack for apps currently in development...
Language bindings
an xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings. more specifically, an xpcom language binding: enables access to xpcom objects from that language (where access means reading/writing/creating xpcom objects as well as calling methods on them). exposes modules written in the bound language as xpcom objects, thereby enabling all other languages for which xpcom bindings exist to access these modules. since the xpcom layer itself is written in c/c++, its api can be accessed out-of-the-box using c or c++. ...
... the following bridging layers are currently available: components objectthe components object is the object through which xpconnect functionality is reflected into javascript. ...
...ller.components.utils.waivexrayswaives xray vision for an object, giving the caller a transparent wrapper to the underlying object.javaxpcomjavaxpcom allows for communication between java and xpcom, such that a java application can access xpcom objects, and xpcom can access any java class that implements an xpcom interface. javaxpcom is not actively maintained.plxpcomplxpcom (perl xpcom) provides language bindings letting you use xpcom from perl code. the resources here provide information about this language binding and how to use it.pyxpcompyxpcom allows for communication between python and xpcom, such that a python application can access xpcom objects, and xpcom can access any python class that implements an xpcom interface. pyxpcom is actively used in activestate komodo products, for example.r...
...you can find additional information using the resource links below.xpconnectxpconnect is a bridge between javascript and xpcom. with xpconnect, you can use xpcom components from javascript code, and interact with javascript objects from within xpcom components. xpconnect is part of firefox and is actively used in xul applications. ...
AudioTrack.language - Web APIs
the read-only audiotrack property language returns a string identifying the language used in the audio track. for tracks that include multiple languages (such as a movie in english in which a few lines are spoken in other languages), this should be the video's primary language. syntax var audiotracklanguage = audiotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the audio track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". ...
...t language tag of the primary language used in the audio track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". example this example locates all of a media element's primary language and translated audio tracks and returns a list of objects containing each of those tracks' id, kind, and language. this could then be used to build a user interface for selecting the language the user would like to listen to while watching a movie, for example. ...
... portuguese, the value would be "pt-br". example this example locates all of a media element's primary language and translated audio tracks and returns a list of objects containing each of those tracks' id, kind, and language. this could then be used to build a user interface for selecting the language the user would like to listen to while watching a movie, for example. ...
...ld a user interface for selecting the language the user would like to listen to while watching a movie, for example. function getavailablelanguages(el) { var tracklist = []; const wantedkinds = [ "main", "translation" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, language: track.language }); } }); return tracklist; } specifications specification status comment html living standardthe definition of 'audiotrack.language' in that specification. living standard html5the definition of 'audiotrack.language' in that specification. recommendation ...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
Web › HTML › Element › abbr
r inline text providing the definition. when an abbreviation's presence in the text needs to be semantically noted, the <abbr> element is useful. this can be used, in turn, for styling or scripting purposes. you can use <abbr> in concert with <dfn> to establish definitions for terms which are abbreviations or acronyms. see the example defining an abbreviation below. grammar considerations in languages with grammatical number (that is, languages where the number of items affects the grammar of a sentence), use the same grammatical number in your title attribute as inside your <abbr> element. this is especially important in languages with more than two numbers, such as arabic, but is also relevant in english. default styling the purpose of this element is purely for the convenience of the aut...
... providing an expansion adding a title attribute lets you provide an expansion or definition for the abbreviation or acronym. html <p>ashok's joke made me <abbr title="laugh out loud">lol</abbr> big time.</p> result defining an abbreviation you can use <abbr> in tandem with <dfn> to more formally define an abbreviation, as shown here. ...
...ttribute lets you provide an expansion or definition for the abbreviation or acronym. html <p>ashok's joke made me <abbr title="laugh out loud">lol</abbr> big time.</p> result defining an abbreviation you can use <abbr> in tandem with <dfn> to more formally define an abbreviation, as shown here. ...
...n full the first time it is used on a page is beneficial for helping people understand it, especially if the content is technical or industry jargon. example <p>javascript object notation (<abbr>json</abbr>) is a lightweight data-interchange format.</p> this is especially helpful for people who are unfamiliar with the terminology or concepts discussed in the content, people who are new to the language, and people with cognitive concerns. specifications specification status comment html living standardthe definition of '<abbr>' in that specification. living standard html5the definition of '<abbr>' in that specification. recommendation html 4.01 specificationthe definition of '<abbr>' in that specification. recommendation ...
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. 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 ...
...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 language subtag must be specified, the locale constructor takes a configuration object, which can override the language subtag. ...
...ructor 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 language subtag must be specified, the locale constructor takes a configuration object, which can override the language subtag. ...
...entifier 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 language subtag must be specified, the locale constructor takes a configuration object, which can override the language subtag. ...
HTML attribute reference - HTML: Hypertext Markup Language
css height property should be used instead. hidden global attribute prevents rendering of given element, while keeping child elements, e.g. script elements, active. high <meter> indicates the lower bound of the upper range. href <a>, <area>, <base>, <link> the url of a linked resource. hreflang <a>, <area>, <link> specifies the language of the linked resource. http-equiv <meta> defines a pragma directive. icon <command> specifies a picture which represents the command. id global attribute often used with css to style a specific element. the value of this attribute must be unique. importance <iframe>, <img>, <link>, <script> indicates the relative fetch priority for th...
...ismap <img> indicates that the image is part of a server-side image map. itemprop global attribute keytype <keygen> specifies the type of key generated. kind <track> specifies the kind of text track. label <optgroup>, <option>, <track> specifies a user-readable title of the element. lang global attribute defines the language used in the element. language <script> defines the script language used in the element. loading <img>, <iframe> indicates if the element should be loaded lazily (loading="lazy") or loaded immediately (loading="eager"). wip: whatwg pr #3752 list <input> identifies a list of pre-defined options to suggest to the user. loop <audio>, ...
... establishes the element's width. note: for all other instances, such as <div>, this is a legacy attribute, in which case the css width property should be used instead. wrap <textarea> indicates whether the text should be wrapped. content versus idl attributes in html, most attributes have two faces: the content attribute and the idl (interface definition language) attribute. the content attribute is the attribute as you set it from the content (the html code) and you can set it or get it via element.setattribute() or element.getattribute(). the content attribute is always a string even when the expected value should be an integer. for example, to set an <input> element's maxlength to 42 using the content attribute, you have to call setattribute("maxlengt...
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
Web › HTML › Element › i
set off from the normal prose for readability reasons. this would be a range of text with different semantic meaning than the surrounding text. ...
...th different semantic meaning than the surrounding text. ...
...p with another element. use <em> to indicate stress emphasis. use <strong> to indicate importance, seriousness, or urgency. use <mark> to indicate relevance. use <cite> to mark up the name of a work, such as a book, play, or song. use <dfn> to mark up the defining instance of a term. examples this example demonstrates using the <i> element to mark text that is in another language. <p>the latin phrase <i>veni, vidi, vici</i> is often mentioned in music, art, and literature.</p> result specifications specification status comment html living standardthe definition of '<i>' in that specification. living standard html5the definition of '<i>' in that specification. recommendation html 4.01 specificationthe defin...
<script>: The Script element - HTML: Hypertext Markup Language
Web › HTML › Element › script
content categories metadata content, flow content, phrasing content. permitted content dynamic script such as text/javascript. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts metadata content, or any element that accepts phrasing content. ...
...ectly within a document. type this attribute indicates the type of script represented. the value of this attribute will be in one of the following categories: omitted or a javascript mime type: this indicates the script is javascript. the html5 specification urges authors to omit the attribute rather than provide a redundant mime type. in earlier browsers, this identified the scripting language of the embedded or imported (via the src attribute) code. javascript mime types are listed in the specification. module: causes the code to be treated as a javascript module. the processing of the script contents is not affected by the charset and defer attributes. for information on using module, see our javascript modules guide. unlike classic scripts, module scripts require the use of the co...
... must use a valid mime type that is not a javascript mime type to denote data blocks. the src attribute will be ignored. deprecated attributes charset if present, its value must be an ascii case-insensitive match for "utf-8". it’s unnecessary to specify the charset attribute, because documents must use utf-8, and the script element inherits its character encoding from the document. language like the type attribute, this attribute identifies the scripting language in use. unlike the type attribute, however, this attribute’s possible values were never standardized. the type attribute should be used instead. notes scripts without async , defer or type="module" attributes, as well as inline scripts, are fetched and executed immediately, before the browser continues to parse the ...
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
it defines the meaning and structure of web content. other technologies besides html are generally used to describe a web page's appearance/presentation (css) or functionality/behavior (javascript). ...
...ss beginner, css, css colors, guide, html, html colors, html styles, styling html, color with css, there are lots of ways to add color to your html elements to create just the look you want. this article is a primer introducing each of the ways css color can be used in html. 4 block-level elements beginner, development, guide, html, html5, web html (hypertext markup language) elements historically were categorized as either "block-level" elements or "inline-level" elements. by default, a block-level element occupies the entire space of its parent element (container), thereby creating a "block." this article helps to explain what this means. 5 dash adaptive streaming for html 5 video guide, html, html5 dynamic adaptive streaming over http (dash) i...
...rs that are associated with the element. 25 itemtype attribute, global attribute, html, html microdata, microdata, reference the global attribute itemtype specifies the url of the vocabulary that will be used to define itemprop's (item properties) in the data structure. 26 lang global attributes, html, reference the lang global attribute helps define the language of an element: the language that non-editable elements are written in, or the language that the editable elements should be written in by the user. the attribute contains a single “language tag” in the format defined in tags for identifying languages (bcp47). 27 part global attributes, html, reference, part the part global attribute contains a space-separated list of the ...
XML introduction - XML: Extensible Markup Language
xml (extensible markup language) is a markup language similar to html, but without predefined tags to use. instead, you define your own tags designed specifically for your needs. this is a powerful way to store data in a format that can be stored, searched, and shared. most importantly, since the fundamental format of xml is standardized, if you share or transmit xml across systems or platforms, either locally or over the internet, the recipient can still parse the data due to the standardized xml syntax. there are many languages based on xml, including xhtml, mathml, svg, xul, xbl, rss, and rdf. you can also define your own. structure of an xml document this sub-article in process writing... whole structure xml and xml based languages built on tags. xml declaration xml - declarati...
...ere are ways to display xml data. if you don't define a specific way for the xml to be rendered, the raw xml is displayed in the browser. one way to style xml output is to specify css to apply to the document using the xml-stylesheet processing instruction. <?xml-stylesheet type="text/css" href="stylesheet.css"?> there is also another more powerful way to display xml: the extensible stylesheet language transformations (xslt) which can be used to transform xml into other languages such as html. this makes xml incredibly versatile. <?xml-stylesheet type="text/xsl" href="transform.xsl"?> recommendations this article is obviously only a very brief introduction to what xml is, with a few small examples and references to get you started. for more details about xml, you should look around on the we...
...to other languages such as html. this makes xml incredibly versatile. <?xml-stylesheet type="text/xsl" href="transform.xsl"?> recommendations this article is obviously only a very brief introduction to what xml is, with a few small examples and references to get you started. for more details about xml, you should look around on the web for more in-depth articles. learning the hypertext markup language (html) will help you better understand xml. ...
An Overview - XSLT: Extensible Stylesheet Language Transformations
an xslt stylesheet is an xml document. unlike css, which has its own specialized syntax, an xslt stylesheet is an xml document, which must conform to all xml rules, including well-formedness. so the model for transformation is that one xml document is used to transform another xml document. an xslt stylesheet is marked as such by the inclusion of a standard xslt heading. ...
...rocessing instructions and so on. some of those children may also have children. and this can continue for several levels. there are certain constraints on which type of nodes can occur where: for example, text nodes can have no children. the result of the processor's action is also a tree. netscape uses this tree to render the contents in the browser window. xslt is a high-level declarative language. in essence, an xslt stylesheet is a set of rules, called templates, which declare that any node that matches this specific pattern should be manipulated in this specific way and end up in this specific position in the result tree. the particulars of how this is to be accomplished are left up to the processor. because the order of execution of the stylesheet cannot be guaranteed, xslt does not s...
...cause the order of execution of the stylesheet cannot be guaranteed, xslt does not support any functionality that produces side-effects. in this it is like lisp or scheme. locations on the tree are specified using xpath, another w3c recommendation. transformations depend on the processor's being able to pinpoint individual nodes on the tree. to facilitate this, the w3c decided to use a separate language, xpath, which also has uses outside the xslt context. as its name implies, xpath defines a "path" the processor must take through the tree to arrive at the desired node. this path consists of xpath-specific expressions to be evaluated, expressions which may include a number of conditions to be matched, a way of associating nodes, and/or an indication of directionality within the tree. a fuller de...
Dynamic programming language - MDN Web Docs Glossary: Definitions of Web-related terms
a dynamic programming language is a programming language in which operations otherwise done at compile-time can be done at run-time. for example, in javascript it is possible to change the type of a variable or add new properties or methods to an object while the program is running. this is opposed to so-called static programming languages, in which such changes are normally not possible. note that while there is indeed a connection between this dynamic/static property of programming languages and dynamic/static-typing, the two are far from synonymous. ...
...w properties or methods to an object while the program is running. this is opposed to so-called static programming languages, in which such changes are normally not possible. ...
High-level programming language - MDN Web Docs Glossary: Definitions of Web-related terms
a high-level programming language has a significant abstraction from the details of computer operation. it is designed to be easily understood by humans and for this reason they must be translated by another software. unlike low-level programming languages, it may use natural language elements, or may automate (or even entirely hide) significant areas of computing systems, making the process of developing simpler and more understandable relative to a lower-level language. the amount of abstraction provided defines how "high-level" a programming language is. ...
...ust be translated by another software. unlike low-level programming languages, it may use natural language elements, or may automate (or even entirely hide) significant areas of computing systems, making the process of developing simpler and more understandable relative to a lower-level language. the amount of abstraction provided defines how "high-level" a programming language is. the idea of a language automatically translatable into machine code, but nearer to human logic, was introduced in computer science in the 1950s, especially thanks to the work of john backus (ibm), to whom it owes the first high-level language to have been widely circulated: fortran. for this innovation backus received the turing prize. ...
IPC Protocol Definition Language (IPDL)
ipdl, short for "ipc (inter-process communication) protocol definition language", is a mozilla-specific language allowing c++ code to pass messages between processes or threads in an organized and secure way. all messages for multi-process plugins and tabs in firefox are declared in the ipdl language. ...
...e allowing c++ code to pass messages between processes or threads in an organized and secure way. all messages for multi-process plugins and tabs in firefox are declared in the ipdl language. ...
AddressErrors.languageCode - Web APIs
an object based on addresserrors includes a languagecode property when the address's languagecode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var languageerror = addresserrors.languagecode; value if the value specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. this validation might be as simple as ensuring the text of the string is compliant with the syntax defined in bcp-47, or as detailed as actually verifying that the specified string matches a value from a database. ...
...code property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. this validation might be as simple as ensuring the text of the string is compliant with the syntax defined in bcp-47, or as detailed as actually verifying that the specified string matches a value from a database. if the languagecode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe definition of 'addresserrors.languagecode' in that specification. candidate recommendation initial definition. ...
NavigatorLanguage - Web APIs
navigatorlanguage contains methods and properties related to the language of the navigator. there is no object of type navigatorlanguage, but other interfaces, like navigator or workernavigator, implement it. properties the navigatorlanguage interface doesn't inherit any property. navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser ui. the null value is returned when this is unknown. navigatorlanguage.languages read only returns an array of domstring representing the languages known to the user, by order of preference. methods the navigatorlanguage interface neither implements, nor inherit any method. specifications specification status comment html living standard...
... the null value is returned when this is unknown. navigatorlanguage.languages read only returns an array of domstring representing the languages known to the user, by order of preference. methods the navigatorlanguage interface neither implements, nor inherit any method. specifications specification status comment html living standardthe definition of 'navigatorlanguage' in that specification. living standard since the html5 snapshot, the languages property has been added. html5the definition of 'navigatorlanguage' in that specification. recommendation initial specification; snapshot of an early version html living standard. ...
WindowEventHandlers.onlanguagechange - Web APIs
the onlanguagechange property of the windoweventhandlers mixin is the eventhandler for processing languagechange events. these events are received by the object implementing this interface, usually a window, an htmlbodyelement, or an htmliframeelement. such an event is sent by the browser to inform that the preferred languages list has been updated. the list is accessible via navigatorlanguage.languages. syntax object.onlanguagechange = function; value function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type event. ...
...as been updated. the list is accessible via navigatorlanguage.languages. syntax object.onlanguagechange = function; value function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}. an event handler always has one single parameter, containing the event, here of type event. example window.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specifications specification status comment html living standardthe definition of 'windoweventhandler.onlanguagechange' in that specification. living standard initial specification. ...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
-color by default, text decorations (such as underlines, strikethroughs, etc) use the color property as their colors. however, you can override that behavior and use a different color for them with the text-decoration-color property. text-emphasis-color the color to use when drawing emphasis symbols adjacent to each character in the text. this is used primarily when drawing text for east asian languages. caret-color the color to use when drawing the caret (sometimes referred to as the text input cursor) within the element. this is only useful in elements that are editable, such as <input> and <textarea> or elements whose html contenteditable attribute is set. boxes every element is a box with some sort of content, and has a background and a border in addition to whatever contents the box m...
...he box begins and ends). border-inline-start-color and border-inline-end-color these let you color the edges of the border closest to to the beginning and the end of the start of lines of text within the box. which side this is will vary depending on the writing-mode, direction, and text-orientation properties, which are typically (but not always) used to adjust text directionality based on the language being displayed. for example, if the box's text is being rendered right-to-left, then the border-inline-start-color is applied to the right side of the border. other ways to use color css isn't the only web technology that supports color. there are graphics technologies that are available on the web which also support color. the html canvas api lets you draw 2d bitmapped graphics in a <can...
HTML attribute: rel - HTML: Hypertext Markup Language
Web › HTML › Attributes › rel
rea, the meaning depends on the values of the other attributes. with the stylesheet keyword on a <link>, it creates an alternate stylesheet. <!-- a persistent style sheet --> <link rel="stylesheet" href="default.css"> <!-- alternate style sheets --> <link rel="alternate stylesheet" href="highcontrast.css" title="high contrast"> with an hreflang attribute that differs from the document language, it indicates a translation. with the type attribute, it indicates that the referenced document is the same content in a different format. for example, with type="application/rss+xml" it creates a hyperlink referencing a syndication feed. <link rel="alternate" type="application/atom+xml" href="posts.xml" title="blog"> both the hreflang and type attributes specify links to versions of th...
... type attribute, it indicates that the referenced document is the same content in a different format. for example, with type="application/rss+xml" it creates a hyperlink referencing a syndication feed. <link rel="alternate" type="application/atom+xml" href="posts.xml" title="blog"> both the hreflang and type attributes specify links to versions of the document in an alternative format and language, intended for other media: <link rel=alternate href="/fr/html/print" hreflang=fr type=text/html media=print title="french html (for printing)"> <link rel=alternate href="/fr/pdf" hreflang=fr type=application/pdf title="french pdf"> author indicates the author of the current document or article. relevant for <link>, <a>, and <area> elements, the author keyword creates a hyperlink. with...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
ring page load. instead, the stylesheet will be loaded on-demand, if and when the disabled attribute is changed to false or removed. setting the disabled property in the dom causes the stylesheet to be removed from the document's document.stylesheets list. href this attribute specifies the url of the linked resource. a url can be absolute or relative. hreflang this attribute indicates the language of the linked resource. it is purely advisory. allowed values are determined by bcp47. use this attribute only if the href attribute is present. importance indicates the relative importance of the resource. priority hints are delegated using the values: auto: indicates no preference. the browser may use its own heuristics to decide the priority of the resource. high: indicates to the bro...
...r an alternate stylesheet. incorrectly using it may cause the stylesheet to be ignored. type this attribute is used to define the type of the content linked to. the value of the attribute should be a mime type such as text/html, text/css, and so on. the common use of this attribute is to define the type of stylesheet being referenced (such as text/css), but given that css is the only stylesheet language used on the web, not only is it possible to omit the type attribute, but is actually now recommended practice. it is also used on rel="preload" link types, to make sure the browser only downloads file types that it supports. non-standard attributes methods the value of this attribute provides information about the functions that might be performed on an object. the values generally are gi...
<sup>: The Superscript element - HTML: Hypertext Markup Language
Web › HTML › Element › sup
done using, for example, vertical-align: super or, to shift the baseline up 50%, vertical-align: 50%. appropriate use cases for <sup> include (but aren't necessarily limited to): displaying exponents, such as "x3." it may be worth considering the use of mathml for these, especially in more complex cases. see exponents under examples below. displaying superior lettering, which is used in some languages when rendering certain abbreviations. for example, in french, the word "mademoiselle" can be abbreviated "mlle"); this is an acceptable use case. see superior lettering for examples. representing ordinal numbers, such as "4th" instead of "fourth." see ordinal numbers for examples. examples exponents exponents, or powers of a number, are among the most common uses of superscripted text. for ...
...pt. however, it is common to use <sup> to present superior lettering in html. among the most common uses of superior lettering is the presentation of certain abbreviations in french: <p>robert a présenté son rapport à m<sup>lle</sup> bernard.</p> the resulting output: ordinal numbers ordinal numbers, such as "fourth" in english or "quinto" in spanish may be abbreviated using numerals and language-specific text rendered in superscript: <p>the ordinal number "fifth" can be abbreviated in various languages as follows:</p> <ul> <li>english: 5<sup>th</sup></li> <li>french: 5<sup>ème</sup></li> </ul> the output: specifications specification status comment html living standardthe definition of '<sub> and <sup>' in that specification. living standard ...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
Web › HTML › Element › track
t to be used. if omitted the default kind is subtitles. if the attribute contains an invalid value, it will use metadata (versions of chrome earlier than 52 treated an invalid value as subtitles). the following keywords are allowed: subtitles subtitles provide translation of content that cannot be understood by the viewer. for example dialogue or text that is not english in an english language film. subtitles may contain additional content, usually extra background information. for example the text at the beginning of the star wars films, or the date, time, and location of a scene. captions closed captions provide a transcription and possibly a translation of audio. it may include important non-verbal information such as music cues or sound effects. it may indi...
...to the user. label a user-readable title of the text track which is used by the browser when listing available text tracks. src address of the track (.vtt file). must be a valid url. this attribute must be specified and its url value must have the same origin as the document — unless the <audio> or <video> parent element of the track element has a crossorigin attribute. srclang language of the track text data. it must be a valid bcp 47 language tag. if the kind attribute is set to subtitles, then srclang must be defined. usage notes track data types the type of data that track adds to the media is set in the kind attribute, which can take values of subtitles, captions, descriptions, chapters or metadata. the element points to a source file containing timed text that the brow...
Global attributes - HTML: Hypertext Markup Language
the html and its dom representation that may be used by scripts. all such custom data are available via the htmlelement interface of the element the attribute is set on. the htmlelement.dataset property gives access to them. dir an enumerated attribute indicating the directionality of the element's text. it can have the following values: ltr, which means left to right and is to be used for languages that are written from the left to the right (like english); rtl, which means right to left and is to be used for languages that are written from the right to the left (like arabic); auto, which lets the user agent decide. it uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then it applies that directionality to the...
...ype associated with it. itemtype is a valid url of a vocabulary (such as schema.org) that describes the item and its properties context. itemtype specifies the url of the vocabulary that will be used to define itemprops (item properties) in the data structure. itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active. lang helps define the language of an element: the language that non-editable elements are in, or the language that editable elements should be written in by the user. the attribute contains one “language tag” (made of hyphen-separated “language subtags”) in the format defined in tags for identifying languages (bcp47). xml:lang has priority over it. part a space-separated list of the part names of the element. part na...
XUL - Mozilla's XML User Interface Language - Archive of obsolete content
presentation view online download summary ben goodger, lead engineer for mozilla firefox talked about xul, mozilla's xml user interface toolkit. questions and discussion xul - mozilla's xml user interface language - discussion ...
The Rust programming language
rust is a new open-source systems programming language created by mozilla and a community of volunteers, designed to help developers create fast, secure applications which take full advantage of the powerful features of modern multi-core processors. it prevents segmentation faults and guarantees thread safety, all with an easy-to-learn syntax. in addition, rust offers zero-cost abstractions, move semantics, guaranteed memory safety, threads with no data races, trait-based generics, pattern matching, type inference, and efficient c bindings, with a minimum runtime size. to learn more about rust, you can: watch the videos below for a closer look at the power and benefits rust provides. read the book the rust programming language online. download the rust compiler, check out examples, ...
getHelperForLanguage
...
nsIProgrammingLanguage
constant value description unknown 0 cplusplus 1 c++ javascript 2 javascript python 3 python perl 4 perl java 5 java zx81_basic 6 zx81 basic javascript2 7 javascript 2 ruby 8 ruby php 9 php tcl 10 tcl max 10 this will be kept at the largest index. ...
PaymentAddress.languageCode - Web APIs
the languagecode read-only property of the paymentaddress interface returns a string containing the bcp-47 language code for the address. this is used while localizing the displayy of the address, allowing the determination of the field separators and the order of fields when formatting the address. syntax var paymentlanguagecode = paymentaddress.languagecode; value a domstring providing the bcp-47 format language code indicating the language the address was written in, such as "en-us", "pt-br", or "ja-jp". ...
Selection.selectionLanguageChange() - Web APIs
obsolete since gecko 29 (firefox 29 / thunderbird 29 / seamonkey 2.26)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. selection.selectionlanguagechange() method is a gecko/firefox internal method that was exposed to web pages until firefox 29. it was removed in bug 949445 and should not be used. ...
TrackDefault.language - Web APIs
the language read-only property of the trackdefault interface returns a default language for an associated sourcebuffer to use when an initialization segment does not contain language information for a new track. this should be a valid language code, e.g. en-us. syntax var mylanguage = trackdefault.language; value a domstring. example tbd ...
Window: languagechange event - Web APIs
the languagechange event is fired at the global scope object when the user's preferred language changes. bubbles no cancelable no interface event event handler onlanguagechange examples you can use the languagechange event in an addeventlistener method: window.addeventlistener('languagechange', function() { console.log('languagechange event detected!'); }); or use the onlanguagechange event handler property: window.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specification specification status html living standardthe definition of 'languagechange' in that specification. living standard ...
WorkerGlobalScope: languagechange event - Web APIs
the languagechange event is fired at the global scope object when the user's preferred language changes. bubbles no cancelable no interface event event handler onlanguagechange examples you can use the languagechange event in an addeventlistener method: worker.addeventlistener('languagechange', function() { console.log('languagechange event detected!'); }); or use the onlanguagechange event handler property: worker.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specification specification status html living standardthe definition of 'languagechange' in that specification. living standard ...
WorkerGlobalScope.onlanguagechange - Web APIs
the onlanguagechange property of the workerglobalscope interface represents an eventhandler to be called when the languagechange event occurs and bubbles through the worker. syntax self.onlanguagechange = function() { ... }; example the following code snippet shows an onlanguagechange handler set inside a worker: self.onlanguagechange = function() { console.log('your preferred language settings have been changed'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.onlanguagechange' in that specification. living standard ...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
he payment instrument; on credit cards, this is the 3-digit verification number on the back of the card. "cc-type" the type of payment instrument (such as "visa" or "master card"). "transaction-currency" the currency in which the transaction is to take place. "transaction-amount" the amount, given in the currency specified by "transaction-currency", of the transaction, for a payment form. "language" a preferred language, given as a valid bcp 47 language tag. "bday" a birth date, as a full date. "bday-day" the day of the month of a birth date. "bday-month" the month of the year of a birth date. "bday-year" the year of a birth date. "sex" a gender identity (such as "female", "fa'afafine", "male"), as freeform text without newlines. "tel" a full telephone number, including the cou...
Block-level elements - HTML: Hypertext Markup Language
by default, a block-level element occupies the entire space of its parent element (container), thereby creating a "block." this article helps to explain what this means. browsers typically display the block-level element with a newline both before and after the element. you can visualize them as a stack of boxes. a block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can). ...
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
ts to. links are not restricted to http-based urls — they can use any url scheme supported by browsers: sections of a page with fragment urls pieces of media files with media fragments telephone numbers with tel: urls email addresses with mailto: urls while web browsers may not support other url schemes, web sites can with registerprotocolhandler() hreflang hints at the human language of the linked url. no built-in functionality. allowed values are the same as the global lang attribute. ping a space-separated list of urls. when the link is followed, the browser will send post requests with the body ping to the urls. typically for tracking. referrerpolicy how much of the referrer to send when following the link. see referrer-policy for possible values and their effects. r...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
Web › HTML › Element › applet
hat supplies the data that is bound to the <param> elements associated with the applet. height this attribute specifies the height, in pixels, that the applet needs. hspace this attribute specifies additional horizontal space, in pixels, to be reserved on either side of the applet. mayscript in the netscape implementation, this attribute allows access to an applet by programs in a scripting language embedded in the document. name this attribute assigns a name to the applet so that it can be identified by other resources; particularly scripts. object this attribute specifies the url of a serialized representation of an applet. src as defined for internet explorer 4 and higher, this attribute specifies a url for an associated file for the applet. the meaning and use is unclear and not pa...
<area> - HTML: Hypertext Markup Language
Web › HTML › Element › area
values are numbers of css pixels. download this attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. see <a> for a full description of the download attribute. href the hyperlink target for the area. its value is a valid url. this attribute may be omitted; if so, the <area> element does not represent a hyperlink. hreflang indicates the language of the linked resource. allowed values are determined by bcp47. use this attribute only if the href attribute is present. ping contains a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. referrerpolicy a string indicating which referrer to use when fetching th...
<body>: The Document Body element - HTML: Hypertext Markup Language
Web › HTML › Element › body
tion to call when the document is about to be unloaded. onblur function to call when the document loses focus. onerror function to call when the document fails to load properly. onfocus function to call when the document receives focus. onhashchange function to call when the fragment identifier part (starting with the hash ('#') character) of the document's current address has changed. onlanguagechange function to call when the preferred languages changed. onload function to call when the document has finished loading. onmessage function to call when the document has received a message. onoffline function to call when network communication has failed. ononline function to call when network communication has been restored. onpopstate function to call when the user has navigate...
<div>: The Content Division element - HTML: Hypertext Markup Language
Web › HTML › Element › div
tory. 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. as a "pure" container, the <div> element does not inherently represent anything. instead, it's used to group content so it can be easily styled using the class or id attributes, marking a section of a document as being written in a different language (using the lang attribute), and so on. content categories flow content, palpable content. permitted content flow content. or (in whatwg html): if the parent is a <dl> element: one or more <dt> elements followed by one or more <dd> elements, optionally intermixed with <script> and <template> elements. tag omission none, both the starting and ending tag are ...
<em>: The Emphasis element - HTML: Hypertext Markup Language
Web › HTML › Element › em
cally this element is displayed in italic type. however, it should not be used simply to apply italic styling; use the css font-style property for that purpose. use the <cite> element to mark the title of a work (book, play, song, etc.). use the <i> element to mark text that is in an alternate tone or mood, which covers many common situations for italics such as scientific names or words in other languages. use the <strong> element to mark text that has greater importance than surrounding text. <i> vs. <em> new developers are often confused at seeing multiple elements that produce similar results. <em> and <i> are a common example, since they both italicize text. what's the difference? which should you use? by default, the visual result is the same. however, the semantic meaning is different. t...
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
Web › HTML › Element › html
n the document type declaration. xmlns specifies the xml namespace of the document. default value is "http://www.w3.org/1999/xhtml". this is required in documents parsed with xml parsers, and optional in text/html documents. example <!doctype html> <html lang="en"> <head>...</head> <body>...</body> </html> accessibility concerns providing a lang attribute with a valid ietf identifying language tag on the <html> element will help screen reading technology determine the proper language to announce. the identifying language tag should describe the language used by the majority of the content of the page. without it, screen readers will typically default to the operating system's set language, which may cause mispronunciations. including a valid lang declaration on the <html> element also...
<input type="color"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › color
-case form. the value is never in any other form, and is never empty. note: setting the value to anything that isn't a valid, fully-opaque, rgb color in hexadecimal notation will result in the value being set to #000000. in particular, you can't use css's standardized color names, or any css function syntax, to set the value. this makes sense when you keep in mind that html and css are separate languages and specifications. in addition, colors with an alpha channel are not supported; specifying a color in 9-character hexadecimal notation (e.g. #009900aa) will also result in the color being set to #000000. note: any web browser that doesn't support an input of type color will naturally fall back to the type text. because users can write colors in many different ways (such as rgb(255, 255, 0)),...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
ilar way. this has been removed as of version 66 (see bug 1513890). localization the allowed inputs for certain <input> types depend on the locale. in some locales, 1,000.00 is a valid number, while in other locales the valid way to enter this number is 1.000,00. firefox uses the following heuristics to determine the locale to validate the user's input (at least for type="number"): try the language specified by a lang/xml:lang attribute on the element or any of its parents. try the language specified by any content-language http header. or, if none specified, use the browser's locale. technical summary content categories flow content, listed, submittable, resettable, form-associated element, phrasing content. if the type is not hidden, then labelable element, palpable conte...
<style>: The Style Information element - HTML: Hypertext Markup Language
Web › HTML › Element › style
m in the correct order, to avoid unexpected cascade issues. in the same manner as <link> elements, <style> elements can include media attributes that contain media queries, allowing you to selectively apply internal stylesheets to your document depending on media features such as viewport width. attributes this element includes the global attributes. type this attribute defines the styling language as a mime type (charset should not be specified). this attribute is optional and defaults to text/css if it is not specified; values other than the empty string or text/css are not used. note: there is very little reason to include this attribute in modern web documents. media this attribute defines which media the style should be applied to. its value is a media query, which defaults to all if...
<table>: The Table element - HTML: Hypertext Markup Language
Web › HTML › Element › table
ntent 2</th> </tr> </thead> <tbody> <tr> <td>body content 1</td> <td>body content 2</td> </tr> </tbody> <tfoot> <tr> <td>footer content 1</td> <td>footer content 2</td> </tr> </tfoot> </table> <p>table with colgroup</p> <table> <colgroup span="4"></colgroup> <tr> <th>countries</th> <th>capitals</th> <th>population</th> <th>language</th> </tr> <tr> <td>usa</td> <td>washington, d.c.</td> <td>309 million</td> <td>english</td> </tr> <tr> <td>sweden</td> <td>stockholm</td> <td>9 million</td> <td>swedish</td> </tr> </table> <p>table with colgroup and col</p> <table> <colgroup> <col style="background-color: #0f0"> <col span="2"> </colgroup> <tr> <th>lime</th> <th>lem...
<xmp> - HTML: Hypertext Markup Language
Web › HTML › Element › xmp
l example element (<xmp>) renders text between the start and end tags without interpreting the html in between and using a monospaced font. the html2 specification recommended that it should be rendered wide enough to allow 80 characters per line. note: do not use this element. it has been deprecated since html3.2 and was not implemented in a consistent way. it was completely removed from the language in html5. use the <pre> element or, if semantically adequate, the <code> element instead. note that you will need to escape the '<' character as '&lt;' to make sure it is not interpreted as markup. a monospaced font can also be obtained on any element, by applying an adequate css style using monospace as the generic-font value for the font-family property. attributes this element has no oth...
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
tains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/device scenarios. <source> the html <source> element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element. scripting in order to create dynamic content and web applications, html supports the use of scripting languages, most prominently javascript. certain elements support this capability. element description <canvas> use the html <canvas> element with either the canvas scripting api or the webgl api to draw graphics and animations. <noscript> the html <noscript> element defines a section of html to be inserted if a script type on the page is unsupported or if scri...
accesskey - HTML: Hypertext Markup Language
y attribute: an accesskey value can conflict with a system or browser keyboard shortcut, or assistive technology functionality. what may work for one combination of operating system, assistive technology, and browser may not work with other combinations. certain accesskey values may not be present on certain keyboards, especially when internationalization is a concern. so adapting to specific languages could cause further problems. accesskey values that rely on numbers may be confusing to individuals experiencing cognitive concerns, where the number doesn't have a logical association with the functionality it triggers. informing the user that accesskeys are present, so that they are aware of the functionality. if the system lacks a method of notifying the user about this feature, the user m...
dir - HTML: Hypertext Markup Language
an enumerated attribute that indicates the directionality of the element's text. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it can have the following values: ltr, which means left to right and is to be used for languages that are written from the left to the right (like english); rtl, which means right to left and is to be used for languages that are written from the right to the left (like arabic); auto, which lets the user agent decide. it uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whol...
Inline elements - HTML: Hypertext Markup Language
since this is a presentational characteristic it is nowadays specified by css in the flow layout. inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the content. in this article, we'll examine html inline-level elements and how they differ from block-level elements. an inline element does not start on a new line and only takes up as much width as necessary. inline vs. block-level elements: a demonstration this is most easily demonstrated with a simple example. ...
Link types - HTML: Hypertext Markup Language
e attribute must be present and not be the empty string. if the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed. the first one defined on the page is the default. otherwise, the link defines an alternative page, of one of these types: for another medium, like a handheld device (if the media attribute is set) in another language (if the hreflang attribute is set), in another format, such as a pdf (if the type attribute is set) a combination of these <a>, <area>, <link> <form> archives defines a hyperlink to a document that contains an archive link to this one. for example, a blog entry could link to a monthly index page this way. note: although recognized, ...
Microdata - HTML: Hypertext Markup Language
nformation), hrecipe (food recipe), hreview (market reviews) and hproduct (product data) and provides its own format for the definition of the terms and encyclopedic articles. this extension was made to solve transliteration problems between the cyrillic and latin alphabets. due to the implementation of additional marking parameters of schema's vocabulary, the indexation of information in russian-language web-pages became considerably more successful. global attributes itemid – the unique, global identifier of an item. itemprop – used to add properties to an item. every html element may have an itemprop attribute specified, where an itemprop consists of a name and value pair. itemref – properties that are not descendants of an element with the itemscope attribute can be associated with t...
Microformats - HTML: Hypertext Markup Language
on web pages and provide more relevant results to users. in addition to being machine-readable, their format is designed to be easily read by humans. to create a microformats object, h-* class names are used in the class attribute. to add a property to an object, the p-*, u-*, dt-*, e-* class names are used on one of the object's descendants. there are open source parsing libraries for most languages for microformats2. how microformats work an author of a webpage can add microformats to their html. for example if they wanted to identify themselves they could use an h-card such as: html example <a class="h-card" href="http://alice.example.com">alice blogger</a> when a parser encounters this data, it will know that this page contains a "card" which describes a person or organization name...
HTML: Hypertext Markup Language
Web › HTML
it defines the meaning and structure of web content. other technologies besides html are generally used to describe a web page's appearance/presentation (css) or functionality/behavior (javascript). "hypertext" refers to links that connect web pages to one another, either within a single website or between websites. links are a fundamental aspect of the web. by uploading content to the internet and linking it to pages created by other people, you become an active participant in the world wide web. html uses "markup" to annotate text, images, and other content for display in a web browser. ...
XML Index - XML: Extensible Markup Language
Web › XML › Index
found 4 pages: # page tags and summary 1 xml: extensible markup language draft, landing, web, xml the extensible markup language is a strict serialisation of the document object model. 2 xml index index, web, xml found 4 pages: 3 xml introduction beginner, introduction, xml xml is a markup language similar to html. it stands for extensible markup language and is a w3c recommended specification as a general purpose markup language. this means, unlike other markup languages, xml is not predefined so you must define your own tags. the primary purpose of the language is the sharing of data across different systems, such as the internet. 4 xml:base html baseelement, needsspectable, svg, xml:base xml:bas...
<xsl:choose> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › choose
syntax <xsl:choose> <xsl:when test="[whatever to test1]"></xsl:when> <xsl:when test="[whatever to test2]"></xsl:when> <xsl:otherwise></xsl:otherwise> [optional] </xsl:choose> required attributes none. optional attributes none. ...
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › if
to achieve the functionality of an if-then-else statement, however, use the <xsl:choose> element with one <xsl:when> and one <xsl:otherwise> children. ...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › number
format="1" 1 2 3 . . . (this is the only format supported at this time) format="01" 01 02 03 . . . 09 10 11 . . . format="a" a b c . . .y z aa ab . . . format="a" a b c . . . y z aa ab . . . format="i" i ii iii iv v . . . format="i" i ii iii iv v . . . lang (not supported at this time.) specifies which language's alphabet should be used in letter-based numbering formats. letter-value disambiguates between numbering sequences that use letters. some languages have more than one numbering system that use letters. if both systems begin with the same token, ambiguity can arise. this attribute can have the value "alphabetic" or "traditional". the default is "alphabetic". grouping-separator specifies...
<xsl:otherwise> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:otherwise> element is used to define the action that should be taken when none of the <xsl:when> conditions apply. it is similar to the else or default case in other programing languages. syntax <xsl:otherwise> template </xsl:otherwise> required attributes none. optional attributes none. type subinstruction, must appear as the last child of an <xsl:choose> element, within a template. defined xslt, section 9.2 gecko support supported. ...
<xsl:sort> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › sort
utes none. optional attributes select uses an xpath expression to specify the nodes to be sorted. order specifies whether the nodes should be processed in "ascending" or "descending" order. the default is "ascending". case-order indicates whether upper- or lowercase letters are to be ordered first. the allowable values are "upper-first" and "lower-first". lang specifies which language is to be used by the sort. data-type defines whether items are to be ordered alphabetically or numerically. the allowable values are "text" and "number" with "text" being the default. type subinstruction, always appears as a child of <xsl:for-each>, where it must appear before the template proper or of <xsl:apply-templates>. defined xslt, section10. gecko support supported. ...
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
tml tutorials/examples zvon xsl programmers: http://www.zvon.org/o_html/group_xsl.html jeni's xslt pages index: http://www.jenitennison.com/xslt/ xmlpitstop.com stylesheet center: http://www.xmlpitstop.com/default.asp?datatype=ssc xsl tutorial index: http://www.nwalsh.com/docs/tutorials/xsl/ other cover pages extensible stylesheet language (xsl): http://www.oasis-open.org/cover/xsl.html xsl-list subscribe: http://www.mulberrytech.com/xsl/xsl-list/ archives: http://www.biglist.com/lists/xsl-list/archives/ the xsl-list is a very active general mailing list, hosted by mulberry technologies mozilla.dev.tech.xslt google groups: http://groups.google.com/group/mozilla.dev.tech.xslt this is a ...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
stylesheets. for basic control of appearance — fonts, colors, position, and so forth — gecko uses css. css1 and css2 are well supported and support for the emerging css3 standard is under development. for further information about css, see eric meyer's css pages. our focus here is on the second type of stylesheet that gecko supports: the xslt stylesheet. xslt stands for extensible stylesheet language/transform and the name is apt. xslt allows a stylesheet author to transform a primary xml document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format (and in the case of firefox, the focus is on converting it on the fly into html which can then be displayed by the browser). xslt...
XSLT: Extensible Stylesheet Language Transformations
Web › XSLT
although the process is referred to as "transformation," the original document is not changed; rather, a new xml document is created based on the content of an existing document. then, the new document may be serialized (output) by the processor in standard xml syntax or in another format, such as html or plain text. ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
es into digital form. since 2007, utf-8 superseded it on the web. 9 atag atag, accessibility, authoring tool accessibility guidelines, glossary atag (authoring tool accessibility guidelines) is a w3c recommendation for building accessible-authoring tools that produce accessible contents. 10 abstraction abstraction, coding, codingscripting, glossary, programming language abstraction in computer programming is a way to reduce complexity and allow efficient design and implementation in complex software systems. it hides the technical complexity of systems behind simpler apis. 11 accessibility accessibility, glossary web accessibility (a11y) refers to best practices for keeping a website usable despite physical and technical restrictions. ...
...ates. arpanet first ran ncp (network control protocol) and subsequently the first version of the internet protocol or tcp/ip suite, making arpanet a prominent part of the nascent internet. arpanet was closed in early 1990. 23 array array, codingscripting, glossary, javascript, programming an array is an ordered collection of data (either primitive or object depending upon the language). arrays are used to store multiple values in a single variable. this is compared to a variable that can store only one value. 24 asynchronous glossary, web, webmechanics, asynchronous the term asynchronous refers to or multiple related things happening without waiting for the previous one to complete). 25 attribute codingscripting, glossary, html an attr...
...sary, svg, alignment, typography the baseline is a term used in european and west asian typography meaning an imaginary line upon which the characters of a font rest. 29 bidi accessibility, glossary bidi (bidirectional) refers to a document containing both right-to-left and left-to-right text. even when both directionalities occur in the same paragraph, the text in each language must appear in its proper directionality. 30 bigint bigint, glossary, javascript, reference, arbitrary precision format in javascript, bigint is a numeric data type that can represent integers in the arbitrary precision format. in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums. 31 blink glossar...
...And 46 more matches
Index
Mozilla › Tech › XPCOM › Index
found 1275 pages: # page tags and summary 1 xpcom add-ons, extensions, landing, mozilla, xpcom xpcom is a cross platform component object model, similar to microsoft com. it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++. 2 accessing the windows registry using xpcom add-ons, code snippets, extensions, needsclassification, windows registry when implementing windows-specific functionality, it is often useful to access the windows registry for information about the environment or other installed programs. to this end, there exist xpcom interfaces to read and write registry data. this article will show you how to use the available interfaces in seve...
... of gecko (version 1.8 and 1.9, for example). the more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between gecko versions. this can create a difficult situation for extension developers trying to support multiple gecko versions (firefox 2 and 3, for example). ...
...ample). 6 creating a python xpcom component guide, needshelp, pyxpcom, xpcom, xpcom:language bindings creating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyxpcom. ...
...And 41 more matches
Index - Archive of obsolete content
to rely on the host application to provide it with functionality such as loading subscripts, and exporting/ importing names. we will show how to do each of these things using the built-in components object provided by xulrunner application such as firefox and thunderbird. 28 private properties people have come up with several ways to emulate private properties using existing language features. this article discusses two common techniques: one using prefixes, the other closures. 29 firefox compatibility add-on sdk no summary! 30 module structure of the sdk add-on sdk no summary! 32 porting the library detector add-on sdk, add-ons, example, extensions, sample code, tutorial no summary! 33 program id ...
... add-ons, extensions, needscontent no summary! 203 preferences add-ons, code snippets, extensions, guide, mozilla, preferences no summary! 204 progress listeners add-ons, extensions no summary! 205 queryselector dom no summary! 206 rosetta c, dom, html, htmlscriptelement, javascript, non-javascript, programming languages no summary! 207 running applications add-ons, code snippets, extensions no summary! 208 svg animation needscontent no summary! 209 svg general code snippets no summary! 210 scrollbar code snippets no summary! 211 sidebar add-ons, code snippets, extensions no summary! 212 stri...
... 262 chapter 4: using xpcom—implementing advanced processes this chapter explains how to use xpcom to implement advanced processes using only javascript. 263 chapter 5: let's build a firefox extension archive, obsolete no summary! 264 chapter 6: firefox extensions and xul applications ...
...And 38 more matches
Index - Web APIs
Web › API › Index
api, addresserrors, error, locality, payment request, payment request api, property, read-only, reference, dependentlocality, payment an object based on addresserrors includes a dependentlocality property when the address's dependentlocality property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. 34 addresserrors.languagecode api, address, addresserrors, deprecated, language, languagecode, locale, payment request, payment request api, property, reference, payment an object based on addresserrors includes a languagecode property when the address's languagecode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. 35 addresserr...
...ing the category of audio contained in the audiotrack. 190 audiotrack.label api, audio, audio track, audiotrack, html dom, media, property, read-only, reference, label, metadata, track the read-only audiotrack property label returns a string specifying the audio track's human-readable label, if one is available; otherwise, it returns an empty string. 191 audiotrack.language api, audio, audiotrack, html dom, language, localization, media, property, read-only, reference, translated, translation, track the read-only audiotrack property language returns a string identifying the language used in the audio track. 192 audiotrack.sourcebuffer api, audio, audiotrack, html dom, mse, media, media source extensions, property, read-only, reference, sourc...
...n hidden. 1021 document: wheel event api, document, reference, events, wheel the wheel event fires when the user rotates a wheel button on a pointing device (typically a mouse). 1022 document object model (dom) api, dom, document, document object model, guide, overview, reference the document object model (dom) connects web pages to scripts or programming languages by representing the structure of a document—such as the html representing a web page—in memory. 1023 events and the dom dom, guide this chapter describes the dom event model. the event interface itself is described, as well as the interfaces for event registration on nodes in the dom, and event listeners, and several longer examples that show how the various event interf...
...And 31 more matches
Processing XML with E4X - Archive of obsolete content
warning: e4x is obselete. it's been disabled by default for chrome in firefox 17, and completely removed in firefox 21. use domparser/domserializer or a non-native jxon algorithm instead. first introduced in javascript 1.6, e4x introduces a native xml object to the javascript language, and adds syntax for embedding literal xml documents in javascript code. a full definition of e4x can be found in the ecma-357 specification. this chapter provides a practical overview of the language; it is not a complete reference. compatibility issues prior to widespread browser support for the <script> element, it was common for javascript embedded in a page to be surrounded by html comment tags to prevent <script> unaware browsers from displaying javascript code to the user. this practice is no...
...essary, but remains in some legacy code. for backwards compatibility, e4x defaults to ignoring comments and cdata sections. you can add an e4x=1 argument to your <script> tag to disable this restriction: <script type="text/javascript;e4x=1"> ... </script> creating an xml object e4x offers two principal ways of creating an xml object. ...
... some legacy code. for backwards compatibility, e4x defaults to ignoring comments and cdata sections. you can add an e4x=1 argument to your <script> tag to disable this restriction: <script type="text/javascript;e4x=1"> ... </script> creating an xml object e4x offers two principal ways of creating an xml object. ...
...And 20 more matches
Index - Learn web development
, theory it's a lot of work to create a professional website, so if you're new to web development, we encourage you to start small. you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there. 37 css basics beginner, css, codingscripting, learn, styling, web, l10n:priority like html, css is not a programming language. it's not a markup language either. css is a style sheet language. css is what you use to selectively style html elements. for example, this css selects paragraph text, setting the color to red: 38 dealing with files beginner, codingscripting, files, guide, html, l10n:priority, theory, website when you are working on a website locally on your computer, you should keep all the...
...lated files in a single folder that mirrors the published website's file structure on the server. this folder can live anywhere you like, but you should put it somewhere where you can easily find it, maybe on your desktop, in your home folder, or at the root of your hard drive. 39 html basics beginner, codingscripting, html, learn, web, l10n:priority html is not a programming language; it is a markup language that defines the structure of your content. html consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. the enclosing tags can make a word or image hyperlink to somewhere else, can italicize words, can make the font bigger or smaller, and so on. for example, take the follo...
...ike a scary list, but fortunately, you can get started in web development without knowing anything about most of these. in this article, we'll just set you up with a bare minimum — a text editor and some modern web browsers. 42 javascript basics beginner, codingscripting, javascript, learn, web, l10n:priority javascript ("js" for short) is a full-fledged dynamic programming language that can add interactivity to a website. it was invented by brendan eich (co-founder of the mozilla project), the mozilla foundation, and the mozilla corporation. 43 publishing your website beginner, codingscripting, ftp, github, google app engine, learn, web, l10n:priority, publishing, web server publishing a website is a complex topic because there are many ways to go about...
...And 14 more matches
XML - Archive of obsolete content
it attempts to balance precise control of layout with flexibility and ease of use, and in this respect it does a great job. using a combination of xul's ready-made widgets (e.g., menubar, scrollbar, progressmeter, and so on) and xul's incorporation of such standards as html4, dom1/2, and cascading stylesheets, you can design any interface that you can imagine, using any number of different features, tools, and methodologies. ...
... element. in xul, elements must either be of the form <tag></tag> or <tag/> to be valid. for example, <html:img src="box.gif" /> is valid, but <html:img src="box.gif"> is not. all attributes must have a value. xul is made out of xml you don't need to know all about xml in order to use xul, but you may want to read through this article to get a sense of xul's pedigree as a specialized markup language. xul is based upon xml, so it inherits a lot of the rules and syntax described above from this "meta-language," as you will see. any familiarity you already have with xml will help you quickly get up to speed developing with xul. xml is a language for creating other languages. it is a language for describing the structure of data. it does not describe the way in which this data is to be presente...
...bing the structure of data. it does not describe the way in which this data is to be presented, like its semantically-challenged cousin html does, and it doesn't have much to say about the data itself. when someone says they are using xml, what they probably mean is that they have used xml to define their own syntax for marking up some data they are interested in. ...
...And 10 more matches
Creating localizable web applications
ariables in the english strings. write semantic code (e.g. don't use text and <img/> for decorations; instead, use css). document your code so that localizers know what they're translating (e.g. in gettext use comments and contexts). app logic detect the locale correctly be smart about detecting the user's locale correctly. you can use one or more of the following techniques: http accept-language headers, the ua string, ip geolocation. see examples of the addons.mozillaorg code at /addons/trunk/site/app/config/language.php and /addons/trunk/site/app/config/language.inc.php. the language_config class expects arrays of valid languages & supported languages. always give the user a possibility to change the locale (e.g. by adding locale dropdown menu at bottom of page) and remember this ...
...the latter involves rewriting the urls to include the locale code and rewriting apache's aliases to handle locale in urls. you can put the locale code as the top-most element of the url's path (e.g. http://example.com/foo/bar) or on its end (e.g. http://example.com/foo/bar/en-us). ...
... the foo element */ width: 10em; /* originally 8em */ } adapt the interaction to rtl locales right-to-left locales not only require good images handling (see images), but also should be taken into account when designing the interaction on the website. consider the following example: a filmreel-like slideshow showcasing highlighted features of the product or featured designs. for right-to-left languages, the slideshow should go from right to left as well, making the last element in the html the first one to be displayed. separate urls from navigation sometimes, when the urls are well-designed, you may want to use the url to do something in the code depending on where the user is. take the url structure of the getpersonas.com website for example. the url http://getpersonas.com/nature/popular/2...
...And 9 more matches
Introduction - JavaScript
« previousnext » this chapter introduces javascript and discusses some of its fundamental concepts. what you should already know this guide assumes you have the following basic background: a general understanding of the internet and the world wide web (www). good working knowledge of hypertext markup language (html). some programming experience. if you are new to programming, try one of the tutorials linked on the main page about javascript. where to find javascript information the javascript documentation on mdn includes the following: learn web development provides information for beginners and introduces basic concepts of programming and the internet. javascript guide (this guide) provides an overview about the javascript language and its objects. javascript re...
...javascript reference provides detailed reference material for javascript. if you are new to javascript, start with the articles in the learning area and the javascript guide. once you have a firm grasp of the fundamentals, you can use the javascript reference to get more details on individual objects and statements. what is javascript? javascript is a cross-platform, object-oriented scripting language used to make webpages interactive (e.g., having complex animations, clickable buttons, popup menus, etc.). there are also more advanced server side versions of javascript such as node.js, which allow you to add more functionality to a website than simply downloading files (such as realtime collaboration between multiple computers). inside a host environment (for example, a web browser), javascri...
...low you to add more functionality to a website than simply downloading files (such as realtime collaboration between multiple computers). inside a host environment (for example, a web browser), javascript can be connected to the objects of its environment to provide programmatic control over them. javascript contains a standard library of objects, such as array, date, and math, and a core set of language elements such as operators, control structures, and statements. core javascript can be extended for a variety of purposes by supplementing it with additional objects; for example: client-side javascript extends the core language by supplying objects to control a browser and its document object model (dom). for example, client-side extensions allow an application to place elements on an html fo...
...And 9 more matches
<switch> - SVG: Scalable Vector Graphics
Web › SVG › Element › switch
other direct children will be bypassed and therefore not rendered. if a child element is a container element, like <g>, then its subtree is also processed/rendered or bypassed/not rendered. the display and visibility properties have no effect on <switch> element processing. in particular, setting display:none on a child has no effect on the true/false testing for <switch> processing. ...
...svg>, <switch>, <text>, <use> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes class style externalresourcesrequired transform dom interface this element implements the svgswitchelement interface. ...
...es core attributes graphical event attributes presentation attributes class style externalresourcesrequired transform dom interface this element implements the svgswitchelement interface. svg <switch> example this example demonstrates showing different text content depending on the browser's language settings. ...
...And 9 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
2 &lt;statusbarpanel&gt; deprecated, xul, xul elements, xul reference an individual element of a statusbar. this is a special type of button which is drawn differently. unlike normal buttons, a statusbarpanel can only have a label or an image but not both. this element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages. ...
... to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-platform development. in contrast to the mozilla jargon file, this article describes items of specific interest to the web or content developer looking to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. 4 accessibility/xul accessibility reference accessibility, xul this table is designed to show how to expose text properly for various xul element types. sections in bold are to draw attention to pieces that are often overlooked for visual layouts. underlined text may be read by the screen reader. 5 attribute (xul) xul attributes, xul reference no su...
... mozilla has configurable, downloadable chrome, meaning that the arrangement and even presence or absence of controls in the main window is not hardwired into the application, but loaded from a separate ui description. in fact, most of mozilla's windows (and dialogs) will be described using this mechanism. xul (pronounced "zool," as if that spelling helped any, and short for "xml user interface language") is our name for the language in which these ui descriptions are built. 439 list of commands xul the following lists commands which might be usable by <command> or command dispatchers/controllers. 440 menus add-ons, extensions, needscontent, reference, référence(2), xul an extension will often wish to attach a new command to a menu. to do this, the new...
...And 8 more matches
What is JavaScript? - Learn web development
such as "what is it?" and "what can you do with it?", and making sure you are comfortable with javascript's purpose. prerequisites: basic computer literacy, a basic understanding of html and css. objective: to gain familiarity with what javascript is, what it can do, and how it fits into a web site. a high-level definition javascript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, etc. — you can bet that javascript is probably involved. it is the third layer of the layer cake of standard web technologi...
...tatic information for you to look at — displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, etc. — you can bet that javascript is probably involved. it is the third layer of the layer cake of standard web technologies, two of which (html and css) we have covered in much more detail in other parts of the learning area. ...
... probably involved. it is the third layer of the layer cake of standard web technologies, two of which (html and css) we have covered in much more detail in other parts of the learning area. html is the markup language that we use to structure and give meaning to our web content, for example defining paragraphs, headings, and data tables, or embedding images and videos in the page. css is a language of style rules that we use to apply styling to our html content, for example setting background colors and fonts, and laying out our content in multiple columns. javascript is a scripting language that enables you to create dynamically updating content, control multimedia, animate images, and pretty much everything else. (okay, not everything, but it is amazing what you can achieve with a few li...
...And 8 more matches
Server-side web frameworks - Learn web development
t files or data from the server may encode what data is required in url parameters or within the url structure. an http post request to update a resource on the server will instead include the update information as "post data" within the body of the request. the http request may also include information about the current session or user in a client-side cookie. web frameworks provide programming-language-appropriate mechanisms to access this information. for example, the httprequest object that django passes to every view function contains methods and properties for accessing the target url, the type of request (e.g. an http get), get or post parameters, cookie and session data, etc. django can also pass information encoded in the structure of the url by defining "capture patterns" in the url map...
...value in a list item. #best/templates/best/index.html <!doctype html> <html lang="en"> <body> {% if youngest_teams %} <ul> {% for team in youngest_teams %} <li>{{ team.team_name }}</li> {% endfor %} </ul> {% else %} <p>no teams are available.</p> {% endif %} </body> </html> how to select a web framework numerous web frameworks exist for almost every programming language you might want to use (we list a few of the more popular frameworks in the following section). with so many choices, it can become difficult to work out what framework provides the best starting point for your new web application. some of the factors that may affect your decision are: effort to learn: the effort to learn a web framework depends on how familiar you are with the underlying pro...
...t want to use (we list a few of the more popular frameworks in the following section). with so many choices, it can become difficult to work out what framework provides the best starting point for your new web application. ...
...And 8 more matches
Adding captions and subtitles to HTML5 video - Developer guides
nces, and convey different information, and it is recommended that you read up on the differences if you are not sure what they are. they are however implemented in the same way technically, so the material in this article will apply to both. for this article we will refer to the text tracks displayed as subtitles, as their content is aimed at hearing people who have difficulty understanding the language of the film, rather than deaf or hard-of-hearing people. the <track> element html5 allows us to specify subtitles for a video using the <track> element. the various attributes of this element allow us to specify such things as the type of content that we're adding, the language it's in, and of course a reference to the text file that contains the actual subtitle information. webvtt the files ...
... relevant css, skip to the subtitle implementation section. in this example we are using a different video, sintel, as it actually has some speech in it and therefore is better for illustrating how subtitles work! html markup as mentioned above, we need to make use of the new html5 <track> element to add our subtitle files to the html5 video. ...
... the default attribute is set on the english <track...
...And 8 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
javascript was created in 1995 by brendan eich while he was an engineer at netscape. javascript was first released with netscape 2 early in 1996. ...
...javascript was created in 1995 by brendan eich while he was an engineer at netscape. javascript was first released with netscape 2 early in 1996. ...
...ng the world's most misunderstood programming language. it is often derided as being a toy, but beneath its layer of deceptive simplicity, powerful language features await. javascript is now used by an incredible number of high-profile applications, showing that deeper knowledge of this technology is an important skill for any web or mobile developer. it's useful to start with an overview of the language's history. javascript was created in 1995 by brendan eich while he was an engineer at netscape. javascript was first released with netscape 2 early in 1996. it was originally going to be called livescript, but it was renamed in an ill-fated marketing decision that attempted to capitalize on the popularity of sun microsystem's java language — despite the two having very little in common. this ha...
...And 8 more matches
Intl - JavaScript
the intl object is the namespace for the ecmascript internationalization api, which provides language sensitive string comparison, number formatting, and date and time formatting. the intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions. constructor properties intl.collator() constructor for collators, which are objects that enable language-sensitive string comparison. intl.datetimeformat() constructor for objects that enable language-sensitive date and time formatting. ...
...ationalization constructors and other language sensitive functions. constructor properties intl.collator() constructor for collators, which are objects that enable language-sensitive string 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 lan...
...e-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() returns canonical locale names. ...
...And 8 more matches
Localization - Archive of obsolete content
...
... english has two forms, which can be described by mapping "1" to "one" and "everything else" to "other":...
...t 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 → n is 1; other → everything else russian uses four forms, that can be described as follows: o...
...And 7 more matches
Localization content best practices
1d in javascript) are the left and right double quotation marks, respectively. the pair should be used to surround statements and references to user input. example: you have chosen a keyword that is currently in use by "%s". please select another. example: search %1$s for "%2$s" non-directional single, and double, quotation marks should be used in reference to html code, or other languages where ascii character usage is required, such as html. html does not prefer one over the other, and our codebase uses them interchangeably as of march 2016. example: this web page at <span id='malware_sitename'/> has been reported as an attack page and has been blocked based on your security preferences. u+2026 (\u2026) is the horizontal ellipsis character. this character should be used in ...
..., ask the localizers. date and time formats for example, you shouldn't hard code date formats into applications: %a, %b %e // resulting in wednesday, may 20 this is fine in english, but in italian results in "mercoledì, mag 20", which sounds unnatural. every time you use this kind of structure, you should have a localizable string behind it, and let localizers decide the best order for their language. units another example is localizing percentages or units. some locales use a space between the number and the % symbol, some don't, some use a non-breaking space. splitting splitting sentences into several keys often inadvertently presumes a grammar, a sentence structure, and such composite strings are often very difficult to translate. when a composite string is needed, try to give the tran...
...ate. when a composite string is needed, try to give the translators "room to move". word order if a string will contain a placeholder, always add the placeholder to the string to allow the localizer to change the word order if necessary. for example, it might seem ok in english to present the strings [username] says: to localizers simply as says: but this will cause serious issues in many other languages as the agent of an action often will not come in front of the verb, but some other position. for example in irish/gaelic the correct order is be [username] at saying:. if a placeholder is present, this can be correctly localized as tá %s ag rádh: but not without. similarly, if the ui string is flash version, do not simply present the translator with version for translation. present the whole ...
...And 7 more matches
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalreview, svg, types, data types svg makes use of a numbe...
...angle for the light source on the xy plane (clockwise), in degrees from the x axis. 30 basefrequency filters, svg, svg attribute the basefrequency attribute represents the base frequency parameter for the noise function of the <feturbulence> filter primitive. 31 baseprofile deprecated, svg, svg attribute the baseprofile attribute describes the minimum svg language profile that the author believes is necessary to correctly render the content. the attribute does not specify any processing restrictions; it can be considered metadata. 32 baseline-shift needsexample, svg, svg attribute the baseline-shift attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element. the shifted ...
...raster image included through the <image> element should use. 48 color-rendering svg, svg attribute the color-rendering attribute provides a hint to the svg user agent about how to optimize its color interpolation and compositing operations. 49 contentscripttype deprecated, svg, svg attribute the contentscripttype attribute specifies the default scripting language for the given document fragment on the <svg> element. 50 contentstyletype deprecated, svg, svg attribute the contentstyletype attribute specifies the style sheet language for the given document fragment on the <svg> element. 51 cursor svg, svg attribute the cursor attribute specifies the mouse cursor displayed when the mouse pointer is over an element. ...
...And 7 more matches
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
f widely understood technologies, and focus instead on introducing new technologies you will need to understand in order to develop for firefox. i will assume that you have experience developing with dynamic html, as well as the topics below. for more information on these technologies, please refer to other sources. ...
...gies, and focus instead on introducing new technologies you will need to understand in order to develop for firefox. i will assume that you have experience developing with dynamic html, as well as the topics below. for more information on these technologies, please refer to other sources. ...
...n introducing new technologies you will need to understand in order to develop for firefox. i will assume that you have experience developing with dynamic html, as well as the topics below. for more information on these technologies, please refer to other sources. xml coding css coding basic javascript syntax xml: a text-based structural language extensible markup language (xml) is a meta-language for expressing various kinds of data. ...
...And 6 more matches
The Joy of XUL - Archive of obsolete content
this guide is designed to introduce application developers and their managers to xul so they can not only understand why mozilla's platform is based on it, but how they might adopt it for their own use. xul (pronounced "zool") is mozilla's xml-based user interface language that lets you build feature rich cross-platform applications that can run connected to or disconnected from the internet. these applications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets. web developers already familiar with dynamic html (dhtml) will learn xul quickly and can start building applications right away. also described are some reasons application developers might choose to leverage xul and mozilla technology for building cros...
...a's motivation to build xul and why the mozilla platform is constructed using it. the key features and benefits of xul will be explored followed by an examination of supporting mozilla technologies. finally, a mini case study of a calendar application written in xul will reinforce the benefits of building applications with mozilla. key features and benefits powerful widget-based markup language the goal of xul is to build cross platform applications, in contrast with dhtml which is intended for developing web pages. for this reason, xul is oriented toward application artifacts such as windows, labels, and buttons instead of pages, heading levels, and hypertext links. in fact, many developers invest a significant amount of effort to achieve these results in their dhtml web applica...
... is oriented toward application artifacts such as windows, labels, and buttons instead of pages, heading levels, and hypertext links. in fact, many developers invest a significant amount of effort to achieve these results in their dhtml web applications but at the cost of complexity and performance and without any supporting standards. based on existing standards xul is an xml language based on w3c standard xml 1.0. applications written in xul are based on additional w3c standard technologies featuring html 4.0; cascading style sheets (css) 1 and 2; document object model (dom) levels 1 and 2; javascript 1.5, including ecma-262 edition 3 (ecmascript); xml 1.0. platform portability like html, xul is designed to be platform-neutral, making applications easily portable ...
...And 6 more matches
Localization - Archive of obsolete content
instead of hard-coding text directly into an application, each piece of text is only a reference into the string table. xml provides entities which can be used for a similar purpose. you should already be familiar with entities if you have written html. ...
...instead of hard-coding text directly into an application, each piece of text is only a reference into the string table. xml provides entities which can be used for a similar purpose. you should already be familiar with entities if you have written html. ...
... replaced with its value, which can be a string of text. entities may be used whenever text occurs, including the values of attributes. the example below demonstrates the use of an entity in a button. <button label="&findlabel;"/> the text that will appear on the label will be the value that the entity &findlabel; has. a file is created which contains the entity declarations for each supported language. in english, the &findlabel; entity will probably be declared to have the text "find". dtd files entities are declared in document type definition (dtd) files. files of this type are normally used to declare the syntax and semantics of a particular xml file, but they also let you declare entities. in the mozilla chrome system, you will find dtd files located in the locales subdirectory. you wou...
...And 6 more matches
XPCOM
interfaces in xpcom are defined in a dialect of idl called xpidl. xpcom itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. the majority of xpcom components are not part of this core set and are provided by other parts of the platform (e.g. gecko or necko) or by an application or even by an extension. ...
...le collector introduced into xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection. ...
...to xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection. ...
...And 6 more matches
About JavaScript - JavaScript
what is javascript? ...
... what is javascript? ...
... what is javascript? ...
...And 6 more matches
Date.prototype.toLocaleString() - JavaScript
in older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent. 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 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 dateobj.tolocalestring([locales[, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. see the intl.datetimeformat() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined. but, if the weekday, year, m...
...d are entirely implementation dependent. see the intl.datetimeformat() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined. but, if the weekday, year, month, and day properties are all undefined, then year, month, and day are assumed to be "numeric". return value a string representing the given date according to language-specific conventions. performance when formatting large numbers of dates, it is better to create an intl.datetimeformat object and use the function provided by its format property. examples using tolocalestring() in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. let date = new date(date.utc(2012, 11, 12, 3, 0, 0)); //...
...And 6 more matches
Number.prototype.toLocaleString() - JavaScript
in implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. ...
... 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 numobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. see the intl.numberformat() constructor for details on these parameters and how to use them. return value a string with a language-sensitive representation of the given number. performance...
... formatted string in the default locale and with default options is returned. var number = 3500; console.log(number.tolocalestring()); // displays "3,500" if in u.s. english locale checking for support for locales and options arguments the locales and options arguments are not supported in all browsers yet. to check for support in es5.1 and later implementations, the requirement that illegal language tags are rejected with a rangeerror exception can be used: function tolocalestringsupportslocales() { var number = 0; try { number.tolocalestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } prior to es5.1, implementations were not required to throw a range error exception if tolocalestring is called with arguments. a check that works in all hosts, i...
...And 6 more matches
Localization Use Cases
ui layer of firefox os) by using l20n. in all presented examples, we try to show the existing code, explain the problem from the localizers' or developers' perspective, and suggest a solution. declensions in gaia's browser app, there's an about-browser string defined as follows in apps/browser/locales/browser: about-browser=about {{browserbrandshortname}} problem definition in many inflected languages (e.g. german, finnish, hungarian, all slavic languages), the about preposition governs the grammatical case of the complement. it might be the accusative (german), ablative (latin) or locative (slavic languages). let's take slovenian as an example. in slovenian, the ideal string would inflect the noun, like so: o firefoxu however, since we want the name of the browser to be stored in the brow...
...the locative case with its about preposition: <aboutbrowser "o {{ browserbrandshortname.locative }}"> for the official branding, we get: o firefoxu and for the unofficial branding, we end up with: o brskalniku genders in the system app's apps/system/locales/system, there's a string called crash-banner-os2. crash-banner-os2={{brandshortname}} just crashed. problem definition in some languages, past participles (crashed) must be accorded with the gender of the subject (in case of reflexive verbs) or the gender of the object. in polish, the grammatical form of crashed depends on the gender of brandshortname. in order to construct a grammatically-correct and naturally-sounding message, we must know the gender of the subject. solution in l20n, the localizer can define the gender (or, ...
...eespace() { var self = this; this.getfreespace(this.appstorage, function(freespace) { devicestoragehelper.showformatedsize(self.appstoragedesc, 'availablesize', freespace); }); }, problem definition for all values of freespace, the following string is enough to construct a grammatically-correct sentence in english: availablesize = {{$size}} {{$unit}} available however, other languages might need to pluralize this string with different forms of the available adjective. consequently, using the existing localization frameworks, the developer needs to predict which strings might need pluralization in other languages, and pluralize them even in english: availablesize = {[ plural(size) ]} availablesize[other] = {{$size}} {{$unit}} available an italian translation might look like...
...And 5 more matches
Cognitive accessibility - Accessibility
velopers should take to improve the cognitive accessibility of their web sites and applications. overview cognitive and intellectual disabilities cover a large spectrum, and may be momentary, temporary, or permanent conditions. for example, dementia and alzheimer's are permanent cognitive impairments that get progressively worse. other permanent cognitive impairments include aphasia, speech and language, autism, add/adhd, dyslexia, and dyscalculia. an example of a temporary cognitive impairment could be people affected by substances such as alcohol or drugs. another form it can take is depression, such as when mourning the loss of a loved one, or being momentarily saddened by a tweet or video they just saw online. a third example could be sleep deprivation. it may seem like an overwhelming cha...
... tweet or video they just saw online. a third example could be sleep deprivation. it may seem like an overwhelming challenge to address the wide range of cognitive differences, especially when solutions for two different people may be conflicting. one way to handle this is to focus on cognitive skills. ...
...clude: attention memory processing speed time management letters and language numbers symbols and math understanding and making choices a solid approach to providing accessible solutions for people with cognitive impairments includes: delivering content in more than one way, such as by text-to-speech or by video; providing easily-understood content, such as text written using plain-language standards; focusing attention on important content; minimizing distractions, such as unnecessary content or advertisements; providing consistent web page layout and navigation; incorporating familiar elements, such as underlined links that are blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; making website authenticati...
...And 5 more matches
:lang() - CSS: Cascading Style Sheets
Web › CSS › :lang
acceptable values are specified in the html spec. ...
...acceptable values are specified in the html spec. ...
...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. ...
...And 5 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
Web › HTTP › CORS
ne of the allowed methods: get head post apart from the headers automatically set by the user agent (for example, connection, user-agent, or the other headers defined in the fetch spec as a “forbidden header name”), the only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safelisted request-header”, which are: accept accept-language content-language content-type (but note the additional requirements below) dpr downlink save-data viewport-width width the only allowed values for the content-type header are: application/x-www-form-urlencoded multipart/form-data text/plain no event listeners are registered on any xmlhttprequestupload object used in the request; these are accessed using the xmlhttp...
...me kinds of cross-site requests that web content can already issue, and no response data is released to the requester unless the server sends an appropriate header. therefore, sites that prevent cross-site request forgery have nothing new to fear from http access control. ...
... requests that web content can already issue, and no response data is released to the requester unless the server sends an appropriate header. therefore, sites that prevent cross-site request forgery have nothing new to fear from http access control. note: webkit nightly and safari technology preview place additional restrictions on the values allowed in the accept, accept-language, and content-language headers. ...
...And 5 more matches
Details of the object model - JavaScript
« previousnext » javascript is an object-based language based on prototypes, rather than being class-based. because of this different basis, it can be less apparent how javascript allows you to create hierarchies of objects and to have inheritance of properties and their values. this chapter attempts to clarify the situation. this chapter assumes that you are already somewhat familiar with javascript and that you have used javascript functions to create simple objects. class-based vs. prototype-based languages class-based object-oriented languages, such as java and c++, are founded on the concept of two distinct entities: classes and instances. a class defines all of the properties that characterize a certain set of objects (considering methods and fields in java, or membe...
...et of objects it describes. for example, the employee class could represent the set of all employees. an instance, on the other hand, is the instantiation of a class; that is. for example, victoria could be an instance of the employee class, representing a particular individual as an employee. an instance has exactly the same properties of its parent class (no more, no less). a prototype-based language, such as javascript, does not make this distinction: it simply has objects. a prototype-based language has the notion of a prototypical object, an object used as a template from which to get the initial properties for a new object. any object can specify its own properties, either when you create it or at run time. in addition, any object can be associated as the prototype for another object, all...
...guage has the notion of a prototypical object, an object used as a template from which to get the initial properties for a new object. any object can specify its own properties, either when you create it or at run time. in addition, any object can be associated as the prototype for another object, allowing the second object to share the first object's properties. defining a class in class-based languages, you define a class in a separate class definition. in that definition you can specify special methods, called constructors, to create instances of the class. a constructor method can specify initial values for the instance's properties and perform other processing appropriate at creation time. you use the new operator in association with the constructor method to create class instances. javasc...
...And 5 more matches
Date.prototype.toLocaleDateString() - JavaScript
in older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. 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. ...
...e 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 dateobj.tolocaledatestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. see the intl.datetimeformat() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined, but if the weekday, year, mo...
...ation dependent. see the intl.datetimeformat() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined, but if the weekday, year, month, day properties are all undefined, then year, month, and day are assumed to be "numeric". return value a string representing the date portion of the given date instance according to language-specific conventions. performance when formatting large numbers of dates, it is better to create an intl.datetimeformat object and use the function provided by its format property. examples using tolocaledatestring() in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. var date = new date(date.utc(2012, 11, 12, 3, 0, 0)); ...
...And 5 more matches
Date.prototype.toLocaleTimeString() - JavaScript
in older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. 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. ...
...he 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 dateobj.tolocaletimestring([locales[, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. see the intl.datetimeformat() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined, but if the hour, minute, sec...
...tation dependent. see the intl.datetimeformat() constructor for details on these parameters and how to use them. the default value for each date-time component property is undefined, but if the hour, minute, second properties are all undefined, then hour, minute, and second are assumed to be "numeric". return value a string representing the time portion of the given date instance according to language-specific conventions. performance when formatting large numbers of dates, it is better to create an intl.datetimeformat object and use the function provided by its format property. examples using tolocaletimestring() in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. var date = new date(date.utc(2012, 11, 12, 3, 0, 0)); ...
...And 5 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
editor's note: this article should be rewritten to describe why use xulrunner to create your own application. related: xulrunner:what xulrunner provides, xulrunner hall of fame ui in mozilla mozilla's philosophy of using "the right tool for the right job" is manifested most prominently in the design of the user interface. we provide an xml-based language called xul for defining the user interface of your application. css is used to style these ui's and dtd's are used to localize the textual information - making your application extremely flexible and able to be utilized across the globe. javascript, considered by many to be the best scripting language ever designed is ideal for specifying the behavior of your interface widgets. where speed is the foremost consideration, we provide c++...
...on. css is used to style these ui's and dtd's are used to localize the textual information - making your application extremely flexible and able to be utilized across the globe. javascript, considered by many to be the best scripting language ever designed is ideal for specifying the behavior of your interface widgets. where speed is the foremost consideration, we provide c++ libraries with multi-language interfaces for comprehensive, performant access to networking, filesystem, content, rendering, and much more. what this means to you as the developer is this: you can take advantage of skills you already have with xml or web technologies to design and implement anything from a simple text editor to a comprehensive ide - complete with all of the interface widgets that you would find in virtually a...
...organization maintains sophisticated, interactive websites, it will already possess a wealth of technical expertise that will be relevant for creating xul applications. in addition to the technologies already mentioned, we go even further by allowing you to even create your own custom interface widgets. don't feel limited by the widgets that the framework already contains! xbl (extensible binding language) allows you to expand your library of interface elements, and even construct your own xml language for defining your ui. for instance imagine that you wanted to create a chess style game. you could easily create xml elements such as <chessboard> or <chesspiece> and via xbl map these to images and application logic. this is very powerful since you could make improvements to the underlying applicat...
...And 4 more matches
Complete - Archive of obsolete content
oes not contain any useful functions. it is just an extended code sample. to see the code, use a jar tool or zip tool to unpack the xpi file that you downloaded. for more information about developing extensions, see the main extensions page here. features of this extension this extension is a more complex version of the original custom toolbar button extension. it provides a user interface in two languages (english and french). it supports firefox, thunderbird, sunbird and flock—these are referred to as "firefox etc." in the rest of this page. it also supports seamonkey. in seamonkey it supports two themes (classic and modern). it provides all five custom toolbar buttons on all the toolbars, and it provides corresponding menu choices in seamonkey's chatzilla window. the following sections descri...
...bird and flock—these are referred to as "firefox etc." in the rest of this page. it also supports seamonkey. in seamonkey it supports two themes (classic and modern). it provides all five custom toolbar buttons on all the toolbars, and it provides corresponding menu choices in seamonkey's chatzilla window. the following sections describe this extension's overall structure, and how it implements languages and themes. overall structure this extension's internal name is allcustom. it uses this name as the default file name throughout. where you see a url in the code with no file name, the application uses this default file name and an extension appropriate for the type of file expected. the extension is supplied as a xpi, which is compressed to reduce download times. the xpi contains: ...
...and unpacked at run-time by the application. to tell the application that the files it needs are in a jar, there are changes to chrome.manifest (for firefox etc.) and to install.js (for seamonkey). for example, chrome.manifest originally had: content custombutton chrome/ now it has: content allcustom jar:chrome/allcustom.jar!/content/allcustom/ you can see the other changes if you unpack the xpi. languages extensions can be installed by users who have different language and regional preferences. a combination of language and regional preferences is known as a locale. locales are named with a two-part code. for example, the code en-us means english language (en) for the united states (us). to make it eaiser to support different locales, developers usually place anything that might depend on the loc...
...And 4 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
rocessing. one approach is to require that users of browsers which do not support the level of javascript used in your content to turn off javascript in order to be able to use your content. you can do this by providing an error message for users of older browsers as well as alternative content contained in noscript tags. <html> <head> <title>noscript</title> </head> <body> <script language="javascript"> window.onerror = function () { // redirect user to a page describing the limitations // of their browser and requesting that they turn off // javascript in order to view your site. } // netscape navigator 4 will throw an error // on any javascript which attempts to use // try ... catch exception processing. try ...
... <noscript> <!-- if javascript is not enabled, then the browser will display the contents of the noscript tag which in this case is a simple menu implemented as an unordered list. ...
... will display the contents of the noscript tag which in this case is a simple menu implemented as an unordered list. --> <ul> <li><a href="choice1.html">choice1</a></li> <li><a href="choice2.html">choice2</a></li> </ul> </noscript> </body> </html> using script language to choose the browser where it will be executed the choice of scripting language is determined by the language attribute of the script tag. ...
...And 4 more matches
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
to request all necessary privileges from the mozilla security manager (see example 2). two new cases for the above mentioned new variables should be added to the plugin implementation of npp_getvalue (see example 3). how to call plugin native methods the following html code will do the job:</p> this should be changed, we shouldn't advocate embed <embed type="application/plugin-mimetype"> <script language="javascript"> var embed = document.embeds[0]; embed.nativemethod(); </script> how to build and install having the built mozilla tree is probably not necessary, but building the plugin with a scriptable instance interface will require mozilla headers and the xpcom compatible idl compiler -- xpidl.exe. ms devstudio midl must not be used. (let's assume 'testplugin' as a plugin name-place holder.) ...
... to set flags used by the security system class nsclassinfomixin : public nsiclassinfo { // these flags are used by the dom and security systems to signal that // javascript callers are allowed to call this object's scritable methods. ...
... system class nsclassinfomixin : public nsiclassinfo { // these flags are used by the dom and security systems to signal that // javascript callers are allowed to call this object's scritable methods. ...
...And 4 more matches
XML - MDN Web Docs Glossary: Definitions of Web-related terms
this means that xml has far broader applications than just the web. for example, web services can use xml to exchange requests and responses. ...
...this means that xml has far broader applications than just the web. for example, web services can use xml to exchange requests and responses. ...
...this means that xml has far broader applications than just the web. for example, web services can use xml to exchange requests and responses. ...
...And 4 more matches
JavaScript basics - Learn web development
it was invented by brendan eich (co-founder of the mozilla project), the mozilla foundation, and the mozilla corporation. javascript is versatile and beginner-friendly. ...
...it was invented by brendan eich (co-founder of the mozilla project), the mozilla foundation, and the mozilla corporation. javascript is versatile and beginner-friendly. ...
...under of the mozilla project), the mozilla foundation, and the mozilla corporation. javascript is versatile and beginner-friendly. with more experience, you'll be able to create games, animated 2d and 3d graphics, comprehensive database-driven apps, and much more! javascript itself is relatively compact, yet very flexible. developers have written a variety of tools on top of the core javascript language, unlocking a vast amount of functionality with minimum effort. these include: browser application programming interfaces (apis) built into web browsers, providing functionality such as dynamically creating html and setting css styles; collecting and manipulating a video stream from a user's webcam, or generating 3d graphics and audio samples. third-party apis that allow developers to incorpor...
...And 4 more matches
The web and web standards - Learn web development
e implemented. web standards are created by standards bodies — institutions that invite groups of people from different technology companies to come together and agree on how the technologies should work in the best way to fulfill all of their use cases. the w3c is the best known web standards body, but there are others such as the whatwg (who were responsible for the modernization of the html language), ecma (who publish the standard for ecmascript, which javascript is based on), khronos (who publish technologies for 3d graphics, such as webgl), and others. "open" standards one of the key aspects of web standards, which timbl and the w3c agreed on from the start, is that the web (and web technologies) should be free to both contribute and use, and not encumbered by patents/licensing. therefo...
...give me the files i need to render bbc.co.uk"? "sure thing web browser — here you go" [downloads files and renders web page] the actual syntax for http messages (called requests and responses) is not that human-readable, but this gives you the basic idea. html, css, and javascript html, css, and javascript are the main three technologies you'll use to build a website: hypertext markup language, or html, is a markup language consisting of different elements you can wrap (mark up) content in to give it meaning (semantics) and structure. simple html looks like this: <h1>this is a top-level heading</h1> <p>this is a paragraph of text.</p> <img src="cat.jpg" alt="a picture of my cat"> if we adopted a house-building analogy, html would be like the foundations and walls of the house, wh...
...t in to give it meaning (semantics) and structure. simple html looks like this: <h1>this is a top-level heading</h1> <p>this is a paragraph of text.</p> <img src="cat.jpg" alt="a picture of my cat"> if we adopted a house-building analogy, html would be like the foundations and walls of the house, which give it structure and hold it together. cascading style sheets (css) is a rule-based language used to apply styles to your html, for example setting text and background colors, adding borders, animating things, or laying out a page in a certain way. as a simple example, the following code would turn our html paragraph red: p { color: red; } in the house analogy, css is like the paint, wallpaper, carpets and paintings you'd use to make the house look nice. javascript is the pro...
...And 4 more matches
Client-side tooling overview - Learn web development
overview: understanding client-side tools next in this article we provide an overview of modern web tooling, what kinds of tools are available and where you’ll meet them in the lifecycle of web app development, and how to find help with individual tools. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand what types of client-side tooling there are, and how to find tools and get help with them. overview of modern tooling writing software for the web has become more sophisticated through the ages. although it is still entirely reasonable to write html, css, and javascript "by hand" there is now a wealth of tools that developers can use to speed up the process of building a web site, or app. there are som...
...eries of articles will go beyond that, focusing on developer tools that help you produce web code more efficiently. from a high-level perspective, you can put client-side tools into the following three broad categories of problems to solve: safety net — tools that are useful during your code development. transformation — tools that transform code in some way, e.g. turning an intermediate language into javascript that a browser can understand. post-development — tools that are useful after you have written your code, such as testing and deployment tools. let's look at each one of these in more detail. safety net these are tools that make the code you write a little better. this part of the tooling should be specific to your own development environment, though it’s not uncommon fo...
... using the wrong number of spaces for indentation, or using template literals rather than regular string literals). eslint is the industry standard javascript linter — a highly configurable tool for catching potential syntax errors and encouraging "best practices" throughout your code. some companies and projects have also shared their eslint configs. you can also find linting tools for other languages, such as csslint. also well-worth looking at is webhint, a configurable, open-source linter for the web that surfaces best practices including approaches to accessibility, performance, cross-browser compatibility via mdn's browser compatibility data, security, testing for pwas, and more. it is available as a node.js command-line tool and a vs code extension. source code control also known as ...
...And 4 more matches
Mozilla
the default values given are for firefox 3. creating a firefox sidebar web publishers can offer visitors a firefox sidebar to encourage their engagement. there are two ways to create a sidebar for firefox users: the social api and an extension. you can choose either depending on your needs and resources. creating a language pack to create a language pack, or a localization repack, you first need to go through the initial setup process. creating a localized windows installer of seamonkey preamble: not all of the programs listed below are necessary. some of them are simply the ones i use because i like them, while others are scripts that i've created to speed up the work. ...
...her authentication protocols supported by the operating system. internationalized domain names (idn) support in mozilla browsers netscape 7.1 is the first commercial browser that has built-in support for internationalized domain name under the new ietf rfc's established in 2003. introduction to layout in mozilla ipc protocol definition language (ipdl) ipdl, short for "ipc (inter-process communication) protocol definition language", is a mozilla-specific language allowing c++ code to pass messages between processes or threads in an organized and secure way. all messages for multi-process plugins and tabs in firefox are declared in the ipdl language. javascript code modules j...
...in the jni.jsm section and not the js-ctypes section due to the jsm abstracting away all of the js-ctypes. unlike binary xpcom components, it allows developers to ship a single binary for use with multiple versions of firefox. localization at mozilla localization (l10n) is the process of translating software user interfaces from one language to another and adapting it to suit a foreign culture. these resources are for anyone with an interest in the technical aspects involved in localization. memory sanitizer memory sanitizer (msan) is a fast detector used for uninitialized memory in c/c++ programs. it uses a compile-time instrumentation to ensure that all memory access at runtime ...
...And 4 more matches
Understandable - Accessibility
ts guidelines and success criteria, see principle 3: understandable — information and the operation of user interface must be understandable. guideline 3.1 — readable: make text content readable and understandable this guideline focuses on making text content as understandable as possible. ...
...inciple 3: understandable — information and the operation of user interface must be understandable. guideline 3.1 — readable: make text content readable and understandable this guideline focuses on making text content as understandable as possible. success criteria how to conform to the criteria practical resource 3.1.1 language of page (a) the default human language of each web page should be detectable via code. this is essential for purposes like making sure the reader has arrived at a page written in a language suitable for them. the simplest way to achieve this is to set the lang attribute on the page's <html> element, giving it a value equal to the language code that best represents the language the page is written in. see setting the primary languag...
...able via code. this is essential for purposes like making sure the reader has arrived at a page written in a language suitable for them. the simplest way to achieve this is to set the lang attribute on the page's <html> element, giving it a value equal to the language code that best represents the language the page is written in. see setting the primary language of the document. 3.1.2 language of parts (aa) in cases where the content of a page includes words or phrases that are in a different language to the primary language, use the lang attribute on an element wrapped around the term in question (e.g. ...
...And 4 more matches
JavaScript technologies overview - JavaScript
introduction whereas html defines a webpage's structure and content and css sets the formatting and appearance, javascript adds interactivity to a webpage and creates rich web applications. however, the umbrella term "javascript" as understood in a web browser context contains several very different elements. one of them is the core language (ecmascript), another is the collection of the web apis, including the dom (document object model). ...
... and css sets the formatting and appearance, javascript adds interactivity to a webpage and creates rich web applications. however, the umbrella term "javascript" as understood in a web browser context contains several very different elements. one of them is the core language (ecmascript), another is the collection of the web apis, including the dom (document object model). javascript, the core language (ecmascript) the core language of javascript is standardized by the ecma tc39 committee as a language named ecmascript. ...
...ella term "javascript" as understood in a web browser context contains several very different elements. one of them is the core language (ecmascript), another is the collection of the web apis, including the dom (document object model). javascript, the core language (ecmascript) the core language of javascript is standardized by the ecma tc39 committee as a language named ecmascript. this core language is also used in non-browser environments, for example in node.js. ...
...And 4 more matches
BigInt.prototype.toLocaleString() - JavaScript
in implementations that ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent. ...
...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 bigintobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. in implementations that ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent. see the intl.numberformat() constructor for details on these parameters and how to use them. return value a string with a language-sensitive representation of the given bigint. performance whe...
... numberformat.format property. examples using tolocalestring in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. var bigint = 3500n; bigint.tolocalestring(); // displays "3,500" if in u.s. english locale using locales this example shows some of the variations in localized number formats. ...
...And 4 more matches
String.prototype.localeCompare() - JavaScript
ing whether a reference string comes before, or after, or is the same as the given string in sort order. 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 new locales and options arguments let applications specify the language whose sort order should be used and customize the behavior of the function. in older implementations, which ignore the locales and options arguments, the locale and sort order used are entirely implementation-dependent. syntax referencestr.localecompare(comparestring[, locales[, options]]) parameters comparestring the string against which the referencestr is compared. locales and options ...
...mentations, which ignore the locales and options arguments, the locale and sort order used are entirely implementation-dependent. syntax referencestr.localecompare(comparestring[, locales[, options]]) parameters comparestring the string against which the referencestr is compared. locales and options these arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. in implementations which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent. see the intl.collator() constructor for details on these parameters and how to use them. return value a negative number if referencestr occurs before comparestring; positive if the referenc...
...mmuniqué', 'café', 'adieu']; items.sort( (a, b) => a.localecompare(b, 'fr', {ignorepunctuation: true})); // ['adieu', 'café', 'cliché', 'communiqué', 'premier', 'réservé'] check browser support for extended arguments the locales and options arguments are not supported in all browsers yet. ...
...And 4 more matches
JavaScript
for information about api specifics to web pages, please see web apis and dom. ...
...for information about api specifics to web pages, please see web apis and dom. ...
...for information about api specifics to web pages, please see web apis and dom. ...
...And 4 more matches
Getting started with HTML - Learn web development
overview: introduction to html next in this article we cover the absolute basics of html. to get you started, this article defines elements, attributes, and all the other important terms you may have heard. it also explains where these fit into html. you will learn how html elements are structured, how a typical html page is structured, and other important basic language features. ...
...it can be as complicated or as simple as the web developer wants it to be. html consists of a series of elements, which you use to enclose, wrap, or mark up different parts of content to make it appear or act in a certain way. ...
...it can be as complicated or as simple as the web developer wants it to be. html consists of a series of elements, which you use to enclose, wrap, or mark up different parts of content to make it appear or act in a certain way. ...
...And 3 more matches
Introduction to web APIs - Learn web development
s they have. prerequisites: basic computer literacy, a basic understanding of html and css, javascript basics (see first steps, building blocks, javascript objects). objective: to gain familiarity with apis, what they can do, and how you can use them in your code. what are apis? application programming interfaces (apis) are constructs made available in programming languages to allow developers to create complex functionality more easily. they abstract more complex code away from you, providing some easier syntax to use in its place. as a real-world example, think about the electricity supply in your house, apartment, or other dwellings. if you want to use an appliance in your house, you simply plug it into a plug socket and it works. you don't try to wire it direc...
...and it works. you don't try to wire it directly into the power supply — to do so would be really inefficient and, if you are not an electrician, difficult and dangerous to attempt. image source: overloaded plug socket by the clear communication people, on flickr. ...
...they generally fall into two categories: browser apis are built into your web browser and are able to expose data from the browser and surrounding computer environment and do useful complex things with it. ...
...And 3 more matches
Introduction to client-side frameworks - Learn web development
javascript frameworks next we begin our look at frameworks with a general overview of the area, looking at a brief history of javascript and frameworks, why frameworks exist and what they give us, how to start thinking about choosing a framework to learn, and what alternatives there are to client-side frameworks. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand how client-side javascript frameworks came to exist, what problems they solve, what alternatives there are, and how to go about choosing one. a brief history when javascript debuted in 1996, it added occasional interactivity and excitement to a web that was, up until then, composed of static documents. the web became not just a place to read things, ...
...velopment. each is regularly improving or changing, and each has its pros and cons. choosing the right framework is a team- and project-dependent process, and you should do your own research to uncover what suits your needs. ...
...in the context of frameworks, dsls are variations on javascript or html that make it easier to develop with that framework. ...
...And 3 more matches
Introducing a complete toolchain - Learn web development
ng up a sample case study toolchain. we'll go all the way from setting up a sensible development environment and putting transformation tools in place to actually deploying your app on netlify. in this article we'll introduce the case study, set up our development environment, and set up our code transformation tools. prerequisites: familiarity with the core html, css, and javascript languages. objective: to solidify what we've learnt so far by working through a complete toolchain case study. there really are unlimited combinations of tools and ways to use them, what you see in this article and the next is only one way that the featured tools can be used for a project. note: it's also worth repeating that not all of these tools need to be run on the command line. ...
...version of the site at near-misses.netlify.com. tools used in our toolchain in this article we're going to use the following tools and features: jsx, a react-related set of syntax extensions that allow you to do things like defining component structures inside javascript. you won't need to know react to follow this tutorial, but we've included this to give you an idea of how a non-native web language could be integrated into a toolchain. the latest built-in javascript features (at time of writing), such as import. useful development tools such as prettier for formatting and eslint for linting. postcss to provide css nesting capabilities. parcel to build and minify our code, and to write a bunch of configuration file content automatically for us. github to manage our source code control. ...
...configure, and easier to break. conversely, the fewer links, the more resilient the toolchain is likely to be. all web projects will be different, and you need to consider what parts of your toolchain are necessary and consider each part carefully. the smallest toolchain is one that has no links at all. you would handcode the html, use "vanilla javascript" (meaning no frameworks or intermediary languages), and manually upload it all to a server for hosting. however, more complicated software requirements will likely benefit from the usage of tools to help simplify the development process. in addition, you should include tests before you deploy to your production server to ensure your software works as intended — this already sounds like a necessary toolchain. for our sample project, we'll be...
...And 3 more matches
Application Translation with Mercurial
in the section "applications & sign-offs", you will find different products and branches which are currently in translation. ...
... in the section "applications & sign-offs", you will find different products and branches which are currently in translation. ...
... in the section "applications & sign-offs", you will find different products and branches which are currently in translation. gaia-* denotes branches of firefox os, the operating system for mobile devices. ...
...And 3 more matches
An Overview of XPCOM
ime of the factory objects themselves. this is important when you want to group sets of factories together and determine if they can be unloaded. another benefit of using the nsisupports interface is that you can support other interfaces as they are introduced. ...
... support querying information about the underlying implementation, such as what language the object is written in, interfaces that the object supports, etc. this kind of "future-proofing" is a key advantage that comes along with deriving from nsisupports. xpidl and type libraries an easy and powerful way to define an interface - indeed, a requirement for defining interfaces in a cross-platform, language neutral development environment - is to use an interface definition language (idl). xpcom uses its own variant of the corba omg interface definition language (idl) called xpidl, which allows you to specify methods, attributes and constants of a given interface, and also to define interface inheritance. there are some drawbacks to defining your interface using xpidl. there is no support for multi...
...s pale in comparison to the functionality gained by using xpidl. xpidl allows you to generate type libraries, or typelibs, which are files with the extension .xpt. the type library is a binary representation of an interface or interfaces. it provides programmatic control and access of the interface, which is crucial for interfaces used in the non c++ world. when components are accessed from other languages, as they can be in xpcom, they use the binary type library to access the interface, learn what methods it supports, and call those methods. this aspect of xpcom is called xpconnect. xpconnect is the layer of xpcom that provides access to xpcom components from languages such as javascript. see connecting to components from the interface for more information about xpconnect. when a component is a...
...And 3 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
when debugging or, possibly, when trying to decide upon the best approach to solving a problem around timing and scheduling of tasks and microtasks, there are things about how the javascript runtime operates under the hood that may be useful to understand. that's what this section covers introduction javascript is an inherently single-threaded language. it was designed in an era in which this was a positive choice; there were few multi-processor computers available to the general public, and the expected amount of code that would be handled by javascript was relatively low at that time. as time passed, of course, we know that computers have evolved into powerful multi-core systems, and javascript has become one of the most prolifically-used languages in the computing world. a vast number of ...
...s time passed, of course, we know that computers have evolved into powerful multi-core systems, and javascript has become one of the most prolifically-used languages in the computing world. a vast number of the most popular applications are based at least in part on javascript code. to support this, it was necessary to find ways to allow for projects to escape the limitations of a single-threaded language. starting with the addition of timeouts and intervals as part of the web api (settimeout() and setinterval()), the javascript environment provided by web browsers has gradually advanced to include powerful features that enable scheduling of tasks, multi-threaded application development, and so forth. to understand where queuemicrotask() comes into play here, it's helpful to understand how the ja...
...text." using the ill-advised eval() function also creates a new execution context. each context is, in essence, a level of scope within your code. as one of these code segments begins execution, a new context is constructed in which to run it; that context is then destroyed when the code exits. ...
...And 3 more matches
Notification.lang - Web APIs
Web › API › Notification › lang
examples the following snippet fires a notification; a simple options object is created, then the notification is fired using the notification() constructor. ...
... examples the following snippet fires a notification; a simple options object is created, then the notification is fired using the notification() constructor. ...
... examples the following snippet fires a notification; a simple options object is created, then the notification is fired using the notification() constructor. ...
...And 3 more matches
quotes - CSS: Cascading Style Sheets
Web › CSS › quotes
es: "«" "»"; /* set open-quote and close-quote to the french quotation marks */ quotes: "«" "»" "‹" "›"; /* set two levels of quotation marks */ /* global values */ quotes: inherit; quotes: initial; quotes: unset; values none the open-quote and close-quote values of the content property produce no quotation marks. auto appropriate quote marks will be used for whatever language value is set on the selected elements (i.e. via the lang attribute). [<string> <string>]+ one or more pairs of <string> values for open-quote and close-quote. the first pair represents the outer level of quotation, the second pair is for the first nested level, next pair for third level and so on. formal definition initial valuedepends on user agentapplies toall elementsinheritedyescompute...
... full support 9samsung internet android full support 1.0auto keywordchrome no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingedge no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingfirefox full support 70ie no support ...
...ault browser behavior is to choose appropriate quotes for the user's language settingfirefox full support 70ie no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingopera no support nonotes no support nonotes notes this value is not supported, but the default browser behavior is to choose appropriate quotes for the user's language settingsafari no support nonotes no support ...
...And 3 more matches
Content negotiation - HTTP
note: some disadvantages of http content negotiation are explained in a wiki page from whatwg. html5 provides alternatives to content negotiation via, for example, the <source> element. principles of content negotiation a specific document is called a resource. ...
...referred choice of the user. the server uses them as hints and an internal algorithm chooses the best content to serve to the client. the algorithm is server-specific and not defined in the standard. see, for example, the apache negotiation algorithm. the http/1.1 standard defines list of the standard headers that start server-driven negotiation (accept, accept-charset, accept-encoding, accept-language). though strictly speaking user-agent is not in this list, it is sometimes also used to send a specific representation of the requested resource, though this is not considered as a good practice. the server uses the vary header to indicate which headers it actually used for content negotiation (or more precisely the associated response headers), so that caches can work optimally. in addition to ...
.... the default value identity is at the lowest priority (unless otherwise declared). compressing http messages is one of the most important ways to improve the performance of a web site, it shrinks the size of the data transmitted and makes better use of the available bandwidth; browsers always send this header and the server should be configured to abide to it and to use compression. the accept-language header the accept-language header is used to indicate the language preference of the user. it is a list of values with quality factors (like: "de, en;q=0.7"). a default value is often set according the language of the graphical interface of the user agent, but most browsers allow to set different language preferences. due to the configuration-based entropy increase, a modified value can be used...
...And 3 more matches
HTTP Index - HTTP
Web › HTTP › Index
rything from data theft to site defacement to distribution of malware. 17 content negotiation content negotiation, content negotiation reference, http, reference in http, content negotiation is the mechanism that is used for serving different representations of a resource at the same uri, so that the user agent can specify which is best suited for the user (for example, which language of a document, which image format, or which content encoding). 18 list of default accept values accept, content negotiation, http, reference this article documents the default values for the http accept header for specific inputs and browser versions. 19 cross-origin resource policy (corp) http, reference, security cross-origin resource policy is an opt-i...
...ding content negotiation, http, http header, reference, request header the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the content-encoding response header. ...
...otiation, http, http header, reference, request header the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the content-encoding response header. ...
...And 3 more matches
Intl.DateTimeFormat - 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. constructor intl.datetimeformat() creates a new datetimeformat object. static methods intl.datetimeformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
...les using datetimeformat in basic use without specifying a locale, datetimeformat uses the default locale and default options. ...
... // tolocalestring without arguments depends on the implementation, // the default locale, and the default time zone console.log(new intl.datetimeformat().format(date)); // → "12/19/2012" if run with en-us locale (language) and time zone america/los_angeles (utc-0800) using locales this example shows some of the variations in localized date and time formats. ...
...And 3 more matches
Intl.NumberFormat - 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. constructor intl.numberformat() creates a new numberformat object. static methods intl.numberformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
...ion of the object. examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. var number = 3500; console.log(new intl.numberformat().format(number)); // → '3,500' if in us english locale using locales this example shows some of the variations in localized number formats. ...
...e, a formatted string in the default locale and with default options is returned. var number = 3500; console.log(new intl.numberformat().format(number)); // → '3,500' if in us english locale using locales this example shows some of the variations in localized number formats. ...
...And 3 more matches
WebAssembly Concepts - WebAssembly
ly works including its goals, the problems it solves, and how it runs inside the web browser's rendering engine. what is webassembly? webassembly is a new type of code that can be run in modern web browsers and provides new features and major gains in performance. it is not primarily intended to be written by hand, rather it is designed to be an effective compilation target for low-level source languages like c, c++, rust, etc. this has huge implications for the web platform — it provides a way to run code written in multiple languages on the web at near-native speed, with client apps running on the web that previously couldn’t have done so. what’s more, you don’t even have to know how to create webassembly code to take advantage of it. webassembly modules can be imported into a web (o...
... to web developers. webassembly goals webassembly is being created as an open standard inside the w3c webassembly community group with the following goals: be fast, efficient, and portable — webassembly code can be executed at near-native speed across different platforms by taking advantage of common hardware capabilities. be readable and debuggable — webassembly is a low-level assembly language, but it does have a human-readable text format (the specification for which is still being finalized) that allows code to be written, viewed, and debugged by hand. keep secure — webassembly is specified to be run in a safe, sandboxed execution environment. like other web code, it will enforce the browser's same-origin and permissions policies. don't break the web — webassembly is designed s...
...ed reality, computer vision, image/video editing, and a number of other domains that demand native performance (see webassembly use cases for more ideas). additionally, the cost of downloading, parsing, and compiling very large javascript applications can be prohibitive. mobile and other resource-constrained platforms can further amplify these performance bottlenecks. webassembly is a different language from javascript, but it is not intended as a replacement. instead, it is designed to complement and work alongside javascript, allowing web developers to take advantage of both languages' strong points: javascript is a high-level language, flexible and expressive enough to write web applications. it has many advantages — it is dynamically typed, requires no compile step, and has a huge ecosy...
...And 3 more matches
XUL user interfaces - Archive of obsolete content
in xul, many common user interface features are built in. for example, xul provides specialized windows like dialogs and wizards, as well as status bars, menus, tool bars, and even browsers. ...
...in xul, many common user interface features are built in. for example, xul provides specialized windows like dialogs and wizards, as well as status bars, menus, tool bars, and even browsers. ...
...in xul, many common user interface features are built in. for example, xul provides specialized windows like dialogs and wizards, as well as status bars, menus, tool bars, and even browsers. ...
...And 2 more matches
A XUL Bestiary - Archive of obsolete content
to be either shrouded in mystery, misused as concepts or terms, or underestimated according to their role in xul and cross-platform development. in contrast to the mozilla jargon file, this article describes items of specific interest to the web or content developer looking to establish a context for understanding mozilla's new technologies -- and in particular mozilla's xml-based user interface language, xul. chrome some of the most powerful and frequently misunderstood features of xul and the mozilla browser have to do with chrome. the term chrome is used in different contexts to mean different things. in general, chrome refers to a xul interface and all of its supporting files; chrome means the xul content and structure, plus the css skin, plus whatever localization and platform-specific fil...
... as boxes and springs. these widgets can be created and placed within a xul file as simple elements: <menu>, <toolbar>, and so on. the syntax for these elements is based for the most part on xml. collectively, these widgets are also known as the xptoolkit. object models: dom and aom the document object model is the representation of a document as a series of scriptable objects. when a scripting language like javascript accesses various parts of an html document, it does so by means of the dom. the parts of the document, such as the head, the links, the body, any tags, are available as nodes whose attributes can be got and set. there are, unfortunately, different document object models corresponding to different types of documents and also to different proprietary notions about what in a document...
...the words that begin with "x" in the mozilla open source project. the mozilla xparchitecture section below describes xpcom, xpidl, and xpconnect, three somewhat related technologies for getting access to application code from the interface. this section describes xul, xptoolkit, and xpfe, which are in some respects synonymous and in others quite different. in briefest terms, xul is the xml-based language used for creating interfaces, xptoolkit is the set of xul widgets (menus, toolbar, etc.) actually assembed for this purpose -- the building blocks of the interface, as it were -- and xpfe, the cross platform front end, is the front end that has been created from xptoolkit. the differences here are significant: xul is the universe of elements, attributes, syntax, rules, and relationships, while x...
...And 2 more matches
Introduction to XUL - Archive of obsolete content
e mozilla has configurable, downloadable chrome, meaning that the arrangement and even presence or absence of controls in the main window is not hardwired into the application, but loaded from a separate ui description. in fact, most of mozilla's windows (and dialogs) will be described using this mechanism. xul (pronounced "zool," as if that spelling helped any, and short for "xml user interface language") is our name for the language in which these ui descriptions are built. window chrome is displayed and managed by the same layout engine that manages html content in the browser. ui descriptions, then, look a great deal like html 4. xul is an application of xml. in fact, it is just xml with specific meaning defined for a few element types, and into which html can be scattered. terms "xpfe" is...
...on of the two. applications, for instance, will have preconceived notions of what to do when they receive an "open file" command. an "open" button is simply a button. it will send its command to the application for processing, generally using some simple javascript for linkage. we are at first primarily concerned with the obvious ui components: toolbars, menus and dialogs. ...
...ing like this (for an application on an os using menubars across the top of its applications' windows): main window containing menubar area at top across width of window containing menubar (and its contents) toolbar area below menubar across width of window containing main toolbar (and its contents) application-specific content area below toolbar area structure of a xul file our language of choice is xml, flavoured with css stylistic information. having said that, the details of a particular application of xml; say, the syntax for specifying a toolbar, are left to separate documents describing those particular applications. check the xptoolkit index for the most recent list. since xul is a language for describing window layout, there is some overlap in the topics covered by this...
...And 2 more matches
Introduction - Archive of obsolete content
next » this tutorial is a guide to learning xul (xml user interface language) which is a cross-platform language for describing applications' user interfaces. this tutorial will demonstrate creating a simple find file user interface, much like that provided by the macintosh's sherlock or the find file dialog in windows. note that only the user interface will be created, with only limited functionality. the actual finding of files will not be implemented. a blue line will appear to the left of a paragraph where the find file dialog is being modified. you can follow along by looking for these sections. ...
...y limited functionality. the actual finding of files will not be implemented. a blue line will appear to the left of a paragraph where the find file dialog is being modified. you can follow along by looking for these sections. what is xul and why was it created? xul (pronounced "zool" and rhyming with "cool") was created to make development of the mozilla browser easier and faster. ...
...browser easier and faster. it is an xml language so all features available to xml are also available to xul. most applications need to be developed using features of a specific platform making building cross-platform software time-consuming and costly. a number of cross-platform solutions have been developed in the past. java, for example, has portability as a main selling point. xul is one such language designed specifically for building portable user interfaces. it takes a long time to build an application even for only one platform. the time required to compile and debug can be lengthy. with xul, an interface can be implemented and modified quickly and easily. xul has all the advantages of other xml languages. ...
...And 2 more matches
XUL Structure - Archive of obsolete content
e, which are all described below. a particular package might provide one or more skins and locales, but a user can replace them with their own. in addition, the package might include several different applications, each accessible via different chrome urls. the packaging system is flexible enough so that you can include whatever parts you need and allow other parts, such as the text for different languages, to be downloaded separately. the three types of chrome packages are: content - windows and scripts the declarations of the windows and the user interface elements contained within them. these are stored in xul files, which have a .xul extension. a content package can have multiple xul files, but the main window should have a filename that is the same as the package name. for example, the ...
...e sheets, images and other theme specific files style sheets describe details of the appearance of a window. they are stored separately from xul files to facilitate modifying the skin (theme) of an application. any images used are stored here also. locale - locale specific files all the text that is displayed within a window is stored separately. this way, a user can have a set for their own language. content packages the name of the jar file might describe what it contains, but you can't be sure unless you view its contents. let's use the browser package included with firefox as an example. if you extract the files in browser.jar, you will find that it contains a directory structure much like the following: content browser browser.xul browser.js -- other browser xul ...
...yles that define the appearance of various parts of the browser interface. again, note how the file browser.css has the same name as the package. by changing the css files, you can adjust the appearance of a window without changing its function. this is how you can create a new theme. the xul part remains the same but the skin part changes independently. locales the file en-us.jar describes the language information for each component, in this case for us english. like the skins, each language file contains files that specify text used by the package for a specific language. the locale structure is similar to the others, so it won't be listed here. the localized text is stored in two types of files: dtd files and properties files. the dtd files have a .dtd extension and contain entity declaratio...
...And 2 more matches
Using Remote XUL - Archive of obsolete content
it contains elements for all common ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers). xul is often used by desktop applications like mozilla but can also be loaded from a web server and rendered inside the content pane of a compatible browser. xul loaded and rendered in this w...
...it contains elements for all common ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers). xul is often used by desktop applications like mozilla but can also be loaded from a web server and rendered inside the content pane of a compatible browser. xul loaded and rendered in this way is called remote xul an...
...ion into a small space, render quickly, and work well. note: the downside to using xul is that it only works with browsers that understand it. this isn't a problem inside an organization that uses mozilla-based browsers exclusively, but for other sites you may need to provide another form of navigation as well. prerequisites to understand this tutorial you should have experience with tag-based languages like html along with basic javascript, css, and the dom. knowledge of xml and its syntax is useful but not required. you also need a text editor and a web browser that can render xul, like mozilla, or firefox. if you build a xul file along with this tutorial and put it onto a web server, you need to configure your web server to specify the content type of xul files as application/vnd.mozilla.xu...
...And 2 more matches
The Implementation of the Application Object Model - Archive of obsolete content
e of this document is two-fold. the first section of the document describes the motivation and reasoning behind using rdf as the foundation of xul. this section makes a technical argument both for having xul in the first place and for using rdf as the underlying implementation of xul's content model. the second section describes the xul/rdf architecture itself and outlines enhancements to the xul language in order to allow the markup language to reference local data and to indicate how and when it would like to be annotatable with local data. the case for the xul/rdf approach what is xul? xul (pronounced zool) used to be a ravening demon intent upon taking over the earth in ghost busters. in recent years, xul dropped the z from its name and replaced it with an x, and upon doing so, transforme...
...ta and to indicate how and when it would like to be annotatable with local data. the case for the xul/rdf approach what is xul? xul (pronounced zool) used to be a ravening demon intent upon taking over the earth in ghost busters. in recent years, xul dropped the z from its name and replaced it with an x, and upon doing so, transformed into something far worse than a demon. it became a markup language. xul stands for "extensible user interface language". it is an xml-based language for describing the contents of windows and dialogs. xul has language constructs for all of the typical dialog controls, as well as for widgets like toolbars, trees, progress bars, and menus. where html describes the contents of a single document, xul describes the contents of an entire window (which could itself con...
...ment object model). in a similar fashion, xul's content tree for a single window is represented as a set of objects that can be accessed and manipulated. this is referred to as the aom (application object model). how are xml dom/aom trees represented in nglayout? nglayout has its own objects for holding content trees. nsxmlelement is used to represent a single node in a content tree for an xml language. in the absence of any modifications to xul, etc., this is what would be used by default to hold the tree for a remote xul file. this nsxmlelement implements a whole slew of interfaces, since raptor has multiple apis for referring to these objects. examples of these interfaces include nsidomelement, nsidomnode, nsixmlcontent, and nsicontent. what is rdf? rdf (pronounced r-d-f) has never been a...
...And 2 more matches
LiveConnect Overview - Archive of obsolete content
when programming in javascript, you can use a wrapper object to access methods and fields of the java object; calling a method or accessing a property on the wrapper results in a call on the java object. ...
...when programming in javascript, you can use a wrapper object to access methods and fields of the java object; calling a method or accessing a property on the wrapper results in a call on the java object. ...
....1 the liveconnect objects object description javaarray a wrapped java array, accessed from within javascript code. javaclass a javascript reference to a java class. javaobject a wrapped java object, accessed from within javascript code. javapackage a javascript reference to a java package. note: because java is a strongly typed language and javascript is weakly typed, the javascript runtime engine converts argument values into the appropriate data types for the other language when you use liveconnect. see data type conversion for complete information. in some ways, the existence of the liveconnect objects is transparent, because you interact with java in a fairly intuitive way. for example, you can create a java string object an...
...And 2 more matches
XForms Custom Controls - Archive of obsolete content
ll fall into one of the following categories: custom presentation - xforms controls as rendered by the mozilla xforms processor do not provide the right look and feel for you. custom data types - existing xforms controls are not able to work properly with your data type advanced xforms controls - you need your controls to be able to do more things than traditional xforms controls can do new host language - you'd like to support xforms in host languages other than xhtml or xul custom presentation the mozilla xforms extension cannot anticipate all of the possible use cases that will evolve in web applications and web pages as xforms matures and the user base grows. and with these new uses, more and more flexibility will be desired from the controls. introducing custom controls into your environmen...
...the xforms implementation has base xbl bindings for every xforms control. you can write implementa...
...the xforms implementation has base xbl bindings for every xforms control. ...
...And 2 more matches
Archive of obsolete content
ad, refer to the downloadable sample code or to the previous sample for further details. creating a status bar extension many of the concepts introduced here apply to any xul-based application; however, to keep from getting completely overwhelmed, we're going to focus specifically on firefox. css3 css3 is the latest evolution of the cascading style sheets language and aims at extending css2.1. it brings a lot of long-awaited novelties, like rounded corners, shadows, gradients, transitions or animations, as well as new layouts like multi-columns, flexible box or grid layouts. element events archived event pages firefox developer tools these are articles related to the firefox develo...
... 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. there are some cases in which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example). in these cases jxon could represent the most practical way. list of former mozilla-based applications the following is a list of all known applications that at one point used mozilla technologies or that are no longer being actively maintained. list of mozilla-based applications the fol...
...mation about a new project or extra information about an existing project, please feel free to update this page. localizing an extension this article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension. performing a few simple steps makes your extension much easier to localize into various languages without having to edit the xul or javascript files themselves. makefile - .mk files misc top level these pages were moved from the top level of mdn in a spate of furious reorganization. mmgc mmgc is the tamarin (née macromedia) garbage collector, a memory management library that has been built as part of the avm2/tamar...
...And 2 more matches
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
javascript is primarily used in the browser, enabling developers to manipulate webpage content through the dom, manipulate data with ajax and indexeddb, draw graphics with canvas, interact with the device running the browser through various apis, and more. ...
... javascript is primarily used in the browser, enabling developers to manipulate webpage content through the dom, manipulate data with ajax and indexeddb, draw graphics with canvas, interact with the device running the browser through various apis, and more. ...
...ry javascript (or "js") is a programming language used most often for dynamic client-side scripts on webpages, but it is also often used on the server-side, using a runtime such as node.js. javascript should not be confused with the java programming language. although "java" and "javascript" are trademarks (or registered trademarks) of oracle in the u.s. and other countries, the two programming languages are significantly different in their syntax, semantics, and use cases. javascript is primarily used in the browser, enabling developers to manipulate webpage content through the dom, manipulate data with ajax and indexeddb, draw graphics with canvas, interact with the device running the browser through various apis, and more. ...
...And 2 more matches
Accessible multimedia - Learn web development
o, think about a user with a low bandwidth connection, who would find downloading the audio inconvenient. think also about a user in a noisy environment like a pub or bar, who is trying to access the information but can't hear it over the noise. video text tracks to make video accessible for deaf, blind, or even other groups of users (such as those on low bandwidth, or who don't understand the language the video is recorded in), you need to include text tracks along with your video content. note: text tracks are also useful for potentially any user, not just those with disabilities. for example, some users may not be able to hear the audio because they are in noisy environments (like a crowded bar when a sports game is being shown) or might not want to disturb others if they are in a quiet pl...
...the main ones you'll come across are: captions — there for the benefit of deaf users who can't hear the audio track, including the words being spoken, and contextual information such as who spoke the words, if the people were angry or sad, and what m...
...the main ones you'll come across are: captions — there for the benefit of deaf users who can't hear the audio track, including the words being spoken, and contextual information such as who spoke the words, if the people were angry or sad, and what mood the music is currentl...
...And 2 more matches
Debugging HTML - Learn web development
ng tools to find problems in html. debugging isn't scary when writing code of some kind, everything is usually fine, until that dreaded moment when an error occurs — you've done something wrong, so your code doesn't work — either not at all, or not quite how you wanted it to. for example, the following shows an error reported when trying to compile a simple program written in the rust language. here, the error message is relatively easy to understand — "unterminated double quote string". if you look at the listing, you can probably see how println!(hello, world!"); might logically be missing a double quote. however, error messages can quickly get more complicated and less easy to interpret as programs get bigger, and even simple cases can look a little intimidating to someone who do...
... println!(hello, world!"); might logically be missing a double quote. however, error messages can quickly get more complicated and less easy to interpret as programs get bigger, and even simple cases can look a little intimidating to someone who doesn't know anything about rust. debugging doesn't have to be scary though — the key to being comfortable with writing and debugging any programming language or code is familiarity with both the language and the tools. html and debugging html is not as complicated to understand as rust. html is not compiled into a different form before the browser parses it and shows the result (it is interpreted, not compiled). and html's element syntax is arguably a lot easier to understand than a "real programming language" like rust, javascript, or python. the w...
...bugging html is not as complicated to understand as rust. html is not compiled into a different form before the browser parses it and shows the result (it is interpreted, not compiled). and html's element syntax is arguably a lot easier to understand than a "real programming language" like rust, javascript, or python. the way that browsers parse html is a lot more permissive than how programming languages are run, which is both a good and a bad thing. permissive code so what do we mean by permissive? well, generally when you do something wrong in code, there are two main types of error that you'll come across: syntax errors: these are spelling errors in your code that actually cause the program not to run, like the rust error shown above. these are usually easy to fix as long as you are fami...
...And 2 more matches
What’s in the head? Metadata in HTML - Learn web development
ngs that you might commonly see, just to give you an idea. specifying your document's character encoding in the example we saw above, this line was included: <meta charset="utf-8"> this element simply specifies the document's character encoding — the character set that the document is permitted to use. utf-8 is a universal character set that includes pretty much any character from any human language. this means that your web page will be able to handle displaying any language; it's therefore a good idea to set this on every web page you create! for example, your page could handle english and japanese just fine: if you set your character encoding to iso-8859-1, for example (the character set for the latin alphabet), your page rendering may appear all messed up: note: some browsers (e.g. ...
...ss has caused the background to go green, and the text to become bigger. it has also styled some of the content that the javascript has added to the page (the red bar with the black border is the styling the css has added to the js-generated list.) note: if you get stuck in this exercise and can't get the css/js to apply, try checking out our css-and-js.html example page. ...
...f the content that the javascript has added to the page (the red bar with the black border is the styling the css has added to the js-generated list.) note: if you get stuck in this exercise and can't get the css/js to apply, try checking out our css-and-js.html example page. setting the primary language of the document finally, it's worth mentioning that you can (and really should) set the language of your page. ...
...And 2 more matches
Storing the information you need — Variables - Learn web development
nderstand code. secondly, when you use var, you can declare the same variable as many times as you like, but with let you can't. the following would work: var myname = 'chris'; var myname = 'bob'; but the following would throw an error on the second line: let myname = 'chris'; let myname = 'bob'; you'd have to do this instead: let myname = 'chris'; myname = 'bob'; again, this is a sensible language decision. there is no reason to redeclare variables — it just makes things more confusing. for these reasons and more, we recommend that you use let as much as possible in your code, rather than var. there is no reason to use var, unless you need to support old versions of internet explorer with your code (it doesn't support let until version 11; the modern windows edge browser supports let ju...
...e in brief, then in future articles, you'll learn about them in more detail. so far we've looked at the first two, but there are others. numbers you can store numbers in variables, either whole numbers like 30 (also called integers) or decimal numbers like 2.456 (also called floats or floating point numbers). you don't need to declare variable types in javascript, unlike some other programming languages. when you give a variable a number value, you don't include quotes: let myage = 17; strings strings are pieces of text. when you give a variable a string value, you need to wrap it in single or double quote marks; otherwise, javascript tries to interpret it as another variable name. let dolphingoodbye = 'so long and thanks for all the fish'; booleans booleans are true/false values — they...
...st element is at index 0. you'll learn a lot more about arrays in a future article. objects in programming, an object is a structure of code that models a real-life object. you can have a simple object that represents a box and contains information about its width, length, and height, or you could have an object that represents a person, and contains data about their name, height, weight, what language they speak, how to say hello to them, and more. try entering the following line into your console: let dog = { name : 'spot', breed : 'dalmatian' }; to retrieve the information stored in the object, you can use the following syntax: dog.name we won't be looking at objects any more for now — you can learn more about those in a future module. dynamic typing javascript is a "dynamically typ...
...And 2 more matches
Framework main features - Learn web development
each major javascript framework has a different approach to updating the dom, handling browser events, and providing an enjoyable developer experience. this article will explore the main features of “the big 4” frameworks, looking at how frameworks tend to work from a high level, and the differences between them. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand the main code features of frameworks. domain-specific languages all of the frameworks discussed in this module are powered by javascript, and all allow you to use domain-specific languages (dsls) in order to build your applications. in particular, react has popularized the use of jsx for writing its components, while ember utilizes handlebars. unlike...
...bjective: to understand the main code features of frameworks. domain-specific languages all of the frameworks discussed in this module are powered by javascript, and all allow you to use domain-specific languages (dsls) in order to build your applications. in particular, react has popularized the use of jsx for writing its components, while ember utilizes handlebars. unlike html, these languages know how to read data variables, and this data can be used to streamline the process of writing your ui. angular apps often make heavy use of typescript. typescript is not concerned with the writing of user interfaces, but it is a domain-specific language, and has significant differences to vanilla javascript. dsls can't be read by the browser directly; they must be transformed into javascript...
... differences to vanilla javascript. dsls can't be read by the browser directly; they must be transformed into javascript or html first. transformation is an extra step in the development process, but framework tooling generally includes the required tools to handle this step, or can be adjusted to include this step. while it is possible to build framework apps without using these domain-specific languages, embracing them will streamline your development process and make it easier to find help from the communities around those frameworks. jsx jsx, which stands for javascript and xml, is an extension of javascript that brings html-like syntax to a javascript environment. it was invented by the react team for use in react applications, but can be used to develop other applications — like vue app...
...And 2 more matches
Handling common JavaScript problems - Learn web development
ss browser testing next now we'll look at common cross-browser javascript problems and how to fix them. this includes information on using browser dev tools to track down and fix problems, using polyfills and libraries to work around problems, getting modern javascript features working in older browsers, and more. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing. objective: to be able to diagnose common javascript cross-browser problems, and use appropriate tools and techniques to fix them. the trouble with javascript historically, javascript was plagued with cross-browser compatibility problems — back in the 1990s, the main browser choices back then (internet explorer ...
...ser testing. objective: to be able to diagnose common javascript cross-browser problems, and use appropriate tools and techniques to fix them. the trouble with javascript historically, javascript was plagued with cross-browser compatibility problems — back in the 1990s, the main browser choices back then (internet explorer and netscape) had scripting implemented in different language flavours (netscape had javascript, ie had jscript and also offered vbscript as an option), and while at least javascript and jscript were compatible to some degree (both based on the ecmascript specification), things were often implemented in conflicting, incompatible ways, causing developers many nightmares. such incompatibility problems persisted well into the early 2000s, as old browsers were...
...urce code also) for a version that works. making sure asynchronous operations have returned before trying to use the values they return. for example, this ajax example checks to make sure the request is complete and the response has been returned before trying to use the response for anything. this kind of operation has been made easier to handle by the introduction of promises to the javascript language. note: buggy javascript code: the 10 most common mistakes javascript developers make has some nice discussions of these common mistakes and more. linters as with html and css, you can ensure better quality, less error-prone javascript code using a linter, which points out errors and can also flag up warnings about bad practices, etc., and be customized to be stricter or more relaxed in thei...
...And 2 more matches
Gecko info for Windows accessibility vendors
derstand msaa, you'll need to read the docs on msdn and play with the sample apps and code that come with msaa sdk 1.3. (i recommend sdk 1.3 because the msaa sdk 2.0 doesn't come with the source code to the testing tools. the other differences are not important). dom: document object model this is the w3c's specification for how web content is exposed to javascript and other languages. it covers content, style and events. inside the gecko process, code has full access to dom apis. however, exposing the entire dom to external software packages is quite involved, partially because changes to the dom in firefox must occur on the main thread. we have chosen a subset of readonly methods in the dom needed for assistive technology vendors. events such as focus changes must be tracke...
... dom apis. however, exposing the entire dom to external software packages is quite involved, partially because changes to the dom in firefox must occur on the main thread. we have chosen a subset of readonly methods in the dom needed for assistive technology vendors. events such as focus changes must be tracked through msaa events, rather than dom events. xul: extensible user-interface language the xml-based language used by firefox and mozilla to develop the ui. similar to html in that it can be combined with css and javascript to make powerful applications. contains more desktop-style widgets than html and follows a box layout model, rather than being text-flow based. ajax: asynchronous javascript and xml ajax is a method of building interactive web ap...
...sibility with your products and the gecko rendering engine. k-meleon: a light, ultra-fast and more advanced (fully configurable) gecko-based web browser available on the windows platform xul-based clients (support msaa) xul-based clients make full use of the gecko architecture, not only for html content, as well as for menus, dialogs and the entire user interface via an xml language called xul (extensible user-interface language). none of the user interface contains standard windows controls -- not even the menus! this is done to ensure a common look and feel across all supported platforms, and to allow for different skins (appearances). firefox (please use version 1.1 alpha builds or later) thunderbird (please use version 1.1 alpha builds or later) mo...
...And 2 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
n internationalized domain name (idn) is a domain/host name which uses non-ascii characters. until recently domain names allowed only a subset of 7-bit ascii characters. as the internet has spread to non-english speaking people around the world, it has become increasingly clear that forcing them to use domain names written only in a subset of the latin alphabet is not ideal. many of the european languages use the basic latin alphabet with additional accented characters for writing but they were not able to use them in domain names. there are many languages whose writing scripts are not based on latin alphabet at all. speakers of these languages were not able to use familiar names in their native languages as part of internet domain/host names. for the past few years, there have been a flurry of ...
...ompeting ascii-compatible encoding (ace) schemes proposed but an agreement was reached eventually to standardize on a type of ace called "punycode". this is defined in rfc 3492 (punycode: a bootstring encoding of unicode for internationalized domain names in applications (idna)). the punycode proposal uses only restricted ascii characters and numbers (a-z0-9) and a hyphen (-). it was shown to be language independent, superior in compression, compact in code size, round-trip safe, and superior for encoding chinese/japanese/korean characters. the final step of the process is the affixing of the ace prefix to the output string from the nameprep/stringprep and punycode processing. since the punycode contains only ascii characters, it is possible that an output may, though unlikely, coincide with exi...
...an international guideline on the use of idn characters. this was accomplished by the publication of the icann guideline for idn in june of 2003. (cf. icann = internet corporation for assigned names and numbers.) the guideline allows domain name registrars in each country to limit the use of characters for domain names. since the unicode repertoire contains characters no longer used in any living languages and there are also living characters in most languages that are not suitable for uri/url creation, the icann guideline allows the governing body of each country's domain registrars to set appropriate limitations on the use of characters. with this last piece of obstacle for standardization out of the way, domain name registrars are expected to move forward on implementing the new rfc's for exis...
...And 2 more matches
Bootstrapping a new locale
are interested in localizing thunderbird 3, seamonkey 2 or other mozilla projects based on gecko 1.9.1 you'll need to follow the instructions on getting the source-code of the comm-central repository. create a bare-bones localization next, create a base localization. this is done by cloning the en-us (united states english) files into your localization. first, you should specify your locale's language identifier in ab-cd format, where "ab" is the iso 639 language code, and cd is the iso 3166 country code. the "-cd" part is only necessary to differentiate between versions of a language that are subtly different from country to country, such as in "en-us" and "en-gb" for united states english and british english. before you run the copy commands, you need to make the locale directory at the sa...
...n-us" and "en-gb" for united states english and british english. before you run the copy commands, you need to make the locale directory at the same level as the mozilla-1.9.x/ you just cloned from above. navigate to that level making sure you are *not* inside mozilla-1.9.x/ and then run the following commands. warning: don't copy and paste these commands; you need to replace "ab-cd" with your language identifier first and 1.9.x with the most current release branch. for instance, firefox 3.6 is released from the 1.9.2 branch. from now on may be needs some corrections, (see expected structure below $cd ab-cd/browser/chrome/browser) may be needs $cp -r mozilla-1.9.x/browser/locales/ ab-cd and then $mv ab-cd/en-us ab-cd/browser and the same for the others the commands seems symbolic and not rea...
...alized build of firefox, and to set up the object directory for the localized build. cd mozilla-1.9.1 echo "mk_add_options moz_objdir=@topsrcdir@/../fx-ab-dc" > .mozconfig echo "ac_add_options --with-l10n-base=../" >> .mozconfig echo "ac_add_options --disable-compile-environment" >> .mozconfig echo "ac_add_options --enable-application=browser" >> .mozconfig make -f client.mk configure create a language pack first, we'll create a build directory. this sounds worse than it is, you won't need to actually build, but we'll need to setup something that looks like it. you're still in the l10n directory, right? we'll create build right next to it. the name of that directory doesn't really matter, so no reason to change it. mkdir ../build cd ../build now we'll set up a not-so-compile environment by ...
...And 2 more matches
Localization and Plurals
1 page" vs "2 pages". if you're here to make your code (e.g., extensions) localizable for plural forms, you can jump straight to developing with pluralform. you may also need to localize the initial strings for your code, so it would be good to read through at least the usage section as well. usage here are a couple terms used in this page to help keep things clear: plural rule: for a given language, there is a grammatical rule on how to change words, depending on the number qualifying the word. different languages can have different rules. plural form: for a particular plural rule, there can be multiple forms of a word, such as "page" and "pages". in this case, there are 2 forms, but other languages can have 1 or many more. if you're here for pluralrule in the chrome/global/intl.properti...
...how many plural forms you need, check the pluralrule number in chrome/global/intl.properties, and look up the corresponding entry in the following list of plural rules. list of plural rules this section contains a list of plural rules ordered by their plural rule number. each entry indicates how many plural forms are needed when localizing a word. for each entry, there is a list of families and languages in those families, to help you figure out if it's the rule you should pick for pluralrule. additionally, there is a brief description of each plural form, followed by some sample numbers that fall into that particular form. for a given plural rule, the order in which the plural forms are listed is the same order you need to localize a word, separated by semi-colons. for example, english uses pl...
...ic/altaic (turkish), thai, lao everything: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, … plural rule #1 (2 forms) families: germanic (danish, dutch, english, faroese, frisian, german, norwegian, swedish), finno-ugric (estonian, finnish, hungarian), language isolate (basque), latin/greek (greek), semitic (hebrew), romanic (italian, portuguese, spanish, catalan), vietnamese is 1: 1 everything else: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, … plural rule #2 (2 forms) families: romanic (french, brazil...
...And 2 more matches
Research and prep
okmarks, and links to recommended sites on the in-product pages as it relates to their locale. it is one of the most customizable and localizable parts of the product l10n process, as it goes beyond string translation. we believe that localization teams are in the best position to provide recommendations on what local providers we can use for web services because you're in the market, work in the language, and know your users. this is, therefore, meant to be a guideline for how you should be formulating your recommendations. here's the basic process: file a bug under mozilla localizations>[your_locale] to request updates to your locale's productization preferences. if this is your first localization for a product, the l10n drivers will file this bug as part of the new product localization releas...
...r suggestions follow these parameters: search there are typically five search plug-ins listed for firefox desktop (only four for firefox mobile): generic search the default option should expose the quickest path to the best result on the world wide web for the user (indexing a large portion of the global www). global search the second position can be used for the next best local language provider, meaning coverage within the local language and/or locale (indexing a smaller portion of the www but producing better local language results). local search a good test is if you were to run a set of comparative queries; the secondary engine should produce the best local language results and the primary/default position should produce the best global results. e-commerce search...
... to buy as quickly and painlessly as possible in a "trusted" site -- for example, choosing the most popular auction, general shopping, or classified type sites that have the desired user experience are good choices. there should be no more than two. specific interest search where users are using popular search engines to search more specific areas of interest that are very popular in your language or locale. there should be no more than two. in all cases, user experience should be taken into account and given preference for what is desired in that language/locale. if you have questions about what that means, please contact milos@mozilla.com or milos on irc. rss readers and content handlers productization for rss readers and content handlers applies only to firefox desktop. your selections...
...And 2 more matches
L20n Javascript API
if it is undefined, or if registerlocales hasn't been called at all, the context instance will create a spec...
...ent.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.classlist.remove('hidden'); }); ctx.registerlocales(defaultlocale: string?, availablelocales: array<string>?) register the default locale of the context instance, as well as all other locales available to the context instance before the language negotiation. locales are referenced by their bcp 47 language codes. ctx.registerlocales('en-us', ['ar', 'es-ar', 'es-es', 'en-us', 'fr', 'pl']); defaultlocale is the original language of the context instance and will be used as the last fallback locale if other locales are registered. if it is undefined, or if registerlocales hasn't been called at all, the context instance will create a special locale called i-default to be used as the default. avail...
... callback - the function to call when the negotiation completes (useful for asynchronous negotiators). it must return an array which is the final fallback chain of locales, or if the negotiation is asynchronous, it must return a falsy value and call the callback argument upon completion. ctx.registerlocalenegotiator(function(available, requested, deflocale, callback) { yourapp.getallavailablelanguages(function(allavailable) { var fallbackchain = yourapp.intersect(allavailable, requested); cb(fallbackchain); }); }); ctx.requestlocales(...requestedlocales: string?) specify the user's preferred locales for the context instance to negotiate against and freeze the context instance. when a context instance is frozen, no more resources can be added or linked. all io related to fetchin...
...And 2 more matches
Rhino overview
introduction most people who have used javascript before have done so by adding scripts to their html web pages. however, rhino is an implementation of the core language only and doesn't contain objects or methods for manipulating html documents. rhino contains all the features of javascript 1.7 allows direct scripting of java a javascript shell for executing javascript scripts a javascript compiler to transform javascript source files into java class files a javascript debugger for scripts executed with rhino language the javascript language itself is standardized by standard ecma-262 ecmascript: a general purpose, cross-platform programming language. rhino 1.3 and greater conform to edition 3 of the standard. rhino 1.6 and greater implement ecma-357 ecmascript for xml (e4x).
...for details on the implementation in rhino. in addition, rhino has implemented javaadapters, which allows javascript to implement any java interface or extend any java class with a javascript object. see the enum.js example for more information. numerous books and tutorials on javascript are available. javascript: the definitive guide is recommended, and contains a chapter on rhino. deprecated language features several language features introduced in javascript 1.2 are now deprecated. these features allow "computational reflection": that is, the ability for a script to determine and influence aspects of the way it is evaluated. these features are generally not broadly useful, yet they impose significant constraints on implementations that hamper or prevent optimization. the deprecated features...
... is, the ability for a script to determine and influence aspects of the way it is evaluated. these features are generally not broadly useful, yet they impose significant constraints on implementations that hamper or prevent optimization. the deprecated features are the __proto__ and __parent__ properties, and the constructors with, closure, and call. ...
...And 2 more matches
Building the WebLock UI
s and tools you've used have been general, cross-platform, and available in the gecko runtime environment or in any gecko-based application after mozilla 1.2 (when the gre began to be used). in this chapter, however, we are going to be building a user interface for the weblock component that's meant to be added to the existing mozilla browser[other-mozlike-browsers]. it uses xul, which is an xml language that gecko knows how to render as user interface, but it also interacts with particular parts of the mozilla user interface, where it must install itself as an extension to the ui. specifically, the user interface we create in this chapter will be overlaid into the statusbar of the browser component, where it will provide a small icon the user can click to access the web lock interface. weblock ...
...y in the sections below. in the following chapter we'll describe how you can take these files and create a package, an installable archive that includes the weblock component and the new ui. because this step (particularly the overlay section) is so dependent on mozilla, the chapter is divided up into a couple of different sections. the second section, xul, describes the xml-based user interface language (xul) and how you can use it to create a dialog that provides access to the weblock component and its services. the third section, overlaying new user interface into mozilla, describes how to create an overlay into the browser that will make this dialog accessible from a mozilla build. the overlay section, where we discuss how to import scripts, images, and other resources from mozilla into your ...
...bar. that function uses the opendialog method from the window object and takes the url to the xul file in which the dialog is defined: function loadweblock() { window.opendialog("chrome://weblock/weblock.xul"); } xul the entire user interface of the mozilla browser and all of the applications that go with it, including the mail client, the irc client, and others, have been defined in an xml language called xul. elements in the xul markup map to widgets in the interface that gecko renders in a fairly straightforward way - so, for instance, the root element of an application window is the element <window/>, the root element of the dialog we'll be creating here is <dialog/>, and so forth. within a xul application file, elements like <button/>, <menu/>, and <checkbox/> can be hooked up to an eve...
...And 2 more matches
nsIClassInfo
xpcom/components/nsiclassinfo.idlscriptable provides information about a specific implementation class. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsisupports gethelperforlanguage(in pruint32 language); void getinterfaces(out pruint32 count, [array, size_is(count), retval] out nsiidptr array); attributes attribute type description classdescription string a human readable string naming the class, or null. read only. classid nscidptr a classid through which an instance of this class can be created, or null. if the flags attribute has the singleton bit set, then the value of this attribute specifies a classid through which this class can be ac...
...ute has the singleton bit set, then the value of this attribute specifies a contractid through which this class may be accessed as a service using nsiservicemanager.getservicebycontractid(). read only. flags pruint32 specifies various binary properties of this class. possible values for this attribute include a bit-wise combination of the constants read only. implementationlanguage obsolete since gecko 40 pruint32 the language type in which this class is implemented. see nsiprogramminglanguage.constants for a list of possible values. read only. constants bitflags for 'flags' attribute. constant value description singleton 1 << 0 the class is a singleton that must be accessed via nsiservicemanager. threadsafe 1 << 1 ...
... reserved for consumers of these flags. no implementor of this interface should ever return flags with this bit set. eager_classinfo 1 << 5 this flag is designed for use with nsgenericfactory and can be set in nsmodulecomponentinfo::mflags. it has no meaning when returned from the flags attribute of a nsiclassinfo implementation. ...
...And 2 more matches
Introduction to the DOM - Web APIs
k at how the dom represents an html or xml document in memory and how you use apis to create web content and applications. what is the dom? the document object model (dom) is a programming interface for html and xml documents. it represents the page so that programs can change the document structure, style, and content. the dom represents the document as nodes and objects. that way, programming languages can connect to the page. a web page is a document. this document can be either displayed in the browser window or as the html source. but it is the same document in both cases. the document object model (dom) represents that same document so it can be manipulated. the dom is an object-oriented representation of the web page, which can be modified with a scripting language such as javascript. t...
...other apis that add new features and capabilities to the dom. for example, the html dom api adds support for representing html documents to the core dom. dom and javascript the short example above, like nearly all of the examples in this reference, is javascript. that is to say, it's written in javascript, but it uses the dom to access the document and its elements. the dom is not a programming language, but without it, the javascript language wouldn't have any model or notion of web pages, html documents, xml documents, and their component parts (e.g. elements). every element in a document—the document as a whole, the head, tables within the document, table headers, text within the table cells—is part of the document object model for that document, so they can all be accessed and manipulate...
... language wouldn't have any model or notion of web pages, html documents, xml documents, and their component parts (e.g. elements). every element in a document—the document as a whole, the head, tables within the document, table headers, text within the table cells—is part of the document object model for that document, so they can all be accessed and manipulated using the dom and a scripting language like javascript. in the beginning, javascript and the dom were tightly intertwined, but eventually, they evolved into separate entities. ...
...And 2 more matches
CSS: Cascading Style Sheets
Web › CSS
previously development of various parts of css specification was done synchronously, which allowed versioning of the latest recommendation. you might have heard about css1, css2.1, css3. however, css4 has never become an official version. ...
...previously development of various parts of css specification was done synchronously, which allowed versioning of the latest recommendation. you might have heard about css1, css2.1, css3. however, css4 has never become an official version. ...
...content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. css building blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more. the aim here is to provide you with a toolkit for writing competent css and help you understand all the essential theory, before moving on ...
...And 2 more matches
Intl.Collator - 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. constructor intl.collator() creates a new collator object. static methods intl.collator.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.collator.prototype.compare getter function that compares two strings according to the sort order of this intl.collator object. ...
...lue console.log(new intl.collator().compare('a', 'a')); // → 0 note that the results shown in the code above can vary between browsers and browser versions. this is because the values are implementation-specific. that is, the specification requires only that the before and after values are negative and positive. ...
...'a')); // → 0 note that the results shown in the code above can vary between browsers and browser versions. this is because the values are implementation-specific. that is, the specification requires only that the before and after values are negative and positive. using locales the results provided by collator.prototype.compare() vary between languages. ...
...And 2 more matches
requiredFeatures - SVG: Scalable Vector Graphics
http://www.w3.org/tr/svg11/feature#svgdom-animation the browser supports all of the dom interfaces and methods tha...
...nkattribute http://www.w3.org/tr/svg11/feature#font http://www.w3.org/tr/svg11/feature#extensibility http://www.w3.org/tr/svg11/feature#svgdom-static the browser supports all of the dom interfaces and methods that correspond to the language features for http://www.w3.org/tr/svg11/feature#svg-static. http://www.w3.org/tr/svg11/feature#svg-animation the browser supports all of the language features from http://www.w3.org/tr/svg11/feature#svg-static plus the feature http://www.w3.org/tr/svg11/feature#animation. http://www.w3.org/tr/svg11/feature#svgdom-animation the browser supports all of the dom interfaces and methods that correspond to the language features for http://www.w3.org/tr/svg11/feature#svg-animation. http://www.w3.org/tr/svg11/feature#svg-dynamic the browser...
.../www.w3.org/tr/svg11/feature#svg-static plus the feature http://www.w3.org/tr/svg11/feature#animation. http://www.w3.org/tr/svg11/feature#svgdom-animation the browser supports all of the dom interfaces and methods that correspond to the language features for http://www.w3.org/tr/svg11/feature#svg-animation. ...
...And 2 more matches
Tutorials
, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. css building blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more. the aim here is to provide you with a toolkit for writing competent css and help you understand all the essential theory, before moving on ...
...s, loops, functions, and events. you've seen this stuff already in the course, but only in passing — here we'll discuss it all explicitly. getting started with javascript what is javascript and how can it help you? codecademy codecademy is an easy way to learn how to code javascript. it's interactive and you can do it with your friends. freecodecamp freecodecamp teaches a variety of languages and frameworks for web development. it also has a forum, an internet radio station, and a blog. intermediate level introducing javascript objects in javascript, most things are objects, from core javascript features like strings and arrays to the browser apis built on top of javascript. you can even create your own objects to encapsulate related functions and variables into efficient p...
...oducing javascript objects in javascript, most things are objects, from core javascript features like strings and arrays to the browser apis built on top of javascript. you can even create your own objects to encapsulate related functions and variables into efficient packages. the object-oriented nature of javascript is important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we've provided this module to help you. here we teach object theory and syntax in detail, look at how to create your own objects, and explain what json data is and how to work with it. client-side web apis when writing client-side javascript for websites or applications, you won't go very far before you start to use apis — interfaces for manipulating d...
...And 2 more matches
Web technology for developers
cations. many of these samples can also be used in xulrunner applications, as well as in actual mozilla code itself. view all... web technology references web apis reference material for each of the individual apis that comprise the web's powerful scriptability, including the dom and all of the related apis and interfaces you can use to build web content and apps. ...
... these samples can also be used in xulrunner applications, as well as in actual mozilla code itself. view all... web technology references web apis reference material for each of the individual apis that comprise the web's powerful scriptability, including the dom and all of the related apis and interfaces you can use to build web content and apps. ...
...nd apps. html hypertext markup language is the language used to describe and define the content of a web page. css cascading style sheets are used to describe the appearance of web content. svg scalable vector graphics let you describe images as sets of vectors and shapes in order to allow them to scale smoothly regardless of the size at which they're drawn. mathml the mathematical markup language makes it possible to display complex mathematical equations and syntax. temporary the stuff below here is temporary to help keep track of things while organization work is ongoing. pay it no mind. ...
...And 2 more matches
Understanding WebAssembly text format - WebAssembly
the binary and textual formats, the fundamental unit of code in webassembly is a module. in the text format, a module is represented as one big s-expression. s-expressions are a very old and very simple textual format for representing trees, and thus we can think of a module as a tree of nodes that describe the module’s structure and its code. unlike the abstract syntax tree of a programming language, though, webassembly’s tree is pretty flat, mostly consisting of lists of instructions. first, let’s see what an s-expression looks like. each node in the tree goes inside a pair of parentheses — ( ... ). the first label inside the parenthesis tells you what type of node it is, and after that there is a space-separated list of either attributes or child nodes. so that means the webassem...
...ebassembly module is grouped into functions, which have the following pseudo-code structure: ( func <signature> <locals> <body> ) the signature declares what the function takes (parameters) and returns (return values). the locals are like vars in javascript, but with explicit types declared. the body is just a linear list of low-level instructions. so this is similar to functions in other languages, even if it looks different because it is an s-expression. signatures and parameters the signature is a sequence of parameter type declarations followed by a list of return type declarations. it is worth noting here that: the absence of a (result) means the function doesn’t return anything. in the current iteration, there can be at most 1 return type, but later this will be relaxed ...
...rect to call a function from the table — it implicitly pops the value of $i off the stack. the net result of this is that the callbyindex function invokes the $i’th function in the table. you could also declare the call_indirect parameter explicitly during the command call instead of before it, like this: (call_indirect (type $return_i32) (local.get $i)) in a higher level, more expressive language like javascript, you could imagine doing the same thing with an array (or probably more likely, object) containing functions. the pseudo code would look something like tbl[i](). so, back to the typechecking. since webassembly is typechecked, and the funcref can be potentially any function signature, we have to supply the presumed signature of the callee at the callsite, hence we include the $ret...
...And 2 more matches
The Essentials of an Extension - Archive of obsolete content
> <em:homepageurl>https://developer.mozilla.org/docs/xul_school</em:homepageurl> this is the data that is displayed before and after the extension is installed, that you can see in the add-ons manager. there are many other tags that can be added, for contributors and translators. the full specification of the install.rdf file has all the details. since extensions can be translated to multiple languages, it is often necessary to translate the extension's description, or even its name. a localized description and name can be added with the following code: <em:localized> <description> <em:locale>es-es</em:locale> <em:name>xul school hola mundo</em:name> <em:description>bienvenido a xul school!</em:description> </description> </em:localized> the es-es locale string indicates ...
... holding user interface (xul) and script (js) files. the skin section has the files that define most of the look and feel of the ui (using css and images, just like web pages). finally, the locale section holds all text used in the extension, in dtd and properties files. this division allows other developers to create themes that replace skins, and translators to create localizations in different languages, all of this without having to change your extension or your code. this gives firefox extensions a great deal of flexibility. chrome files are accessed through the chrome protocol. this is what a chrome uri looks like: chrome://packagename/section/path/to/file so, for instance, if i want to access the file browseroverlay.xul in the extension, the chrome uri would be chrome://xulschoolhell...
...t of localized strings, like when you want to inform the user about some stat related to the extension. for example: "found 5 words matching the search query". your first idea would probably be to simply concatenate strings, and have one "found" property and another "words matching..." property. this is not a good idea. it greatly complicates the work of localizers, and grammar rules on different languages may change the ordering of the sentence entirely. for this reason it's better to use parameters in the properties: xulschoolhello.search.label = found %s words matching the search query! then you use getformattedstring instead of getstring in order to get the localized string. thanks to this we don't need to have multiple properties, and life is easier for translators. you can read more ab...
...alized string. thanks to this we don't need to have multiple properties, and life is easier for translators. you can read more about it on the text formatting section of the xul tutorial. also have a look at the plurals and localization article, that covers a localization feature in firefox that allows you to further refine this last example to handle different types of plural forms that are also language-dependent. skin styling xul is very similar to styling html. we'll look into some of the differences when we cover the xul box model, and other more advanced topics. there isn't much styling you can do to a minimal menu and a very simple alert message, so the hello world extension only includes an empty css file and the compulsory global skin file: <?xml-stylesheet type="text/css" href="chro...
CSS3 - Archive of obsolete content
it brings a lot of long-awaited novelties, like rounded corners, shadows, gradients, transitions or animations, as well as new layouts like multi-columns, flexible box or grid layouts. experimental parts are vendor-prefixed and should either be avoided in production environments, or used with extreme caution as both their syntax and semantics can change in the future. modules and the standardization process css level 2 needed 9 years, from august 2002 to june 2011 to reach the recommendation status. this was due to the fact that a few secondary features held back the whole specification. ...
...to june 2011 to reach the recommendation status. this was due to the fact that a few secondary features held back the whole specification. in order to accelerate the standardization of non-problematic features, the css working group of the w3c, in a decision referred as the beijing doctrine, divided css in smaller components called modules . each of these modules is now an independent part of the language and moves towards standardization at its own pace. while some modules are already w3c recommendations, other still are early working drafts. new modules are also added when new needs are identified. formally, there is no css3 standard per se . each module being standardized independently, the standard css consists of css2.1 amended and extended by the completed modules, not necessary all with ...
...t-letter, and :first-line becomes ::first-line. the new general sibling combinator ( h1~pre ). the next iteration of the selectors specification is already in progress, though it still hasn't reached the first public working draft stage. media queries recommendation since june 19th, 2012 extends the former media type ( print, screen, … ) to a full language allowing queries on the device media capabilities like only screen and (color) . media queries are not only used in css document but also in some attributes of html elements, like the media attribute of the <link> element. the next iteration of this specification is in the work, allowing to tailor a web site regarding the input methods available on the user agent, with new media f...
...ttribute. css fonts module level 3 candidate recommendation since september 20th, 2018 amends the css2.1 font matching algorithm to be closer to what is really implemented. adds: support for downloadable fonts via the css @font-face at-rule. the control of the contextual inter-glyph spacing via the css font-kerning property. the choice of language-specific glyphs via the css font-language-override property. the choice of glyphs with specific opentype features via the css font-feature-settings property. the control of the aspect ratio to use when fallback fonts are selected via the css font-size-adjust property. the choice of alternative font faces using the css font-stretch, font-variant-alternates, font-variant-caps, font-v...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
ing web pages, in which developers format text layouts into pages and link those pages to related content, is analogous to a book or a magazine: readers view pages, go to other pages for more information, and view resources listed as references on that page. html and web standards have evolved and now offer flexible and fine-grained control to layout as well supporting dhtml, powerful programming languages like javascript, and additional media through embeddable third-party resources like flash, java, vrml, etc. additionally, server-side technologies have also evolved, supporting and connecting different resources to different browsers. despite all the evolution, we still see the underpinnings of the original model in modern web sites. we still connect through a set of links that mostly drive us t...
...ngth;i++) { // acquiring the data from the dom... articletitle=article.getelementsbytagname("article").item(0).firstchild.nodevalue; // inserting the content into the container.. document.getelementbyid("container").innerhtml+=articletitle+"<br />"; } source code for the sample <html> <head> <title>inner-browsing example, with xmlhttprequest and dom</title> <script type="text/javascript" language="javascript" src="xmlrequest.js"></script> <script> /* ***** begin license block ***** * version: mpl 1.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license i...
...this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is netscape code. * * the initial developer of the original code is * netscape corporation. * portions created by the initial developer are copyright (c) 2003 * the initial developer. all rights reserved. * * contributor(s): marcio galli <mgalli@mgalli.com> * * ***** end license block ***** */ //// /// calld...
...:hover { background-color:#ddeeff; } </style> </head> <body > <h2>latest headlines - inner-browsing example </h2> <p>click the tabbed menu to dynamically load the headlines into this web page.</p> <br /> <!-- ***** this code dynamically creates the tabbed menu if the browser has support to xmlhttprequest, since the mechanism used here is xmlhttprequest ***** --> <script type="text/javascript" language="javascript"> //// /// object detection // var xcomp=null; var testxmlhttprequest=false; try { xcomp = new xmlhttprequest(); if(xcomp) testxmlhttprequest=true; } catch (e) { try { xcomp = new activexobject("microsoft.xmlhttp"); if(xcomp) testxmlhttprequest=true; } catch (e) { } } if(testxmlhttprequest&&document.getelementsbytagname) { document.write("<...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
rs. i'll also cover nonstandard technologies, such as xmlhttprequest and rich text editing, that mozilla does support because no w3c equivalent existed at the time. ...
...uch as xmlhttprequest and rich text editing, that mozilla does support because no w3c equivalent existed at the time. ...
...many browsers, such as internet explorer, also support pre-w3c apis and ...
..." "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> ... <script> document.write("<script type='text/javascript'>alert('hello');</script>") </script> since the page is in strict mode, mozilla's parser will see the first <script> and parse until it finds a closing tag for it, which would be the first </script>. this is because the parser has no knowledge about javascript (or any other language) when in strict mode. in quirks mode, the parser is aware of javascript when parsing (which slows it down). internet explorer is always in quirks mode, as it does not support true xhtml. to make this work in strict mode in mozilla, separate the string into two parts: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> ... <sc...
Reference - Archive of obsolete content
put in layman definitions there for js constructs like functions and variables. --maian 01:43, 30 september 2005 (pdt) we should define the terms we are using. in particular this means we should define activation object somewhere (and link to it whenever we mention it). --nickolay 18:40, 16 july 2006 (pdt) js 1.2 and gecko 1.8 per the fix for bug 255895, "javascript1.2" values for the script's language attribute no longer work, e.g. <script language="javascript1.2"> will execute the script in the latest js version rather than js 1.2. so how should this be documented? in fx 1.0, js 1.2 is available, but not in the upcoming fx 1.5. there are 5 cases where "javascript1.2" is mentioned in this reference: special:search?search=javascript1.2&go=go. how should they be revised? --maian 23:43, 21 septem...
...w the differences between two versions of js, and if we have a section in the reference that is dedicated to discussing these differences, i would think that those samples should be included in that section of the reference. or am i misunderstanding something? -- dria 05:30, 22 september 2005 (pdt) the examples (or most of them at least) say that the browser can use the js 1.2 engine with the language="javascript1.2" tag, but this is no longer possible; language="javascript1.x" tags will always use the current version now, i.e. js 1.6. so while the examples do show what js 1.2 does, they incorrectly indicate that it's possible to switch to the 1.2 engine. --maian 05:41, 22 september 2005 (pdt) this is true. the wording should be changed with the javascript 1.x examples, as well as refer t...
...the javascript 1.x examples, as well as refer to the versions in the past tense. i also support the use of a deprecated pre box with these examples. since it's been 9 months since the last comment on this, i think i'll go ahead and change all of the examples. if anyone disagrees, you can always revert. sevenspade 13:19, 2 july 2006 (pdt) after some thought, i removed the references to using language="javascript1.2", and all references are merely presented as information detailing past behavior. the "backwards compatibility" sections have been renamed to "behavior in older versions." however, i think this is only appropriate if we are going to document the evolution of everything, or at least note the most significant changes introduced in the various versions. otherwise, i think we should j...
...pages to "... js ..." (no version number). make the pages document the latest version. each statement/function/object/operator/feature has a small note telling what version introduced that feature. perhaps a larger footnote if there are backwards-compatibility issues involved in using that feature. <hr> xmlhttprequest xmlhttprequest is a host object provided by the browser, not part of js core language. i reverted the addition of xhr to the reference. we should link to some dom vs. js article from the main page and global objects page at least. --nickolay 09:48, 31 january 2007 (pst) yes, it's not a "core" javascript object. let me try to add the links you suggested ... --davidcary 10:25, 31 january 2007 (pst) why distinguish global objects from global properties from global functions? why d...
Archived open Web documentation - Archive of obsolete content
bsolete css features displaying notifications (deprecated) firefox offers support for "desktop notifications"; these are notifications that are displayed to the user outside the context of the web content, using the standard notification system provided by the operating system. e4x ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x tutorial ...
...es over enumerable properties of an object. liveconnect (please update or remove as needed.) msx emulator (jsmsx) old proxy api proxies are objects for which the programmer has to define the semantics in javascript. the default object semantics are implemented in the javascript engine, often written in lower-level languages like c++. proxies let the programmer define most of the behavior of an object in javascript. they are said to provide a meta-programming api. parallelarray the goal of parallelarray was to enable data-parallelism in web applications. the higher-order functions available on parallelarray attempted to execute in parallel, though they may fall b...
... to sequential execution if necessary. to ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of js that firefox supports. properly using css and javascript in xhtml documents xhtml™ 1.0 the extensible hypertext markup language (second edition) defines xhtml to be a reformulation of html 4 as an xml 1.0 application. talk:javascript reference the guide section links to an interesting document discussing how to create and use private variables in objects, which is great if you want to protect the various properties within an object from being poked at accidentally. i also ...
...apply(). well if you combine the two, you can have inherited private variables: scope cheatsheet javascript with mozilla extensions has both function-scoped vars and block-scoped lets. along with hoisting and dynamic behavior, scope in javascript is sometimes surprising. server-side javascript here's a radical idea: use one language to write entire web apps -- the same language which billions of web pages already use, every day. sharp variables in javascript a sharp variable is a syntax in object initializers that allows serialization of objects that have cyclic references or multiple references to the same object. standards-compliant authoring tools creating cross-browser ...
Handling different text directions - Learn web development
revious overview: building blocks next many of the properties and values that we have encountered so far in our css learning have been tied to the physical dimensions of our screen. we create borders on the top, right, bottom, and left of a box, for example. these physical dimensions map very neatly to content that is viewed horizontally, and by default the web tends to support left-to-right languages (e.g. english or french) better than right-to-left languages (such as arabic). in recent years however, css has evolved in order to better support different directionality of content, including right-to-left but also top-to-bottom content (such as japanese) — these different directionalities are called writing modes. as you progress in your study and begin to work with layout, an understandin...
...cs (study introduction to html), and an idea of how css works (study css first steps.) objective: to understand the importance of writing modes to modern css. what are writing modes? a writing mode in css refers to whether the text is running horizontally or vertically. the writing-mode property lets us switch from one writing mode to another. you don't need to be working in a language which uses a vertical writing mode to want to do this — you could also change the writing mode of parts of your layout for creative purposes. in the example below we have a heading displayed using writing-mode: vertical-rl. the text now runs vertically. vertical text is common in graphic design, and can be a way to add a more interesting look and feel to your web design. the three possible ...
...this figure shows the two dimensions when in a horizontal writing mode. this figure shows the two dimensions in a vertical writing mode. once you start to look at css layout, and in particular the newer layout methods, this idea of block and inline becomes very important. we will revisit it later on. direction in addition to writing mode we also have text direction. ...
...instead they will talk about start and end along with this idea of inline and block. ...
What is CSS? - Learn web development
prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to learn what css is. ...
...ven if no explicit styling is specified by the author of the page. however, the web would be a boring place if all websites looked like that. using css you can control exactly how html elements look in the browser, presenting your markup using whatever design you like. for more on browser/default styles, check out the following video: what is css for? as we have mentioned before, css is a language for specifying how documents are presented to users — how they are styled, laid out, etc. a document is usually a text file structured using a markup language — html is the most common markup language, but you may also come across other markup languages such as svg or xml. presenting a document to a user means converting it into a form usable by your audience. browsers, like firefox, chrome...
...ic document text styling — for example changing the color and size of headings and links. it can be used to create layout — for example turning a single column of text into a layout with a main content area and a sidebar for related information. it can even be used for effects such as animation. have a look at the links in this paragraph for specific examples. css syntax css is a rule-based language — you define rules specifying groups of styles that should be applied to particular elements or groups of elements on your web page. for example "i want the main heading on my page to be shown as large red text." the following code shows a very simple css rule that would achieve the styling described above: h1 { color: red; font-size: 5em; } the rule opens with a selector . this sele...
...s property pages (along with other css features) listed on the mdn css reference. alternatively, you should get used to searching for "mdn css-feature-name" in your favourite search engine whenever you need to find out more information about a css feature. for example, try searching for "mdn color" and "mdn font-size"! css modules as there are so many things that you could style using css, the language is broken down into modules. you'll see reference to these modules as you explore mdn and many of the documentation pages are organized around a particular module. for example, you could take a look at the mdn reference to the backgrounds and borders module to find out what its purpose is, and what different properties and other features it contains. you will also find links to the css specificat...
HTML basics - Learn web development
html consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. ...
...html consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. ...
...html consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. the enclosing tags can make a word or image hyperlink to somewhere else, can italicize words, can make the font bigger or smaller, and so on. ...
...html page that isn't the content you are showing to your page's viewers. this includes things like keywords and a page description that you want to appear in search results, css to style our content, character set declarations and more. <meta charset="utf-8"> — this element sets the character set your document should use to utf-8 which includes most characters from the vast majority of written languages. essentially, it can now handle any textual content you might put on it. there is no reason not to set this and it can help avoid some problems later on. <title></title> — the <title> element. this sets the title of your page, which is the title that appears in the browser tab the page is loaded in. it is also used to describe the page when you bookmark/favourite it. <body></body> — the <b...
HTML text fundamentals - Learn web development
nts into a food processor.</li> <li>process all the ingredients into a paste. <ul> <li>if you want a coarse "chunky" hummus, process it for a short time.</li> <li>if you want a smooth hummus, process it for a longer time.</li> </ul> </li> </ol> try going back to the previous active learning example and updating the second list like this. ...
...for example, the following two sentences have different meanings. i am glad you weren't late. i am glad you weren't late. the first sentence sounds genuinely relieved that the person wasn't late. ...
...nd we often want to mark certain words as important or different in some way. html provides various semantic elements to allow us to mark up textual content with such effects, and in this section, we'll look at a few of the most common ones. emphasis when we want to add emphasis in spoken language, we stress certain words, subtly altering the meaning of what we are saying. similarly, in written language we tend to stress words by putting them in italics. for example, the following two sentences have different meanings. i am glad you weren't late. i am glad you weren't late. the first sentence sounds genuinely relieved that the person wasn't late. in contrast, the second one sounds sarcastic or passive-aggressive, expressing annoyance that the person arrived a bit late. in html we use the <em...
...ised by screen readers and spoken out in a different tone of voice. browsers style this as italic by default, but you shouldn't use this tag purely to get italic styling. to do that, you'd use a <span> element and some css, or perhaps an <i> element (see below). <p>i am <em>glad</em> you weren't <em>late</em>.</p> strong importance to emphasize important words, we tend to stress them in spoken language and bold them in written language. for example: this liquid is highly toxic. i am counting on you. do not be late! in html we use the <strong> (strong importance) element to mark up such instances. as well as making the document more useful, again these are recognized by screen readers and spoken in a different tone of voice. browsers style this as bold text by default, but you shouldn't use t...
Client-Server Overview - Learn web development
nt-server interactions in a dynamic website, and in particular what operations need to be performed by server-side code. there is no real code in the discussion because we haven't yet chosen a web framework to use to write our code! this discussion is however still very relevant, because the described behaviour must be implemented by your server-side code, irrespective of which programming language or web framework you select. web servers and http (a primer) web browsers communicate with web servers using the hypertext transfer protocol (http). when you click a link on a web page, submit a form, or run a search, the browser sends an http request to the server. this request includes: a url identifying the target server and resource (e.g. an html file, a particular data point on the ser...
... the target resource url (/search). the url parameters (q=c...
...1lu21b1t136rhbv7ezngie; ...). the remaining lines contain information about the browser used and the sort of responses it can handle. for example, you can see here that: my browser (user-agent) is mozilla firefox (mozilla/5.0). it can accept gzip compressed information (accept-encoding: gzip). it can accept the specified set of characters (accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7) and languages (accept-language: de,en;q=0.7,en-us;q=0.3). the referer line indicates the address of the web page that contained the link to this resource (i.e. the origin of the request, https://developer.mozilla.org/). http requests can also have a body, but it is empty in this case. the response the first part of the response for this request is shown below. the header contains information like the fol...
...illa.org upgrade-insecure-requests: 1 user-agent: mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/52.0.2743.116 safari/537.36 content-type: application/x-www-form-urlencoded accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 referer: https://developer.mozilla.org/profiles/hamishwillee/edit accept-encoding: gzip, deflate, br accept-language: en-us,en;q=0.8,es;q=0.6 cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; _gat=1; csrftoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _ga=ga1.2.1688886003.1471911953; ffo=true csrfmiddlewaretoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat&user-username=hamishwillee&user-fullname=hamish+willee&user-title=&user-organization=&user-location=australia&user-local...
Getting started with Ember - Learn web development
previous overview: client-side javascript frameworks next in our first ember article we will look at how ember works and what it's useful for, install the ember toolchain locally, create a sample app, and then do some initial setup to get it ready for development. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to learn how to install ember, and create a starter app. introducing ember ember is a component-service framework that focuses on the overall web application ...
...end frameworks out there. but what does it mean to be opinionated? in ember, opinions are a set of conventions that help increase the efficiency of developers at the cost of having to learn those conventions. as conventions are defined and shared, the opinions that back those conventions help reduce the menial differences between apps — a common goal among all opinionated frameworks, across any language and ecosystem. developers are then more easily able to switch between projects and applications without having to completely relearn the architecture, patterns, conventions, etc. as you work through this series of tutorials, you'll notice ember's opinions — such as strict naming conventions of component files. how does ember relate to vanilla javascript? ember is built on javascript technol...
......
... to make build and runtime optimizations that otherwise wouldn't be possible. most importantly, it is a superset of html — meaning that anyone who knows html can make meaningful contributions to any ember project with minimal fear of breaking code. designers and other non-developers can contribute to page templates without any knowledge of javascript, and interactivity can be added later. this language also enables lighter asset payloads due to compiling the templates into a "byte code" that can be parsed faster than javascript. the glimmer vm enables extremely fast dom change tracking without the need to manage and diff a cached virtual representation (which is a common approach to mitigating the slow i/o of dom changes). for more information on the technical aspects of the glimmer vm, the gi...
A bird's-eye view of the Mozilla framework
f the source tree. the code samples in the article are based on mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.9a1) gecko/20051104 seamonkey/1.1a from a new source tree checked out 11/04/05. the build id is 2005110409. thehelp viewer files referenced in the article are located in /seamonkey/extensions/help/ this article also assumes you are familiar with the javascript and c++ programming languages, object-oriented programming (oop) terminology and design concepts, the microsoft® component object model (com), and the corba omg interface definition language (idl). organization this article first covers some conceptual groundwork, then walks through a user scenario to illustrate how key mozilla architectural components work together to support a simplehelp viewer ui action. framework lay...
...d object that encapsulates both the command actions and data associated with a graphical user interface (gui) control. the various x toolkit implementations provide a set of widgets for ui controls such as menus, command buttons, dialog boxes and scroll bars. the mozilla xptoolkit module provides a similar set of facilities for building cross-platform ui controls implemented as xml user interface language (xul) packages. a xul package consists of a xul description of the ui widget cascading style sheets customizing appearance javascript services implementing the ui behavior a package (also known as chrome) is really just a bundling of a set of ui widgets and associated services implementing a particular application feature. chrome and extensions are examples of packages. content (dom) the...
... not need to know anything about the internal structure or implementation of the provider object in order to take advantage of its services. the client simply queries the provider for a particular service, and if available, accesses that service through an interface defined in xpidl (cross-platform idl), derived from the corba idl. the xpidl interface description is independent of the programming language used to implement the object itself. for example, a javascript object or c++ class could both implement the same xpidl interface. scripting languages such as javascript cannot directly access xpcom components, but access them indirectly using xpconnect. xpconnect also provides a required layer for xpcom components written in a scripting language. let’s consider a resource description framewor...
...ing thecontents panel widget within thehelp viewer window. suppose the client already has an nsirdfdatasource object representing a sub-graph of an rdf graph and calls nsirdfdatasource.gettarget(resource, nc_link, true) to obtain an nsirdfnode representing a specific node in the graph, in this case a link to ahelp viewer document page. the client is completely unaware of which c++ class (or other language) actually implements nsirdfnode; it only interacts with the idl interface. the client would like to ask the nsirdfnode whether its supports nsirdfliteral. an nsirdfnode must be an nsirdfliteral or an nsirdfresource. the link is a literal, so the client wants nsirdfliteral. since all xpcom interfaces inherit the base interface nsisupports, the client can ask whether nsirdfnode supports nsirdflite...
Index
these resources are for anyone with an interest in the technical aspects involved in localization. ...
...ation document, an interested localizer can follow a technical step-by-step process that starts the localization process by focusing on how to localize two of the primary types of localization files (dtd and properties) used in the mozilla source code. with that document, users can see immediately two localized files in their user interface by following closely and carefully the steps to create a language pack or a binary file that is ready for installation. repeating the process allows a localizer to create a testable package to see his or her work as they progress to a final version. 28 mozilla l10n style guide localization cultural references, idioms, and slang require a full understanding of these references between the cultures of your source and target languages. an exam...
... slang require a full understanding of these references between the cultures of your source and target languages. an example of a cultural reference in english would be the phrase, "kick-off meeting." this is a reference that uses an american football term. it means a meeting to begin a project. to translate it, you can follow one of two approaches: 29 mozilla content localized in your language localization, mdn, mozilla, reference, style guide no summary! 30 mozilla content localized in your language localization this section of the style guide is for you to author. the content here should be what you and your localization team have decided, together, to follow when localizing mozilla products and web sites. you are free to add, edit, remove, and localize...
...all we ask is that you name this page according to this example, "mozilla content in spanish (es-mx)" and add your locale code tag at the bottom. enjoy developing your style guide! 31 patching a localization localization say you have found a problem with an existing localization. ...
Initial setup
also notify us when you're having problems unique to your localization team's work. add a request about creating your locale's bugzilla component to the new locales newsgroup. local environment tools similar to accounts, there is a number of environment tools that you should install on your personal computer. these tools will help you to store your contributions, build mozilla applications and language packs, and test your work. hg (mercurial) as noted above, we use mercurial for maintaining mozilla source code and localized code. not only will you need a localization repository to store your localizations, but you need to have it installed and configured on your personal computer as well. you can find everything you need to know about installing and configuring mercurial for your localizat...
...is a python script that helps you check your work without needing to run firefox or another application. install intructions are located here. l10n checks l10n checks is another python script that helps you check your work without running an application. install instructions are located here. ...
...you can find the source files and install instructions here. ...
... 2.13 and higher for these builds. you can find the source files and install instructions here. wget wget is a command-line utility that allows you to retrieve files using internet protocols. we use it for retrieving files from repositories. you can find the source files and install instructions here. perl perl is a programming language that will help you create mozilla application builds and language packs. you can find the source files and install instructions here. python python is a programming language in which many of our l10n testing scripts 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 ...
QA phase
your work but you want to make sure it's accurate! if you don't have a lot of experience with code, you might even be concerned that you've broken something (oops!). now we'll walk you through performing some quality assurance testing on your work to make sure you're on the right track. if you're localizing mozilla websites, your work will display soon after you've committed it without needing a language pack. since such is the case, this part of the guide may not be entirely applicable to you. feel free to skip ahead to the next section by clicking on the next link at the bottom of the page. in order to see your work on firefox (or another mozilla application), you'll need to have a built language pack to install on your local instance. manual & automated builds with the click of a button, so...
...not be entirely applicable to you. feel free to skip ahead to the next section by clicking on the next link at the bottom of the page. in order to see your work on firefox (or another mozilla application), you'll need to have a built language pack to install on your local instance. manual & automated builds with the click of a button, some l10n tools (like narro and koala) automatically create language pack builds for you. if you're using one of these tools, feel free to skip ahead to the seeing your work section. if you're not using one of these tools, let's walk you through building your own language pack manually. note: remember all of those pre-requisite tools we asked you to install in the initial setup? here's where you'll need almost all of them. if you haven't installed them yet, now i...
...oolkit/ cp mozilla-aurora/toolkit/locales/defines.inc l10n-central/x-testing/toolkit/defines.inc tah-dah! copied! finally, you will need a file called .mozconfig to proceed with manual builds. this file contains the necessary build instructions. ...
...inks above to learn how to make these testing builds. testing your l10n & seeing your work now that you have your langpack or l10n repack, let's discuss seeing your work and testing it in the application. testing the langpack will put you one step closer to having your localization added to the l10n releases. follow the steps below to test your localization: install aurora in your preferred language. install the .xpi langpack you just created (or exported). set your language using the quick locale switcher or locale switcher add-ons by navigating to tools->language->your localization's language code. restart your browser and start testing! now you should be able to see all of your work up to this point. click here for guidelines on how to test your localization. don't lose your work! ...
L20n HTML Bindings
to localize your html documents with l20n. download l20n with html bindings we maintain a repository with l20n optimized for production use: one file (~110kb) one file, minified (~35kb) it's recommended to include the l20n.js file as the last script in the head element. <head> … <script src="l20n.js"></script> </head> create manifest use a localization manifest to define available languages and their resource files. <link rel="localization" href="../locales/manifest.json"> an example of the manifest file (all keys are required): { "locales": [ "en-us", "pl"], "default_locale": "en-us", "resources": [ "../locales/{{locale}}/strings.l20n", "/shared/{{locale}}/date.l20n"¨ ] } make html elements localizable use the data-l10n-id attribute on an html element to ma...
... doesn't replace dom elements, but only modifies their text nodes and their attributes. this makes it possible to use l20n in conjunction with mvc frameworks. when all dom nodes are localized, the document element will fire a documentlocalized event, which you can listen to: document.addeventlistener('documentlocalized', function() { // the dom has been localized and the user sees it in their language yourapp.init(); }); exposing context data you can expose important bits of data to the localization context in form of context data. <script type="application/l10n-data+json"> { "newnotifications": 3, "user": { "name": "jane", "gender": "feminine" } } </script> this data will be available context-wide to all localized strings. for instance, a string could use the informatio...
... *unknown: "{{ $user.name }} has invited you to their circles." }> based on the context data defined above, this will produce: jane has invited you to her circles. monolingual mode l20n can also operate in the so-called monolingual mode, when there is only one locale available. it doesn't have any specific locale code (internally, it's called i-default in compliance to rfc 2277). there is no language negotiation nor locale fallback possible in the monolingual mode. l20n simply always uses this one default locale. the monolingual mode may be useful when you first start a new project, when you want to test something quickly or when using server-side language negotiation. in order to enable the monolingual mode, remove the manifest link from your html. with no information about the available a...
...our html. with no information about the available and the default locales, l20n will switch to the monolingual mode. you can then embed localization resources right in your html. <script type="application/l20n"> <brandname "firefox"> <about "about {{ brandname }}"> </script> an alternative is to include localization resources in script elements. note that this still only works for a single language. we plan to add support for a language pack service in the future that can tap into this scenario on the client side. <script type="application/l20n" src="../locales/strings.l20n"></script> note that you currently cannot use the manifest file and manually add resources via script tags at the same time (bug 923670). ...
JSAPI User Guide
down to free any remaining cached resources. (this is a mere nicety if the process is about to exit anyway. but as that is not always the case, calling js_shutdown is a good habit to get into.) the context: use js_newcontext and js_destroycontext. for maximum ecmascript standard compliance, applications should also use js_setoptions to enable jsoption_varobjfix. to get the latest javascript language features, applications may use js_setversion. error reporting is also per-context and is enabled using js_seterrorreporter. the global object: to create this object, you first need a jsclass with the jsclass_global_flags option. the example below defines a very basic jsclass (named global_class) with no methods or properties of its own. use js_newglobalobject to create a global object. use ...
...s any web page can call alert. in the environment we have created, the "hello world" script looks like this: system("echo hello world"); jsapi concepts this section aims to fill in the major gaps in the picture of the jsapi presented so far. to do anything useful with spidermonkey, you must read all three sections. javascript values main article: js::value javascript is a dynamically typed language: variables and properties do not have a type that is fixed at compile time. how can a statically typed language, like c or c++, in which all variables have types, interact with javascript? the jsapi provides a data type, js::value (also with a deprecated jsval typedef), which can contain javascript values of any type. a js::value can be a number, a string, a boolean value, a reference to an objec...
... only if it is likely to reclaim a worthwhile amount of memory. errors and exceptions the importance of checking the return value of jsapi functions, of course, goes without saying. almost every jsapi function that takes a jscontext * argument can fail. the system might run out of memory. there might be a syntax error in a script. or a script might explicitly throw an exception. the javascript language has exceptions, and c++ has exceptions, but they are not the same thing. spidermonkey does not use c++ exceptions for anything. jsapi functions never throw c++ exceptions, and when spidermonkey calls an application callback, the callback must not throw a c++ exception. throwing and catching exceptions we have already seen one example of how to throw an exception from a jsnative function. simply...
...nullptr. uncatchable errors another way for a jsnative callback to report an error is like this: if (!p) { js_reportoutofmemory(cx); return false; } this does something subtly different from what js_reporterror does. most errors, including those raised by js_reporterror, are represented as javascript exceptions and thus interact with the javascript exception-handling language features, try, catch, and finally. however, in some cases we do not want scripts to be able to catch an error; we want script execution to terminate right away. if the system runs out of memory in the middle of a script, we do not want finally blocks to execute, because almost anything a script does requires at least a little memory, and we have none. if a script has been running too long and we ...
JSPropertyDescriptor
two main types of property descriptors that exist in an object: a data descriptor and an access descriptor. you can use the object.getownpropertydescriptor() function to get the corresponding property of an object. descriptor. examples the following example demonstrates how to use the object.defineproperty() function to create a property under an object in a javascript via a descriptor. var language = {}; // define an empty object language object.defineproperty(language, 'log', { // define the log attribute under the language object value : ['cn','en'], writable : true, enumerable : true, configurable : true }) in the above example we defined a writable, deletable enumerable property.this is the same as the javascript directly defined property. in other words, the above co...
...ject.defineproperty(language, 'log', { // define the log attribute under the language object value : ['cn','en'], writable : true, enumerable : true, configurable : true }) in the above example we defined a writable, deletable enumerable property.this is the same as the javascript directly defined property. in other words, the above code is equivalent to the following code. ...
... define the log attribute under the language object value : ['cn','en'], writable : true, enumerable : true, configurable : true }) in the above example we defined a writable, deletable enumerable property.this is the same as the javascript directly defined property. in other words, the above code is equivalent to the following code. ...
... writable : true, enumerable : true, configurable : true }) in the above example we defined a writable, deletable enumerable property.this is the same as the javascript directly defined property. in other words, the above code is equivalent to the following code. var language = {}; // define an empty object language languange.log = ['cn','en']; // define the log attribute under the language object ...
Avoiding leaks in JavaScript XPCOM components
ormation on this site with a grain of salt, although most concepts and best practices still apply. using xpcom in javascript (also known as xpconnect) is an environment where memory management issues are not obvious. there are no calls to malloc and free and no reference counting. despite this, it's easy to write javascript code that leaks. it's easy to write leaky code in any garbage-collected language. but it's even easier in this environment because some of the objects you're dealing with are reference-counted behind the scenes. programmers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks. this document attempts to help them do so, first by explaining the underlying concepts, and second by describing a...
... memory allocation system are: memory should be returned to the heap when the program no longer needs it (or soon thereafter) so that the amount of memory consumed by the program does not increase. programs should not dereference pointers pointing to memory that has been returned to the heap (and potentially reused). meeting both requirements at the same time can be tricky. many programming languages guarantee a solution for (2) and handle all the heap management for the programmer. however, this doesn't mean that (1) is also solved. the most common strategies for managing heap allocation are the following: malloc and free (or new and delete) the simplest strategy for heap allocation is that the programmer makes one function call to request memory from the heap and another one to return i...
...pt properties on dom nodes may also improve—see bug 283129—but it requires substantial changes.) things not to do everybody writing, reviewing, or checking in javascript code to mozilla cvs should understand why these things are bad. don't store temporary objects permanently in global variables storing temporary objects permanently in global variables will leak memory in garbage-collected languages. that it leaks in the xpcom+javascript world isn't at all special. the most common way this is done in javascript is on implementations of observer interfaces like nsiobserver in javascript. if you implement nsiobserver in javascript and register that observer (without using weak references) with a service (for example, with the observer service bug 239833 or with the pref service bug 256822), ...
...lease the pointer, and creates a garbage collection root that roots j. thus j is always reachable from a garbage collection root, and we have a cycle. i actually can't find an example of this simple leak pattern that occurred in mozilla's codebase. but it certainly could. however, it's easy to inadvertently create this same type of leak when using closures. in javascript, as in many interpreted languages, functions have access to the variables that are in scope where they are created. a closure is a code × environment pair: function objects are not just the code; they're also the environment. since all the variables in that environment are reachable from the function object, the objects referenced by those variables are reachable from the function. to understand closures a little better before...
HTMLElement.lang - Web APIs
Web › API › HTMLElement › lang
the htmlelement.lang property gets or sets the base language of an element's attribute values and text content. the language code returned by this property is defined in the tags for identifying languages (bcp47) ietf document. common examples include "en" for english, "ja" for japanese, "es" for spanish and so on. the default value of this attribute is unknown. note that this attribute, though valid at the individual element level described here, is most often specified for the root element of the document. this also only works with the lang attribute and not with xml:lang. ...
...anguages (bcp47) ietf document. common examples include "en" for english, "ja" for japanese, "es" for spanish and so on. the default value of this attribute is unknown. note that this attribute, though valid at the individual element level described here, is most often specified for the root element of the document. this also only works with the lang attribute and not with xml:lang. syntax var languageused = elementnodereference.lang; // get the value of lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the text of the current element is written. newlanguage is a string variable with its value setting the language in which the text of the current element is written. example // this snippet compares the b...
... = elementnodereference.lang; // get the value of lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the text of the current element is written. newlanguage is a string variable with its value setting the language in which the text of the current element is written. ...
...lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the text of the current element is written. newlanguage is a string variable with its value setting the language in which the text of the current element is written. example // this snippet compares the base language and // redirects to another url based on language if (document.documentelement.lang === "en") { window.location.href = "some_document.html.en"; } else if (document.documentelement.lang === "ru") { window.location.href = "some_document.html.ru"; } specification specification status comment document object model (dom) level 2 html specificationthe definition of 'lang' in that specification. obsolete ...
Web Video Text Tracks Format (WebVTT) - Web APIs
to the right of the cue timings. there must be one or more spaces between the cue timing and the first setting and between each setting. a setting's name and value are separated by a colon. the settings are case sensitive so use lower case as shown. there are five cue settings: vertical indicates that the text will be displayed vertically rather than horizontally, such as in some asian languages. table 1 - vertical values vertical:rl writing direction is right to left vertical:lr writing direction is left to right line specifies where text appears vertically. if vertical is set, line specifies where text appears horizontally. value can be a line number. the line height is the height of...
... align:middle centred horizontally centred vertically centred vertically align:end right bottom bottom example 13 - cue setting examples the first line demonstrates no settings. the second line might be used to overlay text on a sign or label. the third line might be used for a title. the last line might be used for an asian language. 00:00:05.000 --> 00:00:10.000 00:00:05.000 --> 00:00:10.000 line:63% position:72% align:start 00:00:05.000 --> 00:00:10.000 line:0 position:20% size:60% align:start 00:00:05.000 --> 00:00:10.000 vertical:rt line:-1 align:end cue payload the payload is where the main information or content is located. in normal usage the payload contains the subtitles to be displayed. the payload text may con...
...onstructor: for construction of new vtt regions. tutorial on how to write a webvtt file there are few steps that can be followed to write a simple webvtt file. before start, it must be noted that you can make use of a notepad and then save the file as ‘.vtt’ file. steps are given below: open a notepad. the first line of webvtt is standardized similar to the way some other languages require you to put headers as the file starts to indicate the file type. on the very first line you have to write: webvtt 3. leave the second line blank, and on the third line the time for first cue is to be specified. for example, for a first cue starting at time 1 second and ending at 5 seconds, it is written as: 00:01.000 --> 00:05.000 on the next line you can write the caption f...
... the type of pseudo class is determined by the selector it is using and working is similar in nature as it works in html. following css pseudo classes can be used: lang (lanugage): e.g., p:lang(it). link: e.g., a:link. nth-last-child: e.g., p:nth-last-child(2). nth-child(n): e.g., p:nth-child(2). where p and a are the tags which are used in html f...
Perceivable - Accessibility
) you should provide synchronized captions for all live multimedia that contains audio (e.g., video conferences, live audio broadcasts). 1.2.5 provide audio descriptions for prerecorded video (aa) audio descriptions should be provided for prerecorded video, but only where the existing audio does not convey the full meaning expressed by the video. 1.2.6 provide sign language equivalent to prerecorded audio (aaa) an equivalent sign language video should be provided for any prerecorded content containing audio. 1.2.7 provide extended video with audio descriptions (aaa) where audio descriptions cannot be provided (see 1.2.5) due to video timing issues (e.g., there are no suitable pauses in the content in which to insert the audio descriptions), an alt...
...trait or landscape, unless a specific display orientation is essential. understanding orientation 1.3.5 identify input purpose (aa) added in 2.1 follow the list of 53 input fields to programmatically identify the purpose of a field. understanding identify input purpose 1.3.6 identify purpose (aaa) added in 2.1 in content implemented using markup languages, the purpose of user interface components, icons, and regions can be programmatically determined. understanding identify purpose note: also see the wcag description for guideline 1.3: adaptable: create content that can be presented in different ways without losing information or structure. guideline 1.4: make it easier for users to see and hear content including separating foregroun...
...n the text size is doubled, the content should not need to be scrolled. 1.4.9 images of text (no exception) (aaa) text should not be presented as part of an image unless it is purely decoration (i.e., it does not convey any content) or cannot be presented in any other way. ...
...ould not need to be scrolled. 1.4.9 images of text (no exception) (aaa) text should not be presented as part of an image unless it is purely decoration (i.e., it does not convey any content) or cannot be presented in any other way. 1.4.10 reflow (aa) added in 2.1 no horizontal scrolling for left-to-right languages (like english) or right-to-left languages (like arabic) no vertical scrolling for top-to-bottom languages (like japanese) except for parts of the content which require two-dimensional layout for usage or meaning (like a large data table) understanding reflow 1.4.11 non-text contrast(aa) added in 2.1 minimum color contrast ratio of 3:1 for user interface components and graphical objects. understan...
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
ng a first-child selector and set that item to align-self: stretch; another item has been selected using its class of selected and given align-self: center. you can change the value of align-items or change the values of align-self on the individual items to see how this works. changing the main axis so far we have looked at the behaviour when our flex-direction is row, and while working in a language written top to bottom. this means that the main axis runs along the row horizontally, and our cross axis alignment moves the items up and down. if we change our flex-direction to column, align-items and align-self will align the items to the left and right. you can try this out in the example below, which has a flex container with flex-direction: column yet otherwise is exactly the same as ...
...e the values of justify-content to see how flexbox behaves when the start of the inline direction is on the right. alignment and flex-direction the start line will also change if you change the flex-direction property — for example using row-reverse instead of row. in this next example i have items laid out with flex-direction: row-reverse and justify-content: flex-end. ...
...then flex-start will then be where the top of your first paragraph of text would start. ...
... right hand side. while this may all seem a little confusing, the rule to remember is that unless you do something to change it, flex items lay themselves out in the direction that words are laid out in the language of your document along the inline, row axis. flex-start will be where the start of a sentence of text would begin. you can switch them to display in the block direction for the language of your document by selecting flex-direction: column. then flex-start will then be where the top of your first paragraph of text would start. if you change flex-direction to one of the reverse values, then they will lay themselves out from the end axis and in the reverse order to the way words are written in the language of your document. flex-start will then change to the end of that axis —...
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
here are also physical properties in css. we add margins, padding, and borders using these physical properties of margin-left, padding-left, and so on. we call these keywords and properties physical because they relate to the screen you are looking at. left is always left, no matter what direction your text is running. this can become an issue when developing a site that has to work in multiple languages, including languages that have text starting on the right, rather than the left. browsers are pretty good at dealing with text direction, and you don’t even need to be working in a rtl language to take a look. in the example below, i have two paragraphs. one has no text-align property set, the second has text-align set to left. i have added dir="rtl" to the html element, which switches the wri...
...you can see that the first paragraph remains left to right, due to the text-align value being left . the second however, switches direction and the text runs from right to left . ...
...lignment, becomes very useful. if you can start to see layout in terms of block and inline, the way things work in grid start to make a lot more sense. css writing modes i’m going to introduce another specification here, that i will be using in my examples: the css writing modes specification. this spec details how we can use these different writing modes in css, not just for the support of languages that have a different writing mode to english, but also for creative purposes. i’ll be using the writing-mode property to make changes to the writing mode applied to our grid, in order to demonstrate how the logical values work. if you want to dig into writing modes further, however, then i would recommend that you read jen simmons excellent article on css writing modes. this goes into more de...
...left bottom right this is anti-clockwise! so the reverse of what we do for margins and padding. once you realize that grid-area sees the world as "block and inline", you can remember that we are setting the two starts, then the two ends. it becomes much more logical once you know! mixed writing modes and grid layout in addition to displaying documents, using the correct writing mode for the language, writing modes can be used creatively within documents that are otherwise ltr. in this next example i have a grid layout with a set of links down one side. i’ve used writing modes to turn these on their side in the column track: .wrapper { display: grid; grid-gap: 20px; grid-template-columns: 1fr auto; font: 1em helvetica, arial, sans-serif; } .wrapper nav { writing-mode: ...
Developer guides
audio and video delivery we can deliver audio and video on the web in several ways, ranging from 'static' media files to adaptive live streams. ...
... audio and video delivery we can deliver audio and video on the web in several ways, ranging from 'static' media files to adaptive live streams. ...
... audio and video delivery we can deliver audio and video on the web in several ways, ranging from 'static' media files to adaptive live streams. ...
...ons to make quick, incremental updates to the user interface without reloading the entire browser page. this makes 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 encod...
Evolution of HTTP - HTTP
the world wide web in 1989, while he was working at cern, tim berners-lee wrote a proposal to build a hypertext system over the internet. initially calling it the mesh, it was later renamed to world wide web during its implementation in 1990. built over the existing tcp and ip protocols, it consisted of 4 building blocks: a textual format to represent hypertext documents, the hypertext markup language (html). a simple protocol to exchange these documents, the hyperttext transfer protocol (http). a client to display (and accidentally edit) these documents, the first web browser called worldwideweb. a server to give access to the document, an early version of httpd. these four building blocks were completed by the end of 1990, and the first servers were already running outside of cern by ea...
...eopen it numerous times to display the resources embedded into the single original document retrieved. pipelining has been added, allowing to send a second request before the answer for the first one is fully transmitted, lowering the latency of the communication. chunked responses are now also supported. additional cache control mechanisms have been introduced. content negotiation, including language, encoding, or type, has been introduced, and allows a client and a server to agree on the most adequate content to exchange. thanks to the host header, the ability to host different domains at the same ip address now allows server colocation. a typical flow of requests, all through one single connection is now looking like this: get /docs/glossary/simple_header http/1.1 host: developer.mozill...
...rent domains at the same ip address now allows server colocation. ...
...g: "547fa7e369ef56031dd3bff2ace9fc0832eb251a" keep-alive: timeout=5, max=1000 last-modified: tue, 19 jul 2016 00:59:33 gmt server: apache transfer-encoding: chunked vary: cookie, accept-encoding (content) get /static/img/header-background.png http/1.1 host: developer.cdn.mozilla.net user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: */* accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate, br referer: https://developer.mozilla.org/docs/glossary/simple_header 200 ok age: 9578461 cache-control: public, max-age=315360000 connection: keep-alive content-length: 3077 content-type: image/png date: thu, 31 mar 2016 13:34:46 gmt last-modified: wed, 21 oct 2015 18:27:50 gmt server: apache (image content of 3077 bytes) http/1.1 was first publ...
Index - HTTP
Web › HTTP › Headers › Index
oding content negotiation, http, http header, reference, request header the accept-encoding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the content-encoding response header. ...
...oding request http header advertises which content encoding, usually a compression algorithm, the client is able to understand. using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the content-encoding response header. 5 accept-language content negotiation, http, http header, reference, request header the accept-language request http header advertises which languages the client is able to understand, and which locale variant is preferred. (by languages, we mean natural languages, such as english, and not programming languages.) using content negotiation, the server then selects one of the proposals, uses it and informs the client of its choice with the content-language response header. browsers set adequate value...
... 6 accept-ranges http, http header, range requests, reference, response header the accept-ranges response http header is a marker used by the server to advertise its support of partial requests. ...
...ody itself, content-disposition has no effect. 23 content-encoding http, headers, reference the content-encoding entity header is used to compress the media-type. when present, its value indicates which encodings were applied to the entity-body. it lets the client know how to decode in order to obtain the media-type referenced by the content-type header. 24 content-language http, headers, reference the content-language entity header is used to describe the language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language. 25 content-length http, headers, reference the content-length entity header indicates the size of the entity-body, in bytes, sent to the recipient. ...
A typical HTTP session - HTTP
Web › HTTP › Session
ed by crlf (carriage return, followed by line feed), divided into three blocks: the first line contains a request method followed by its parameters: the path of the document, i.e. an absolute url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server information about what type of data is appropriate (e.g., what language, what mime types), or other data altering its behavior (e.g., not sending an answer if it is already cached). these http headers form a block which ends with an empty line. the final block is an optional data block, which may contain further data mainly used by the post method. example requests fetching the root page of developer.mozilla.org, i.e. http://developer.mozilla.org/, and telling th...
...ers form a block which ends with an empty line. the final block is an optional data block, which may contain further data mainly used by the post method. example requests fetching the root page of developer.mozilla.org, i.e. http://developer.mozilla.org/, and telling the server that the user-agent would prefer the page in french, if possible: get / http/1.1 host: developer.mozilla.org accept-language: fr observe that final empty line, this separates the data block from the header block. as there is no content-length provided in an http header, this data block is presented empty, marking the end of the headers, allowing the server to process the request the moment it receives this empty line. for example, sending the result of a form: post /contact_form.php http/1.1 host: developer.mozilla...
...ng). similarly to the block of http headers for a client request, these http headers form a block ending with an empty line. the final block is a data block, which contains the optional data. ...
...ge to display if the user-agent is not able to follow the link) <!doctype html... (contains a site-customized page helping the user to find the missing resource) notification that the requested resource doesn't exist: http/1.1 404 not found content-type: text/html; charset=utf-8 content-length: 38217 connection: keep-alive cache-control: no-cache, no-store, must-revalidate, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:35:13 gmt expires: thu, 06 dec 2018 17:35:13 gmt server: meinheld/0.6.1 strict-transport-security: max-age=63072000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block vary: accept-encoding,cookie x-cache: error from cloudfront <!doctype html... (contains a site-customized page helping the user to find the missing resource) re...
JavaScript data types and data structures - JavaScript
programming languages all have built-in data structures, but these often differ from one language to another. this article attempts to list the built-in data structures available in javascript and what properties they have. these can be used to build other data structures. wherever possible, comparisons with other languages are drawn. dynamic typing javascript is a loosely typed and dynamic language. variables in javascript are not directly associated with any particular value type, and any variable can be assigned (and re-assigned) values of all types: let foo = 42; // foo is now a number foo = 'bar'; // foo is now a string foo = true; // foo is now a boolean data and structure types the latest ecmascript standard defines nine types: six data types that are primitives, check...
...geably with numbers. instead a typeerror will be thrown. string type javascript's string type is used to represent textual data. it is a set of "elements" of 16-bit unsigned integer values. each element in the string occupies a position in the string. the first element is at index 0, the next at index 1, and so on. the length of a string is the number of elements in it. unlike some programming languages (such as c), javascript strings are immutable. this means that once a string is created, it is not possible to modify it. however, it is still possible to create another string based on an operation on the original string. for example: a substring of the original by picking individual letters or using string.substr(). a concatenation of two strings using the concatenation operator (+) or st...
...e list is broken. an escape character can be chosen, etc. all of this requires conventions and creates an unnecessary maintenance burden. use strings for textual data. when representing complex data, parse strings, and use the appropriate abstraction. symbol type a symbol is a unique and immutable primitive value and may be used as the key of an object property (see below). in some programming languages, symbols are called "atoms". for more details see symbol and the symbol object wrapper in javascript. objects in computer science, an object is a value in memory which is possibly referenced by an identifier. properties in javascript, objects can be seen as a collection of properties. with the object literal syntax, a limited set of properties are initialized; then properties can be added a...
... dom node, one could set properties directly on the object, or use data-* attributes. this has the downside that the data is available to any script running in the same context. maps and weakmaps make it easy to privately bind data to an object. structured data: json json (javascript object notation) is a lightweight data-interchange format, derived from javascript, but used by many programming languages. json builds universal data structures. see json and json for more details. more objects in the standard library javascript has a standard library of built-in objects. please have a look at the reference to find out about more objects. determining types using the typeof operator the typeof operator can help you to find the type of your variable. please read the reference page for more det...
Grammar and types - JavaScript
ctice reduces the chances of bugs getting into the code. the source text of javascript script gets scanned from left to right, and is converted into a sequence of input elements which are tokens, control characters, line terminators, comments, or whitespace. (spaces, tabs, and newline characters are considered whitespace.) comments the syntax of comments is the same as in c++ and in many other languages: // a one line comment /* this is a longer, * multi-line comment */ /* you can't, however, /* nest comments */ syntaxerror */ comments behave like whitespace, and are discarded during script execution. note: you might also see a third type of comment syntax at the start of some javascript files, which looks something like this: #!/usr/bin/env node. this is called hashbang comment synta...
...xample: 9007199254740992n. string. a sequence of characters that represent a text value. for example: "howdy" symbol (new in ecmascript 2015). a data type whose instances are unique and immutable. and object although these data types are relatively few, they enable you to perform useful functions with your applications. objects and functions are the other fundamental elements in the language. you can think of objects as named containers for values, and functions as procedures that your script can perform. data type conversion javascript is a dynamically typed language. this means you don't have to specify the data type of a variable when you declare it. it also means that data types are automatically converted as-needed during script execution. so, for example, you could define a ...
...the following example, the length of the array is four, and mylist[0] and mylist[2] are missing. let mylist = [ ,'home', , 'school']; in the following example, the length of the array is four, and mylist[1] and mylist[3] are missing. only the last comma is ignored. let mylist = ['home', , 'school', , ]; understanding the behavior of extra commas is important to understanding javascript as a language. however, when writing your own code, you should explicitly declare the missing elements as undefined. doing this increases your code's clarity and maintainability. boolean literals the boolean type has two literal values: true and false. be careful: do not confuse the primitive boolean values true and false with the true and false values of the boolean object. the boolean object is a wrapp...
...d,\n\ violets are blue.\n\ sugar is sweet,\n\ and so is foo.' ecmascript 2015 introduces a new type of literal, namely template literals. this allows for many new features, including multiline strings! var poem = `roses are red, violets are blue. sugar is sweet, and so is foo.` more information this chapter focuses on basic syntax for declarations and types. to learn more about javascript's language constructs, see also the following chapters in this guide: control flow and error handling loops and iteration functions expressions and operators in the next chapter, we will have a look at control flow constructs and error handling. « previousnext » ...
Memory Management - JavaScript
low-level languages like c, have manual memory management primitives such as malloc() and free(). in contrast, javascript automatically allocates memory when objects are created and frees it when they are not used anymore (garbage collection). this automaticity is a potential source of confusion: it can give developers the false impression that they don't need to worry about memory management. memory life cycle regardless of the programming language, the memory life cycle is pretty much always the same: allocate the memory you need use the allocated memory (read, write) release the allocated memory when it is not needed anymore the second part is explicit in all languages. ...
... allocation in javascript value initialization in order to not bother the programmer with allocations, javascript will automatically allocate memory when values are initially declared. ...
... allocation in javascript value initialization in order to not bother the programmer with allocations, javascript will automatically allocate memory when values are initially declared. ...
... means reading and writing in allocated memory. this can be done by reading or writing the value of a variable or an object property or even passing an argument to a function. release when the memory is not needed anymore the majority of memory management issues occur at this phase. the most difficult aspect of this stage is determining when the allocated memory is no longer needed. low-level languages require the developer to manually determine at which point in the program the allocated memory is no longer needed and to release it. some high-level languages, such as javascript, utilize a form of automatic memory management known as garbage collection (gc). the purpose of a garbage collector is to monitor memory allocation and determine when a block of allocated memory is no longer needed an...
Intl.DateTimeFormat() constructor - JavaScript
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. ...
...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. ...
...ementations must recognize is "utc"; the default is the runtime's default time zone. implementations may also recognize the time zone names of the iana time zone database, such as "asia/shanghai", "asia/kolkata", "america/new_york". hour12 whether to use 12-hour time (as opposed to 24-hour time). possible values are true and false; the default is locale dependent. this option overrides the hc language tag and/or the hourcycle option in case both are present. hourcycle the hour cycle to use. possible values are "h11", "h12", "h23", or "h24". this option overrides the hc language tag, if both are present, and the hour12 option takes precedence in case both options have been specified. formatmatcher the format matching algorithm to use. possible values are "basic" and "best fit"; the defa...
...les using datetimeformat in basic use without specifying a locale, datetimeformat uses the default locale and default options. ...
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
hout having to fall back to the runtime's default locale. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.datetimeformat.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings repre...
...matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedl...
...s returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore...
... though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. var locales = ['ban', 'id-u-co-pinyin', 'de-id']; var options = { localematcher: 'lookup' }; console.log(intl.datetimeformat.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.datetimeformat.supportedlocalesof' in that specification. ...
Intl.DisplayNames.supportedLocalesOf() - JavaScript
for the general form of the locales argument, see the intl page. options optional. ...
...matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedl...
...s returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore...
... though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. const locales = ['ban', 'id-u-co-pinyin', 'de-id']; const options = { localematcher: 'lookup' }; console.log(intl.displaynames.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification intl.displaynamesthe definition of 'supportedlocalesof()' in that specification. ...
Intl.DisplayNames - 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. constructor intl.displaynames() creates a new intl.displaynames object. static methods intl.displaynames.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
...; // "bosnia & herzegovina" regionnames.of('mm'); // "myanmar (burma)" // get display names of region in traditional chinese regionnames = new intl.displaynames(['zh-hant'], {type: 'region'}); regionnames.of('419'; // "拉丁美洲" regionnames.of('bz'); // "貝里斯" regionnames.of('us'); // "美國" regionnames.of('ba'); // "波士尼亞與赫塞哥維納" regionnames.of('mm'); // "緬甸" language display names to create an intl.displaynames for a locale and get the display name for a language-script-region sequence. // get display names of language in english let languagenames = new intl.displaynames(['en'], {type: 'language'}); languagenames.of('fr'); // "french" languagenames.of('de'); // "german" languagenames.of('fr-ca'); // "canadian french" languagenames.of('zh-hant');...
...an intl.displaynames for a locale and get the display name for a language-script-region sequence. ...
...ay name for a language-script-region sequence. // get display names of language in english let languagenames = new intl.displaynames(['en'], {type: 'language'}); languagenames.of('fr'); // "french" languagenames.of('de'); // "german" languagenames.of('fr-ca'); // "canadian french" languagenames.of('zh-hant'); // "traditional chinese" languagenames.of('en-us'); // "american english" languagenames.of('zh-tw'); // "chinese (taiwan)"] // get display names of language in traditional chinese languagenames = new intl.displaynames(['zh-hant'], {type: 'language'}); languagenames.of('fr'); // "法文" languagenames.of('zh'); // "中文" languagenames.of('de'); // "德文" script code display names to create an intl.displaynames for a locale and get the display name for a script code. //...
Intl.ListFormat.supportedLocalesOf() - JavaScript
for the general form of the locales argument, see the intl page. options optional. ...
...matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedl...
...s returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore...
... though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. const locales = ['ban', 'id-u-co-pinyin', 'de-id']; const options = { localematcher: 'lookup' }; console.log(intl.listformat.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification intl.listformatthe definition of 'supportedlocalesof()' in that specification. ...
Intl.Locale.prototype.maximize() - JavaScript
the intl.locale.prototype.maximize() method gets the most likely values for the language, script, and region of the locale based on existing values. 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.maximize() return value a locale instance whose basename property returns the result of the add likely subtags algorithm executed against locale.basename. description sometimes, it is convenient to be able to identify the most likely locale language identifier subtags based on an incomplete langauage id. ...
...ale.maximize() return value a locale instance whose basename property returns the result of the add likely subtags algorithm executed against locale.basename. description sometimes, it is convenient to be able to identify the most likely locale language identifier subtags based on an incomplete langauage id. the add likely subtags algorithm gives us this functionality. ...
...other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the maximize() method. examples of these subtags include locale.hourcycle, locale.calendar, and locale.numeric. ...
...other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the maximize() method. examples of these subtags include locale.hourcycle, locale.calendar, and locale.numeric. ...
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 w...
...mation 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 well. adding a locale class, however, adds ease of parsing and manipulating the language, script, and region, as well as extension tags. constructor intl.locale() creates a new locale object. instance properties intl.locale.prototype.basename returns basic, core information about the locale in the form of a substring of the complete data string. intl.locale.prototype.calendar returns the part of the locale that indicates the locale's calendar era. intl.locale.prototype.
... the locale's calendar era. intl.locale.prototype.casefirst returns whether case is taken into account for the locale's collation rules. intl.locale.prototype.collation returns the collation type for the locale, which is used to order strings according to the locale's rules. intl.locale.prototype.hourcycle returns the time keeping format convention used by the locale. intl.locale.prototype.language returns the language associated with the locale. intl.locale.prototype.numberingsystem returns the numeral system used by the locale. intl.locale.prototype.numeric returns whether the locale has special collation handling for numeric characters. intl.locale.prototype.region returns the region of the world (usually a country) associated with the locale. intl.locale.prototype.script return...
...cale. intl.locale.prototype.numberingsystem returns the numeral system used by the locale. intl.locale.prototype.numeric returns whether the locale has special collation handling for numeric characters. intl.locale.prototype.region returns the region of the world (usually a country) associated with the locale. intl.locale.prototype.script returns the script used for writing the particular language used in the locale. instance methods intl.locale.prototype.maximize() gets the most likely values for the language, script, and region of the locale based on existing values. intl.locale.prototype.minimize() gets the most likely values for the language, script, and region of the locale based on existing values. intl.locale.prototype.tostring() returns the locale's full locale identifier...
Intl.NumberFormat.supportedLocalesOf() - JavaScript
ithout having to fall back to the runtime's default locale. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.numberformat.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings repre...
...locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in number formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in number formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in number formatting, supportedlocalesof retur...
...e language tags returned are those for which the runtime supports a locale in number formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in number formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to number formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return...
...d, even though pinyin collation is neither relevant to number formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. var locales = ['ban', 'id-u-co-pinyin', 'de-id']; var options = { localematcher: 'lookup' }; console.log(intl.numberformat.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.numberformat.supportedlocalesof' in that specification. ...
Intl.PluralRules.supportedLocalesOf() - JavaScript
for the general form of the locales argument, see the intl page. options optional. ...
... the locale matching algorithm to use. possible values are lookup and best fit; the default is best fit. for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in plural formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in plural formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof() assuming a runtime that supports indonesian and german but not balinese in plural formatting, supportedlocalesof ret...
...language tags returned are those for which the runtime supports a locale in plural formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof() assuming a runtime that supports indonesian and german but not balinese in plural formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to plural formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the lookup algorithm here — a best fit matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the...
...anged, even though pinyin collation is neither relevant to plural formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the lookup algorithm here — a best fit matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. var locales = ['ban', 'id-u-co-pinyin', 'de-id']; var options = { localematcher: 'lookup' }; console.log(intl.pluralrules.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.pluralrules.supportedlocalesof' in that specification. ...
Intl.PluralRules - JavaScript
constructor intl.pluralrules.pluralrules() creates a new intl.pluralrules object. static methods intl.pluralrules.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.pluralrules.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object. intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware formatting. ...
...ype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during initialization of the object. intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware formatting. examples using locales this example shows some of the variations in localized plural rules. ...
...nd collation options computed during initialization of the object. intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware formatting. examples using locales this example shows some of the variations in localized plural rules. ...
...initialization of the object. intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware formatting. examples using locales this example shows some of the variations in localized plural rules. ...
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
having to fall back to the runtime's default locale. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.relativetimeformat.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings repre...
...matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedl...
...s returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in date and time formatting, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore...
... though pinyin collation is neither relevant to date and time formatting nor used with indonesian, and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. const locales = ['ban', 'id-u-co-pinyin', 'de-id']; const options = { localematcher: 'lookup' }; console.log(intl.relativetimeformat.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification status comment ecmascript internationalization api (ecma-402)the definition of 'relativetimeformat.supportedlocales...
Authoring MathML - MathML
just like html, mathml is described with tags and attributes. html becomes verbose when your document contains advanced structures like lists or tables but fortunately there are many generators from simple notations, wysiwyg 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. ...
...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 scope of this document but anyone with basic knowledge of web languages will easily be able to mix these features with mathml. check out our demos and mathml references for more details. using mathml mathml in html pages you can use presentation mathml inside html5 documents: <!doctype html> <html> <head> <title>mathml in html5</title> </head> <body> <h1>mathml in html5</h1> <p> square root of two: <math> <msqrt> <mn>2</mn> </m...
...below) and then render the mathml expressions generated from the (plaintext) instant messages. for example, there is an instantbird add-on that handles latex expressions. conversion from a simple syntax there are many simple notations (e.g. wiki or markdown syntaxes) to generate html pages. the same is true for mathml: for example ascii syntaxes as used in calculators or the more powerful latex language, very popular among the scientific community. in this section, we present some of these tools to convert from a simple syntax to mathml. pros: writing mathematical expressions may only require a standard text editor. many tools are available, some of them are compatible with the classical latex-to-pdf workflow. this gives access to advanced features of latex like macros. cons...
...latex like macros. cons: this may be harder to use: people must learn a syntax, typos in the code may easily lead to parsing or rendering errors etc the interface is not user-friendly: only code editor without immediate display of the mathematical expression. none of the syntax has been standardized, making cross-compatibility between converters difficult. even the popular latex language keeps having new packages added. client-side conversion in a web environment, the most obvious method to convert a simple syntax into a dom tree is to use javascript and of course many libraries have been developed to perform that task. pros: this is very easy setup: only a few javascript and css files to upload and/or a link to add to your document header. this is a pure web-...
Media - Progressive web apps (PWAs)
might want to print it. these different media have different characteristics. css has the capacity to present content according to the media type. to specify rules that are specific to a type of media, use @media followed by the media type, followed by curly braces that enclose the rules. example a document on a website has a navigation area that contains the primary site menu. in the markup language, the navigation area's parent element has the id nav-area. (in html5, this can be marked up with the <nav> element instead of <div> with an id attribute.) when printing the document, the navigation area has no purpose. this css (below) removes the navigation area when printing the document: @media print { #nav-area {display: none;} } some common media types are: screen color...
...he navigation area when printing the document: @media print { #nav-area {display: none;} } some common media types are: screen color device display print printed paged media projection projected display all all media (the default) more details there are other ways to specify the media type for a set of rules. the document's markup language might allow the media type to be specified when the stylesheet is linked to the document. for example, in html, you have the option to specify the media type with a media attribute in the link element. in css, you can use @import at the start of a stylesheet to import another stylesheet from a url, optionally specifying the media type. these are ways of separating styling rules for different me...
...button also has a dark outline around the entire button when it is the default, and a dotted outline on the face of the button when it has keyboard focus. it might also have a hover effect when the pointer is over it. more details for more information about user interfaces in css, see user interface in the css specification. in part ii of this tutorial, there is an example of mozilla's markup language for user interfaces. action: printing a document note: this snippet only works on firefox since it erroneously increments the css counter for fix-position elemnts. it shouldn not work in other browsers. see issue on css3-page. make a new html document, doc4.html. copy and paste the content from here: <!doctype html> <html> <head> <title>print sample</title> <link rel="stylesh...
... ...
SVG Conditional Processing Attributes - SVG: Scalable Vector Graphics
the svg conditional processing attributes are all the attributes that can be specified on some svg elements to control whether or not the element on which it appears should be rendered. externalresourcesrequired requiredextensions requiredfeatures systemlanguage attributes externalresourcesrequired deprecated since svg 2 if set to true, it indicates that the browser must wait for all the external resources necessary to render that element to be loaded before processing the associated element. value: false|true; animatable: no requiredextensions list all the browser specific capabilities that must be supported by the borwser to be allowed to render the associated element. value: a list of space-separated uri; animatable: no requiredfeatures deprecated since svg 2 list al...
...ities that must be supported by the borwser to be allowed to render the associated element. ...
...ed by the borwser to be allowed to render the associated element. ...
...; animatable: no requiredfeatures deprecated since svg 2 list all the features, as defined is the svg 1.1 specification, that must be supported by the borwser to be allowed to render the associated element.. value: a list of space-separated uri; animatable: no systemlanguage indicates which language the user must have chosen to render the associated element. value: a list of comma-separated language id; animatable: no ...
SVG Core Attributes - SVG: Scalable Vector Graphics
Web › SVG › Attribute › Core
ibutes that can be specified on any svg element. id lang tabindex xml:base xml:lang xml:space attributes id defines a unique identifier (id) which must be unique in the whole document. its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css). value: any valid id string; animatable: no lang participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. the tag contains one single entry value in the format defined in the tags for identifying languages (bcp47) ietf document. svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are used, xml:lang has priority over lang. value: any valid...
... value type: <integer>; animatable: no xml:base specifies a base iri other than the base iri of the document. ...
...ute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation. value type: <integer>; animatable: no xml:base specifies a base iri other than the base iri of the document. ...
...cifies a base iri other than the base iri of the document. value type: <iri>; animatable: no xml:lang it is a universal attribute allowed in all xml dialects to mark up the natural human language that an element contains. it's almost identical in usage to html's lang, but in conforming xml 1.0 documents, it does not allow the use of a null attribute value (xml:lang="") to indicate an unknown language. instead, use xml:lang="und". svg 2 introduce the new lang attributes. if both lang and xml:lang attribute are used, xml:lang has priority over lang. value: any valid language id; animatable: no xml:space deprecated since svg 2 svg supports the standard xml attribute xml:space to specify the handling of white space characters within a given <text> element's character data. note:...
contentScriptType - SVG: Scalable Vector Graphics
the value specifies a media type, per mime part two: media types [rfc2046]. ...
...the value specifies a media type, per mime part two: media types [rfc2046]. ...
...the value specifies a media type, per mime part two: media types [rfc2046]. ...
...the value specifies a media type, per mime part two: media types [rfc2046]. ...
Rosetta - Archive of obsolete content
by default, the only possible standardized scripting language for html is ecmascript. hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it. also, regarding some languages (like c), it is even not well defined the meaning of part of their semantics in respect to a scope that is more restricted than the full access to the resources they usually deal with – imagine, for example, the meaning of a c pointer within a html page! nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full virtual machines in pure ecmascript. therefore, it is also possible, in theory, to use ecmascript for a smaller task: parsing exotic programming ...
...usually deal with – imagine, for example, the meaning of a c pointer within a html page! nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full virtual machines in pure ecmascript. therefore, it is also possible, in theory, to use ecmascript for a smaller task: parsing exotic programming languages (i.e., creating compilers). beyond ecmascript this is not the place for showing a full compiler written in ecmascript. we can show, however, a possible way to start from. the following code is nothing but the base for an extensible collection of compilers. but by default, no compilers are loaded. it relies on the fact that unrecognized mime types will be simply ignored: this allows us to manua...
...int main () { printf("hello world number 1!\n"); return 0; } </script> <script type="text/x-c" src="example.c"></script> </head> <body> <p>lorem ipsum</p> <script type="text/javascript"> rosetta.translateall(); </script> </body> </html> example.c: c example #include <stdio.h> int main () { printf("hello world number 2!\n"); return 0; } if creating a compiler for the c programming language, as in the example above, can really look a huge task, there are many dialects of ecmascript which could be easily translated to standard ecmascript. the previous example shows a possible solution for all these cases, from the simplest to the hardest one. mime types here is a short list of the mime types associated to some programming languages: language mime type bash...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
hibited no modifications payment required certain uses are permitted depending on which license you choose english version is the official text nearly all oss licenses take english as their official texts. japanese versions, for example, are mentioned only as reference translations. thanks to the internet, published source code can be used all over the world, so the language that the most people will be able to understand is chosen as the language for the license (although this may reflect a western bias). applying an oss license in this section, i will explain practical details of applying a license when you are using oss source code, and participating in open-source projects. circumstances of application first i’ll explain what kind of license to use dependin...
...r own organization, you need not release it. for example, if you are using an modified version of linux as the operating system for a web server, it’s fine if you don’t release it. picking a license for original works if you are releasing source code you have developed yourself, you need to pick a license. but what kind of license? yukihiro matsumoto, the developer behind the ruby scripting language, published a “free software license diagnostic” in his personal blog. it asks a series of questions, and your responses help you pick the right license. in brief, it goes like this: best not to even try: creating a new license for your own use → support is a nightmare. do you hate the idea of your software ever being embedded in a commercial package? → choose the gpl. do you enthusia...
...siders its terms too harsh, and that it does not allow for the free distribution of documents. creative commons is a flexible copyright licensing scheme that applies not just to documents but other creative works, including music, pictures, video, etc. it has the following characteristics: gives creators flexibility when selecting and applying terms; terms of use stated in easy-to-understand language; licensing conditions conform with current copyright laws; also has an rdf schema for attaching metadata. it is particularly convenient in the way that it allows creators to decide whether to permit commercial uses or not, whether to enforce copyleft or not, etc. this is easy to use when you are releasing new documents. the future of gpl despite being buffeted by circumstances, open source ...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
lease follow the guidelines on the contribute page. « previousnext » this document was authored by hiroshi shimoda of clear code inc. and was originally published in japanese for the firefox developers conference summer 2007. shimoda-san is a co-author of firefox 3 hacks (o'reilly japan, 2008). before you learn how to develop extensions, let's learn about xul, the xml-based user-interface language, which is one of the building blocks for extensions. introduction an overview of xul xul is an xml-based language, and was developed to be the gui markup language for the mozilla browser. there are earlier experiments going back a long way in developing user interfaces using a combination of html and scripting languages, and xul could be considered an evolutionary step from that. similar appro...
...n of html and scripting languages, and xul could be considered an evolutionary step from that. similar approaches are found in xaml, which is used in windows vista, and flex, which is used in adobe flash. like web pages, which display the same regardless of platform, applications marked up in xul will work the same in any environment where firefox runs. because html was originally conceived as a language for marking up documents, specifically web pages, it is inevitably lacking in functionality for marking up applications. xul, on the other hand, was conceived from the ground up as a markup language for user interfaces, and makes it possible to insert ui components with sophisticated features just by writing tags, without any particular scripting. ...
... note: although there is a specification document, its markup is based on implementations and markup as of 2001, and current xul differs from it in many aspects. ...
Creating reusable content with CSS and XBL - Archive of obsolete content
llustrates how you can use css in mozilla to improve the structure of complex applications, making code and resources more easily reusable. note: xbl cannot be loaded over http, so this technique is only useful for local content accessed using the file:/// scheme, or from add-on code. you apply this technique in a simple demonstration. information: xbl bindings the structure provided by markup languages and css is not ideal for complex applications where parts need to be self-contained and reusable. you can place stylesheets in separate files, and you can place scripts in separate files. but you must link those files from the document as a whole. another structural limitation concerns content. you can use css to provide content for selected elements, but the content is limited to text and image...
... place scripts in separate files. but you must link those files from the document as a whole. another structural limitation concerns content. you can use css to provide content for selected elements, but the content is limited to text and images, and its positioning is limited to before or after the selected element. mozilla provides a mechanism that overcomes these limitations: xbl (xml bindings language). you can use xbl to link selected elements to their own: stylesheets content properties and methods event handlers because you avoid linking everything at the document level, you can make self-contained parts that are easy to maintain and reuse. more details for more information about xbl bindings, see the xbl page in this wiki. action: an xbl demonstration make a new ht...
...to the right. use the dom inspector tool to inspect the document, revealing the added content. what next? if you had difficulty understanding this page, or if you have other comments about it, please contribute to its discussion page. in this demonstration, the square and the button make a self-contained widget that functions within an html document. mozilla has a specialized markup language for creating user interfaces. the next page demonstrates it: xul user interfaces. ...
Creating a Microsummary - Archive of obsolete content
revising the transform sheet and other code in this tutorial, new material added will be shown in boldface so you can follow along more easily. note: if you are a web site developer, and you want to create microsummaries for pages on your site, you can write generators to do so, but a simpler and more efficient approach is to create the microsummaries on the server-side using the same tools and languages you already use to generate pages. for example, if you use php scripts to generate pages on your site, you could write php code to output a microsummary when the view=microsummary url parameter is present. then just link to the microsummaries from within the pages themselves using a <link rel="microsummary"> element, f.e.: <head> <link rel="microsummary" href="index.php?view=microsummary"> <...
..., let's give it the name "firefox download count": <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> </generator> adding an xslt transform sheet generators must include an xslt transform sheet (also known as an xslt stylesheet) which transforms the page content into its microsummary. xslt is a powerful language for transforming documents into different representations of the same information. add the xslt transform sheet to the generator by including it within a <template> element: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version=...
...="1.0"> <output method="text"/> <template match="/"> </template> </transform> </template> </generator> including the download count to include the download count in the output of the xslt transform sheet, we need to add an xslt <value-of> element to the template whose select attribute contains an xpath expression that points to the node containing the count. xpath is a language for identifying nodes in html/xml documents. it also contains basic functions for manipulating those nodes and their content. the easiest way to get an xpath expression that points to the node in question is to use the xpath checker extension. install the extension (restarting firefox to complete installation) then go to the spread firefox home page, find the firefox download count (a large numb...
Elements - Archive of obsolete content
9-1"?> uri in namespace declarations is an opaque string used to uniquely identify the namespace. it doesn't have to (and often it doesn't) point to some actual schema or a namespace-related resource. namespaces in xml besides the default namespace, you can declare any amount of additional namespaces to handle your content. the most useful namespaces could be html/xhtml, xul (xml user interface language), svg (scalable vector graphics) and xlink. this way a more-or-less universal namespace declaration in your bindings could be like: <bindings xmlns="http://www.mozilla.org/xbl" xmlns:html = "http://www.w3.org/1999/xhtml" xmlns:xul = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg = "http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink"> bindin...
...ding class that is constructed for the implementation. if no name attribute is specified then the binding's document uri and id are used to uniquely reference the binding's implementation. implements - the implements attribute can be used to describe the set of interfaces that are implemented by the binding. its value is a comma-separated list of named interfaces. if supported, in strongly typed languages the bound element can be referenced not only as any of the interfaces that the element might already support (e.g., htmlelement) but also as any of the interfaces described by this attribute. support of this capability is optional. constructor the code inside the constructor is called when a binding has just been attached to an element. so full access to anonymous nodes generated by the bindi...
... document-unique identifier. event - the event attribute describes the specific event that this handler is listening for. its value can be any legal dom event name (including custom events created using the documentevent interface of the dom). action - the action attribute contains script that is invoked when the handler fires. the type attribute on the enclosing handlers element determines the language of the script. the handler script can also be specified as a child of the handler element. phase - this attribute specifies the phase of the event flow that this handler should monitor. the possible values are capturing, bubbling, and target. if a phase is specified, the handler will only be invoked during that phase of the event handling process. if no phase is specified, a default of bubbling ...
XUL accessibility guidelines - Archive of obsolete content
practices, you will be able to write your xul applications in such a way that all users, including those with physical, sensory, or communicative disabilities, with be able to use and enjoy them. accessibility is not difficult, but does require a basic understanding of the different types of disabilities, commonly used assistive technologies, and special accessibility features built into the xul languages. most of all, accessibility requires a conscious effort on your part, and a desire to include everyone. it is hoped that these guidelines will be sufficiently clear and detailed that everyone—even someone with no previous background in accessibility—can understand them. in addition, there is an active community of accessibility developers within the mozilla project that will be happy to hel...
...is determined by the order of the elements in the underlying code. it can also be set programmatically with the tabindex attribute if needed, but this should be done sparingly and thoroughly tested whenever it is used. the navigation order should be logical, generally left to right, top to bottom. navigation order may vary depending on the nature of the application or the reading direction of the language. ensure that tab order is logical and all interactive elements can be accessed simply without the use of a mouse. you should be able to perform all functionality either directly in the application or through menu items or the context menu. trees provide alternative functionality for inaccessible operations. the column picker and column headers in xul trees are not keyboard accessible, consiste...
...shing content. no control over animation or warnings about flashing exist. other checkpoint pass fail custom widgets custom widgets provide accessible functionality. custom widgets are inaccessible. further references the official w3c accessibility guidelines, soon to be released: 2.0 and techniques for 2.0 which will supercede 1.0. these include language-neutral guidelines and also refer to techniques for xhtml, which is relevant for xul, as html can also be included inside of xul by use of the xhtml namespace. ...
XUL Coding Style Guidelines - Archive of obsolete content
it could contain xul specific element types for ui controls, html4 markups for content data, and even javascript for user event handling. to make xul files easy to read and maintain, localization friendly, and portable across user agents, we need to have a set of coding style guidelines to ensure our objectives are achievable. the author has collected a set of guidelines from various sources listed in the references section. while some of the guidelines are recommended practices, the others are mandatory. ...
...ace. case sensitivity. use chrome urls. javascript code shall be moved out of xul. dtd declaration. predefined entities. other guidelines mentioned in xhtml 1.1 recommendation. see details here. making xul localizable -- mandatory in the past, ui (display) related resource descriptions are stored in *.rc (for windows client) or *.ad (for unix client) so that they can be localized for a specific language or culture. in the new world, mozilla 5.0, this is not true any more. most of the windows and dialogs in mozilla will be described using xul. to make xul stream/file localizable, several guidelines are to be adopted to make the translation work easier and less error-prone. the issues are discussed in details here: what is localizable? widget resources content data style info layout geometry ho...
...mples or a kind of source documentation. to prevent them from being localized, you may insert a line of comment following the xml declaration as follows. <?xml 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: ...
Make your xulrunner app match the system locale - Archive of obsolete content
step is to figure out the system locale. to be finished later. then set the locale preference. the following is python code to set this preference. ...
... this preference. ...
...cls = components.classes["@mozilla.org/preferences-service;1"] ps = ps_cls.getservice(components.interfaces.nsiprefservice) branch = ps.getbranch("general.useragent.") branch.setcharpref("locale", lang) i also set the language environment variable to match the system locale so that python's gettext functionality will work (it pulls straight from language instead of using setlocale): os.environ["language"] = lang ...
New in JavaScript - Archive of obsolete content
ecmascript 5 support implementation status for the current standard ecma-262 edition 5.1 in mozilla-based engines and products. ecmascript 2015 support implementation status for the draft ecma-262 edition 6 (es2015) in mozilla-based engines and products. ...
... ecmascript 5 support implementation status for the current standard ecma-262 edition 5.1 in mozilla-based engines and products. ecmascript 2015 support implementation status for the draft ecma-262 edition 6 (es2015) in mozilla-based engines and products. ...
...and products. ecmascript 2015 support implementation status for the draft ecma-262 edition 6 (es2015) in mozilla-based engines and products. ecmascript next support implementation status for upcoming ecma-262 features as per the yearly (es2016/es2017/es2018/...) release schedule in mozilla-based engines and products. javascript versions deprecated ( ). the explicit versioning and opt-in of language features was mozilla-specific and are in process of being removed. firefox 4 was the last version which referred to a javascript version (1.8.5). with new ecma standards, javascript language features are now often mentioned with their initial definition in ecma-262 editions such as ecmascript 2015. javascript was released as version 1.0 in march 1996 in netscape navigator 2.0 and internet explor...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
by davey waterson, javascript architect, aptana there's no debate that javascript is the most widely used language client-side on the web. regardless of how the back-ends of your web applications are implemented, client side you're using javascript for everything from same form validations to full ajax applications. now imagine being able to develop web apps using javascript server-side too. wouldn't being able to use the same language on both client and server simplify life for us developers? full circle if you were part of the early web's big bang in the mid-1990s you might recall that being able to use javascript both client-side and server-side was core to netscape's original vision for web apps. netscape livewire was the first server-side javascript engine. now...
...rver-side ajax via the firefox browser engine on the server although server-side javascript is not a new concept, jaxer implements it in a unique fashion. by taking advantage of current scriptmonkey and ajax capabilities not to mention the loads of other features packed into the mozilla firefox browser engine, aptana jaxer fuses the client-side with the server-side, creating a unified “same language” development platform. where once you would need to master not only javascript for the client-side but also some flavor of a server-side web language, jaxer puts all the rich capability of a server-side language into javascript. this accounts for added simplicity and promotes rapid development methodologies. managing context to take advantage of all the operating co...
...ooked at, this one has to be my favorite. to be able to use jaxer to essentially create an xml based restful service in javascript is useful and shifts a great deal of power to the javascript developer. conclusion javascript can be successfully used for full application development on both the client and server, fulfilling netscape's original vision for a single, unified language for the web that makes apps easier to develop and maintain. advances such as ajax and running ajax on the server side with the jaxer server boosted by today's faster javascript engines and radically faster ones like tracemonkey to come from mozilla, sets the stage for significant use of server-side javascript now. resources mozilla spidermonk...
Server-Side JavaScript - Archive of obsolete content
the simplicity of using javascript on the server was part of netscape's original vision back in the day with netscape livewire. ...
... the simplicity of using javascript on the server was part of netscape's original vision back in the day with netscape livewire. ...
...r server-side environments like php and ruby on rails. now, with tracemonkey available, javascript (both client side and server-side) can see 20x to 40x speed improvements according to brendan eich, mozilla cto and creator of javascript. server-side javascript is another way in which, as this article quotes eich, "mozilla wants to 'get people thinking about javascript as a more general-purpose language' and show them that 'it really is a platform for writing full applications.'" many vendors today are embedding mozilla rhino or mozilla spidermonkey into web server environments. some, like aptana with the open source jaxer server actually embed the entire mozilla firefox browser engine (including spidermonkey) within a web server to enable server-side ajax and server-side dom access in addition...
Mozilla XForms User Interface - Archive of obsolete content
xforms can be hosted by xhtml and xul in seamonkey and firefox. later we have plans to support xforms hosted by svg. the xforms specs define two kinds of xforms ui elements, called 'form controls' and 'xforms user interface'. elements from the "form controls" group allows users to interact with instance data. the set of "xforms user interface" elements exist to aid form authors in combining host language markup and xforms markup together in order to build user interfaces. some of the 'form controls' can have multiple appearances and thus may be rendered in multiple ways. we use the data type of the instance node that the form control is bound to as a clue when making a rendering decision. the form author can also use the 'appearance' attribute on the form control to give us another clue. for exam...
...ol is introduced in xforms 1.1 and we don't feel adding the enhancement would be prudent until the 1.1 spec is more stable. for instance, when the spec reaches 'recommendation'-level status. if you see xhtml/xul then it means the control is available when xforms is hosted in either xhtml or xul. similarly, if you see xhtml only or xul only, then it means the control is available only in that host language. attribute sets this section describes attributes that are often used on xforms elements. these attributes are combined into following logical groups. ui common the ui common attribute set (see the spec) contains the attributes that are available for the xforms elements that are used to build the user interface presentation in a form. appearance - the value provided by the form author gives a ...
... the form's markup. they can be bound to instance nodes to define context for the xforms controls that they contain, should any of their child nodes happen to use relative xpath expressions. binding these elements to instance data is also a way to apply model item properties (for example, relevancy) to the elements. elements in this section do not have any behaviors that are dependent on the host language. group this element is used to logically group xforms elements together (see the spec). switch this element is used in conjunction with case and toggle elements (see the spec). the switch element contains case elements which in turn contain markup. only the contents of a single case may be displayed at one time. the toggle element is used (as an event handler) to make a case visible and thereby h...
XQuery - Archive of obsolete content
it offers powerful and yet intuitive searching based on xpath, has sql-like syntax for the query portion, and has scripting features such as function and variable definitions, xml-inclusion, etc. while xquery is currently not supported in firefox (whether through javascript to developers or to browser users), at least one extension has been developed to give a preliminary support for xquery for browser users (and serving as a simple model for how xquery can be implemented within extensions). ...
...xon b (though this extension currently only performs the xqueries). other popular native xml databases might also be supported (e.g., exist) in the future, especially now that the extension has added some basic support for the open-standard (xqj) for java and exist is in the midst of getting such an api. berkeley db xml was the initial choice by the extension developer for its support across many languages (c++, java, python, perl, php, etc.) (besides its also being open source), but now some problems may exist with bdbxml (unlike saxon). a simple usage example is available. notes for developers wishing to access xquery in their own extensions at present, the extension works simply by using liveconnect to work with berkeley db xml's java api (and via a java wrapper class which circumvents livec...
...via a java wrapper class which circumvents liveconnect's current inability to handle some types of java exceptions properly). however, use of the approach of the java firefox extension might be used to turn the above extension concept into an xpcom component (giving it access to all open windows), and for berkeley db xml, possibly implementing it in c++ instead, which is that database's original language of development. however, the extension demonstrates a technique which does not depend on using xpcom, while still giving full privileges. tutorials w3schools learn xquery in 10 minutes an introduction to xquery ...
Index - Game development
javascript that is hardware accelerated. 16 building up a basic demo with a-frame 3d, a-frame, vr, virtual reality, web, webgl the webxr and webgl apis already enable us to start creating virtual reality (vr) experiences inside web browsers, but the community is still waiting for tools and libraries to appear, to make this easier. mozilla's a-frame framework provides a markup language allowing us to build 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without having to write a lot of javascript or glsl. this article explains how to get up and running with a-frame, and how to use it to build up a simple demo. 17 building up a basic...
... explaining basic 3d theory 3d, coordinates, textures, basics, fragment, lighting, primitives, rendering, theory, vertex, vertices this article explains all of the basic theory that's useful to know when you are getting started working with 3d. 23 glsl shaders beginner, glsl, opengl, shader, texture shader, three.js, vertex shader shaders use glsl (opengl shading language), a special opengl shading language with syntax similar to c. glsl is executed directly by the graphics pipeline. there are two types of shaders: vertex shaders and fragment (pixel) shaders. vertex shaders transform shape positions into 3d drawing coordinates. fragment shaders compute the renderings of a shape's colors and other attributes. 25 async scripts for asm.js games, javasc...
...of small, regular-shaped images called tiles. this results in performance and memory usage gains — big image files containing entire level maps are not needed, as they are constructed by small images or image fragments multiple times. this set of articles covers the basics of creating tile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) 36 square tilemaps implementation: scrolling maps canvas, games, javascript, atlas, scrolling, spritesheet, tilemap, tiles this article covers how to implement scrolling square tilemaps using the canvas api. 37 square tilemaps implementation: static maps canvas, games, javascript, static, atlas, spritesheet, tilemap, tilemaps, tiles this article covers ...
Plug-in Development Overview - Gecko Plugin API Reference
be used to determines the mime types, file extensions, file open template, plug-in name, and description. ...
...ermines the mime types, file extensions, file open template, plug-in name, and description. ...
...pes fileextents: for file extensions fileopenname: for file open template productname: for plug-in name filedescription: for description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/quicktime|audio/aiff|image/jpeg the version stamp will be loaded only if it has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment. the resource code for this language and character set combination is 040904e4. unix on unix, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser loads each library and calls into the np_getm...
Internationalization - MDN Web Docs Glossary: Definitions of Web-related terms
also so that a user can browse features to translate or localize the application to access all the content without breaking the layout. ...
...also so that a user can browse features to translate or localize the application to access all the content without breaking the layout. ...
...also so that a user can browse features to translate or localize the application to access all the content without breaking the layout. ...
SGML - MDN Web Docs Glossary: Definitions of Web-related terms
it is worth noting that since its fifth edition, html is no longer sgml-based and has its own parsing rules. ...
...it is worth noting that since its fifth edition, html is no longer sgml-based and has its own parsing rules. ...
...it is worth noting that since its fifth edition, html is no longer sgml-based and has its own parsing rules. ...
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. ...
...for example, one character set would store japanese characters, and another would store the arabic alphabet. ...
...for example, one character set would store japanese characters, and another would store the arabic alphabet. ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
conjunction with xpointer (firefox supports a subset of it, and is used in the code sample below), xinclude can also target just specific portions of a document for inclusion. firefox does not support it natively, but the following function aims to allow its use with documents passed into it. code sample the following code aims to let <xi:include> and <xi:fallback> tags (the two elements in the language) with all of the attributes of <xi:include> be included in an xml document so as to be resolvable into a single xml document. (note that this has not been thoroughly tested for all circumstances and may not necessarily reflect the standard behavior completely.) note also that if you wish to allow xml:base, you will need the xml:base function, and the line beginning var href = ... should become:...
... var parse = xinclude.getattribute('parse'); var xpointer = xinclude.getattribute('xpointer'); var encoding = xinclude.getattribute('encoding'); // e.g., utf-8 // "text/xml or application/xml or matches text/*+xml or application/*+xml" before encoding (then utf-8) var accept = xinclude.getattribute('accept'); // header "accept: "+x var acceptlanguage = xinclude.getattribute('accept-language'); // "accept-language: "+x var xifallback = xinclude.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'fallback')[0]; // only one such child is allowed if (href === '' || href === null) { // points to same document if empty (null is equivalent to empty string) href = null; // set for uniformity in testing b...
...xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); request.setrequestheader('cache-control', 'no-cache'); if (accept) { request.setrequestheader('accept', accept); } if (acceptlanguage) { request.setrequestheader('accept-language', acceptlanguage); } switch (parse) { case 'text': // priority should be on media type: var contenttype = request.getresponseheader('content-type'); //text/xml; charset="utf-8" // ...
HTML: A good basis for accessibility - Learn web development
this article looks in detail at how html can be used to ensure maximum accessibility. prerequisites: basic computer literacy, a basic understanding of html (see introduction to html), and an understanding of what accessibility is. objective: to gain familiarity with the features of html that have accessibility benefits and how to use them appropriately in your web documents. ...
... hasn't got anything to use as signposts, so you can't retrieve a useful table of contents, and the whole page is seen as a single giant block, so it is just read out in one go, all at once. there are other issues too beyond accessibility — it is harder to style the content using css, or manipulate it with javascript, for example, because there are no elements to use as selectors. using clear language the language you use can also affect accessibility. in general, you should use clear language that is not overly complex and doesn't use unnecessary jargon or slang terms. this not only benefits people with cognitive or other disabilities; it benefits readers for whom the text is not written in their first language, younger people ... everyone, in fact! apart from this, you should try to avoid u...
... language you use can also affect accessibility. in general, you should use clear language that is not overly complex and doesn't use unnecessary jargon or slang terms. this not only benefits people with cognitive or other disabilities; it benefits readers for whom the text is not written in their first language, younger people ... everyone, in fact! apart from this, you should try to avoid using language and characters that don't get read out clearly by the screen reader. for example: don't use dashes if you can avoid it. instead of writing 5–7, write 5 to 7. expand abbreviations — instead of writing jan, write january. expand acronyms, at least once or twice. instead of writing html in the first instance, write hypertext markup language. page layouts in the bad old days, people used ...
HTML: A good basis for accessibility - Learn web development
this article looks in detail at how html can be used to ensure maximum accessibility. prerequisites: basic computer literacy, a basic understanding of html (see introduction to html), and an understanding of what accessibility is. objective: to gain familiarity with the features of html that have accessibility benefits and how to use them appropriately in your web documents. ...
... hasn't got anything to use as signposts, so you can't retrieve a useful table of contents, and the whole page is seen as a single giant block, so it is just read out in one go, all at once. there are other issues too beyond accessibility — it is harder to style the content using css, or manipulate it with javascript, for example, because there are no elements to use as selectors. using clear language the language you use can also affect accessibility. in general, you should use clear language that is not overly complex and doesn't use unnecessary jargon or slang terms. this not only benefits people with cognitive or other disabilities; it benefits readers for whom the text is not written in their first language, younger people ... everyone, in fact! apart from this, you should try to avoid u...
... language you use can also affect accessibility. in general, you should use clear language that is not overly complex and doesn't use unnecessary jargon or slang terms. this not only benefits people with cognitive or other disabilities; it benefits readers for whom the text is not written in their first language, younger people ... everyone, in fact! apart from this, you should try to avoid using language and characters that don't get read out clearly by the screen reader. for example: don't use dashes if you can avoid it. instead of writing 5–7, write 5 to 7. expand abbreviations — instead of writing jan, write january. expand acronyms, at least once or twice. instead of writing html in the first instance, write hypertext markup language. page layouts in the bad old days, people used ...
Using CSS generated content - Learn web development
re it makes sense to specify certain content as part of the stylesheet, not as part of the document. you can specify text or image content within a stylesheet when that content is closely linked to the document's structure. note: content specified in a stylesheet does not become part of the dom. specifying content in a stylesheet can cause complications. ...
... examples text content css can insert text content before or after an element. ...
... examples text content css can insert text content before or after an element. to specify this, make a rule and add ::before or ::after to the selector. in the declaration, specify the content property with the text content as its value. ...
Fundamental text and font styling - Learn web development
introduction to css). objective: to learn the fundamental properties and techniques needed to style text on web pages. what is involved in styling text in css? as you'll have already experienced in your work with html and css, text inside an element is laid out inside the element's content box. it starts at the top left of the content area (or the top right, in the case of rtl language content), and flows towards the end of the line. once it reaches the end, it goes down to the next line and continues, then the next line, until all the content has been placed in the box. text content effectively behaves like a series of inline elements, being laid out on lines adjacent to one another, and not creating line breaks until the end of the line is reached, or unless you force a line ...
...ed. values include: none: prevents any transformation. uppercase: transforms all text to capitals. lowercase: transforms all text to lower case. capitalize: transforms all words to have the first letter capitalized. full-width: transforms all glyphs to be written inside a fixed-width square, similar to a monospace font, allowing aligning of e.g. latin characters along with asian language glyphs (like chinese, japanese, korean). text-decoration: sets/unsets text decorations on fonts (you'll mainly use this to unset the default underline on links when styling them.) available values are: none: unsets any text decorations already present. underline: underlines the text. overline: gives the text an overline. line-through: puts a strikethrough over the text. ...
... much horizontal space should be left before the beginning of the first line of the text content. text-overflow: define how overflowed content that is not displayed is signaled to users. white-space: define how whitespace and associated line breaks inside the element are handled. word-break: specify whether to break lines within words. direction: define the text direction (this depends on the language and usually it's better to let html handle that part as it is tied to the text content.) hyphens: switch on and off hyphenation for supported languages. line-break: relax or strengthen line breaking for asian languages. text-align-last: define how the last line of a block or a line, right before a forced line break, is aligned. text-orientation: define the orientation of the text in a line. ...
Learn to style HTML using CSS - Learn web development
content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html. css building blocks this module carries on where css first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more. the aim here is to provide you with a toolkit for writing competent css and help you understand all the essential theory, before moving on ...
...oks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more. the aim here is to provide you with a toolkit for writing competent css and help you understand all the essential theory, before moving on to more specific disciplines like text styling and css layout. styling text with the basics of the css language covered, the next css topic for you to concentrate on is styling text — one of the most common things you'll do with css. here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows and other text features. we round off the module by looking at applying custom fonts to your page, and styling lists and links. css layout at this po...
...d add and define borders on elements. but there's not much you can't do once you have a solid understanding of even the basics of css. one of the best things about learning css is that once you know the fundamentals, usually you have a pretty good feel for what can and can't be done, even if you don't actually know how to do it yet! "css is weird" css works a bit differently to most programming languages and design tools you'll come across. why does it work the way it does? in the following video, miriam suzanne provides a useful explanation of why css works like it does, and why it has evolved like it has: ...
Sending form data - Learn web development
rl is navigated to. note: again, this code won't work if you just try to load it into a browser directly. python works a bit differently to php — to run this code locally you'll need to install python/pip, then install flask using pip3 install flask. at this point you should be able to run the example using python3 python-example.py, then navigating to localhost:5000 in your browser. other languages and frameworks there are many other server-side technologies you can use for form handling, including perl, java, .net, ruby, etc. just pick the one you like best. that said, it's worth noting that it's very uncommon to use these technologies directly because this can be tricky. it's more common to use one of the many high quality frameworks that make handling forms easier, such as: django f...
... flask, but with more tools and options). express for node.js. laravel for php. ruby on rails for ruby. it's worth noting that even using these frameworks, working with forms isn't necessarily easy. but it's much easier than trying to write all the functionality yourself from scratch, and will save you a lot of time. note: it is beyond the scope of this article to teach you any server-side languages or frameworks. the links above will give you some help, should you wish to learn them. a special case: sending files sending files with html forms is a special case. files are binary data — or considered as such — whereas all other data is text data. because http is a text protocol, there are special requirements for handling binary data. the enctype attribute this attribute lets you sp...
...ule is: never ever trust your users, including yourself; even a trusted user could have been hijacked. all data that comes to your server must be checked and sanitized. always. no exception. escape potentially dangerous characters. the specific characters you should be cautious with vary depending on the context in which the data is used and the server platform you employ, but all server-side languages have functions for this. things to watch out for are character sequences that look like executable code (such as javascript or sql commands). limit the incoming amount of data to allow only what's necessary. sandbox uploaded files. store them on a different server and allow access to the file only through a different subdomain or even better through a completely different domain. you should ...
Functions — reusable blocks of code - Learn web development
ons everywhere. in fact, we've been using functions all the way through the course so far; we've just not been talking about them very much. now is the time, however, for us to start talking about functions explicitly, and really exploring their syntax. pretty much anytime you make use of a javascript structure that features a pair of parentheses — () — and you're not using a common built-in language structure like a for loop, while or do...while loop, or if...else statement, you are making use of a function. built-in browser functions we've made use of functions built in to the browser a lot in this course. every time we manipulated a text string, for example: let mytext = 'i am a string'; let newstring = mytext.replace('string', 'sausage'); console.log(newstring); // the replace() string...
...this new string or every time we generated a random number: let mynumber = math.random(); // the random() function generates a random number between // 0 and up to but not including 1, and returns that number ...we were using a function! note: feel free to enter these lines into your browser's javascript console to re-familiarize yourself with their functionality, if needed. ...
...ipt language has many built-in functions to allow you to do useful things without having to write all that code yourself. in fact, some of the code you are calling when you invoke (a fancy word for run, or execute) a built in browser function couldn't be written in javascript — many of these functions are calling parts of the background browser code, which is written largely in low-level system languages like c++, not web languages like javascript. bear in mind that some built-in browser functions are not part of the core javascript language — some are defined as part of browser apis, which build on top of the default language to provide even more functionality (refer to this early section of our course for more descriptions). we'll look at using browser apis in more detail in a later module.
Drawing graphics - Learn web development
this article provides an introduction to canvas, and further resources to allow you to learn more. prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn the basics of drawing on <canvas> elements using javascript. ...
...owever was still not enough. while you could use css and javascript to animate (and otherwise manipulate) svg vector images — as they are represented by markup — there was still no way to do the same for bitmap images, and the tools available were rather limited. the web still had no way to effectively create animations, games, 3d scenes, and other requirements commonly handled by lower level languages such as c++ or java. the situation started to improve when browsers began to support the <canvas> element and associated canvas api — apple invented it in around 2004, and other browsers followed by implementing it in the years that followed. as you'll see below, canvas provides many useful tools for creating 2d animations, games, data visualizations, and other types of app, especially when c...
... it's now time to leave 2d behind, and take a quick look at 3d canvas. 3d canvas content is specified using the webgl api, which is a completely separate api from the 2d canvas api, even though they both render onto <canvas> elements. webgl is based on opengl (open graphics library), and allows you to communicate directly with the computer's gpu. as such, writing raw webgl is closer to low level languages such as c++ than regular javascript; it is quite complex but incredibly powerful. using a library because of its complexity, most people write 3d graphics code using a third party javascript library such as three.js, playcanvas, or babylon.js. most of these work in a similar way, providing functionality to create primitive and custom shapes, position viewing cameras and lighting, covering surf...
Manipulating documents - Learn web development
c to that document on the client-side (for example using a local database or other storage mechanism), attach an event handler to the current window, and more. the navigator represents the state and identity of the browser (i.e. the user-agent) as it exists on the web. in javascript, this is represented by the navigator object. you can use this object to retrieve things like the user's preferred language, a media stream from the user's webcam, etc. the document (represented by the dom in browsers) is the actual page loaded into the window, and is represented in javascript by the document object. you can use this object to return and manipulate information on the html and css that comprises the document, for example get a reference to an element in the dom, change its text content, apply new styl...
...e it altogether. in this article we'll focus mostly on manipulating the document, but we'll show a few other useful bits besides. the document object model the document currently loaded in each one of your browser tabs is represented by a document object model. this is a "tree structure" representation created by the browser that enables the html structure to be easily accessed by programming languages — for example the browser itself uses it to apply styling and other information to the correct elements as it renders a page, and developers like you can manipulate the dom with javascript after the page has been rendered. we have created a simple example page at dom-example.html (see it live also). try opening this up in your browser — it is a very simple page containing a <section> elemen...
...mple.html demo on github (see it live also). active learning: getting useful information from the window object so far we've only really looked at using node and document features to manipulate documents, but there is no reason why you can't get data from other sources and use it in your ui. you just have to make sure your data is in the right format; javascript makes it easier than many other languages, being weakly typed — for example numbers will convert to strings automatically when you want to print them to the screen. in this example we will solve a common problem — making sure your application is as big as the window it is viewed in, whatever size it is. this is often useful in situations like games, where you want to use as much of the screen area as possible to play the game in. ...
Basic math in JavaScript — numbers and operators - Learn web development
everybody loves math okay, maybe not. some of us like math, some of us have hated math ever since we had to learn multiplication tables and long division in school, and some of us sit somewhere in between the two. but none of us can deny that math is a fundamental part of life that we can't get very far without. this is especially true when we are learning to program javascript (or any other language for that matter) — so much of what we do relies on processing numerical data, calculating new values, and so on, that you won't be surprised to learn that javascript has a full-featured set of math functions available. this article discusses only the basic parts that you need to know now. types of numbers in programming, even the humble decimal number system that we all know so well is more ...
...ces, for example 12.5, and 56.7786543. doubles are a specific type of floating point number that have greater precision than standard floating point numbers (meaning that they are accurate to a greater number of decimal places). we even have different types of number systems! decimal is base 10 (meaning it uses 0–9 in each column), but we also have things like: binary — the lowest level language of computers; 0s and 1s. octal — base 8, uses 0–7 in each column. hexadecimal — base 16, uses 0–9 and then a–f in each column. you may have encountered these numbers before when setting colors in css. before you start to get worried about your brain melting, stop right there! for a start, we are just going to stick to decimal numbers throughout this course; you'll rarely come across...
......
JavaScript — Dynamic client-side scripting - Learn web development
every time a web page does more than just sit there and display static information for you to look at—displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, or more—you can bet that javascript is probably involved. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites javascript is arguably more difficult to learn than related technologies such as html and css. ...
... more difficult to learn than related technologies such as html and css. before attempting to learn javascript, you are strongly advised to get familiar with at least these two technologies first, and perhaps others as well. start by working through the following modules: getting started with the web introduction to html introduction to css having previous experience with other programming languages might also help. after getting familiar with the basics of javascript, you should be in a position to learn about more advanced topics, for example: javascript in depth, as taught in our javascript guide web apis modules this topic contains the following modules, in a suggested order for working through them. javascript first steps in our first javascript module, we first answer some...
...oducing javascript objects in javascript, most things are objects, from core javascript features like strings and arrays to the browser apis built on top of javascript. you can even create your own objects to encapsulate related functions and variables into efficient packages. the object-oriented nature of javascript is important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we've provided this module to help you. here we teach object theory and syntax in detail, look at how to create your own objects, and explain what json data is and how to work with it. asynchronous javascript in this module we take a look at asynchronous javascript, why it is important, and how it can be used to effectively handle potential blocking op...
Introduction to the server side - Learn web development
retrieved data with html templates (4), and sends back a response containing the generated html (5,6). are server-side and client-side programming the same? let's now turn our attention to the code involved in server-side and client-side programming. in each case, the code is significantly different: they have different purposes and concerns. they generally don't use the same programming languages (the exception being javascript, which can be used on the server- and client-side). they run inside different operating system environments. code running in the browser is known as client-side code and is primarily concerned with improving the appearance and behavior of a rendered web page. this includes selecting and styling ui components, creating layouts, navigation, form validation, etc. ...
...stem (including limited access to the file system). web developers can't control what browser every user might be using to view a website — browsers provide inconsistent levels of compatibility with client-side code features, and part of the challenge of client-side programming is handling differences in browser support gracefully. server-side code can be written in any number of programming languages — examples of popular server-side web languages include php, python, ruby, c#, and nodejs(javascript). the server-side code has full access to the server operating system and the developer can choose what programming language (and specific version) they wish to use. developers typically write their code using web frameworks. web frameworks are collections of functions, objects, rules and othe...
...re and presentation of that data to the user). you should also understand that it is useful because it allows us to create websites that efficiently deliver information tailored for individual users and have a good idea of some of the things you might be able to do when you're a server-side programmer. lastly, you should understand that server-side code can be written in a number of programming languages and that you should use a web framework to make the whole process easier. in a future article we'll help you choose the best web framework for your first site. here we'll take you through the main client-server interactions in just a little more detail. overview: first steps next in this module introduction to the server side client-server overview server-side web frameworks web...
TypeScript support in Svelte - Learn web development
ons. first we'll learn what typescript is and what benefits it can bring us. then we'll see how to configure our project to work with typescript files. finally we will go over our app and see what modifications we have to make to fully take advantage of typescript features. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn how to configure and use typescript when developing svelte applications. note that our application is fully functional and porting it to typescript is completely optional. there are different opinions about it, and in this ...
...ard work of the svelte team, together with many contributors, we have an official solution ready to be put to the test. in this section we'll show you how to setup a svelte project with typescript support to give it a try. why typescript? recently typescript has seen enormous growth. from last year's github octoverse report we can see that typescript is the 7th most used and 5th fastest growing language used on github. according to stackoverflow's 2019 developer survey it is the third most loved language, right behind rust and python. so typescript is going through a great phase of adoption. typescript's main advantages are: early spotted bugs: the compiler checks types at compile time and provides error reporting. readability: static typing gives the code more structure, making it self-do...
...piles many recent es6 features to plain old-school javascript, allowing you to use them even on user-agents that don't support them natively yet. typescript also has some disadvantages: not true static typing: types are only checked at compile time, and they are removed from the generated code. steep learning curve: even though typescript is a superset of javascript and not a completely new language, there is a considerable learning curve, especially if you have no experience at all with static languages like java or c#. more code: you have to write and maintain more code. no replacement for automatic tests: even though types might help you catch several bugs, typescript is not a true replacement for a comprehensive suite of automated tests. boiler plate code: working with types, classes,...
Getting started with Svelte - Learn web development
te works and what sets it apart from the rest of the frameworks and tools we've seen so far. then we will learn how to setup our development environment, create a sample app, understand the structure of the project, and see how to run it locally and build it for production. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. svelte is a compiler that generates minimal and highly optimized javascript code from our sources; you'll need a terminal with node + npm installed to compile and build your app. objective: to setup a local svelte development environment, create and build a starter app, and understand the basics of how it works. svelte...
...the following ways: it extends html by allowing javascript expressions in markup and providing directives to use conditions and loops, in a fashion similar to handlebars. it extends css by adding a scoping mechanism, allowing each component to define their own styles without the risk of clashing with other component's styles. it extends javascript by reinterpreting specific directives of the language to achieve true reactivity and ease component state management. the compiler only intervenes in very specific situations and only in the context of svelte components. extensions to the javascript language are minimal and carefully picked in order to not break javascript syntax nor alienate developers. in fact, you will be mostly working with vanilla javascript. first steps with svelte being a...
...ensas/mdn-svelte-tutorial. you can also download a specific folder with npx degit opensas/mdn-svelte-tutorial/01-getting-started. degit won't create a local git repo, it will just download the files of the specified folder. using the svelte repl a repl (read–eval–print loop) is an interactive environment that allows you to enter commands and immediately see the results — many programming languages provide a repl. svelte's repl is much more than that. it's an online tool that allows you to create complete apps, save them online, and share with others. it's the easiest way to start playing with svelte from any machine, without having to install anything. it is also widely used by svelte community. if you want to share an idea, ask for help, or report an issue, it's always extremely useful...
Setting up your own test automation environment - Learn web development
rticle, we will teach you how to install your own automation environment and run your own tests using selenium/webdriver and a testing library such as selenium-webdriver for node. we will also look at how to integrate your local testing environment with commercial tools like the ones discussed in the previous article. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing, and automated testing. objective: to show how to set up a selenium testing environment locally and run tests with it, and how to integrate it with tools like lambdatest, sauce labs, and browserstack. selenium selenium is the most popular browser automation tool. there are other ways, but the best way to use selen...
... on the page", "click this link", "see whether the link opens this url", etc. this is ideal for running automated tests. how you install and use webdriver depends on what programming environment you want to use to write and run your tests. most popular environments have available a package or framework that will install webdriver and the bindings required to communicate with webdriver using this language, for example, java, c#, ruby, python, javascript (node), etc. see setting up a selenium-webdriver project for more details of selenium setups for different languages. different browsers require different drivers to allow webdriver to communicate with and control them. see platforms supported by selenium for more information on where to get browser drivers from, etc. we will cover writing and ru...
...in a bit more detail. webdriver syntax crash course let's have a look at a few key features of the webdriver syntax. for more complete details, you should consult the selenium-webdriver javascript api reference for a detailed reference, and the selenium main documentation's selenium webdriver and webdriver: advanced usage pages, which contain multiple examples to learn from written in different languages. starting a new test to start up a new test, you need to include the selenium-webdriver module like this: const webdriver = require('selenium-webdriver'), by = webdriver.by, until = webdriver.until; next, you need to create a new instance of a driver, using the new webdriver.builder() constructor. this needs to have the forbrowser() method chained onto it to specify what browser you ...
Command line crash course - Learn web development
ly be required to run some command in the terminal (or on the "command line" — these are effectively the same thing). this article provides an introduction to the terminal, the essential commands you'll need to enter into it, how to chain commands together, and how to add your own command line interface (cli) tools. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand what the terminal/command line is, what basic commands you should learn, and how to install new command line tools. welcome to the terminal the terminal is a text interface for executing text-based programs. if you're running any tooling for web development there's a near-guaranteed chance that you'll have to pop open the command line and run some co...
.../docs/web/api/globalfetch/globalfetch.fetch() location: /docs/web/api/globalfetch/fetch location: /docs/web/api/windoworworkerglobalscope/fetch although contrived, we could take this result a little further and transform the location: line contents, adding the base origin to the start of each one so that we get complete urls printed out. for that, we'll add awk to the mix (which is a programming language akin to javascript or ruby or python, just a lot older!). try running this: curl /docs/web/api/fetch -l -i | grep location | awk '{ print "https://developer.mozilla.org" $2 }' your final output should look something like this: /docs/web/api/fetch /docs/web/api/globalfetch/globalfetch.fetch() /docs/web/api/globalfetch/fetch /docs/web/api/windoworworkerglobalscope/fetch by combining these comm...
...r than the benefits. however, for now we'll err on the side of simplicity and install globally to keep things simple. we'll look more at local installs and why they're good in the next article. installing prettier for this article we will install prettier as a global command line utility. prettier is an opinionated code formatting tool for front end developers, focusing around javascript-based languages and adding support for html, css, scss, json and more. prettier can: save the cognitive overhead of getting the style consistent manually across all your code files; prettier can do this for you automatically. help newcomers to web development format their code in best-practice fashion. be installed on any operating system and even as a direct part of project tooling, ensuring that colleag...
Creating a spell check dictionary add-on
pdate your existing add-on, so that it can be installed, uninstalled and updated without a restart. parts needed to create a dictionary add-on, you first need two things: a spell check dictionary in hunspell or myspell format, with a license which allows you to use it. such a dictionary consists of two files, one with a .dic and one with an .aff file extension. a locale code to describe the language of the dictionary. for example en-us, de-de or da. it is important to choose the right locale code, or the spell checker will not be able to match the language of your dictionary against the language of a web page in order to select the right dictionary to use. if you are creating a new dictionary, as opposed to updating an existing one, please make sure that there is not already a dictionary a...
...if you update an existing dictionary add-on, you must keep the existing em:id, or your users will not be updated to the latest version. the em:version should follow the rules of mozilla add-on version numbers, and if you update an existing dictionary add...
...ate to a newer version of firefox/thunderbird (bug 782115). update the em:maxversion to the greatest versions available. once you have added these files to your zip file and renamed the file to have the .xpi extension, you can install your add-on in firefox and test it. after a successful test, you can upload your add-on to addons.mozilla.org and ask for it to be included in the dictionaries & language packs page. reference creating a hunspell dictionary ...
gettext
irst argument (which is the string returned by gettext) will be replaced with the value of $num. for english, the above code will produce the following output: 1 user likes this. the string definition in the messages.po file will look like this: #: file.php:3 #, php-format msgid "%d user likes this." msgid_plural "%d users like this." msgstr[0] "" msgstr[1] "" depending on the localizer's target language and its rules for creating plural forms, there might be another field for translation, e.g. msgstr[2]. gettext will return one of the msgstrs, depending on the number passed to the gettext function in the code ($num in the above example). to determine which form to return, gettext uses a plural rule, which should be declared in the po file header. for example, for english, the plural rule is of t...
...rings from the php file, use xgettext. you can specify the function calls to look for with the --keyword option. for example, --keyword=n___:1,2,4c tells xgettext to look for n___() calls, and extract the first argument as the singular string, the second argument as the plural string and the fourth argument as the context (the third argument is reserved for the number in this example). xgettext --language=php \ --add-comments=l10n \ --keyword=___:1 \ --keyword=___:1,2c \ --keyword=n___:1,2 \ --keyword=n___:1,2,4c \ file.php running xgettext will result in the following messages.po file: # some descriptive title. # copyright (c) year the package's copyright holder # this file is distributed under the same license as the package package. # first...
.... # copyright (c) year the package's copyright holder # this file is distributed under the same license as the package package. # first author <email@address>, year. # #, fuzzy msgid "" msgstr "" "project-id-version: package version\n" "report-msgid-bugs-to: \n" "pot-creation-date: 2009-09-28 16:18+0200\n" "po-revision-date: year-mo-da ho:mi+zone\n" "last-translator: full name <email@address>\n" "language-team: language <ll@li.org>\n" "mime-version: 1.0\n" "content-type: text/plain; charset=charset\n" "content-transfer-encoding: 8bit\n" "plural-forms: nplurals=integer; plural=expression;\n" #. l10n: this is a block comment one line directly above the gettext function call. it will be extracted by xgettext. #: file.php:12 msgid "a simple string." msgstr "" #. l10n: this is an inline comment. it w...
Index
ey objects are made up of the following parts: 129 jsobjectop jsapi reference, obsolete, spidermonkey the callbacks of this type are: 130 jsobjectops.defaultvalue jsapi reference, obsolete, spidermonkey the jsobjectops.defaultvalue callback corresponds to the [[defaultvalue]] method defined in ecma 262-3 §8.6.2.6. many expressions in the ecmascript language, such as a+b, involve implicit conversion of the operands using [[defaultvalue]]. 131 jsobjectops.defineproperty jsapi reference, obsolete, spidermonkey define obj[id], an own property of obj named id, having the given initial value, with the specified getter, setter, and attributes. 132 jsobjectops.destroyobjectmap jsapi reference, obsolete, spidermonkey ...
...t jsapi reference, obsolete, spidermonkey this function is obsolete: use js_getglobalforobject or js_getglobalforscopechain instead. the concept of a global object belonging to a context will likely be phased out in future versions of spidermonkey. 309 js_getimplementationversion jsapi reference, spidermonkey js_getimplementationversion returns a hard-coded, english language string that specifies the version number of the js engine currently in use, and its release date. 310 js_getinstanceprivate jsapi reference, spidermonkey js_getinstanceprivate determines if a javascript object, obj, is an instance of a given jsclass, clasp, and if it is, returns a pointer to the object's private data. otherwise it returns null. 311 js_getinternedst...
...tself. see js_threadsafe for a gentler introduction to using spidermonkey in a multi-threaded application. 537 tracing jit deprecated, spidermonkey the tracing jit in spidermonkey consists of a generic, low level component called nanojit which is co-maintained between adobe and mozilla, and a spidermonkey-specific high level component called jstracer. the nanojit component is language agnostic, and contains no knowledge about spidermonkey or any other part of the mozilla codebase. the jstracer component consists of a monitor and a recorder. the monitor watches the executing spidermonkey interpreter. when the monitor determines that the interpreter has entered a region of code that would benefit from native compilation, the monitor activates the recorder. the recorder records t...
SpiderMonkey 1.8.5
ascript team is pleased to announce the release of spidermonkey 1.8.5. you can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz (md5 checksum: a4574365938222adca0a6bd33329cb32). spidermonkey 1.8.5 is the javascript engine that shipped in firefox 4.0. it is much faster than spidermonkey 1.8, implements es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.5 is supported on all the platforms where firefox 4 runs. spidermonkey 1.8.5 includes a just-in...
...8.5 is supported on all the platforms where firefox 4 runs. spidermonkey 1.8.5 includes a just-in-time compiler (jit) (several, actually) that compiles javascript to machine code, for a significant speed increase. it is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8 the following features in earlier versions of spidermonkey have been dropped. support for extended class methods (in particular, jsequalityop) has been removed. multithreaded js programs that race against the same objects are now explicitly not supported. multithreaded programs are allowed, but each thread must operate on objects in a separate c...
...ervalue are gone. instead use double_to_jsval, int_to_jsval, and uint_to_jsval, which are faster and can't fail. js_getstringbytes and js_getstringchars are gone. there is no longer an infallible way to examine string characters. applications must use js_getstringcharsandlength or js_encodestring/js_free and check for errors. these and other changes are explained in detail below. new javascript language features javascript 1.8.5 adds support for ecmascript edition 5, including es5 strict mode. for details, see new in javascript 1.8.5. note that there are a very small number of incompatibilities between es5 and and es3, the version of ecmascript supported by spidermonkey versions 1.5 through 1.8. these are discussed in annex e of the es5 specification. spidermonkey 1.8.5 also ships with js-ctype...
SpiderMonkey 1.8.7
ascript team is pleased to announce the release of spidermonkey 1.8.5. you can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz (md5 checksum: a4574365938222adca0a6bd33329cb32). spidermonkey 1.8.5 is the javascript engine that shipped in firefox 4.0. it is much faster than spidermonkey 1.8, implements es-5 (ecma 262, 5th edition), and contains many new language and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —22 march 2011 platform support spidermonkey 1.8.7 is supported on all the platforms where firefox 10 runs. spidermonkey 1.8.7 includes type inf...
...pidermonkey 1.8.7 includes type inference, which boosts the speed of the jägermonkey jit by about 30% over version 1.8.5. type inference largely obviates tracemonkey, so the tracemonkey jit has been removed. the jit is supported only on x86, x86_64 and arm architectures. on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8.7 this covers migrating from version 1.8.5. see the 1.8.5 release notes for information on migrating from earlier versions. the following features in earlier versions of spidermonkey have been dropped. xxx is there anything here? spidermonkey 1.8.7 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi type...
... of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. xxx is there anything here? these and other changes are explained in detail below. new javascript language features xxx needs updating javascript 1.8.5 adds support for ecmascript edition 5, including es5 strict mode. for details, see new in javascript 1.8.5. note that there are a very small number of incompatibilities between es5 and and es3, the version of ecmascript supported by spidermonkey versions 1.5 through 1.8. these are discussed in annex e of the es5 specification. spidermonkey 1.8.5 also ...
SpiderMonkey 1.8.8
can download full source code here: insert-actual-link-when-the-release-happens (md5 checksum: insert-actual-hash-here). spidermonkey 1.8.8 is the javascript engine that shipped in firefox 10.0. it continues to improve performance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —insert-actual-release-date-here platform support spidermonkey 1.8.8 is supported on all the platforms where firefox insert-actual-firefox-version...
.... spidermonkey 1.8.8 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 1.8.8 the following features in earlier versions of spidermonkey have been dropped. the jsresolve_classname and jsresolve_with resolve flags (passed to jsclass.resolve when jsclass.flags contains jsclass_new_resolve) have been removed. spidermonkey 1.8.8 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi ty...
...ignificant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. a significant number of typedefs of built-in types, or of types which are now standardized, have been removed. these and other changes are explained in detail below. new javascript language features javascript 1.8.8 includes significant updates to language features, yo. typedef changes many types have been removed from the jsapi and replaced with simpler alternatives. including jsapi.h provides all these types, but more-specific headers also provide these types if you wish to use them in other code. obsolete typedef replacement type provided by uint...
SpiderMonkey 17
urce code here: http://ftp.mozilla.org/pub/mozilla.org/js/mozjs17.0.0.tar.gz (md5 checksum: 20b6f8f1140ef6e47daa3b16965c9202). spidermonkey 17 is the javascript engine that shipped in firefox 17. it continues to improve performance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — 25 march 2013 platform support spidermonkey 17 is supported on all the platforms where firefox 17 runs. spidermonkey 17 includes a just-in-time ...
...uns. spidermonkey 17 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 17 the following features in earlier versions of spidermonkey have been dropped. the jsresolve_classname and jsresolve_with resolve flags (passed to jsclass.resolve when jsclass.flags contains jsclass_new_resolve) have been removed. spidermonkey 17 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi types, f...
...ignificant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes. a significant number of typedefs of built-in types, or of types which are now standardized, have been removed. these and other changes are explained in detail below. new javascript language features javascript 17 includes significant updates to language features, yo. typedef changes many types have been removed from the jsapi and replaced with simpler alternatives. including jsapi.h provides all these types, but more-specific headers also provide these types if you wish to use them in other code. obsolete typedef replacement type provided by uint8, ...
SpiderMonkey 24
d full source code here: https://ftp.mozilla.org/pub/mozilla.org/js/mozjs-24.2.0.tar.bz2 (sha1: ce779081cc11bd0c871c6f303fc4a0091cf4fe66) spidermonkey 24 is the javascript engine that shipped in firefox 24. it continues to improve performance over previous spidermonkey releases, with a significantly improved garbage collector, a new jit compilation mode, and other features. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — dec 16, 2013 the download url still available, but spidermonkey not release alone! get it here mozilla-esr24 if the download url is outdate y...
...ed. spidermonkey 24 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 24 spidermonkey now provides a fully c++ interface, so embedders relying on embeddability in c projects will have to convert to c++, or implement their own adapter code. the following features in earlier versions of spidermonkey have been dropped. e4x, an extension to ecmascript adding xml support, has been removed. the extension eventually beca...
... changes. many of the garbage collector changes require type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types. these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.). these and other changes are explained in detail below. new javascript language features javascript 24 includes significant updates to language features, yo. typedef changes the fixed-size integer types introduced in spidermonkey 17 are defined in one of the following ways (xxx update for msvc<10 deprecation): if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types. the file must conform to the standard...
SpiderMonkey 31
these release notes are incomplete. the mozilla javascript team is pleased to announce the release of spidermonkey 31. spidermonkey 31 is the javascript engine that shipped in firefox 31. it continues to improve performance over previous spidermonkey releases, with a significantly improved garbage collector and other features. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. the download url is outdated and spidermonkey not release alone! get it here mozilla-esr31 you will find it in "firefox extended support release 31" package on hg release platform support ...
...ed. spidermonkey 31 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 31 the first change most embedders will notice is that spidermonkey must now be initialized before it can be used, using the newly-repurposed js_init method. after this method is called, normal jsapi operations are permitted. when all jsapi operation has completed, the corresponding js_shutdown method (currently non-mandatory, but highly recommende...
...licitly const, and several apis have been updated to use const jsclass * and const js::class * pointers. all references to shortid/tinyid have been removed. that includes the apis js_definepropertywithtinyid and js_defineucpropertywithtinyid as well as the jspropertydescriptor structure and the matching jsprop_shortid flag. these and other changes are explained in detail below. new javascript language features javascript 31 includes significant updates to language features, yo. new c++ apis jsapi is now a c++-only api. please note that spidermonkey reserves the js:: namespace for itself (and the js:: namespace for internal use). js_init is a new function which must be used to initialize the js engine before any jsruntimes are created or other jsapi methods are called. this method pairs ...
SpiderMonkey 38
spidermonkey 38 is outdated and contains known security vulnerabilities. these release notes are incomplete. the mozilla javascript team is pleased to announce the release of spidermonkey 38. spidermonkey 38 is the javascript engine that shipped in firefox 38. it continues to improve performance over previous spidermonkey releases, with xxx blah blah blah. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. — sep 17, 2015 the download url is outdated and spidermonkey not release alone! get it here mozilla-esr38 you will find it in "firefox extended support rele...
...10. spidermonkey 38 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions. it's the same language, just not as fast. migrating to spidermonkey 38 .... xxx will need updating for actual new gc stuff at time! a major change to spidermonkey in 38 is that its apis support a moving garbage collector. this entailed changing the vast majority of the jsapi from raw types, such as js::value or js::value*, to js::handle and js::mutablehandle template types that encapsulate access to the provided v...
...d still have the same names and implement essentially unchanged functionality. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a list of the most significant changes: .... these and other changes are explained in detail below. new javascript language features javascript 38 includes significant updates to language features, yo. new c++ apis jsapi is now a c++-only api. please note that spidermonkey reserves the js:: namespace for itself (and the js:: namespace for internal use). js::clonefunctionobject (bug 1088228) interned_string_to_jsid (bug 1045900) js::construct (bug 1017109) js::createerror (bug 984048) js::falsehandlevalue (bu...
SpiderMonkey 45
5. you can download full source code from https://ftp.mozilla.org/pub/spidermonkey/releases/45.0.2/mozjs-45.0.2.tar.bz2 sha256: 570530b1e551bf4a459d7cae875f33f99d5ef0c29ccc7742a1b6f588e5eadbee md5: 2ca34f998d8b5ea79d8616dd26b5fbab spidermonkey 45 is the javascript engine that shipped in firefox 45. it continues to improve performance over previous spidermonkey releases. it also contains new language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. you may wish to make the bugs block bug 837921 (aliased as "sm.embedding"). — apr 14, 2016 platform support spidermonkey 45 is supported on all ...
... spidermonkey 45 includes a just-in-time compiler (jit) that compiles javascript to machine code, for a significant speed increase. it is supported on x86, x86_64, and arm architectures. on several other platforms (sparc, mips), the jit is provided but not supported. on remaining platforms the jit is disabled; javascript code runs in an interpreter, as it has in previous versions. it's the same language, just not as fast. migrating to spidermonkey 45 spidermonkey 45 is not binary-compatible with previous releases, nor is it source-code compatible. many jsapi types; functions, and callback signatures, have changed though most functions that have retain their previous name, providing relatively unchanged functionality. applications will require significant changes, but most changes will be autom...
...g relatively unchanged functionality. applications will require significant changes, but most changes will be automatically detected by the c/c++ compiler, making them easy to detect and updating the code a relatively straightforward job. here is a list of the most significant changes: js::nullptr is obsolete. you should now use nullptr instead. (supporting decltype(nullptr)). new javascript language features javascript 45 includes significant updates to its language features, yo. new c++ apis jsapi is a c++ exclusive api. please note that spidermonkey reserves the js:: namespace for itself for public exports and the js:: namespace for internal use. js_setcurrentembeddertimefunction (bug 1159507) js_getcurrentembeddertime (bug 1159507) js_mayresolvestandardclass (bug 1155946) js_get...
Zest
it is completely free, open source and can be included in any tool whether open or closed, free or commercial. zest is still at a very early stage of development, but is has been made available so that anyone can play around with it. ...
... it is completely free, open source and can be included in any tool whether open or closed, free or commercial. zest is still at a very early stage of development, but is has been made available so that anyone can play around with it. ...
... it is completely free, open source and can be included in any tool whether open or closed, free or commercial. zest is still at a very early stage of development, but is has been made available so that anyone can play around with it. ...
Mozilla Projects
a python script that helps localizers to check their work without running firefox or another application. crash reporting firefox ships with an open-source crash reporting system. this system is combination of projects: emscripten emscripten is an llvm to javascript compiler. it takes llvm bytecode (e.g. generated from c/c++ using clang, or from another language) and compiles that into javascript, which can be run on the web. firefox sync firefox sync synchronizes state and configuration data used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among all your devices. jshydra jshydra is a static analysis tool that is capable of performing analysis of general javascr...
...latform for implementing debugging and analysis features. we would like to use web replay to radically improve not just the debugging experience but the entire web development experience. to that end, this document will be revised over time as we find new and better ways of helping developers. ...
...lysis features. we would like to use web replay to radically improve not just the debugging experience but the entire web development experience. to that end, this document will be revised over time as we find new and better ways of helping developers. zest zest is an experimental specialized scripting language (also known as a domain-specific language) developed by the mozilla security team and is intended to be used in web oriented security tools. the language is written in json, but we do not expect people to write zest in this format - it is designed to be a visual language. the core language does not define any graphical representation - that is expected to be defined by the tools that integrate zest. ...
Component Internals
ncellation. note also that xpcom services may deny you access once you have received the shutdown notification. it is possible that xpcom will return an error if you access the nsiservicemanager at that point, for example, so you may have to keep a reference-counted pointer to the service you are interested in using during this notification. component loaders components can be written in many languages. so far this book has been focusing on "native components," shared libraries exporting a nsgetmodule symbol. but if there is a component loader for javascript installed, then you can also write a javascript component. to register, unregister, load and manage various component types, xpcom abstracts the interface between the xpcom component and xpcom with the component loader. this loader is res...
...om with the component loader. this loader is responsible for initialization, loading, unloading, and supporting the nsimodule interface on behalf of each component. it is the component loader's responsibility to provide scriptable component support. when building a "native" component, the component loader looks for an exported symbol from the components shared library. "native" here includes any language that can generate a platform native dynamically loaded library. scripting languages and other "non-native" languages usually have no way to build native libraries. in order to have "non-native" xpcom components work, xpcom must have a special component loader which knows how to deal with these type of components. xpconnect, for example, provides a component loader that makes the various types, i...
... three parts of a xpcom component library xpcom is like an onionor a parfait! everybody likes parfaits. xpcom components have at least three layers. ...
Starting WebLock
pell out the interface for the weblock component in this way. for example, addsite is supposed to add the current url to the white list, but is the url an input parameter to the method, is it the topmost web page in the gecko application, or is it something more random-a url picked from global history or that's been given context in some other way? as a strongly typed and implementation-agnostic language, xpidl requires that you be quite specific about the apis, the list of parameters, their order, and their types. xpidl requires that you spell it all out, in other words. and it's this formality that makes the interfaces in xpcom effective contracts between services and clients. the next section shows the interface of the weblock component, iweblock, in xpidl. once the interface has been describ...
... that you be quite specific about the apis, the list of parameters, their order, and their types. xpidl requires that you spell it all out, in other words. and it's this formality that makes the interfaces in xpcom effective contracts between services and clients. the next section shows the interface of the weblock component, iweblock, in xpidl. once the interface has been described in the xpidl language, the interface file can be used to generate the header files needed for the implementation code, the binary type library files that let you use the interface of the weblock component from javascript, and even broken linkjavadoc style html documentation. defining the weblock interface in xpidl most interfaces in the xpcom world are described in xpidl. the xpidl file for the iweblock interface ca...
...nd even broken linkjavadoc style html documentation. defining the weblock interface in xpidl most interfaces in the xpcom world are described in xpidl. the xpidl file for the iweblock interface can be used to generate the c++ header file, which you'll need to implement the interface in the component and also a type library that makes the component accessible from javascript or other interpreted languages. in mozilla, javascript is the bridge between components and the xul-based user interface. the xpidl syntax the xpidl syntax is a mix of c++ and java, and of course it's very much like the omg idl upon which it is closely based. the xpidl for iweblock appears below: iweblock #include "nsisupports.idl" interface nsisimpleenumerator; [scriptable, uuid(ea54eee4-9548-4b63-b94d-c519ffc91d09)] inte...
mozIPersonalDictionary
graphically sorted) list of words. read only. methods addcorrection() adds a misspelling to the list of corrections. note that this method is not currently implemented. void addcorrection( in wstring word, in wstring correction, in wstring lang ); parameters word the incorrect spelling of the word to add to the list of corrections. correction the correct spelling of the word. ...
...ion( in wstring word, in wstring correction, in wstring lang ); parameters word 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 th...
...oad(); parameters none. removecorrection() removes a misspelling from the list of corrections. this removes a single misspelling and correction pair from the list. void removecorrection( in wstring word, in wstring correction, in wstring lang ); parameters word the incorrect spelling of the word to remove from the list of corrections. correction the correct spelling of the word. lang the language of the word. notes only an entry matching both word and correction will be removed from the list of corrections. removeword() removes a word from the personal dictionary. void removeword( in wstring word, in wstring lang ); parameters word the word to remove. lang the language of the word. note that this parameter is currently ignored. save() saves the dictionary. void save(); parameters...
nsIBidiKeyboard
havebidikeyboards boolean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed. read only. note: this throws ns_error_not_implemented if the widget layer doesn't provide this information. currently, this is only implemented on windows. methods islangrtl() determines if the current keyboard language is right-to-left. (supported on: win32, mac, gtk2) note: prior to gecko 1.9 this method used a parameter 'out prbool aisrtl' to return the value. boolean islangrtl(); parameters none. return value true if the current keyboard is right-to-left, false if it is not. exceptions thrown ns_error_failure if no right-to-left keyboards are installed. setlangfrombidilevel() sets the keyboard lan...
...the problem is fixed on gtk+ version 2.10.1 and 2.12. ...
...t. (supported on: win32) void setlangfrombidilevel( in pruint8 alevel ); parameters alevel if odd set the keyboard to right-to-left, if even set left-to-right. exceptions thrown ns_error_failure if no right-to-left keyboards are installed. remarks implementation windows this implementation uses win32 api to get the language of the keyboard layout, and the direction of those languages. linux this implementation depends on the gecko and gtk+ version. in the gecko 1.8 branch, just islangrtl() had been implemented, and uses gdk's api to check the direction of keyboard layout, which has a problem with hebrew language. the problem is fixed on gtk+ version 2.10.1 and 2.12. in the gecko 1.9 branch, we are going to implement all the interface, with xkb functions for xlib and gtk2 bac...
nsIEditorSpellCheck
nvalid. boolean checkcurrentwordnosuggest( in wstring suggestedword ); parameters suggestedword the word to check. return value true if the word is misspelled; otherwise false. getcurrentdictionary() returns the name of the dictionary currently in use. astring getcurrentdictionary(); parameters none. return value the name of the dictionary currently in use. typically, this is an iso language code, such as "en-us". getdictionarylist() retrieves a list of the currently available dictionaries. the strings will typically be language ids, such as "en-us". void getdictionarylist( [array, size_is(count)] out wstring dictionarylist, out pruint32 count ); parameters dictionarylist an array into which the list of dictionary name strings are placed. count on return, contai...
...o 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6). since spelling dictionaries can now be selected per-site, this method is no longer needed. void savedefaultdictionary(); parameters none. setcurrentdictionary() selects the main dictionary to use. void setcurrentdictionary( in astring dictionary ); parameters dictionary the name of the dictionary to use. typically, this is an iso language code such as "en-us". setfilter() used to filter the content (for example, to skip blockquotes in email from spell checking). call this before calling initspellchecker(); calling it after initialization will have no effect. void setfilter( in nsitextservicesfilter filter ); parameters filter an nsitextservicesfilter describing the filter to apply. this filter lets you avoid spell che...
...lling initspellchecker(); calling it after initialization will have no effect. void setfilter( in nsitextservicesfilter filter ); parameters filter an nsitextservicesfilter describing the filter to apply. this filter lets you avoid spell checking specific parts of the document. uninitspellchecker() call this to release the spell checking object. it will also save the current selected language as the default for future use. if you have called canspellcheck() but not initspellchecker(), you can still call this function to clear the cached spell check object, and no preferences are saved. void uninitspellchecker(); parameters none. updatecurrentdictionary() updates the dictionary in use to be sure it corresponds to what the editor needs. void updatecurrentdictionary(); parameters none.
nsIXPConnect
(ns_succeeded(rv)) { /* use the object */ } method overview void addjsholder(in voidptr aholder, in nsscriptobjecttracerptr atracer); native code only! void clearallwrappednativesecuritypolicies(); nsixpconnectjsobjectholder createsandbox(in jscontextptr cx, in nsiprincipal principal); native code only! ...
...tptr cx, in nsiprincipal principal ); parameters cx a context to use when creating the sandbox object. principal the principal (or null to use the null principal) to use when evaluating code in this sandbox. ...
...pal (or null to use the null principal) to use when evaluating code in this sandbox. ...
Xptcall Porting Guide
this code needs to be ported to all platforms that want to support xptcall (and thus mozilla). ...
...cated by the index methodindex on the xpcom interface that. here are examples of this implementation for win32 and linux x86, netbsd x86, and freebsd. these implementations use the basic strategy of: figure out how much stack space is needed for the params, make the space in a new frame, copy the params to that space, invoke the method, cleanup and return. c++ is used where appropriate, assembly language is used where necessary. inline assembly language is used here, but it is equally valid to use separate assembly language source files. porters can decide how best to do this for their platforms. the stubs functionality is more complex. the goal here is a class whose vtbl can look like the vtbl of any arbitrary xpcom interface. objects of this class can then be built to impersonate any xpcom obje...
...tform specific macros to define the stub functions. these '.inc' files are checked into cvs. however, they can be regenerated as necessary (i.e. to change the number of stubs or to change their specific declaration) using the perl script xptcall/public/genstubs.pl. here are examples of this implementation for win32 and linux x86, netbsd x86, and freebsd. both of these examples use inline assembly language. that is just how i decided to do it. you can do it as you choose. the win32 version is somewhat tighter because the __declspec(naked) feature allows for very small stubs. however, the __stdcall requires the callee to clean up the stack, so it is imperative that the interface information scheme allow the code to determine the correct stack pointer fixup for return without fail, else the process w...
Plug-in Development Overview - Plugins
be used to determines the mime types, file extensions, file open template, plug-in name, and description. ...
...ermines the mime types, file extensions, file open template, plug-in name, and description. ...
...pes fileextents: for file extensions fileopenname: for file open template productname: for plug-in name filedescription: for description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/quicktime|audio/aiff|image/jpeg the version stamp will be loaded only if it has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment. the resource code for this language and character set combination is 040904e4. unix on unix, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser loads each library and calls into the np_getm...
Debugger-API - Firefox Developer Tools
script code. both firefox’s built-in developer tools and the firebug add-on use debugger to implement their javascript debuggers. however, debugger is quite general, and can be used to implement other kinds of tools like tracers, coverage analysis, patch-and-continue, and so on. ...
...fox’s built-in developer tools and the firebug add-on use debugger to implement their javascript debuggers. however, debugger is quite general, and can be used to implement other kinds of tools like tracers, coverage analysis, patch-and-continue, and so on. debugger has three essential qualities: it is a source level interface: it operates in terms of the javascript language, not machine language. it operates on javascript objects, stack frames, environments, and code, and presents a consistent interface regardless of whether the debuggee is interpreted, compiled, or optimized. if you have a strong command of the javascript language, you should have all the background you need to use debugger successfully, even if you have never looked into the language’s implementation. it is for...
...nments, and code, and presents a consistent interface regardless of whether the debuggee is interpreted, compiled, or optimized. if you have a strong command of the javascript language, you should have all the background you need to use debugger successfully, even if you have never looked into the language’s implementation. it is for use by javascript code. javascript is both the debuggee language and the tool implementation language, so the qualities that make javascript effective on the web can be brought to bear in crafting tools for developers. as is expected of javascript apis, debugger is a sound interface: using (or even misusing) debugger should never cause gecko to crash. errors throw proper javascript exceptions. it is an intra-thread debugging api. both the debuggee and th...
FileSystemDirectoryEntry.getDirectory() - Web APIs
ist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. ...
...toryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. example in this example, a function is presented whose job it is to locate within a user's app data directory a json file containing a user dictionary for a specified language, then load that dictionary. ...
...the success callback for this takes the resulting directory entry object and calls getfile() to get a filesystemfileentry object representing the dictionary file; the success callback for this, in turn, creates a new...
FileSystemDirectoryEntry.getFile() - Web APIs
ist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. ...
...toryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. example in this example, a function is presented whose job it is to locate within a user's app data directory a json file containing a user dictionary for a specified language, then load that dictionary. ...
...the success callback for this takes the resulting directory entry object and calls getfile() to get a filesystemfileentry object representing the dictionary file; the success callback for this, in turn, creates a new...
HTMLElement.dir - Web APIs
Web › API › HTMLElement › dir
an image can have its dir property set to "rtl" in which case the html attributes title and alt will be formatted and defined as "rtl". when a table has its dir set to "rtl", the column order is arranged from right to left. ...
... an image can have its dir property set to "rtl" in which case the html attributes title and alt will be formatted and defined as "rtl". when a table has its dir set to "rtl", the column order is arranged from right to left. ...
... an image can have its dir property set to "rtl" in which case the html attributes title and alt will be formatted and defined as "rtl". when a table has its dir set to "rtl", the column order is arranged from right to left. ...
Key Values - Web APIs
eup (224) [1] the standby key is not supported by internet explorer (tested on release 9 and 11) and firefox 36 and earlier, so it is reported as "unidentified". [2] prior to firefox 37, this key generated the value "unidentified". ime and composition keys keys used when using an input method editor (ime) to input text which can't readily be entered by simple keypresses, such as text in languages such as those which have more graphemes than there are character entry keys on the keyboard. common examples include chinese, japanese, korean, and hindi. some keys are common across multiple languages, while others exist only on keyboards targeting specific languages. in addition, not all keyboards have all of these keys. common ime keys keyboardevent.key value description vir...
...ypresses as coming from the first column on subsequent keystrokes. gdk_key_iso_first_group (0xfe0c) "grouplast" switches to the last character group on an iso/iec 9995 keyboard. gdk_key_iso_last_group (0xfe0e) "groupnext" [4] switches to the next character group on an iso/iec 9995 keyboard. gdk_key_iso_next_group (0xfe08) keycode_language_switch (204) "groupprevious" switches to the previous character group on an iso/iec 9995 keyboard. gdk_key_iso_prev_group (0xfe0a) "modechange" [5] the mode change key. toggles or cycles among input modes of imes. vk_modechange (0x1f) gdk_key_mode_switch (0xff7e) gdk_key_script_switch (0xff7e) qt::key_mode_switch (0x0100117e) keycode_swi...
...s (0xfe57) qt::key_dead_diaeresis (0x01001257) ¨ also called an umlaut. gdk_key_dead_abovering (0xfe58) qt::key_dead_abovering (0x01001258) ˚ gdk_key_dead_doubleacute (0xfe59) qt::key_dead_doubleacute (0x01001259) ˝ gdk_key_dead_caron (0xfe5a) qt::key_dead_caron (0x0100125a) ˇ also called a háček; used in czech among other languages. gdk_key_dead_cedilla (0xfe5b) qt::key_dead_cedilla (0x0100125b) ¸ gdk_key_dead_ogonek (0xfe5c) qt::key_dead_ogonek (0x0100125c) ˛ also called a nosinė; used in polish and old irish. gdk_key_dead_iota (0xfe5d) qt::key_dead_iota (0x0100125d) ͅ iota subscript. gdk_key_dead_voiced_sound (0xfe5e) qt::key_dead_voiced_sound (0...
SpeechRecognition.lang - Web APIs
examples this code is excerpted from our speech color changer example. ...
... examples this code is excerpted from our speech color changer example. ...
... examples this code is excerpted from our speech color changer example. ...
WorkerNavigator - Web APIs
the workernavigator interface represents a subset of the navigator interface allowed to be accessed from a worker. such an object is initialized for each worker and is available via the workerglobalscope.navigator property obtained by calling window.self.navigator. properties the workernavigator interface implements properties from the navigatorid, navigatorlanguage, navigatoronline, navigatordatastore, and navigatorconcurrenthardware interfaces. workernavigator.connectionread only provides a networkinformation object containing information about the network connection of a device. workernavigator.locks read only returns a lockmanager object which provides methods for requesting a new lock object and querying for an existing lock object. workernavigator.permissions read only retur...
...igatorid.appname read only returns the official name of the browser. do not rely on this property to return the correct value. navigatorid.appversion read only returns the version of the browser as a string. do not rely on this property to return the correct value. navigatorconcurrenthardware.hardwareconcurrencyread only returns the number of logical processor cores available. navigatorlanguage.languageread only returns a domstring representing the language version of the browser. the null value is returned when this is unknown. navigatorlanguage.languagesread only returns an array of domstrings representing the languages known to the user, in order of preference. navigatoronline.onlineread only returns a boolean indicating whether the browser is online. navigatorid.platform r...
...ing the platform of the browser. do not rely on this property to return the correct value. navigatorid.product read only always returns 'gecko', on any browser. this property is kept only for compatibility purposes. navigatorid.useragentread only returns the user agent string for the current browser. methods the workernavigator interface implements methods from the navigatorid, navigatorlanguage and navigatoronline interfaces. specifications specification status comment html living standardthe definition of 'workernavigator' in that specification. living standard ...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
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 combination of the ::before pseudo-element and the content property may inject some text at the beginning of the element. in that case, ::...
... of this generated content. css3 introduced the ::first-letter notation (with two colons) to distinguish pseudo-classes from pseudo-elements. browsers also accept :first-letter, introduced in css2. ...
...t decoration module level 3the definition of 'text-shadow with ::first-letter' in that specification. candidate recommendation allows the use of text-shadow with ::first-letter. selectors level 3the definition of '::first-letter' in that specification. recommendation introduction of the two-colon syntax. definition of edge-case behavior, such as in list items or with specific languages (e.g., the dutch digraph ij). css level 2 (revision 1)the definition of '::first-letter' in that specification. recommendation no change. css level 1the definition of '::first-letter' in that specification. recommendation initial definition, using the one-colon syntax. ...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
s article we will take a look at how flexbox fits in with all the other css modules. we’ll find out which specifications you also need to take notice of if you want to learn flexbox, and find out why flexbox is different to some other modules. note: css versions 1 and 2 were a single monolithic specification where all of css was defined in one large document. as css became a more feature rich language, maintaining one huge specification became problematic, with different parts of css moving on at different speeds. css was therefore modularised, and the various css specifications are different modules that make up css today. these modules relate to each other, and are at different stages of development. the box alignment module for many people the first reason they start to look at flexbox i...
...rious different writing modes that exist internationally. we need to be aware of how this will impact our flex layouts as writing mode changes the direction that blocks are laid out in our document. understanding block and inline directions is key to new layout methods. it is worth noting that we might want to change the writing mode of our document for reasons other than publishing content in a language that uses a different writing mode. see this article for a full description of writing modes and ways to use them, both for content in other languages and for creative reasons. the writing modes the writing modes specification defines the following values of the writing-mode property, which serve to change the direction that blocks are laid out on the page, to match the direction that blocks l...
...u are planning on using writing modes in your layout, carefully testing the results is advisable — not least because it would be easy to make things hard to read! note that you would not normally use css and the writing-mode property to change an entire document to another writing mode. this would be done via html, by adding a dir and lang attribute to the html element to indicate the document language and default text direction. this would mean that the document would display correctly even if css did not load. flexbox and other layout methods the flexbox specification contains a definition of what happens if an item uses another layout method and then becomes a flex item. for example, if an item is floated and then its parent becomes a flex container. or, how a flex container behaves as par...
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
low direction is the direction in which boxes, for example paragraphs, stack in that writing mode. the css writing-mode property controls the block flow direction. if you want to change your page, or part of your page, to vertical-lr then you can set writing-mode: vertical-lr on the element and this will change the direction of the blocks and therefore the inline direction as well. while certain languages will use a particular writing mode or text direction, we can also use these properties for creative effect, such as running a heading vertically. the writing-mode property and block flow the writing-mode property accepts the values horizontal-tb, vertical-rl and vertical-lr. these values control the direction that blocks flow on the page. the initial value is horizontal-tb, which is a top to...
...roperties for creative effect, such as running a heading vertically. the writing-mode property and block flow the writing-mode property accepts the values horizontal-tb, vertical-rl and vertical-lr. these values control the direction that blocks flow on the page. the initial value is horizontal-tb, which is a top to bottom block flow direction with a horizontal inline direction. left to right languages, such as english, and right to left languages. such as arabic, are all horizontal-tb. the following example shows blocks using horizontal-tb. the value vertical-rl gives you a right-to-left block flow direction with a vertical inline direction, as shown in the next example. the final example demonstrates the third possible value for writing-mode — vertical-lr. this gives you a left-to-r...
...ies and values specification includes logical versions of the properties that control margins, padding and borders as well as other mappings for things that we have typically used physical directions to specify. summary in most cases, flow layout works as you would expect it to when changing the writing mode of the document or parts of the document. this can be used to properly typeset vertical languages or for creative reasons. css is making this easier by way of introducing logical properties and values so that when working in a vertical writing mode sizing can be based on element's inline and block size. this will be useful when creating components which can work in different writing-modes. see also writing modes external resources css writing modes, jen simmons on 24 ways ...
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
-area: c; } .item4 { grid-area: d; } <div class="wrapper"> <div class="item1">item 1</div> <div class="item2">item 2</div> <div class="item3">item 3</div> <div class="item4">item 4</div> </div> you can see how the item is aligned by using the firefox grid highlighter: alignment and writing modes in all of these examples i have been working in english, which is a left-to-right language. ...
...ox grid highlighter: alignment and writing modes in all of these examples i have been working in english, which is a left-to-right language. this means that our start lines are top and left of our grid when thinking in physical directions. css grid layout, and the box alignment specification are designed to work with writing modes in css. this means that if you are working in a right to left language, such as arabic, the start of the grid would be the top and right, so the default of justify-content: start would be for grid tracks to start on the right hand side of the grid. setting auto margins, using margin-right or margin-left however, or absolutely positioning items using the top, right, bottom and left offsets would not honor writing modes. in the next guide, we will look further into t...
...the grid. setting auto margins, using margin-right or margin-left however, or absolutely positioning items using the top, right, bottom and left offsets would not honor writing modes. in the next guide, we will look further into this interaction between css grid layout, box alignment and writing modes. this will be important to understand, if you develop sites that are then displayed in multiple languages, or if you want to mix languages or writing modes in a design. ...
text-transform - CSS: Cascading Style Sheets
text appear in all-uppercase or all-lowercase, or with each word capitalized. it also can help improve legibility for ruby. 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 text-transform property takes into account language-specific case mapping rules such as the following: in turkic languages, like turkish (tr), azerbaijani (az), crimean tatar (crh), volga tatar (tt), and bashkir (ba), there are two kinds of i, with and without the dot, and two case pairings: i/İ and ı/i. in german (de), the ß becomes ss in uppercase. in dutch (nl), the ij digraph becomes ij, even with text-transform: capitaliz...
...(ga), certain prefixed letters remain in lowercase when the base initial is capitalized, so for example text-transform: uppercase will change ar aon tslí to ar aon tslÍ and not, as one might expect, ar aon tslÍ (firefox only). in some cases, a hyphen is also removed upon uppercasing: an t-uisce transforms to an tuisce (and the hyphen is correctly reinserted by text-transform: lowercase). the language is defined by the lang html attribute or the xml:lang xml attribute. note: support for language-specific cases varies between browsers, so check the browser compatibility table. syntax /* keyword values */ text-transform: none; text-transform: capitalize; text-transform: uppercase; text-transform: lowercase; text-transform: full-width; text-transform: full-size-kana; /* global values */ tex...
...s 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 calculated (firefox considered - and _ as letters, but other browsers did not. both webkit and gecko incorrectly considered letter-based symbols like ⓐ to be real letters. intern...
Localizations and character encodings - Developer guides
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 europe. however, there are locales where web publishing was common already in the 1990s but the windows-1252 encoding was not suitable for the local language. in these locales, legacy content that doesn't declare its encoding is typically encoded using a legacy encoding other than windows-1252. in order to work with legacy content, some firefox localizations need a non-windows-1252 fallback encoding. unfortunately, this means that the web-exposed functionality of firefox differs by locale and it is hard to read legacy content across locales with diff...
...ence intl.charset.default in intl.properties. it should be set to the canonical name of the legacy encoding that users of the localizations are most likely to encounter when browsing non-conforming legacy web content that doesn't declare its encoding. note that the fallback encoding as defined by the previous sentence does not necessarily need to be able to represent the characters needed for the language of the localization! the fallback encoding should be left to windows-1252 for western european locales, north, central and south american locales, african locales, central asian locales and oceanian locales. it typically needs to be set to something other than windows-1252 for central and eastern european locales, middle eastern locales and east asian locales. in order to avoid the problem of w...
...52 as the fallback encoding. specifying the heuristic detection mode the heuristic detection mode is specified by the preference intl.charset.detector in intl.properties. the setting must be left blank for all locales other than russian, ukrainian and japanese. do not under any circumstances specify the "universal" detector. it is not actually universal despite its name! exception for minority languages if the localization is for minority language and the users are typically literate in the majority language of the region and read web content written in the majority language very often, it is appropriate to specify the fallback encoding and the heuristic detection mode to be the same as for the localization for the majority language of the region. for example, for a localization for minority l...
About the JavaScript reference - JavaScript
the javascript reference serves as a repository of facts about the javascript language. the entire language is described here in detail. as you write javascript code, you'll refer to these pages often (thus the title "javascript reference"). if you're learning javascript, or need help understanding some of its capabilities or features, check out the javascript guide. the javascript language is intended to be used within some larger environment, be it a browser, server-side scripts, or similar. for the most part, this reference attempts to be environment-agnostic and does not target a web browser environment. ...
...erstanding some of its capabilities or features, check out the javascript guide. the javascript language is intended to be used within some larger environment, be it a browser, server-side scripts, or similar. for the most part, this reference attempts to be environment-agnostic and does not target a web browser environment. where to find javascript information javascript documentation of core language features (pure ecmascript, for the most part) includes the following: the javascript guide the javascript reference if you are new to javascript, start with the guide. once you have a firm grasp of the fundamentals, you can use the reference to get more details on individual objects and language constructs. structure of the reference in the javascript reference you can find the following ...
...along with their methods and properties. statements and declarations javascript applications consist of statements with an appropriate syntax. a single statement may span multiple lines. multiple statements may occur on a single line if each statement is separated by a semicolon. this isn't a keyword, but a group of keywords. expressions and operators this chapter documents all the javascript language operators, expressions and keywords. functions chapter about javascript functions. classes chapter about javascript classes introduced in ecmascript 2015. errors chapter about specific errors, exceptions and warnings thrown by javascript. new in javascript chapter about javascript version history. more reference pages deprecated and obsolete features lexical grammar data types and ...
Intl.Collator.supportedLocalesOf() - JavaScript
on without having to fall back to the runtime's default locale. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.collator.supportedlocalesof(locales[, options]) parameters locales a string with a bcp 47 language tag, or an array of such strings. for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings repre...
...r the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. return value an array of strings representing a subset of the given locale tags that are supported in collation without having to fall back to the runtime's default locale. description returns an array with a subset of the language tags provided in locales. the language tags returned are those for which the runtime supports a locale in collation that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in collation, supportedlocalesof returns the indonesia...
...d in locales. the language tags returned are those for which the runtime supports a locale in collation that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale. examples using supportedlocalesof assuming a runtime that supports indonesian and german but not balinese in collation, supportedlocalesof returns the indonesian and german language tags unchanged, even though pinyin collation is not used with indonesian and a specialized german for indonesia is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. va...
Intl.DisplayNames() constructor - JavaScript
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. ...
...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. ...
... optional an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. style the formatting style to use, the default is "long". "narrow" "short" "long" type the type to use, the default is "language". "language" "region" "script" "currency" fallback the fallback to use, the default is "code". "code" "none" examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. console.log((new intl.displaynames()).of('us')); // expected output: 'us' specifications ...
Intl.ListFormat() constructor - JavaScript
for the general form and interpretation of the locales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. ...
...for the general form and interpretation of the locales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". ...
...ts of values with units (e.g., 5 pounds, 12 ounces). style the length of the formated message. possible values are: "long" (default, e.g., a, b, and c); "short" (e.g., a, b, c), or "narrow" (e.g., a b c). when style is short or narrow, unit is the only allowed value for the type option. examples using format the following example shows how to create a list formatter using the english language. const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', { style: 'long', type: 'conjunction' }).format(list)); // > motorcycle, bus and car console.log(new intl.listformat('en-gb', { style: 'short', type: 'disjunction' }).format(list)); // > motorcycle, bus or car console.log(new intl.listformat('en-gb', { style: 'narrow', type: 'unit' }).format(list)); // > mo...
Intl.Locale.prototype.baseName - JavaScript
ame property returns a substring of the locale's string representation, containing core information about the locale. description an intl.locale 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...
...basename returns the language ["-" script] ["-" region] *("-" variant) subsequence of the unicode_language_id grammar. ...
...a" example with options in the input string // sets language to japanese, region to japan, // calendar to gregorian, hour cycle to 24 hours let japan = new intl.locale("ja-jp-u-ca-gregory-hc-24"); console.log(japan.tostring()); // prints out "ja-jp-u-ca-gregory-hc-h24" console.log(japan.basename); // prints out "ja-jp" example with options that override input string // input string indicates language as dutch and region as belgium, // but options object overrides the region and sets it to the netherlands let dutch = new intl.locale("nl-latn-be", {region: "nl"}); console.log(dutch.basename); // prints out "nl-latn-nl" specifications specification ecmascript internationalization api (ecma-402) ...
MathML documentation index - MathML
Web › MathML › Index
just like html, mathml is described with tags and attributes. ...
...just like html, mathml is described with tags and attributes. ...
...<mrow> element is used to group sub-expressions, which usually contain one or more operators with their respective operands (such as <mi> and <mn>). this element renders as a horizontal row containing its arguments. 27 <ms> mathml, mathml reference, mathml:element, mathml:token elements the mathml <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems. by default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display. note that quotation marks should not be specified unless they are part of the string literal. the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyp...
Performance fundamentals - Web Performance
ormance generally, below the level of all applications. from a developer's or user's perspective, this answers the question, "what does the platform do for you?" web technologies the web platform provides many tools, some better suited for particular jobs than others. all application logic is written in javascript. to display graphics, developers can use html or css (i.e. high-level declarative languages), or use low-level imperative interfaces offered by the <canvas> element (which includes webgl). somewhere "in between" html/css and canvas is svg, which offers some benefits of both. html and css greatly increase productivity, sometimes at the expense of framerate or pixel-level control over rendering. text and images reflow automatically, ui elements automatically receive the system theme, an...
...hich offers some benefits of both. html and css greatly increase productivity, sometimes at the expense of framerate or pixel-level control over rendering. text and images reflow automatically, ui elements automatically receive the system theme, and the system provides "built-in" support for some use cases developers may not think of initially, like different-resolution displays or right-to-left languages. the canvas element offers a pixel buffer directly for developers to draw on. this gives developers pixel-level control over rendering and precise control of framerate, but now the developers need to deal with multiple resolutions and orientations, right-to-left languages, and so forth. developers draw to canvases using either a familiar 2d drawing api, or webgl, a "close to the metal" binding ...
...nu"; "fetch and decode the image for the high scores list", etc. those work items are not on the critical path to painting the first frame. it seems obvious, but to reach a user-perceived startup event more quickly, the main "trick" is run only the code on the critical path. shorten the critical path by simplifying the scene. the web platform is highly dynamic. javascript is a dynamically-typed language, and the web platform allows loading code, html, css, images, and other resources dynamically. these features can be used to defer work that's off the critical path by loading unnecessary content "lazily" some time after startup. another problem that can delay startup is idle time, caused by waiting for responses to requests (like database loads). to avoid this problem, applications should issue...
Introduction - SVG: Scalable Vector Graphics
it can be used to create an image either by specifying all the lines and shapes necessary, by modifying already existing raster images, or by a combination of both. the image and its components can also be transformed, composited together, or filtered to change their appearance completely. svg came about in 1999 after several competing formats had been submitted to the w3c and failed to be fully ratified. svg is supported by all major browsers. a downside is loading svg can be slow. ...
...f nothing more than the <svg> root element and several basic shapes that build a graphic together. in addition there is the <g> element, which is used to group several basic shapes together. starting from there, the svg image can become arbitrarily complex. svg supports gradients, rotations, filter effects, animations, interactivity with javascript, and so on. but all these extra features of the language rely on this relatively small set of elements to define the graphics area. before you start there are a number of drawing applications available such as inkscape which are free and use svg as their native file format. however, this tutorial will rely on the trusty xml or text editor (your choice). the idea is to teach the internals of svg to those who want to understand it, and that is best don...
...er support table can be found on can i use. firefox has supported some svg content since version 1.5, and that support level has been growing with each release since. hopefully, along with the tutorial here, mdn can help developers keep up with the differences between gecko and some of the other major implementations. before starting you should have a basic understanding of xml or another markup language such as html. if you are not too familiar with xml, here are some guidelines to keep in mind: svg elements and attributes should all be entered in the case shown here since xml is case-sensitive (unlike html). attribute values in svg must be placed inside quotes, even if they are numbers. svg is a huge specification. this tutorial attempts to cover the basics. once you are familiar you shou...
Index - WebAssembly
it is also designed to run alongside javascript, allowing both to work together. ...
...it is also designed to run alongside javascript, allowing both to work together. ...
... caching is useful for improving the performance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time. this article explains the best practices around this. 3 compiling a new c/c++ module to webassembly c, c++, compiling, emscripten, webassembly, wasm when you’ve written a new code module in a language like c/c++, you can compile it into webassembly using a tool like emscripten. let’s look at how it works. 4 compiling an existing c module to webassembly c++, compiling, emscripten, webassembly, wasm a core use-case for webassembly is to take the existing ecosystem of c libraries and allow developers to use them on the web. 5 compiling from rust to webassembly ...
Using the WebAssembly JavaScript API - WebAssembly
this article teaches you what you’ll need to know. note: if you are unfamiliar with the basic concepts mentioned in this article and need more explanation, read webassembly concepts first, then come back. some simple examples let’s run through some examples that explain how to use the webassembly javascript api, and how to use it to load a wasm module in a web page. note: you can find the sample code in our webassembly-examples github repo. ...
... portability, and stability reasons. tables have an element type, which limits the types of reference that can be stored in the table. in the current iteration of webassembly, there is only one type of reference needed by webassembly code — functions — and thus only one valid element type. in future iterations, more element types will be added. function references are necessary to compile languages like c/c++ that have function pointers. in a native implementation of c/c++, a function pointer is represented by the raw address of the function’s code in the process’s virtual address space and so, for the safety reasons mentioned above, cannot be stored directly in linear memory. instead, function references are stored in a table and their indexes, which are integers and can be stored i...
...eir indexes, which are integers and can be stored in linear memory, are passed around instead. when the time comes to call a function pointer, the webassembly caller supplies the index, which can then be safety bounds checked against the table before indexing and calling the indexed function reference. thus, tables are currently a rather low-level primitive used to compile low-level programming language features safely and portably. tables can be mutated via table.prototype.set(), which updates one of the values in a table, and table.prototype.grow(), which increases the number of values that can be stored in a table. this allows the indirectly-callable set of functions to change over time, which is necessary for dynamic linking techniques. the mutations are immediately accessible via table.p...
Private Properties - Archive of obsolete content
this article discusses two common techniques: one using prefixes, the other closures. both approaches have drawbacks, they are either not restrictive enough or too restrictive, respectively. a better alternative is to use weakmap objects, which solve both these problems. however, note that weakmaps might not be supported by all implementations yet. ...
...: point.prototype.getx = function () { return this._x; }; point.prototype.setx = function (x) { this._x = x; }; point.prototype.gety = function () { return this._y; }; point.prototype.sety = function (y) { this._y = y; }; the above technique is simple and clearly expresses intent. however, the use of an underscore prefix is just a coding convention and is not enforced by the language: there is nothing to prevent a user from directly accessing a property that is supposed to be private. using closures another common technique, is to define private properties as variables and their getter and setter functions as a closure over these variables: function point(_x, _y) { this.getx = function () { return _x; }; this.setx = function (x) { _x = x; }...
Contributor's Guide - Archive of obsolete content
es of the class. each class defines one or more members, which are initialized to a given value when the class is instantiated. data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior. inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. unlike languages like c++ and java, javascript does not have native support for classical inheritance. instead, it uses something called prototypal inheritance. as it turns out, it is possible to emulate classical inheritance using prototypal inheritance, but not without writing a significant amount of boilerplate code. content processes a content process was supposed to run all the code associated with a sing...
...this article discusses two common techniques: one using prefixes, the other closures. ...
Code snippets - Archive of obsolete content
code fragments html to dom using a hidden browser element to parse html to a window's dom javascript libraries here are some javascript libraries that may come in handy. stringview a library that implements a stringview view for javascript typed arrays. this lets you access data in typed arrays using c-like string functions. rosetta by default, the only possible standardized scripting language for html is ecmascript. hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it. nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full virtual machines in pure ecmascript. therefore, it is also possible, in theory, to use ...
...this snippets shows a possible way to start from. ...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
ser window, everything other than the web page being displayed in the content area is chrome. extensions also can be considered xul applications with chrome. three kinds of packages make up chrome the content package this package is used to contain the main xul and javascript source files. most extensions consist of a single content package2 the locale package this package is used to contain language data that can be translated. to make an extension’s gui support multiple languages, you can include multiple locale packages, one for each language. the skin package this is used to include source files used as visual elements in the gui, including style sheets and images. most extensions include only one skin package, but you can include multiple skin packages to allow the gui to change with...
...and locale/ and locale/fr-fr/ are the relative paths to the folders containing the source files; en-us and fr-fr indicate that those locale packages are for english and french, respectively. listing 7: additional content for chrome.manifest locale helloworld en-us locale/ locale helloworld fr-fr locale/fr-fr/ replacing text with entity references in xul to make the extension support multiple languages, you will need to separate out all the hard-coded display text in clock.xul and move it to a dtd file. the dtd file is located inside the locale package, and the correct file is picked automatically to match the user’s language preferences. edit clock.xul to match listing 8. add the doctype declaration that references the dtd file, and replace “clock” and “current time” with entity ref...
Connecting to Remote Content - Archive of obsolete content
.nodevalue); // => orange window.alert(totalelement.firstchild.nodevalue); // => 2 } }; using dom functions is good for simple xml documents, but dom manipulation code can become too complicated if the documents are more complex. there are a couple of tools you can use to process these documents more efficiently: using xpath xpath stands for xml path language, it uses a non-xml syntax that provides a flexible way of addressing (pointing to) different parts of an xml document. taken from the xpath page. you can use xpath to quickly access specific nodes in an xml or html document with a simple query mechanism. xpath can also be used to extract information from web pages once they load, along with the page load interception techniques discussed previ...
... used to extract information from web pages once they load, along with the page load interception techniques discussed previously. xpath is very useful for cases when you're receiving large and complex xml files, and you only need some of the data contained in them. using xpath to parse a complete xml document is probably not a good idea performance-wise. using xslt xslt (extensible stylesheet language transformations) is another tool used to manipulate xml documents and transform them into other forms of text output, such as html, xul, and so on. we can not cover all transformations to various output formats, so we'll just look into converting an xml document to xul. first you need to create an xslt stylesheet that acts as a template. this template will transform the xml you receive (in our ...
Custom XUL Elements with XBL - Archive of obsolete content
xbl was submitted to the w3c for standardization, but for now it's used in xul almost exclusively. with xbl you can define new elements and define their properties, attributes, methods and event handlers. ...
...dings that can be attached to elements in other documents. the element that the binding is attached to, called the bound element, acquires the new behavior specified by the binding. taken from the xbl page. this somewhat cryptic explanation describes a very simple concept: with xbl you can create your own custom elements. xbl is heavily used in xul, but in theory it could be applied to any xml language. xbl was submitted to the w3c for standardization, but for now it's used in xul almost exclusively. with xbl you can define new elements and define their properties, attributes, methods and event handlers. many complex elements such as tabs, buttons and input controls are implemented using xbl and simpler xul elements. as explained earlier, xul is really just boxes, text and images. we'll look ...
List of Mozilla-Based Applications - Archive of obsolete content
y xulrunner foxkeh clock clock frizione javascript development, testing and deployment environment uses mozilla rhino geckofx embeddable gecko gjs javascript bindings for gnome globalmojo browser that raises money for your favorite causes gluescript a javascript engine which can be used as a general purpose language uses mozilla spidermonkey and formerly called wxjavascript gnome operating system gnome 3 will use spidermonkey through gjs google adwords editor editor google gadgets for linux google’s desktop widget engine uses xulrunner according to the build instructions grani grain sizing assessment tool according to this wiki page grani is b...
...firefox extension and xulrunner application note: this page was previously hosted on mozpad.org and the history for that page can be found on that site. ...
Localizing an extension - Archive of obsolete content
« previousnext » this article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension. performing a few simple steps makes your extension much easier to localize into various languages without having to edit the xul or javascript files themselves. if you haven't already created an extension, or would like to refresh your memory, take a look at the previous articles in this series: creating a status bar extension creating a dynamic status bar extension adding preferences to an extension download the sample you can download this article's sample code so you can look at it side-by-side with the article, or to use it as a basis for your own extension. download the sample localizing strings in xul files create the needed...
... the appropriate variables: samplepanel.tooltiptext = changestring + fieldarray[4] + " | " + openstring + fieldarray[5] + " | " + lowstring + fieldarray[6] + " | " + highstring + fieldarray[7] + " | " + volumestring + fieldarray[8]; localizing the description in install.rdf see localizing extension descriptions. adding more localizations to add another localization for a new language, all you need to do is add another line to the chrome manifest referencing the new locale. for example, to add a spanish localization, you would add: locale stockwatcher2 es-es chrome/locale/es-es/ then just create a subdirectory chrome/locale/es-es and add the needed dtd files; in this case, options.dtd and stockwatcher2.dtd. these files should map the same tags to the spanish translations of ...
Dehydra - Archive of obsolete content
dra could be thought of as a semantic grep tool. it presented a wealth of semantic information that can be queried with concise javascripts. it was also useful to find bugs in source code as it allows for much more error checking than c++ is capable of by itself. dehydra was built as a gcc plugin, thus it is easy to use for projects that already support gcc. dehydra is also useful for generating language bindings and is used to bootstrap treehydra, a heavy-duty static analysis gcc plugin. documentation installing dehydra download, installation and dependency info for dehydra using dehydra examples for getting started writing analysis scripts. dehydra function reference callback and utility functions for dehydra scripts. dehydra object refe...
...odo steps to dehydra 1.0 release community view dehydra forums... mailing list newsgroup rss feed #static on irc.mozilla.org blogs taras glek david mandelin benjamin smedberg related topics pork c/c++ refactoring tools, mozilla 2, spidermonkey categories interwiki language links ...
Modularization techniques - Archive of obsolete content
ompatible with com on platforms that support it, so it may not matter. but no promises, yet. what are the major differences? instead of microsoft's midl compiler, we are using a corba-compliant idl compiler, xpidl. it outputs nspr types when generating c++ headers. it also generates typelibraries that are not compatible with microsoft's .tlb format. xpcom uses these typelibraries to allow other languages, such as javascript, to implement and call xpcom objects. we also do cross-thread proxying calls using the typelib and nspr's event queues. microsoft provides an extensive support infrastructure for com. this technology is built into windows, but not most other platforms. the technology can be licensed from microsoft, but for obvious reasons we are not going to be doing that. in house equivalen...
... most other platforms. the technology can be licensed from microsoft, but for obvious reasons we are not going to be doing that. in house equivalents to the important elements of this technology will be developed as needed. ...
Mozilla Application Framework - Archive of obsolete content
lla application framework: for powerful, easy to develop cross-platform applications want to build applications? use the mozilla framework and make your life easier. we provide a comprehensive framework that does much of the work for you, tools to help you develop your apps, and a community of people to help. framework xul a comprehensive, cross-platform ui toolkit with an easy-to-learn xml language for defining ui structure, a schema for localization, and support for both native and cross-platform (using css) look and feel to make writing uis quick and painless. gecko a performant web content rendering/editing engine with world-leading support for standards that you can drop into your application with a single line of xul. necko a wicked-fast, extensible networking library with bu...
...g/editing engine with world-leading support for standards that you can drop into your application with a single line of xul. necko a wicked-fast, extensible networking library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. xpcom a simple, cross-platform component model with multiple language bindings and idl descriptions so you can plug your custom functionality into the framework and connect it with other components. web services built-in support for xmlhttprequest, xml-rpc, soap, and wsdl to enable mozilla-based application authors to take advantage of the exploding world of web services. xpinstall our cross-platform installer for trivial packaging and installation of you...
Nanojit - Archive of obsolete content
mall, cross-platform c++ library that emits machine code. both the tamarin jit and the spidermonkey jit (a.k.a. tracemonkey) use nanojit as their back end. you can get nanojit by cloning the tamarin-redux mercurial repository at http://hg.mozilla.org/tamarin-redux. it's in the nanojit directory. the input for nanojit is a stream of nanojit lir instructions. the term lir is compiler jargon for a language used internally in a compiler that is usually cross-platform but very close to machine language. it is an acronym for "low-level intermediate representation". a compiler's lir is typically one of several partly-compiled representations of a program that a compiler produces on the way from raw source code to machine code. an application using nanojit creates a nanojit::lirbuffer object to hold li...
...o in the most hardcoded way possible. the conversion from lir to a program like one shown above is the task of the parser. guards guards are special lir instructions, similar to conditional branches, with the difference that when they are called, instead of going to a particular address, they leave the jit code entirely, and stop the trace. need guards are required in a cross platform dynamic language like javascript. certain assumptions are made when a particular jit code is generated. for example, in an instruction inr x, a guard would check that x doesn't overflow the range for a 32 bit integer. the jit code would have a guard checking this condition(an xt guard), and would return to the interpreter if the condition turns out to be true. the interpreter is then equipped to handle the overf...
Treehydra Manual - Archive of obsolete content
ecipes for accessing specific gcc intermediate representations. treehydra provides the following callbacks to analysis scripts: process_tree_decl, process_tree, process_tree_type, and process_cp_pre_genericize. fixme document all these callbacks. c++ asts c++ asts are provided via the process_cp_pre_genericize callback. this is called just before gcc converts the c++-specific ast to the generic (language-independent) representation. example treehydra script: function process_cp_pre_genericize(fn) { // fn is a function_decl, decl_saved_tree(fn) is ast print(fn); } gimple asts gimple asts are provided via the process_tree callback. by default, this is called just after gcc converts the ast to gimple, before any further lowering or optimization. example: function process_tree(fn) { // fn...
...ll of the substate tracking and fixed-point solving. the library is at unstable/esp.js. there is a sample application that checks for double-locking in a simple mutex api in test/esp_lock.js. abstract interpretation is a big topic, which is not yet fully documented here. for now, here is an explanation of some of the terminology that is often confusing: concrete value. a value in the programming language being analyzed. e.g., (int) 3. abstract value. a value used in the analysis script that represents a set of concrete values. e.g., nonzero. in esp, these are user-defined. concrete state. a memory state in the programming language being analyzed. in other words, a mapping from program variables to concrete values. abstract state. conceptually, this is an object used in the analysis that represen...
Using gdb on wimpy computers - Archive of obsolete content
ed to shar when used in gdb. the argument to the command is a regular expression for the libraries to be loaded. here's what it looks like in the 4.18 version of the debugger: ^c program received signal sigint, interrupt. 0x404ccdeb in __sigsuspend (set=0xbf5ffbc0) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 48 ../sysdeps/unix/sysv/linux/sigsuspend.c: no such file or directory. current language: auto; currently c (gdb) shar glib reading symbols from /usr/lib/libglib-1.2.so.0...done. (gdb) here's what it looks like in a version 5.x of the debugger ( yet unreleased ): ^c program received signal sigint, interrupt. [switching to thread 2051 (runnable)] 0x404ccdeb in __sigsuspend (set=0xbf5ffbac) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 48 ../sysdeps/unix/sysv/linux/sigsuspen...
...ding symbols from /usr/lib/libglib-1.2.so.0...done. (gdb) here's what it looks like in a version 5.x of the debugger ( yet unreleased ): ^c program received signal sigint, interrupt. [switching to thread 2051 (runnable)] 0x404ccdeb in __sigsuspend (set=0xbf5ffbac) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 48 ../sysdeps/unix/sysv/linux/sigsuspend.c: no such file or directory. current language: auto; currently c (gdb) shar gtk reading symbols from /usr/lib/libgtk-1.2.so.0...done. loaded symbols for /usr/lib/libgtk-1.2.so.0 reading symbols from /usr/lib/gtk/themes/engines/libthinice.so...done. loaded symbols for /usr/lib/gtk/themes/engines/libthinice.so (gdb) as you see above, it's possible to load more than one library with the same load command in gdb. how do i see what libraries i ...
XBL - Archive of obsolete content
xbl bindings have been removed from the firefox codebase and the work was tracked in bug 1397874 and are we xbl still?. removal of the xbl implementation is being tracked in bug 1566221. see also: xbl removal design review packet, problems with xbl and the xbl and web components comparison. 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, called the bound element, acquires the new behavior specified by the binding. bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that b...
...ly, the reference will be updated to describe those differences. xbl 1.0 is a mozilla-specific technology, and not a w3c standard. at least two standards spawned from it have died: sxbl and xbl 2.0. warning: sxbl and xbl 2.0 have died. w3c sxbl (currently a working draft, 2005) stands for svg's xml binding language. it is supposed to include a subset of xbl 2.0 features needed for svg. it's similar in spirit to mozilla's xbl, but there are a few subtle (and not-so-subtle) differences. for example, names of the elements are different. also sxbl lacks some features of xbl, such as bindings inheritance and defining methods/properties on bound elements. xbl...
XML in Mozilla - Archive of obsolete content
css, manipulating xml documents with scripts via dom, associating stylesheets with xml documents, and namespaces in xml. the core support is very good with few bugs. dtds and other external entities mozilla does not load external entities from the web. mozilla can load external entities whose system identifier uses the chrome protocol. this feature is used mainly to localize mozilla to different languages (the ui strings are stored in external dtd files). another exception is an entity whose system identifier is a relative path, and the xml declaration states that the document is not standalone (default), in which case mozilla will try to look for the entity under <bin>/res/dtd directory. mozilla may also make an exception with xhtml documents, see below. mozilla will read internal (dtd) subsets,...
...w. mozilla will read internal (dtd) subsets, and in special circumstances external dtds as explained above and will use this information to recognize id type attributes, default attribute values, and general entities. other notes a lot of the document object model (dom, w3c recommendations and drafts) applies to xml. likewise, the cascading style sheets (css, w3c recommendations and drafts) style language can be used to style xml documents. the code for most the core xml can be found in the following directories on the mozilla mercurial repository: content/xml/, parser/expat/ and parser/htmlparser/. the newsgroup to discuss xml in mozilla depends a bit on the nature of the question. for example, dom related questions should probably be discussed in the mozilla.dev.tech.dom newsgroup, while style i...
accesskey - Archive of obsolete content
aracter of the label is an ellipsis or a colon, the accesskey text is inserted before them. this allows a label of 'open…' with an accesskey of 'a', to have a generated label of 'open (a)…'. similarly, when the label is 'your name:' and the accesskey is 'b', the generated label will be 'your name (b):'. it is recommended that you only use characters that appear in the label. ...
... 'open (a)…'. similarly, when the label is 'your name:' and the accesskey is 'b', the generated label will be 'your name (b):'. it is recommended that you only use characters that appear in the label. however in some languages, for example, in japanese, characters will not always map directly to single keys, and it is quite common to have labels which cannot have a single accesskey. for these languages, you can assign an accesskey different than any of the label characters, and the accesskey text will always be appended as described above. for consistency, this occurs for languages such as japanese even if the labels have their accesskey characters. for example, when an the accesskey for an 'ok' button is 'o', and the accesskey for the button labeled 'キャンセル' (which means 'cancel') is...
Dynamically modifying XUL-based user interface - Archive of obsolete content
with anonymous xbl content using mozilla-specific methods. it is written for beginner to intermediate xul developers. we assume that the reader has basic knowledge of both xul and javascript. you may also want to read some introductory documents about dom, like the about the document object model article or the introduction page of the gecko dom reference. introduction as you know, xul is an xml language used in various mozilla-based applications, such as firefox and thunderbird, to describe the user interface. in xul applications javascript defines the behavior, using dom apis to access the xul document. so what are the document object model apis? they are the interfaces that are used in any interaction of a script and a document. if you have ever written a script that interacts with a xul (or h...
... you can also use appendchild() and insertbefore() to move existing elements. for example you could move the item labeled "first item" to the end of popup by adding this statement as a last line to the snippet above: popup.appendchild(first); this statement would remove the node from its current position in the document and re-insert it at the end of the popup. anonymous content (xbl) xbl is the language used in mozilla to define new widgets. widgets defined in xbl may choose to define some content which is inserted to the bound element, when the binding is attached. this content, called anonymous content, is not accessible through normal dom methods. you need to use the methods of nsidomdocumentxbl interface instead. for example: // gets the first anonymous child of the given node document.getan...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
earlier versions and other mozilla applications also support extensions, but some parts of this tutorial 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 seam...
..., and paste it into the new file: custombutton = { 1: function () { alert("just testing") }, } there is nothing to customize for now. save the file. the next section in this tutorial contains examples of code that you can use to make your button do something useful. explanation: this file specifies what happens when you press the button. it uses the javascript programming language, together with features provided by the application. 9. download the button image. get a context menu for the image that you see here (for example, by right-clicking it). choose save image as... from the context menu, and save it in the same custombutton directory as the files you have just created. ensure that the name of the saved file is: button-1s.png explanation: the im...
Custom toolbar button - Archive of obsolete content
lier versions and other mozilla applications also support extensions, but some parts of this tutorial 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 f...
...ng content, and paste it into the new file: custombutton = { 1: function () { alert("just testing") }, } there is nothing to customize for now. save the file. the next section in this tutorial contains examples of code that you can use to make your button do something useful. explanation: this file specifies what happens when you press the button. it uses the javascript programming language, together with features provided by the application. 9. download the button image. get a context menu for the image that you see here (for example, by right-clicking it). choose save image as... from the context menu, and save it in the same chrome directory as the files you have just created. ensure that the name of the saved file is: button-1.png explanation: the image is in four parts. t...
Introduction to XBL - Archive of obsolete content
bindings you can use xul to define the layout of a user interface for an application. you can customize the look of elements by applying styles to them. you can also create new skins by changing the styles. the basic appearance of all elements, such as scroll bars and check boxes may be modified by adjusting the style or by setting attributes on the element. however, xul provides no means in which you can change how an element works (or add a new element which can be reused). for example, you might want to change how the pieces of a scroll bar function. for this, you need xbl. ...
... might want to change how the pieces of a scroll bar function. for this, you need xbl. an xbl file contains a set of bindings. each binding describes the behavior of a xul widget. for example, a binding might be attached to a scroll bar. the behavior describes the properties and methods of the scroll bar in addition to describing the xul elements that make up a scroll bar. like xul, xbl is an xml language, so it has similar syntax rules. the following example shows the basic skeleton of an xbl file: <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl"> <binding id="binding1"> <!-- content, property, method and event descriptions go here --> </binding> <binding id="binding2"> <!-- content, property, method and event descriptions go here --> </binding> </bindings> the ...
What is RSS - Archive of obsolete content
this page explains what rss is. you will not yet be creating your own rss files, but you will be seeing how rss is commonly used and simple example rss files for these common uses. you will also be getting a little history on rss. what is rss? the most popular versions of rss are xml-based markup languages used for syndication. ...
...mats exist, namely the deprecated rss 0.90 and rss 1.0.) common uses of rss syndication are for the syndication of news web sites, of blogs, of internet radio, and of internet television. this tutorial teaches rss 2.0, but makes an effort to point out issues with other versions of rss. rss is almost never written by hand; it is almost always created by server-side software (usually written in a language like php, java, c#, or python) on the web server. however, so that we can learn rss, we will be creating rss scripts by hand. a short history of rss in march of 1999 netscape released rss 0.90. it was much much different than today's rss. it wasn't really a format for syndication, but was a format for providing a summary of a website. in fact, back then, rss did not stand for really simple synd...
title - Archive of obsolete content
is a 100 character maximum limit. ...
...ter maximum limit. ...
Making sure your theme works with RTL locales - Archive of obsolete content
some languages are written from right to left. of the languages firefox and thunderbird are shipped in, that includes arabic and hebrew, with persian available as beta, for a total population in excess of 100 million potential users. the important thing to understand about these locales, is that the entire interface is mirrored right-to-left. that means that text that had a left margin will have a right margin instead (or -moz-margin-start), arrows that pointed right will have to point left and vice versa, and so on. ...
...ant thing to understand about these locales, is that the entire interface is mirrored right-to-left. that means that text that had a left margin will have a right margin instead (or -moz-margin-start), arrows that pointed right will have to point left and vice versa, and so on. ...
E4X for templating - Archive of obsolete content
ve jxon algorithm instead. e4x can be used for creating templates for dynamic content. while it may be obvious after a study of the basics of e4x that it can be used for this purpose, if one adds a few common purpose functions (especially along with the convenience of javascript 1.8 expression closures), the templates can function more dynamically, offering the power and readability of templating languages such as smarty for php (though admittedly without the currently wider cross-browser support of xslt or the strictly-xml approach of phptal or seethrough templating). security and escaping function e (str) { if (typeof str === 'xml') {str = str.tostring();} return str; } function quot (s) { // useful for placing user input within inline javascript; may be combined with escape function ab...
..., including potentially xmllist's) in order to execute more than a single related statement, keeping this logic together with the resulting xml. ...
New in JavaScript 1.3 - Archive of obsolete content
umentation 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). ...
... 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. <script language="javascript1.2"> <!-- javascript for navigator 4.0. --> <script language="javascript1.3"> <!-- javascript for navigator 4.5. --> new features in javascript 1.3 new globals nan infinity undefined new methods isfin...
Old Proxy API - Archive of obsolete content
the spidermonkey implementation may not reflect the latest specification draft. it is subject to change anytime. it is provided as an experimental feature. do not rely on it for production code. introduction proxies are objects for which the programmer has to define the semantics in javascript. the default object semantics are implemented in the javascript engine, often written in lower-level languages like c++. proxies let the programmer define most of the behavior of an object in javascript. they are said to provide a meta-programming api. terminology catch-all mechanism (or "intercession api") the technical term for this feature. handler the object that intercepts properties. proxy the object whose properties are being intercepted. proxy factory the object or method that creates ...
...order as they are in the returned array. object.keys(proxy) keys: function() -> string array function() { return this.getownpropertynames().filter( function (name) { return this.getownpropertydescriptor(name).enumerable } ); } invariants even though proxies provide a lot of power to users, some operations are not trapped in order to keep the language consistent: the triple equal (===) operator is not trapped. p1 === p2 if and only if p1 and p2 refer to the same proxy. fixing a proxy does not alter its object identity (the object “generated” by the handler during fixing does not have its own object identity; it retains the object identity of the proxy, upholding the illusion that the proxy “becomes” the object). object.getprototype...
Windows Media in Netscape - Archive of obsolete content
activexobject is used by many web developers to detect the presence of internet explorer in much the same fashion as document.all is used. for example if (window.activexobject) { // internet explorer only script } server-side detection using user-agent strings netscape 7.1's user agent string on windows has the general pattern: mozilla/5.0 (windows; u; <em>operating system version</em>; <em>language</em>; rv:1.4) gecko/20030624 netscape/7.1 (ax<em>[;optional comments]</em>) the "vendor comment" (ax) following the "vendor version" netscape/7.1 is an indicator that the browser supports the windows media player activex control. for example on windows xp, netscape 7.1's user agent string may be: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.4) gecko/20030624 netscape/7.1 (ax) if the cli...
.... dhtml behaviors can be used in internet explorer to perform activex control detection. for example, the following uses dhtml behaviors to associate a set of behaviors with a span element, which is then interrogated for its version number (the script attempts to verify that the windows media player control is at version 9): <span style="behavior:url(#default#clientcaps)" id="cc"></span> <script language=javascript> var cv = cc.getcomponentversion( "{6bf52a52-394a-11d3-b153-00c04f79faa6}", "componentid" ); if (cv == null || cv == "") { top.location.href = "http://foo.bar.foo/checkref"; } </script> netscape 7.1 does not support ie's dhtml behaviors. in order to use the windows media player control in both netscape 7.1 and ie, you need to avoid browser-specific detection mechanisms like thi...
Introduction to game development for the Web - Game development
orm you can truly think of the web as a better target platform for your game. as we like to say, "the web is the platform." let's take a look at the core of the web platform: function technology audio web audio api graphics webgl (opengl es 2.0) input touch events, gamepad api, device sensors, webrtc, full screen api, pointer lock api language javascript (or c/c++ using emscripten to compile to javascript) networking webrtc and/or websockets storage indexeddb or the "cloud" web html, css, svg (and much more!) the business case as a game developer, whether you're an individual or a large game studio, you want to know why it makes sense to target the web with your next game project. let's lo...
... powerful data storage api for maintaining user data on their own computer or device. a great way to save game state and other information locally so it doesn't have to be downloaded every time it's needed. also useful to help make your game playable even when the user isn't connected to the web (such as when they're stuck on an airplane for hours on end). javascript javascript, the programming language used on the web, is blazing fast in modern browsers and getting faster all the time. use its power to write the code for your game, or look at using technologies like emscripten or asm.js to easily port your existing games. pointer lock api the pointer lock api lets you lock the mouse or other pointing device within your game's interface so that instead of absolute cursor positioning you receiv...
CSS - MDN Web Docs Glossary: Definitions of Web-related terms
a css rule is a set of properties associated with a selector. ...
... a css rule is a set of properties associated with a selector. here is an example that makes every html paragraph yellow against a black background: /* the selector "p" indicates that all paragraphs in the document will be affected by that rule */ p { /* the "color" property defines the text color, in this case yellow. ...
Computer Programming - MDN Web Docs Glossary: Definitions of Web-related terms
computer programming is a process of composing and organizing a collection of instructions. these tell a computer/software program what to do in a language which the computer understands. these instructions come in the form of many different languages such as c++, java, javascript, html, python, ruby, and rust. using an appropriate language, you can program/create all sorts of software. ...
...using an appropriate language, you can program/create all sorts of software. for example, a program that helps scientists with complex calculations, a database that stores huge amounts of data, a web site that allows people to download music, or animation software that allows people to create animated movies. ...
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
the content attribute is the attribute as you set it from the content (the html code) and you can set it or get it via element.setattribute() or element.getattribute(). the content attribute is always a string even when the expected value should be an integer. for example, to set an <input> element's maxlength to 42 using the content attribute, you have to call setattribute("maxlength", "42") on that element. ...
...but sometimes it doesn't. ...
Python - MDN Web Docs Glossary: Definitions of Web-related terms
python is developed under an osi-approved open source license, making it freely usable and distributable, even for commercial use. ...
... python is developed under an osi-approved open source license, making it freely usable and distributable, even for commercial use. ...
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
only. a symbol value represents a unique identifier. for example: // here are two symbols with the same description: let sym1 = symbol("sym") let sym2 = symbol("sym") console.log(sym1 === sym2) // returns "false" // symbols are guaranteed to be unique. // even if we create many symbols with the same description, // they are different values. note: if you are familiar with ruby's (or another language) that also has a feature called "symbols", please don’t be misguided. javascript symbols are different. symbol type is a new feature in ecmascript 2015. there is no ecmascript 5 equivalent for symbol. in some programming languages, the symbol data type is referred to as an "atom." symbols don't "auto-convert" to strings most values in javascript support implicit conversion to a string. for...
...nguages, the symbol data type is referred to as an "atom." symbols don't "auto-convert" to strings most values in javascript support implicit conversion to a string. for instance, we can alert almost any value, and it will work. symbols are special. they don’t auto-convert. for example: let sym = symbol("sym") alert(sym) // typeerror: cannot convert a symbol value to a string that’s a "language guard" against messing up, because strings and symbols are fundamentally different, and should not occasionally convert one into another. if you really want to show a symbol, we need to call .tostring() on it. let sym = symbol("sym") alert(sym.tostring()) // symbol(sym), now it works or you can use the symbol.description property to get its description: let _sym = symbol("sym"); alert(_sym.
Syntax - MDN Web Docs Glossary: Definitions of Web-related terms
syntax specifies the required combination and sequence of characters making up correctly structured code. syntax generally includes grammar and the rules that apply to writing it, such as indentation requirements in python. syntax varies from language to language (e.g., syntax is different in html and javascript). although languages can share few similarities in terms of their syntaxes for example "operand operator operand" rule in javascript and python. this does not mean the two langauges share similarities with syntax. syntax applies both to programming languages (commands to the computer) and markup languages (document structure information) alike. syntax only governs ordering and structure; the instructions must also be meaningful, which is the province of semantics. code must hav...
...ompile correctly, otherwise a syntax error occurs. ...
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
whitespace is a set of characters which is used to show horizontal or vertical spaces between other characters. they are often used to separate tokens in html, css, javascript, and other computer languages. whitespace characters and their usage vary between languages. in html html living standard specifies 5 characters as the ascii whitespace: u+0009 tab, u+000a lf, u+000c ff, u+000d cr, and u+0020 space. ...
...ace: u+0009 tab, u+000a lf, u+000c ff, u+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 t...
markup - MDN Web Docs Glossary: Definitions of Web-related terms
procedural markup: combined with text to provide instructions on text processing to programs. this text is visibly manipulated by the author. descriptive markup: labels sections of documents as to how the program should handle them. for example, the html <td> defines a cell in a html table. ...
... procedural markup: combined with text to provide instructions on text processing to programs. this text is visibly manipulated by the author. descriptive markup: labels sections of documents as to how the program should handle them. for example, the html <td> defines a cell in a html table. ...
MDN Web Docs Glossary: Definitions of Web-related terms
distributed denial of service dmz dns doctype document directive document environment dom (document object model) domain domain name domain sharding dominator dos attack dtls (datagram transport layer security) dtmf (dual-tone multi-frequency signaling) dynamic programming language dynamic typing e ecma ecmascript effective connection type element empty element encapsulation encryption endianness engine entity entity header event exception expando f fallback alignment falsy favicon ...
... gonk google chrome gpl gpu graceful degradation grid grid areas grid axis grid cell grid column grid container grid lines grid row grid tracks guard gutters gzip compression h hash head high-level programming language hmac hoisting host hotlink houdini hpkp hsts html html5 http http header http/2 http/3 https hyperlink hypertext i i18n iana icann ice ide idempotent identifier idl ...
About Scriptable Interfaces - Interfaces
a starter document, it should not be considered complete. most of the information of this document is based on http://www.mozilla.org/scriptable/ and creating xpcom components scriptable interfaces interfaces allow xpcom components to expose their functionality to the outside world while hiding the inner details of the component implementation. interfaces are written in an interface description language. when we label an interface as scriptable, we're saying that components exporting this interface can be referenced (through this interface) from scripts (e.g javascript), and that we can write new components implementing the interface using script languages. xpconnect xpconnect is a technology that allows scriptable interfaces to be used/implemented from/in javascript scripts. no other scripts...
... when we label an interface as scriptable, we're saying that components exporting this interface can be referenced (through this interface) from scripts (e.g javascript), and that we can write new components implementing the interface using script languages. xpconnect xpconnect is a technology that allows scriptable interfaces to be used/implemented from/in javascript scripts. no other scripts languages are supported by xpconnect. python there's an extension extensions/python that bridges the gap between xpcom and python, allowing scriptable interfaces to be used/implemented from/in python scripts. ...
CSS and JavaScript accessibility best practices - Learn web development
style emphasis elements in any significant way. the standard conventions of bold and italic text are very recognisable, and changing the style can cause confusion. for more on emphasis, see emphasis and importance. abbreviations an element that allows an abbreviation, acronym, or initialization to be associated with its expansion: <p>web content is marked up using <abbr title="hypertext markup language">html</abbr>.</p> again, you might want to style it in some simple way: abbr { color: #a60000; } the recognised styling convention for abbreviations is a dotted underline, and it is unwise to significantly deviate from this. for more on abbreviations, see abbreviations. links hyperlinks — the way you get to new places on the web: <p>visit the <a href="https://www.mozilla.org">mozilla ho...
...his, and make your designs flexible enough so that such changes will work in your design. as an example, you might want to make sure your main content area can handle bigger text (maybe it will start to scroll to allow it all to be seen), and won't just hide it, or break completely. javascript javascript can also break accessibility, depending on how it is used. modern javascript is a powerful language, and we can do so much with it these days, from simple content and ui updates to fully-fledged 2d and 3d games. there is no rule that says all content has to be 100% accessible to all people — you just need to do what you can, and make your apps as accessible as possible. simple content and functionality is arguably easy to make accessible — for example text, images, tables, forms and push b...
What is accessibility? - Learn web development
s out on because your site isn't coded properly — almost the same size as the population of the united states of america. people with hearing impairments otherwise known as people with auditory impairments or deaf people, this group of people has either low hearing levels or no hearing at all. hearing-impaired people do use ats (see assistive devices for people with hearing, voice, speech, or language disorders), but there are not really special ats specific for computer/web use. there are, however, specific techniques for providing textual alternatives to audio content which range from simple text transcripts to text tracks (i.e. captions) that can be displayed along with video. an article, later on, will discuss these. hearing-impaired people also represent a significant userbase — "466 ...
...n set of functional problems. these include difficulty with understanding content, remembering how to complete tasks, and confusion caused by inconsistent webpage layouts. ...
CSS building blocks - Learn web development
this module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more. the aim here is to provide you with a toolkit for writing competent css and help you understand all the essential theory, before moving on to more specific disciplines like text styling and css layout. ...
...standing of the basics of css, as discussed in the css first steps module. note: if you are working on a computer/tablet/another device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch. guides this module contains the following articles, which cover the most essential parts of the css language. along the way you'll come across plenty of exercises to allow you to test your understanding. cascade and inheritance the aim of this lesson is to develop your understanding of some of the most fundamental concepts of css — the cascade, specificity, and inheritance — which control how css is applied to html and how conflicts are resolved. css selectors there are a wide variety of css s...
Introduction to CSS layout - Learn web development
followed by the unordered list, followed by the second paragraph. the elements that appear one below the other are described as block elements, in contrast to inline elements, which appear one beside the other, like the individual words in a paragraph. note: the direction in which block element contents are laid out is described as the block direction. the block direction runs vertically in a language such as english, which has a horizontal writing mode. it would run horizontally in any language with a vertical writing mode, such as japanese. the corresponding inline direction is the direction in which inline contents (such as a sentence) would run. for many of the elements on your page the normal flow will create exactly the layout you need, however for more complex layouts you will need to...
... as a column. to use flexbox, you apply display: flex to the parent element of the elements you want to lay out; all its direct children then become flex items. we can see this in a simple example. the html markup below gives us a containing element, with a class of wrapper, inside which are three <div> elements. by default these would display as block elements, below one another, in our english language document. however, if we add display: flex to the parent, the three items now arrange themselves into columns. this is due to them becoming flex items and being affected by some initial values that flexbox sets on the flex container. they are displayed in a row, because the initial value of flex-direction set on their parent is row. they all appear to stretch to the height of the tallest item, b...
How CSS is structured - Learn web development
a p selector that sets paragraph text to blue. however, there is also a class that sets the text of selected elements to red. .special { color: red; } p { color: blue; } suppose that in our html document, we have a paragraph with a class of special. both rules apply. which selector prevails? do you expect to see blue or red paragraph text? <p class="special">what color am i?</p> the css language has rules to control which selector is stronger in the event of a conflict. these rules are called cascade and specificity. in the code block below, we define two rules for the p selector, but the paragraph text will be blue. this is because the declaration that sets the paragraph text to blue appears later in the stylesheet. later styles replace conflicting styles that appear earlier in the styl...
...that apply styling to different html elements: font-size width background-color color border important: if a property is unknown, or if a value is not valid for a given property, the declaration is processed as invalid. it is completely ignored by the browser's css engine. important: in css (and other web standards), it has been agreed that us spelling is the standard where there is language variation or uncertainty. for example, color should be spelled color, as colour will not work. functions while most values are relatively simple keywords or numeric values, there are some values which take the form of a function. an example would be the calc() function, which can do simple math within css: <div class="outer"><div class="box">the inner box is 90% - 30px.</div></div> .outer {...
How do you set up a local testing server? - Learn web development
if you open them as local files. this can be due to a variety of reasons, the most likely being: they feature asynchronous requests. some browsers (including chrome) will not run async requests (see fetching data from the server) if you just run the example from a local file. this is because of security restrictions (for more on web security, read website security). they feature a server-side language. server-side languages (such as php or python) require a special server to interpret the code and deliver the results. running a simple local http server to get around the problem of async requests, we need to test such examples by running them through a local web server. one of the easiest ways to do this for our purposes is to use python's simplehttpserver (or http.server, depending on the v...
...ents of the directory listed — click the html file you want to run. note: if you already have something running on port 8000, you can choose another port by running the server command followed by an alternative port number, e.g. python3 -m http.server 7800 (python 3.x) or python -m simplehttpserver 7800 (python 2.x). you can then access your content at localhost:7800. running server-side languages locally python's simplehttpserver (python 2.0) http.server (python 3.0) module is useful, but it doesn't know how to run code written in languages such as python, php or javascript. to handle that you'll need something more — exactly what you'll need depends on the server-side language you are trying to run. here are a few examples: to run python server-side code, you'll need to use a pyth...
Getting started with the Web - Learn web development
ing with files a website consists of many files: text content, code, stylesheets, media content, and so on. when you're building a website, you need to assemble these files into a sensible structure and make sure they can talk to one another. dealing with files explains how to set up a sensible file structure for your website and what issues you should be aware of. html basics hypertext markup language (html) is the code that you use to structure your web content and give it meaning and purpose. for example, is my content a set of paragraphs or a list of bullet points? do i have images inserted on my page? do i have a data table? without overwhelming you, html basics provides enough information to make you familiar with html. css basics cascading stylesheets (css) is the code that you use to ...
...ake you familiar with html. css basics cascading stylesheets (css) is the code that you use to style your website. for example, do you want the text to be black or red? where should content be drawn on the screen? what background images and colors should be used to decorate your website? css basics takes you through what you need to get started. javascript basics javascript is the programming language that you use to add interactive features to your website. some examples could be games, things that happen when buttons are pressed or data is entered in forms, dynamic styling effects, animation, and much more. javascript basics gives you an idea of what is possible with this exciting language, and how to get started. publishing your website once you have finished writing the code and organizi...
Use JavaScript within a webpage - Learn web development
essing javascript. learn in this article how to trigger javascript right from your html documents. prerequisites: you need to be familiar with how to create a basic html document. objective: learn how to trigger javascript in your html file, and learn the most important best practices for keeping javascript accessible. about javascript javascript is a programming language mostly used client-side to make webpages interactive. you can create amazing webpages without javascript, but javascript opens up a whole new level of possibilities. in this article we're going over the html code you need to make javascript take effect. if you want to learn javascript itself, you can start with our javascript basics article. if you already know something about javascript or if ...
...eractive. you can create amazing webpages without javascript, but javascript opens up a whole new level of possibilities. in this article we're going over the html code you need to make javascript take effect. if you want to learn javascript itself, you can start with our javascript basics article. if you already know something about javascript or if you have a background with other programming languages, we suggest you jump directly into our javascript guide. how to trigger javascript from html within a browser, javascript doesn't do anything by itself. you run javascript from inside your html webpages. to call javascript code from within html, you need the <script> element. there are two ways to use script, depending on whether you're linking to an external script or embedding a script righ...
Introduction to HTML - Learn web development
this module will introduce the first two of these and introduce fundamental concepts and syntax you need to know to understand html. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. ...
...nline coding program such as jsbin or glitch. guides this module contains the following articles, which will take you through all the basic theory of html and provide ample opportunity for you to test out some skills. getting started with html covers the absolute basics of html, to get you started — we define elements, attributes, and other important terms, and show where they fit in the language. we also show how a typical html page is structured and how an html element is structured, and explain other important basic language features. along the way, we'll play with some html to get you interested! what’s in the head? metadata in html the head of an html document is the part that is not displayed in the web browser when the page is loaded. it contains information such as the page <t...
Video and audio content - Learn web development
o can't hear the audio clearly if at all. others may not be able to hear the audio because they are in noisy environments (like a crowded bar when a sports game is being shown). similarly, in environments where having the audio playing would be a distraction or disruption (such as in a library or when a partner is trying to sleep), having captions can be very useful. people who don't speak the language of the video might want a text transcript or even translation to help them understand the media content. wouldn't it be nice to be able to provide these people with a transcript of the words being spoken in the audio/video? well, thanks to html video, you can. to do so we use the webvtt file format and the <track> element. note: "transcribe" means "to write down spoken words as text." the res...
... ... to get this displayed along with the html media playback, you need to: save it as a .vtt file in a sensible place. link to the .vtt file with the <track> element. <track> should be placed within <audio> or <video>, but after all <source> elements. use the kind attribute to specify whether the cues are subtitles, captions, or descriptions. further, use srclang to tell the browser what language you have written the subtitles in. here's an example: <video controls> <source src="example.mp4" type="video/mp4"> <source src="example.webm" type="video/webm"> <track kind="subtitles" src="subtitles_en.vtt" srclang="en"> </video> this will result in a video that has subtitles displayed, kind of like this: for more details, please read adding captions and subtitles to html5 vid...
Introduction to events - Learn web development
nse to an event, we say we are registering an event handler. note: event handlers are sometimes called event listeners — they are pretty much interchangeable for our purposes, although strictly speaking, they work together. the listener listens out for the event happening, and the handler is the code that is run in response to it happening. note: web events are not part of the core javascript language — they are defined as part of the apis built into the browser. a simple example let's look at a simple example of what we mean here. you've already seen events and event handlers used in many of the examples, but let's recap just to cement our knowledge. in the following example, we have a single <button>, which when pressed, makes the background change to a random color: <button>change col...
...nymous function containing code that generates a random rgb color and sets the <body> background-color equal to it. this code is run whenever the click event fires on the <button> element, that is, whenever a user selects it. the example output is as follows: it's not just web pages another thing worth mentioning at this point is that events are not unique to javascript — most programming languages have some kind of event model, and the way the model works often differs from javascript's way. in fact, the event model in javascript for web pages differs from the event model for javascript as it is used in other environments. for example, node.js is a very popular javascript runtime that enables developers to use javascript to build network and server-side applications. the node.js event mo...
Client-side web APIs - Learn web development
ites to get the most out of this module, you should have worked your way through the previous javascript modules in the series (first steps, building blocks, and javascript objects). those modules typically involve simple api usage, as it is often difficult to write client-side javascript examples without them. for this tutorial, we will assume that you are knowledgable about the core javascript language, and we will explore common web apis in a bit more detail. basic knowledge of html and css would also be useful. note: if you are working on a device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch. guides introduction to web apis first up, we'll start by looking at apis from a hi...
...isplaying your twitter stream on your blog) or services (e.g. displaying custom google maps on your site, or using facebook login to log in your users). this article looks at the difference between browser apis and 3rd party apis and shows some typical uses of the latter. drawing graphics the browser contains some very powerful graphics programming tools, from the scalable vector graphics (svg) language, to apis for drawing on html <canvas> elements, (see the canvas api and webgl). this article provides an introduction to the canvas api, and further resources to allow you to learn more. video and audio apis html5 comes with elements for embedding rich media in documents — <video> and <audio> — which in turn come with their own apis for controlling playback, seeking, etc. this article shows...
Object prototypes - Learn web development
hings — see ecmascript 2015 classes. prerequisites: understanding javascript functions, familiarity with javascript basics (see first steps and building blocks), and oojs basics (see introduction to objects). objective: to understand javascript object prototypes, how prototype chains work, and how to add new methods onto the prototype property. a prototype-based language? javascript is often described as a prototype-based language — to provide inheritance, objects can have a prototype object, which acts as a template object that it inherits methods and properties from. an object's prototype object may also have a prototype object, which it inherits methods and properties from, and so on. this is often referred to as a prototype chain, and explains why differe...
...and properties are not copied from one object to another in the prototype chain. they are accessed by walking up the chain as described above. note: before ecmascript 2015, there wasn't officially a way to access an object's prototype directly — the "links" between the items in the chain are defined in an internal property, referred to as [[prototype]] in the specification for the javascript language (see ecmascript). most modern browsers, however, do offer property available called __proto__ (that's 2 underscores either side), which contains the object's constructor's prototype object. for example, try person1.__proto__ and person1.__proto__.__proto__ to see what the chain looks like in code! since ecmascript 2015, you can access an object's prototype object indirectly via object.getprotot...
Introducing JavaScript objects - Learn web development
in javascript, most things are objects, from core javascript features like arrays to the browser apis built on top of javascript. you can even create your own objects to encapsulate related functions and variables into efficient packages and act as handy data containers. the object-based nature of javascript is important to understand if you want to go further with your knowledge of the language, therefore we've provided this module to help you. here we teach object theory and syntax in detail, then look at how to create your own objects. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites before starting this module, you should have some familiarity with html an...
...his article presents a basic view of object-oriented programming (oop) theory, then explores how javascript emulates object classes via constructor functions, and how to create object instances. object prototypes prototypes are the mechanism by which javascript objects inherit features from one another, and they work differently to inheritance mechanisms in classical object-oriented programming languages. in this article, we explore that difference, explain how prototype chains work, and look at how the prototype property can be used to add methods to existing constructors. inheritance in javascript with most of the gory details of oojs now explained, this article shows how to create "child" object classes (constructors) that inherit features from their "parent" classes. in addition, we presen...
Server-side website programming - Learn web development
tend to perform a lot of very similar operations (retrieving data from a database and displaying it in a page, validating user-entered data and saving it in a database, checking user permissions and logging users in, etc.), and are constructed using web frameworks that make these and other common web server operations easy. basic knowledge of programming concepts (or of a particular programming language) is useful, but not essential. similarly, expertise in client-side coding is not required, but a basic knowledge will help you work better with the developers creating your client-side web "front end". you will need to understand "how the web works". we recommend that you first read the following topics: what is a web server what software do i need to build a website? how do you upload file...
...s a web server what software do i need to build a website? how do you upload files to a web server? with that basic understanding, you'll be ready to work your way through the modules in this section. modules this topic contains the following modules. you should start with the first module, then go on to one of the following modules, which show how to work with two very popular server-side languages using appropriate web frameworks. server-side website programming first steps this module provides technology-agnostic information about server-side website programming such as "what is it?", "how does it differ from client-side programming?", and "why is it useful?". this module also outlines some of the more popular server-side web frameworks and gives guidance on how to select the best o...
Deployment and next steps - Learn web development
lte's typescript support, and how to use it to make your application more robust. in this final article we will look at how to deploy your application and get it online, and also share some of the resources that you should go on to, to continue your svelte learning journey. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn how to prepare our svelte app for production, and what learning resources you should visit next. note that our application is fully functional and porting it to typescript is completely optional. there are different opinion...
...s when not in production !production && livereload('public'), // if we're building for production (npm run build // instead of npm run dev), minify production && terser() ], there are many plugins for rollup that allow you to customize its behavior. a particularly useful plugin which is also maintained by the svelte team is svelte-preprocess, which pre-processes many different languages in svelte files such as postcss, scss, less, coffeescript, sass, and typescript. deploying your svelte application from the point of view of a web server, a svelte application is nothing more than a bunch of html, css, and javascript files. all you need is a web server capable of serving static files, which means you have plenty of options to choose from. let's look at a couple of examples. ...
Handling common HTML and CSS problems - Learn web development
ll come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur. this includes linting code, handling css prefixes, using browser dev tools to track down problems, using polyfills to add support into browsers, tackling responsive design problems, and more. ...
... prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross browser testing. objective: to be able to diagnose common html and css cross browser problems, and use appropriate tools and techniques to fix them. the trouble with html and css some of the trouble with html and css lies with the fact that both languages are fairly simple, and often developers don't take them seriously, in terms of making sure the code is well-crafted, efficient, and semantically describes the purpose of the features on the page. in the worst cases, javascript is used to generate the entire web page content and style, which makes your pages inaccessible, and less performant (generating dom elements is expensive). in other cases,...
Package management basics - Learn web development
previous overview: understanding client-side tools next in this article we'll look at package managers in some detail to understand how we can use them in our own projects — to install project tool dependencies, keep them up-to-date, and more. prerequisites: familiarity with the core html, css, and javascript languages. objective: to understand what package managers and package repositories are, why they are needed, and the basics of how to use them. a dependency in your project a dependency is a third-party bit of software that was probably written by someone else and ideally solves a single problem for you. a web project can have any number of dependencies, ranging from none to many, and your dependencies might include sub-dependencies that you didn't...
... audit for vulnerabilities npm audit yarn audit this will check all of the dependency tree for your project and run the specific versions you're using against a vulnerability database and notify you if there are potential vulnerable packages in your project. a good starting point for learning about vulnerabilities is the snyk project, which covers both javascript packages and other programming languages. checking on a dependency npm ls date-fns yarn why date-fns this command will show what version of a dependency is installed and how it came to be included in your project. it's possible that another, top level, package could have pulled in date-fns. it's equally possible (and not ideal) that you have multiple versions of a package in your project (this has been seen many times over with the ...
Learn web development
t effect does running that line of javascript have?", or "what purpose or role does that html element have" (rather than "what does it look like?".) topics covered the following is a list of all the topics we cover in the mdn learning area. getting started with the web provides a practical introduction to web development for complete beginners. html — structuring the web html is the language that we use to structure the different parts of our content and define what their meaning or purpose is. this topic teaches html in detail. css — styling the web css is the language that we can use to style and layout our web content, as well as adding behavior like animation. this topic provides comprehensive coverage of css. javascript — dynamic client-side scripting javascript is the s...
...this topic teaches all the essentials needed to become comfortable with writing and understanding javascript. ...
Chrome registration
flags] instructs mozilla to load interface information from a typelib file produced by xpidl. prior to firefox 4, files in the components directory were registered automatically. component component {00000000-0000-0000-0000-000000000000} components/mycomponent.js [flags] informs mozilla about a component cid implemented by an xpcom component implemented in javascript (or another scripting language, if applicable). the classid {0000...} must match the classid implemented by the component. to generate a unique classid, use a uuid generator program or site. contract contract @foobar/mycontract;1 {00000000-0000-0000-0000-000000000000} [flags] maps a contract id (a readable string) to the classid for a specific implementation. typically a contract id will be paired with a component entry ...
...e when resolving the uri chrome://packagename/content/.... the uri may be absolute or relative to the location of the manifest file. note: it must end with a '/'. locale a locale package is registered with the line: locale packagename localename uri/to/files/ [flags] this will register a locale package when resolving the uri chrome://packagename/locale/... . the localename is usually a plain language identifier "en" or a language-country identifier "en-us". if more than one locale is registered for a package, the chrome registry will select the best-fit locale using the user's preferences. skin a skin package is registered with the line: skin packagename skinname uri/to/files/ [flags] this will register a skin package when resolving the uri chrome://packagename/skin/... . the skinname is...
Commenting IDL for better documentation
s obvious to human brains. plus, what is obvious to you is likely not obvious to everyone. use doxygen style comments only for information that is directly useful to someone using or implementing the interface. this helps keep the documentation tidy. be concise and to the point. writers will expand upon your documentation if necessary. keep in mind that people for whom english is not their native language will be reading your comments (as well as the generated documentation), so try to avoid slang and abbreviations when possible. if possible, avoid putting comments in the middle of the definitions of apis. if an interface is used as a parameter or as the type of the value returned by a method, please use the full name of the interface in the description of the method. this will help the tools gene...
...ter might say. * * @param number the saying number to return. * * @returns an astring containing the requested funny quote. if the specified * quote number is invalid, an exception is thrown. * * @throws ns_error_failure unable to locate the requested quote. */ astring getfunnysaying(in integer number); /** * says something appreciative of the tastiness of the cookie in the specified * language. * * @param language the localization identification indicating the language in * which the cookie monster is to express his love of cookies. */ [noscript] void sayyummy(in astring language); }; in conclusion with just a little extra help from you, the intrepid developer, the documentation team can crank out full, formatted documentation for your interface much more quickly and accurately. ...
IPDL Tutorial
to experiment with adding a new ipdl protocol, see creating a new protocol. all ipdl messages are sent between parent and a child end points, called actors. an ipdl protocol declares how actors communicate: it declares the possible messages that may be sent between actors, as well as a state machine describing when messages are allowed to be sent. ...
...ng[] args) returns (int rv); }; // ----- file pplugininstance.ipdl include protocol pplugin; rpc protocol pplugininstance { manager pplugin; child: rpc __delete__(); setsize(int width, int height); }; this example has several new elements: `include protocol` imports another protocol declaration into this file. note that this is not a preprocessor directive, but a part of the ipdl language. the generated c++ code will have proper #include preprocessor directives for the imported protocols. the `manages` statement declares that this protocol manages pplugininstance. the pplugin protocol must declare constructor and destructor messages for pplugininstance actors. the `manages` statement also means that pplugininstance actors are tied to the lifetime of the plugin actor that creates ...
Localizing extension metadata on addons.mozilla.org
f an extension are: name homepage summary description eula privacy policy version notes developer comments when you submit a new extension to amo, the process is divided into several steps. in step 2, you'll be asked to provide the attributes listed above in the add-on's default locale (selected in step 1). the values you provide here are used as fallback values if someone requests a language that doesn't exist. step 4 allows you to translate any of the above fields into any other language amo supports. remember, all fields are optional when localizing. any field that is blank will just show up in the default locale. getting translation help you are kindly advised not to use any automatic online translation, which can bring unpleasant low-quality output to users. always prefer a qu...
...al turk this is not free, but for a very modest amount of money you can get your amo page quickly translated by native speakers. create an account and then, using the “basic open-ended question” template, follow the instructions to upload the text of your amo page. on the properties page you can specify the location of the worker in order to restrict to people living in the country where the language is spoken. the reward is up to you, but $5-10 per translation seems to work well. localization codes amo offers 33 localizations, including english. here is a list of the codes: arabic (ar), catalan (ca), czech (cs), danish (da), german (de), greek (el), basque (eu), spanish (es-es), farsi (fa), finnish (fi), french (fr), gaeilge (ga-ie), hebrew (he), hungarian (hu), indonesian (id), italian (...
Localizing with Pontoon
llowing items (from left to right): list of strings opens a sidebar with a list of all strings to localize. project selector (affiliates) switches between projects to localize. resource selector (homepage) switches between project resources to localize, like subpages or localization files. hidden if no resources available for project. locale selector (slovenian) switches between languages to localize. go opens project-resource-locale selection. progress indicator displays your progress on the resource being localized. more details are available in the popup. user menu allows for user-specific tasks, like commiting to repository, downloading files and signing out. info menu gives important information, like the anticipated project timeline and a list of keyboard shortc...
...ntext pontoon's in-context translation mode is what puts it above others. it opens a web page (or web app) and enables real-time editing of that page. here's how you translate your first string: hover over the text you want to translate with your mouse. an edit button appears over that text. click on it to enable the translate mode. replace the original text with its translation into your language. click the save button to save your translation. out-of-context some strings are impossible to translate in-context, e.g. the contents of the <title> tag in websites and strings with placeables or different plural forms. by clicking on the hamburger icon in the main toolbar, a list of all strings and available translations will open in the sidebar. you can also use the sidebar for out-of-con...
Localization technical reviews
listing the name just after the moz_langpack_creator. the team can also wrap contributors with <em:contributor> tags just after the moz_langpack_contributors section. make sure that the the text content is wrapped with emptylines. leading comments are ok, but watch out for #filter emptylines #define ... # comment #define ... #unfilter emptylines in toolkit/defines.inc, the native name of the language is specified, which is used as description for the built language packs. region.properties though locales might like to specify changes from the beginning, the region.properties files will be reverted to en-us. changes will be discussed in productization bugs filed for each locale. search plugins similar to the region.properties files, the list.txt file should be reverted to en-us and ame...
...e. most locales should have the following: #filter substitution pref("general.useragent.locale", "@ab_cd@") how it all works a large part of the review process takes place before you even submit your request for a technical review. to put it simply, when we receive your request, we expect that you have spent time testing your work and making sure all strings have been localized and that your language pack is relatively functional. your review request symbolically represents that you have worked on your localization, tested it successfully, and found it to represent the best of your work. so before you request your technical review, be sure that it is as ready as it can be. there is a specific process to follow in bugzilla for requesting these reviews: file a bug requesting the review. at...
What every Mozilla translator should know
firefox 3.6 mozilla-1.9.1 l10n-mozilla-1.9.1 firefox 3.5 and, on the former revision control system, cvs: cvs trunk (the default branch) -> firefox/thunderbird 3.0.x branch mozilla_1_8_branch -> firefox/thunderbird 2.0 branch mozilla cross-reference mozilla cross-reference is a web site mirroring the content of the hg server. here we can easily have a look into other languages translations. bugzilla, the bug-tracking system you do need an account in bugzilla you should configure the account to watch the following addresses: firefoxl10n@hotmail.com calendar-l10n@mozilla.bugs (specific for calendar related bugs) this way you will receive mail for bugs affecting many or even all locales. when you create a bug, if you want the person in charge of the l10n to fol...
... productization elements (i.e. search plugins, protocol handlers, rss/live bookmarks), you will need to upload a patch with the suggested changes to bugzilla and get approval before pushing those changes to your hg repository. do the changes in your local disk create a diff file with the changes $ hg diff -p -u 8 filename create a new bug: product: mozilla localization component: your language ... cc: l10n@mozilla.com assigned to: you explain what you need! specify the branch (1.9.2 for firefox 3.6, 1.9.2.1 for firefox 3.6.1, ...) attach the diff file to the bug: content type: patch mark the approval1.9.xxx with ? asking for approval (use the appropriate branch) if you get the approval you will see who_is_ap:approval1.8.xxx+ now, you can upload the changes approved to the cv...
Emscripten
emscripten is an llvm to javascript compiler. it takes llvm bytecode (e.g. generated from c/c++ using clang, or from another language) and compiles that into javascript, which can be run on the web. important: this page provides a very brief introduction to what emscripten is. to get started with emscripten, go to the official emscripten wiki. using emscripten, you can compile c and c++ code into javascript compile any other code that can be translated into llvm bytecode into javascript. ...
... compiles that into javascript, which can be run on the web. important: this page provides a very brief introduction to what emscripten is. to get started with emscripten, go to the official emscripten wiki. using emscripten, you can compile c and c++ code into javascript compile any other code that can be translated into llvm bytecode into javascript. compile the c/c++ runtimes of other languages into javascript, and then run code in those other languages in an indirect way (this has been done for python and lua)! emscripten makes native code immediately available on the web: a platform that is standards-based, has numerous independent compatible implementations, and runs everywhere from pcs to ipads. with emscripten, c/c++ developers don’t have the high cost of porting code manuall...
L20n
note: this document is in draft form/out-of-date — for current documentation please see our documentation on github. a javascript localization framework to unleash your natural language's power with simple code. introducing l20n l20n reinvents software localization. users should be able to benefit from the entire expressive power of the natural language. l20n keeps simple things simple, and at the same time makes complex things possible. through l20n, mozilla is creating a new generation of technology that places more power in localizers' hands. ...
...l language. l20n keeps simple things simple, and at the same time makes complex things possible. through l20n, mozilla is creating a new generation of technology that places more power in localizers' hands. l20n lets localizers reach higher levels of free linguistic expression by sharpening the divide between localization and application logic. it allows to adapt your web application not only to languages and cultures, but also contextual data, user gender and screen dimensions. what l20n looks like here is a simple, straightforward example showing an english string being provided: <brandname "firefox"> <about "about {{ brandname }}"> here is the same string being provided in slovenian: <brandname { nominative: "firefox", genitive: "firefoxa", dative: "firefoxu", accusative: "firef...
Python binding for NSS
ocess management. python also provides an abstraction of common operating system services but because nss and nspr are tightly bound python-nss exposes elements of nspr. for information on nss and nspr, see the following: network security services (nss). nss project page. netscape portable runtime. nspr project page. nspr reference. nspr api documentation. design goals nss and nspr are c language api's which python-nss "wraps" and exposes to python programs. the design of python-nss follows these basic guiding principles: be a thin layer with almost a one-to-one mapping of nss/nspr calls to python methods and functions. programmers already familiar with nss/nspr will be quite comfortable with python-nss. be "pythonic". the term pythonic means to follow accepted python paradigms and id...
...n-nss "wraps" and exposes to python programs. the design of python-nss follows these basic guiding principles: be a thin layer with almost a one-to-one mapping of nss/nspr calls to python methods and functions. programmers already familiar with nss/nspr will be quite comfortable with python-nss. be "pythonic". the term pythonic means to follow accepted python paradigms and idoms in the python language and libraries. thus when deciding if the nss/nspr api should be rigidly followed or a more pythonic api provided the pythonic implementation wins because python programmers do not want to write c programs in python, rather they want their python code to feel like python code with the richness of full python. identifer names follow the preferred python style instead of the style in the nss/nspr c...
Rhino and BSF
this framework has been embedded in a number of open source projects, including the xsl processor xalan and the xml/java build tool ant. ...
... this framework has been embedded in a number of open source projects, including the xsl processor xalan and the xml/java build tool ant. ...
Rhino documentation
license rhino license information. requirements and limitations what you must have to run rhino; what rhino cannot do. downloads archive includes release notes for rhino releases optimization details on the various optimization levels. faq answers to frequently asked questions about rhino. rhino history history of the beast. writing scripts scripting java how to use rhino to script java classes. performance hints some tips on writing faster javascript code. ...
...f the javascript runtime. small footprint hints for those interested in small-footprint embeddings. examples a set of examples showing how to control the javascript engine and build javascript host objects. using rhino with bean scripting framework (bsf) how to use rhino with apps that support bsf (bean scripting framework) from the apache jakarta project. external references scripting languages for java (link broken? try this at http://archive.is/ssvxq ) an article comparing and contrasting rhino and jython. rhino contributors interested in contributing to rhino? check out the rhino wish list. ...
Creating JavaScript jstest reftests
ontains tests of spidermonkey conformance to ecmascript as well as spidermonkey non-standard extenstions to ecmascript. directory overview in the js/src/tests directory, there are a few important subdirectories. non262 tests the directory js/src/tests/non262/ should contain all tests of the following type: regressions of spidermonkey non-standard spidermonkey extensions to the javascript language test of "implementation-defined" details of the ecmascript standard for example, the exact definition of pi or some details of array sorting. you should not add tests of the following type: tests of the jit test of jit correctness belong in the jit-test suite, read more here. performance tests or stress tests tests of spidermonkey's comformance to the ecmascript stan...
...story: in 2017, spidermonkey started comsuming test262, a comprehensive tests suite for ecmascript implementations. before using test262, spidermonkey had a fair number of internal tests of conformance to ecmascript, and many of those tests remain in the js/src/non262 directory as regressions. test262 tests test262 is the implementation conformance test suite for the latest drafts of ecmascript language specification, as well as internationalization api specification and the json data interchange format. it is maintained by tc39, the ecmascript standard's technical committee. mozilla manually imports these tests into the js/src/tests/test262 directory. you should contribute directly to test262 in the following scenarios: you are writing tests for the implementation of a new feature or featu...
Self-hosted builtins in SpiderMonkey
ccess to, then callfunction(receiver.fun, receiver) wouldn't be guaranteed to work, because content might have changed the value of receiver.fun, so callcontentfunction(receiver.fun, receiver) has to be used. self-hosted functions by default are not constructors and do not have a prototype property, so that they meet the requirements for standard built-in functions as described in the ecmascript language specification 5.1, clause 15. to make a self-hosted function a constructor, call makeconstructible(functionname) after the function declaration. a prototype property can be added from the self-hosted code itself. all self-hosted functions have direct access to each other and can rely on references being stable, i.e. not changeable by client js code. otoh, self-hosted code doesn't have access to...
...rototype.apply directly. a select set of c++-implemented builtins is installed via the intrinsic_functions array in selfhosting.cpp, as described below. using the same mechanism, c++-implemented helper functions are made available to self-hosted code. some general-purpose functions provided in this way are: the abstract operations toobject, tointeger, and iscallable specified in the ecmascript language specification. throwtypeerror, throwrangeerror, throwsyntaxerror, which self-hosted code should use instead of throw so that the error message is specified in js.msg and can be localized. the makeconstructible function described above. the file utilities.js provides some additional, js-implemented helper functions. of note, it provides implementations of list and record, types defined in the ...
SpiderMonkey 1.8
the mozilla javascript team is pleased to announce the release of spidermonkey 1.8 release candidate 1. you can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/js-1.8.0-rc1.tar.gz (md5 checksum: eaad8815dcc66a717ddb87e9724d964e). spidermonkey 1.8 is the javascript engine that shipped in firefox 3.0. it is much faster than spidermonkey 1.7 and contains a few new language features and api features, described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or, file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. —9 march 2009 known issues spidermonkey 1.8 has one known significant regression from 1.7. in js_threadsafe builds, some objects are not ...
...e feel free to contact the spidermonkey team via email, bugzilla, or irc.) alternatively, you can install mozillabuild and run the command make -f makefile.ref in the js/src directory. spidermonkey 1.8 does not include the new tracemonkey jit or the configure-based build system, both of which are (a) pretty darn awesome and (b) coming in spidermonkey 1.8.1. on to the fun stuff. new javascript language features javascript 1.8 adds array.reduce() and reduceright(), expression closures, and generator expressions. there is also one obscure non-backwards-compatible change. for details, see new in javascript 1.8. new jsapi features it has been a couple years since spidermonkey 1.7 was released, and many improvements have been made to the jsapi. however, one of the most important advances for jsap...
SpiderMonkey 52
load full source code from treeherder, by going to the mozilla-esr52 repository and clicking on the first sm(pkg) link you see. that will open a small window in the bottom left with a line like "artifact uploaded:mozjs-52.x.y.tar.bz2". spidermonkey 52 is the javascript engine that shipped in firefox 52. it continues to improve performance over previous spidermonkey releases. ...
...language and api features described in detail below. please let us know about your experiences with this release by posting in the mozilla.dev.tech.js-engine newsgroup. or file bugs at bugzilla.mozilla.org under product: core, component: javascript engine. you may wish to make the bugs block bug 837921 (aliased as "sm.embedding"). ...
AT APIs Support
on email - provides integrated mail, addressbook and calendaring functionality to users of the gnome desktop. on mac platform camino - web browser for os x xul applications xul applications make full use of the gecko architecture, not only for html content, but also for the entire user interface. widgets such as menus, tab panels, tree views and dialogs are provided via an xml language called xul (extensible user-interface language). none of the user interface contains standard os controls. this is done to ensure a common look and feel across all supported platforms, and to allow for different skins (appearances). developing a xul window is not that different from developing a web page, but the elements available to add widgets are more powerful and designed to be similar to de...
...edom*) interface support. any object that supports iaccessible will also support iaccessible2 and possibly any of the other ia2 interfaces. linux/unix platform we support atk/at-spi interfaces on linux. mac platform we currently support only a subset of universal access. the rest of the mozilla universal access support is in progress. accessible web standards gecko exposes the number of xml languages including html to at. refer to accessible web specifications page to learn what and how markup languages are exposed. at apis implementation details refer to implementation details page to see how gecko supports interesting at api. there you will find information how at api interfaces, roles, states and etc are mapped into gecko accessibility api and visa versa. keyboard user interface and ap...
Preface
you will know something about the framework for these components in gecko, which is xpcom. who should read this book no one. it is badly out of date, and much of what it says is either no longer remotely accurate, or is severely deprecated. if you are a historian, though... creating xpcom components is meant for c++ developers. though you can create xpcom components in javascript and other languages, and though you might be able to follow along as a c programmer, the component implementation code is written in c++, and much of the discussion of how to make your codeinto an xpcom component starts from c++. you don't need to be a c++ expert, however. although basic ideas such as inheritance and encapsulation should be familar to you, wherever possible they are explained in the book as they ar...
...make your codeinto an xpcom component starts from c++. you don't need to be a c++ expert, however. although basic ideas such as inheritance and encapsulation should be familar to you, wherever possible they are explained in the book as they are used. also many of the examples are in javascript, which is used in mozilla to access xpcom components as scriptable objects, and so familiarity with that language is useful as well. xpcom stands for the cross platform component object model. as this name implies, xpcom is similar to microsoft com. if you have any experience with this technology, much of it can be applied to xpcom. however, this book does not assume any prior knowledge of com - all of the basic com ideas will be introduced. this book provides a tutorial about building an xpcom component t...
Using XPCOM Components
www.mozilla.org/scriptable/ for more information about xpconnect and javascript. this isn't quite all there is to it, of course, but this shows an important aspect of xpcom. the contractual arrangements that xpcom enforces open up the way to binary interoperability - to being able to access, use, and reuse xpcom components at runtime. and they make it possible to use components written in other languages - such as javascript, python, and others - and to use c++-based xpcom components from these other languages as well. in the mozilla browser, components are used as often from javascript in the interface as they are from c++ or any other language. in fact, a search of the mozilla source code reveals that this cookiemanager component is called only from javascript. we'll be using this component f...
...er component is called only from javascript. we'll be using this component from javascript ourselves as part of this tutorial[cookie-manager-in-tutorial]. javascript and mozilla javascript is the lingua franca of the mozilla browser front-end, and the bindings between it and xpcom are strong and well-defined. scriptability, this ability to get and use xpcom components from javascript and other languages for which xpconnect bindings have been created, is a core feature of xpcom. the webbrowserfind component components are used all over - in high-level browser-like functionality such as nswebbrowserfind, which provides find() and findnext() methods for finding content in web pages, and in low-level tasks such as the manipulation of data. though not every api in mozilla is or should be "xpcomif...
IAccessibleText
e" and a child text() object containing "two" and if the caret is in the descendant object just before the 'o' in "two", then: the caretoffset for the "one ? three" object would be 4, matching the embed character</li> the caretoffset for "two" would be 2, matching the "o" the caret position/offset is that of the character logically following it, for example to the right of it in a left to right language. [propget] hresult caretoffset( [out] long offset ); parameters offset the returned offset is relative to the text() represented by this object. return value s_false if the caret is not currently active on this object, that is the caret is located on some other object. the returned offset value will be -1. s_ok. characterextents() returns the bounding box of the specified position. the virtu...
...first selected character. endoffset 0 based offset of one past the last selected character. return value e_invalidarg if bad [in] passed, [out] values are 0s. s_false if there is nothing to return, [out] values are 0s. s_ok. setcaretoffset() sets the position of the caret. the caret position/offset is that of the character logically following it, for example to the right of it in a left to right language. setting the caret position may or may not alter the current selection(). a change of the selection() is notified to the accessibility event listeners with an ::ia2_event_text_selection_changed event. when the new caret position differs from the old one (which, of course, is the standard case) this is notified to the accessibility event listeners with an ::ia2_event_text_caret_moved event. hresul...
nsILocaleService
refox 3) implemented by: @mozilla.org/intl/nslocaleservice;1. to use this service, use: var localeservice = components.classes["@mozilla.org/intl/nslocaleservice;1"] .getservice(components.interfaces.nsilocaleservice); method overview nsilocale getapplicationlocale(); astring getlocalecomponentforuseragent(); nsilocale getlocalefromacceptlanguage(in string acceptlanguage); nsilocale getsystemlocale(); nsilocale newlocale(in astring alocale); nsilocale newlocaleobject(in nsilocaledefinition localedefinition); obsolete since gecko 1.9 methods getapplicationlocale() gets the user preference for locale from the operating system. note: this has nothing to do with the locale used for localization of the applicat...
...lecomponentforuseragent() gets the user preference for locale from the operating system. note: this has nothing to do with any http user-agent. this method returns the same as getsystemlocale.getcategory("nsilocale_messages"). astring getlocalecomponentforuseragent(); parameters none. return value the user's os setting for preferred locale in the format described in nsilocale. getlocalefromacceptlanguage() gets the most preferred locale from a list of locale preferences. nsilocale getlocalefromacceptlanguage( in string acceptlanguage ); parameters acceptlanguage locale preference in the same format as the accept-language http header. return value the most preferred locale according to the acceptlanguage parameter. getsystemlocale() gets the user preference for locale from the operati...
nsISelection
read only. anchoroffset long the offset within the (text) node where the selection begins. read only. focusnode nsidomnode returns the node in which the selection ends...
.... void removeallranges(); parameters none removerange() removes a range from the current selection. void removerange( in nsidomrange range ); parameters range selectallchildren() adds all children of the specified node to the selection. void selectallchildren( in nsidomnode parentnode ); parameters parentnode the parent of the children to be added to the selection. selectionlanguagechange() modifies the cursor bidi level after a change in keyboard direction. void selectionlanguagechange( in boolean langrtl ); parameters langrtl is pr_true if the new language is right-to-left or pr_false if the new language is left-to-right. tostring() returns the whole selection into a plain text string. domstring tostring(); remarks see also ...
Storage
ment.finalize()) you do not need to worry about calling mozistoragestatement.reset(). you should do this before you reuse the statement. warning: if you fail to reset a write statement, it will continue to hold a lock on the database preventing future writes or reads. additionally, if you fail to reset a read statement, it will prevent any future writes to the database. in javascript, the language makes it pretty easy to ensure that you always reset a statement. be aware that you should always reset even if an exception is thrown, so your code should look something like this: var statement = dbconn.createstatement("select * from table_name"); try { while (statement.step()) { // use the results... } } finally { statement.reset(); } in c++, storage provides a helper object in st...
... sqlite aggregate function. mozistorageprogresshandler monitor progress during the execution of a statement. mozistoragestatementwrapper storage statement wrapper mozistorageservice storage service storage:performance how to get your database connection performing well. storage inspector extension makes it easy to view any sqlite database files in the current profile. sqlite syntax query language understood by sqlite sqlite database browser is a capable free tool available for many platforms. it can be handy for examining existing databases and testing sql statements. sqlite manager extension helps manage sqlite database files on your computer. ...
Mozilla technologies
t as just another document format. the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/xpcom users. the xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds.xpcomxpcom is a cross platform component object model, similar to microsoft com. ...
...e xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds.xpcomxpcom is a cross platform component object model, similar to microsoft com. ...
Building a Thunderbird extension 1: introduction
similar to firefox, thunderbird functionality can be enhanced and customized via extensions. warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer information. ...
...l will introduce you to the components of a thunderbird extension and will show you how to build your own. ...
AudioTrack - Web APIs
domstring specifying the category into which the track falls. for example, the main audio track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, an audio commentary track for a movie might have a label of "commentary with director john q. public and actors john doe and jane eod." this string is empty if no label is provided. language read only a domstring specifying the audio track's primary language, or an empty string if unknown. the language is specified as a bcp 47 (rfc 5646) language code, such as "en-us" or "pt-br". sourcebuffer read only the sourcebuffer that created the track. returns null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attrib...
...ed in the media: var el = document.queryselector("video"); var tracks = el.audiotracks; you can then access the media's individual tracks using either array syntax or functions such as foreach(). this first example gets the first audio track on the media: var firsttrack = tracks[0]; the next example scans through all of the media's audio tracks, enabling any that are in the user's preferred language (taken from a variable userlanguage) and disabling any others. tracks.foreach(function(track) { if (track.language === userlanguage) { track.enabled = true; } else { track.enabled = false; } }); the language is in standard (rfc 5646) format. for us english, this would be "en-us", for example. example this example returns an array of track kinds and labels for potential use in a...
Using Fetch - Web APIs
fetch('https://example.com', { credentials: 'include' }); ...
... fetch('https://example.com', { credentials: 'include' }); if you only want t...
HTMLBodyElement - Web APIs
eventhandlers.onbeforeprint is an eventhandler representing the code to be called when the beforeprint event is raised. windoweventhandlers.onbeforeunload is an eventhandler representing the code to be called when the beforeunload event is raised. windoweventhandlers.onhashchange is an eventhandler representing the code to be called when the hashchange event is raised. windoweventhandlers.onlanguagechange is an eventhandler representing the code to be called when the languagechange event is raised. windoweventhandlers.onmessage is an eventhandler called whenever an object receives a message event. windoweventhandlers.onmessageerror is an eventhandler called whenever an object receives a messageerror event. windoweventhandlers.onoffline is an eventhandler representing the code to be ...
...s.onunload is an eventhandler representing the code to be called when the unload event is raised. specifications specification status comment html living standardthe definition of 'htmlbodyelement' in that specification. living standard technically, the event-related properties onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload, have been moved to windoweventhandlers. htmlbodyelement implements this interface. html 5.1the definition of 'htmlbodyelement' in that specification. recommendation html5the definition of 'htmlbodyelement' in that specification. recommendation the following properties are n...
HTMLFrameSetElement - Web APIs
eventhandlers.onbeforeprint is an eventhandler representing the code to be called when the beforeprint event is raised. windoweventhandlers.onbeforeunload is an eventhandler representing the code to be called when the beforeunload event is raised. windoweventhandlers.onhashchange is an eventhandler representing the code to be called when the hashchange event is raised. windoweventhandlers.onlanguagechange is an eventhandler representing the code to be called when the languagechange event is raised. windoweventhandlers.onmessage is an eventhandler representing the code to be called when the message event is raised. windoweventhandlers.onoffline is an eventhandler representing the code to be called when the offline event is raised. windoweventhandlers.ononline is an eventhandler repre...
...when the storage event is raised. windoweventhandlers.onunload is an eventhandler representing the code to be called when the unload event is raised. specifications specification status comment html living standardthe definition of 'htmlframesetelement' in that specification. living standard from the html5 snapshot, the windoweventhandlers interface now have a onlanguagechange property. html5the definition of 'htmlframesetelement' in that specification. recommendation snapshot of a previous html living standard frames are now obsolete. implements windoweventhandlers. document object model (dom) level 2 html specificationthe definition of 'htmlbodyelement' in that specification. obsolete no change from document object model (dom) ...
Headers.entries() - Web APIs
Web › API › Headers › entries
allowing to go through all key/value pairs contained in this object. the both the key and value of each pairs are bytestring objects. note: this method is available in web workers. ...
...s. syntax headers.entries(); return value returns an iterator. ...
Headers.values() - Web APIs
Web › API › Headers › values
ers.values() method returns an iterator allowing to go through all values contained in this object. the values are bytestring objects. ...
... note: this method is available in web workers. syntax headers.values(); return value returns an iterator. ...
Basic concepts - Web APIs
n the other hand, requires you to create an object store for a type of data and simply persist javascript objects to that store. each object store can have a collection of indexes that makes it efficient to query and iterate across. if you are not familiar with object-oriented database management systems, read the wikipedia article on object database. indexeddb does not use structured query language (sql). it uses queries on an index that produces a cursor, which you use to iterate across the result set. if you are not familiar with nosql systems, read the wikipedia article on nosql. indexeddb adheres to a same-origin policy. an origin is the domain, application layer protocol, and port of a url of the document where the script is being executed. each origin has its own associated set ...
...f keys. you can limit or filter the range using lower and upper bounds. for example, you can iterate over all values of a key between x and y. for the reference documentation on key range, see idbkeyrange. limitations indexeddb is designed to cover most cases that need client-side storage. however, it is not designed for a few cases like the following: internationalized sorting. not all languages sort strings in the same way, so internationalized sorting is not supported. while the database can't store data in a specific internationalized order, you can sort the data that you've read out of the database yourself. note, however, that locale-aware sorting has been allowed with an experimental flag enabled (currently for firefox only) since firefox 43. synchronizing. the api is not designe...
NDEFRecord.lang - Web APIs
Web › API › NDEFRecord › lang
syntax ndefrecord.lang value a usvstring. ...
... syntax ndefrecord.lang value a usvstring. ...
Navigator - Web APIs
Web › API › Navigator
the navigator interface represents the state and the identity of the user agent. it allows scripts to query it and to register themselves to carry on some activities. a navigator object can be retrieved using the read-only window.navigator property. properties doesn't inherit any properties, but implements those defined in navigatorid, navigatorlanguage, navigatoronline, navigatorcontentutils, navigatorstorage, navigatorstorageutils, navigatorconcurrenthardware, navigatorplugins, and navigatorusermedia. standard navigatorid.appcodename read only returns the internal "code" name of the current browser. do not rely on this property to return the correct value. navigatorid.appname read only returns a domstring with the official name of the browser. do not rely on this property to retur...
... read only returns the number of logical processor cores available. navigatorplugins.javaenabled read only returns a boolean flag indicating whether the host browser is java-enabled or not. navigator.keyboard read only returns a keyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard. navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser ui. the null value is returned when this is unknown. navigatorlanguage.languages read only returns an array of domstring representing the languages known to the user, by order of preference. navigator.locks read only returns a lockmanager object which provides metho...
SpeechSynthesisUtterance.lang - Web APIs
examples var synth = window.speechsynthesis; var inputform = document.queryselector('form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
... examples var synth = window.speechsynthesis; var inputform = document.queryselector('form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); var voices = synth.getvoices(); ... ...
TrackDefault.TrackDefault() - Web APIs
the trackdefault() constructor of the trackdefault interface constructs and returns a new trackdefault object. syntax var trackdefault = new trackdefault(type, language, label, kinds, bytestreamtrackid); parameters type a domstring specifying a media segment data type for the sourcebuffer to contain. can be audio, video, or text. language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track. label a domstring specifying a default label for the sourcebuffer to use when an initialization segment does not contain label information for a new track. kinds an array (sequence) of domstrings specifying default kinds for the sourcebuffer to use when an initialization segment does n...
...ack. bytestreamtrackid optional a domstring specifying the id of the specific track that the sourcebuffer should apply to. if not specified, this value will be an empty string and the sourcebuffer can contain any tracks of the specified type. errors when this constructor is invoked, the following errors can occur: error explanation invalidaccesserror the supplied language is not a valid language code, e.g. en-us. typeerror there are values specified in the kinds array that do not apply to the specified type. example tbd ...
TrackDefault - Web APIs
the trackdefault interface provides a sourcebuffer with kind, label, and language information for tracks that do not contain this information in the initialization segments of a media chunk. a trackdefault object is provided to a sourcebuffer object by setting its sourcebuffer.trackdefaults property. constructor trackdefault() constructs and returns a new trackdefault object. properties trackdefault.type read only returns the type of track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text track.) trackdefault.bytestreamtrackid read only returns the id of the specific track that the sourcebuffer should apply to. ...
...ckdefaults property. constructor trackdefault() constructs and returns a new trackdefault object. properties trackdefault.type read only returns the type of track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text track.) trackdefault.bytestreamtrackid read only returns the id of the specific track that the sourcebuffer should apply to. trackdefault.language read only returns the default language to use when an initialization segment does not contain language information for a new track. trackdefault.label read only returns the default label to use when an initialization segment does not contain label information for a new track. trackdefault.kinds read only returns the default kinds used when an initialization segment does not contain kind i...
VideoTrack - Web APIs
t of the url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main video track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, a track whose kind is "sign" might have a label of "a sign-language interpretation". this string is empty if no label is provided. language read only a domstring specifying the video track's primary language, or an empty string if unknown. the language is specified as a bcp 47 (rfc 5646) language code, such as "en-us" or "pt-br". sourcebuffer read only the sourcebuffer that created the track. returns null if the track was not created by a sourcebuffer or th...
...ar el = document.queryselector("video"); var tracks = el.videotracks; you can then access the media's individual tracks using either array syntax or functions such as foreach(). this first example gets the first video track on the media: var firsttrack = tracks[0]; the next example scans through all of the media's video tracks, activating the first video track that is in the user's preferred language (taken from a variable userlanguage). for (var i = 0; i < tracks.length; i++) { if (tracks[i].language === userlanguage) { tracks[i].selected = true; break; } }); the language is in standard (rfc 5646) format. for us english, this would be "en-us", for example. specifications specification status comment html living standardthe definition of 'videotrac...
WebGL best practices - Web APIs
ons if you expect to pass an essl300 int between shaders, and you need it to have 32-bits, you must use highp or you will have portability problems. ...
... while you can use mediump float instead, but be...
Using the Web Speech API - Web APIs
the speechgrammarlist to the speech recognition instance by setting it to the value of the speechrecognition.grammars property. we also set a few other properties of the recognition instance before we move on: speechrecognition.continuous: controls whether continuous results are captured (true), or just a single result each time recognition is started (false). speechrecognition.lang: sets the language of the recognition. setting this is good practice, and therefore recommended. speechrecognition.interimresults: defines whether the speech recognition system should return interim results, or just final results. final results are good enough for this simple demo. speechrecognition.maxalternatives: sets the number of alternative potential matches that should be returned per result. this can some...
...ptions the device has available, we've written a populatevoicelist() function. we first invoke speechsynthesis.getvoices(), which returns a list of all the available voices, represented by speechsynthesisvoice objects. we then loop through this list — for each voice we create an <option> element, set its text content to display the name of the voice (grabbed from speechsynthesisvoice.name), the language of the voice (grabbed from speechsynthesisvoice.lang), and -- default if the voice is the default voice for the synthesis engine (checked by seeing if speechsynthesisvoice.default returns true.) we also create data- attributes for each option, containing the name and language of the associated voice, so we can grab them easily later on, and then append the options as children of the select. fun...
Window - Web APIs
Web › API › Window
andlers.oninput called when the value of an <input> element changes globaleventhandlers.onkeydown called when you begin pressing any key. see keydown event. globaleventhandlers.onkeypress called when a key (except shift, fn, and capslock) is in pressed position. see keypress event. globaleventhandlers.onkeyup called when you finish releasing any key. see keyup event. windoweventhandlers.onlanguagechange an event handler property for languagechange events on the window. globaleventhandlers.onload called after all resources and the dom are fully loaded. will not get called when the page is loaded from cache, such as with back button. windoweventhandlers.onmessage is an eventhandler representing the code to be called when the message event is raised. globaleventhandlers.onmousedown cal...
....onunload called when the user navigates away from the page. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. error fired when a resource failed to load, or can't be used. for example, if a script has an execution error or an image can't be found or is invalid. also available via the onerror property. languagechange fired at the global scope object when the user's preferred language changes. also available via the onlanguagechange property. orientationchange fired when the orientation of the device has changed. also available via the onorientationchange property. devicemotion fired at a regular interval, indicating the amount of physical force of acceleration the device is receiving and the rate...
WindowEventHandlers - Web APIs
eventhandlers.onbeforeprint is an eventhandler representing the code to be called when the beforeprint event is raised. windoweventhandlers.onbeforeunload is an eventhandler representing the code to be called when the beforeunload event is raised. windoweventhandlers.onhashchange is an eventhandler representing the code to be called when the hashchange event is raised. windoweventhandlers.onlanguagechange is an eventhandler representing the code to be called when the languagechange event is raised. windoweventhandlers.onmessage is an eventhandler representing the code to be called when the message event is raised. windoweventhandlers.onmessageerror is an eventhandler representing the code to be called when the messageerror event is raised. windoweventhandlers.onoffline is an eventha...
...s interface defines no method. specifications specification status comment html living standardthe definition of 'windoweventhandlers' in that specification. living standard no change since the latest snapshot, html 5.1. html 5.1the definition of 'windoweventhandlers' in that specification. recommendation snapshot of html living standard. added onlanguage since the html5 snapshot. html5the definition of 'windoweventhandlers' in that specification. recommendation snapshot of html living standard. creation of windoweventhandlers (properties where on the target before it). ...
Attribute selectors - CSS: Cascading Style Sheets
h an attribute name of attr whose value is exactly value. [attr~=value] represents elements with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly value. [attr|=value] represents elements with an attribute name of attr whose value can be exactly value or can begin with value immediately followed by a hyphen, - (u+002d). it is often used for language subcode matches. [attr^=value] represents elements with an attribute name of attr whose value is prefixed (preceded) by value. [attr$=value] represents elements with an attribute name of attr whose value is suffixed (followed) by value. [attr*=value] represents elements with an attribute name of attr whose value contains at least one occurrence of value within the string. [attr operator va...
...*/ div[lang] { font-weight: bold; } /* all divs without a `lang` attribute are italicized. */ div:not([lang]) { font-style: italic; } /* all divs in us english are blue. */ div[lang~="en-us"] { color: blue; } /* all divs in portuguese are green. */ div[lang="pt"] { color: green; } /* all divs in chinese are red, whether simplifie...
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
article we will fully explore how this fundamental feature of the specification works. starting your exploration of grid with numbered lines is the most logical place to begin, as when you use grid layout you always have numbered lines. the lines are numbered for columns and rows, and are indexed from 1. note that grid is indexed according to the writing mode of the document. in a left to right language such as english line 1 is on the left-hand side of the grid. if you are working in a right-to-left language then line 1 will be the far right of the grid. we will learn more about the interaction between writing modes and grids in a later guide. a basic example as a very simple example we can take a grid with 3 column tracks and 3 row tracks. this gives us 4 lines in each dimension. inside our...
... and padding as a shorthand for example. it may help to realize that this is due to grid using the flow-relative directions defined in the css writing modes specification. we will explore how grids work with writing modes in a later article however we have the concept of four flow-relative directions: block-start block-end inline-start inline-end we are working in english, a left-to-right language. our block-start is the top row line of the grid container, block-end the final row line of the container. our inline-start is the left-hand column line as inline-start is always the point from which text would be written in the current writing mode, inline-end is the final column line of our grid. when we specify our grid area using the grid-area property we first define both start lines block-...
content - CSS: Cascading Style Sheets
Web › CSS › content
normal computes to ...
...value of all counters with the given name in scope at the given pseudo-element, from outermost to innermost, separated by the specified string. the counters are rendered in the indicated style (decimal by default). attr(x) the value of the element's attribute x as a string. if there is no attribute x, an empty string is returned. the case-sensitivity of attribute names depends on the document language. open-quote | close-quote these values are replaced by the appropriate string from the quotes property. no-open-quote | no-close-quote introduces no content, but increments (decrements) the level of nesting for quotes. accessibility concerns css-generated content is not included in the dom. because of this, it will not be represented in the accessibility tree and certain assistive technol...
hyphens - CSS: Cascading Style Sheets
Web › CSS › hyphens
vent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. 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. hyphenation rules are language-specific. in html, the language is determined by the lang attribute, and browsers will hyphenate only if this attribute is present and the appropriate hyphenation dictionary is available. in xml, the xml:lang attribute must be used. note: the rules defining how hyphenation is performed are not explicitly defined by the specification, so the exact hyphenation may vary from browser to browser. ...
...unities. see suggesting line break opportunities below for details. auto the browser is free to automatically break words at appropriate hyphenation points, following whatever rules it chooses. however, suggested line break opportunities (see suggesting 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...
text-emphasis-position - CSS: Cascading Style Sheets
ition: initial; text-emphasis-position: unset; syntax values over draw marks over the text in horizontal writing mode. under draw marks under the text in horizontal writing mode. right draws marks to the right of the text in vertical writing mode. left draw marks to the left of the text in vertical writing mode. description the preferred position of emphasis marks depends on the language. ...
...ical writing mode. description the preferred position of emphasis marks depends on the language. in japanese for example, the preferred position is over right. in chinese, on the other hand, the preferred position is under right. the informative table below summarizes the preferred emphasis mark positions for chinese, mongolian and japanese: preferred emphasis mark and ruby position language preferred position illustration horizontal vertical japanese over right korean mongolian chinese under right note: the text-emphasis-position cannot be set, and therefore are not reset either, using the text-emphasis shorthand property. formal definition initial valueover rightapplies toall elementsinheri...
text-justify - CSS: Cascading Style Sheets
ist of values below. values none the text justification is turned off. this has the same effect as not setting text-align at all, although it is useful if you need to turn justification on and off for some reason. auto the browser chooses the best type of justification for the current situation based on a balance between performance and quality, but also on what is most appropriate for the language of the text (e.g., english, cjk languages, etc.). this is the default justification used if text-justify is not set at all. inter-word the text is justified by adding space between words (effectively varying word-spacing), which is most appropriate for languages that separate words using spaces, like english or korean. inter-character the text is justified by adding space between characters (...
... distribute exhibits the same behaviour as inter-character; this value is kept for backwards compatibility. ...
writing-mode - CSS: Cascading Style Sheets
*/ writing-mode: horizontal-tb; writing-mode: vertical-rl; writing-mode: vertical-lr; /* global values */ writing-mode: inherit; writing-mode: initial; writing-mode: unset; the writing-mode property is specified as one of the values listed below. the flow direction in horizontal scripts is also affected by the directionality of that script, either left-to-right (ltr, like english and most other languages) or right-to-left (rtl, like hebrew or arabic). values horizontal-tb for ltr scripts, content flows horizontally from left to right. for rtl scripts, content flows horizontally from right to left. the next horizontal line is positioned below the previous line. vertical-rl for ltr scripts, content flows vertically from top to bottom, and the next vertical line is positioned to the left of ...
... html the html is a <table> with each writing mode in a row with a column showing text in various scripts using that writing mode. <table> <tr> <th>value</th> <th>vertical script</th> <th>horizontal (ltr) script</th> <th>horizontal (rtl) script</th> <th>mixed script</th> </tr> <tr> <td>horizontal-tb</td> <td class="example text1"><span>我家没有电脑。</...
Ajax - Developer guides
Web › Guide › AJAX
perty of the xmlhttprequest object can be set to change the expected response type from the server. possible values are the empty string (default), arraybuffer, blob, document, json, and text. the response property will contain the entity body according to responsetype, as an arraybuffer, blob, document, json, or string. this article will show some ajax i/o techniques. xml the extensible markup language (xml) is a w3c-recommended general-purpose markup language for creating special-purpose markup languages. it is a simplified subset of sgml, capable of describing many different kinds of data. its primary purpose is to facilitate the sharing of data across different systems, particularly systems connected via the internet. parsing and serializing xml how to parse an xml document from a string, ...
...le of describing many different kinds of data. its primary purpose is to facilitate the sharing of data across different systems, particularly systems connected via the internet. parsing and serializing xml how to parse an xml document from a string, a file or via javascript and how to serialize xml documents to strings, javascript object trees (jxon) or files. xpath xpath stands for xml path language, it uses a non-xml syntax that provides a flexible way of addressing (pointing to) different parts of an xml document. as well as this, it can also be used to test addressed nodes within a document to determine whether they match a pattern or not. filereader api the filereader api lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer...
Using HTML sections and outlines - Developer guides
tion"); document.createelement("time"); </script> <![endif]--> as a last precaution, you could also add an explicit <noscript> element inside the <head> element to warn any users that have javascript disabled that your page relies on javascript: <noscript> <p><strong>this web page requires javascript to be enabled.</strong></p> <p>javascript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.</p> <p><a href="https://goo.gl/koeeaj">how to enable javascript?</a></p> </noscript> this leads to the following code to allow the support of the html5 sections and headings elements in non-html5 browsers, even for internet explorer (8 and older), with a proper fallback for the case where this latter browser is configured no...
...this isn't a really bad thing neccessarily — sites will often have a few validation errors — but it's something to be aware of still. conclusion the new semantic el...
Introduction to Web development - Developer guides
css concepts — grouping, pseudo-classes and more. javascript beginning getting started with javascript — what is javascript and how can it help you? javascript reference guide — a comprehensive, regularly updated guide to javascript for all levels of learning from beginner to advanced. crockford on javascript — an in-depth video series on the javascript language. ...
...ensive, regularly updated guide to javascript for all levels of learning from beginner to advanced. crockford on javascript — an in-depth video series on the javascript language. eloquent javascript — a comprehensive guide to intermediate and advanced javascript methodologies intermediate a re-introduction to javascript — a recap on the javascript programming language aimed at intermediate-level developers essential javascript design patterns — an introduction to essential javascript design patterns introduction to object-oriented javascript — learn about the javascript object model. christian heilmann's javascript best practices — learn about some of the obvious and (not so) obvious best practices when writing javascript. advanc...
HTTP headers - HTTP
Web › HTTP › Headers
the current transaction finishes. keep-alive controls how long a persistent connection should stay open. content negotiation accept informs the server about the types of data that can be sent back. accept-charset which character encodings the client understands. accept-encoding the encoding algorithm, usually a compression algorithm, that can be used on the resource sent back. accept-language informs the server about the human language the server is expected to send back. this is a hint and is not necessarily under the full control of the user: the server should always pay attention not to override an explicit user choice (like selecting a language from a dropdown). controls expect indicates expectations that need to be fulfilled by the server to properly handle the request. m...
...smitted should be displayed inline (default behavior without the header), or if it should be handled like a download and the browser should present a “save as” dialog. message body information content-length the size of the resource, in decimal number of bytes. content-type indicates the media type of the resource. content-encoding used to specify the compression algorithm. content-language describes the human language(s) intended for the audience, so that it allows a user to differentiate according to the users' own preferred language. content-location indicates an alternate location for the returned data. proxies forwarded contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request. x-forwa...
Closures - JavaScript
name); } return displayname; } var myfunc = makefunc(); myfunc(); running this code has exactly the same effect as the previous example of the init() function above. what's different (and interesting) is that the displayname() inner function is returned from the outer function before being executed. at first glance, it might seem unintuitive that this code still works. in some programming languages, the local variables within a function exist for just the duration of that function's execution. once makefunc() finishes executing, you might expect that the name variable would no longer be accessible. however, because the code still works as expected, this is obviously not the case in javascript. the reason is that functions in javascript form closures. a closure is the combination of a func...
...this case hyperlinks) as demonstrated in the following code example. document.getelementbyid('size-12').onclick = size12; document.getelementbyid('size-14').onclick = size14; document.getelementbyid('size-16').onclick = size16; <a href="#" id="size-12">12</a> <a href="#" id="size-14">14</a> <a href="#" id="size-16">16</a> run the code using jsfiddle. emulating private methods with closures languages such as java allow you to declare methods as private, meaning that they can be called only by other methods in the same class. javascript does not provide a native way of doing this, but it is possible to emulate private methods using closures. private methods aren't just useful for restricting access to code. they also provide a powerful way of managing your global namespace. the following co...
Concurrency model and the event loop - JavaScript
runtime concepts the following sections explain a theoretical model. modern javascript engines implement and heavily optimize the described semantics. visual representation stack function calls form a stack of frames. ...
...mmunicating together a web worker or a cross-origin iframe has its own stack, heap, and message queue. two distinct runtimes can only communicate through sending messages via the postmessage method. this method adds a message to the other runtime if the latter listens to message events. never blocking a very interesting property of the event loop model is that javascript, unlike a lot of other languages, never blocks. handling i/o is typically performed via events and callbacks, so when the application is waiting for an indexeddb query to return or an xhr request to return, it can still process other things like user input. legacy exceptions exist like alert or synchronous xhr, but it is considered a good practice to avoid them. beware: exceptions to the exception do exist (but are usually imp...
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 following...
...for instance, english and spanish are written using the latin script while arabic and russian are written with other scripts (respectively arabic and cyrillic). the script and script_extensions unicode properties allow regular expression to match characters according to the script they are mainly used with (script) or according to the set of script...
Inheritance and the prototype chain - JavaScript
when it comes to inheritance, javascript only has one construct: objects. each object has a private property which holds a link to another object called its prototype. that prototype object has a prototype of its own, and so on until an object is reached with null as its prototype. by definition, null has no prototype, and acts as the final link in this prototype chain. ...
...pe. // o.[[prototype]].[[prototype]].[[prototype]] is null, stop searching, // no property found, return undefined. code link setting a property to an object creates an own property. the only exception to the getting and setting behavior rules is when there is an inherited property with a getter or a setter. inheriting "methods" javascript does not have "methods" in the form that class-based languages define them. in javascript, any function can be added to an object in the form of a property. an inherited function acts just as any other property, including property shadowing as shown above (in this case, a form of method overriding). when an inherited function is executed, the value of this points to the inheriting object, not to the prototype object where the function is an own property. ...
SyntaxError: missing ) after condition - JavaScript
the javascript exception "missing ) after condition" occurs when there is an error with how an if condition is written. it must appear in parenthesis after the if keyword. message syntaxerror: expected ')' (edge) syntaxerror: missing ) after condition (firefox) error type syntaxerror what went wrong? there is an error with how an if condition is written. in any programming language, code needs to make decisions and carry out actions accordingly depending on different inputs. the if statement executes a statement if a specified condition is truthy. in javascript, this condition must appear in parenthesis after the if keyword, like this: if (condition) { // do something if the condition is true } examples missing parenthesis it might just be an oversight, carefully check all you parent...
...mples missing parenthesis it might just be an oversight, carefully check all you parenthesis in your code. if (3 > math.pi { console.log("wait what?"); } // syntaxerror: missing ) after condition to fix this code, you would need to add a parenthesis that closes the condition. if (3 > math.pi) { console.log("wait what?"); } misused is keyword if you are coming from another programming language, it is also easy to add keywords that don't mean the same or have no meaning at all in javascript. if (done is true) { console.log("we are done!"); } // syntaxerror: missing ) after condition instead you need to use a correct comparison operator. for example: if (done === true) { console.log("we are done!"); } ...
SyntaxError: Unexpected token - JavaScript
this might be a simple typo. examples expression expected for example, when chaining expressions, trailing commas are not allowed. ...
...ing else was provided. this might be a simple typo. message syntaxerror: expected expression, got "x" syntaxerror: expected property name, got "x" syntaxerror: expected target, got "x" syntaxerror: expected rest argument name, got "x" syntaxerror: expected closing parenthesis, got "x" syntaxerror: expected '=>' after argument list, got "x" error type syntaxerror what went wrong? a specific language construct was expected, but something else was provided. this might be a simple typo. examples expression expected for example, when chaining expressions, trailing commas are not allowed. for (let i = 0; i < 5,; ++i) { console.log(i); } // syntaxerror: expected expression, got ')' correct would be omitting the comma or adding another expression: for (let i = 0; i < 5; ++i) { console.lo...
setter - JavaScript
etter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another set or with a data entry for the same property. ( { set x(v) { }, set x(v) { } } and { x: ..., set x(v) { } } are forbidden ) examples defining a setter on new objects in object initializers the following example define a pseudo-property current of object language. when current is assigned a value, it updates log with that value: const language = { set current(name) { this.log.push(name); }, log: [] } language.current = 'en'; console.log(language.log); // ['en'] language.current = 'fa'; console.log(language.log); // ['en', 'fa'] note that current is not defined, and any attempts to access it will result in undefined. removing a setter with ...
... set current(name) { this.log.push(name); }, log: [] } language.current = 'en'; console.log(language.log); // ['en'] language.current = 'fa'; console.log(language.log); // ['en', 'fa'] note that current is not defined, and any attempts to access it will result in undefined. removing a setter with the delete operator if you want to remove the setter, you can just delete it: delete language.current; defining a setter on existing objects using defineproperty to append a setter to an existing object, use object.defineproperty(). const o = {a: 0}; object.defineproperty(o, 'b', { set: function(x) { this.a = x / 2; } }); o.b = 10; // runs the setter, which assigns 10 / 2 (5) to the 'a' property console.log(o.a) // 5 using a computed property name const expr = 'foo'; const o...
Intl.Collator() constructor - JavaScript
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. ...
...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. ...
Intl.DisplayNames.prototype.of() - JavaScript
https://github.com/mdn/interactive-examples and send us a pull request. syntax displaynames.of(code); parameters 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 la...
...rs 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'], {type: 'region'}); regionnames.of('419'); // "latin america" let languagenames = new intl.displaynames(['en'], {type: 'language'}); languagenames.of('fr'); // "french" let currencynames = new intl.displaynames(['en'], {type: 'currency'}); currencynames.of('eur'); // "euro" specifications specification intl.displaynamesthe definition of 'of()' in that specification. ...
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
e and style formatting options computed during the 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 "na...
...at 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 property in the options argument of the constructor or the default value ("language"). its value is either "language", "region", "script", or "currency". fallback the value provided for this property in the options argument of the constructor or the default value ("code"). its value is either "code" or "none". examples using resolvedoptions const displaynames = new intl.displaynames(['de-de'], {type: 'region'}); const usedoptions = displaynames.resolvedoptions(); console.
Intl.ListFormat - JavaScript
the intl.listformat object is a constructor for objects that enable language-sensitive list formatting. 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. constructor intl.listformat() creates a new listformat object. static methods intl.listformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.listformat.prototype.format() returns a language-specific formatted string representing the elements of the list. intl.listformat.prototype.formattoparts() returns an array of object...
....listformat.prototype.format() returns a language-specific formatted string representing the elements of the list. intl.listformat.prototype.formattoparts() returns an array of objects representing the different components that can be used to format a list of values in a locale-aware fashion. examples using format the following example shows how to create a list formatter using the english language. const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', { style: 'long', type: 'conjunction' }).format(list)); // > motorcycle, bus and car console.log(new intl.listformat('en-gb', { style: 'short', type: 'disjunction' }).format(list)); // > motorcycle, bus or car console.log(new intl.listformat('en-gb', { style: 'narrow', type: 'unit' }).format(list)); // > mo...
Intl.Locale.prototype.collation - JavaScript
locale, which is used to order strings according to the locale's rules. description collation is the process of ordering strings of characters. it is used whenever strings must be sorted and placed into a certain order, 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 characte...
... phonetic phonetic ordering (sorting based on pronunciation) pinyin pinyin ordering for latin and for cjk characters (used in chinese) reformed reformed ordering (such as in swedish) search special collation type for string search searchjl special collation type for korean initial consonant search standard default ordering for each language stroke pinyin ordering for latin, stroke order for cjk characters (used in chinese) trad traditional style ordering (such as in spanish) unihan pinyin ordering for latin, unihan radical-stroke ordering for cjk characters (used in chinese) zhuyin pinyin ordering for latin, zhuyin order for bopomofo and cjk characters (used in chinese) ...
Intl.Locale.prototype.minimize() - JavaScript
u'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.minimize() return value a locale instance whose basename property returns the result of the remove likely subtags algorithm executed against locale.basename. ...
...roject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax locale.minimize() return value a locale instance whose basename property returns the result of the remove likely subtags algorithm executed against locale.basename. description this method carries out the reverse of maximize(), removing any language, script, or region subtags from the locale language identifier (essentially the contents of basename). this is useful when there are superfluous subtags in the language identifier; for instance, "en-latn" can be simplified to "en", since "latn" is the only script used to write english. minimize() only affects the main subtags that comprise the language identifier: language, script, and region subtags. other subtags after the "-u" in the locale ind...
Intl.Locale.prototype.region - JavaScript
world (usually a country) associated with the locale. description the region is an essential part of the locale identifier, as it places the locale in a specific area of the world. knowing the locale's region is vital to identifying differences between locales. ...
...here 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 region subtag...
Intl.Locale.prototype.script - JavaScript
the intl.locale.prototype.script property is an accessor property which returns the script used for writing the particular language used in the locale. description a script, sometimes called writing system, is one of the core attributes of a locale. it indicates the set of symbols, or glyphs, that are used to write a particular language. 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 ...
...note that the script is not a required part of a locale identifier. ...
Intl.NumberFormat() constructor - JavaScript
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. ...
...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. ...
Intl.RelativeTimeFormat() constructor - JavaScript
for the general form and interpretation of the locales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see intl. ...
... output. 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 the short style for some locales. examples basic format usage the following example shows how to create a relative time formatter using the english language. // create a relative time formatter in your locale // with default values explicitly passed in. const rtf = new intl.relativetimeformat("en", { localematcher: "best fit", // other values: "lookup" numeric: "always", // other values: "auto" style: "long", // other values: "short" or "narrow" }); // format relative time using negative value (-1). rtf.format(-1, "day"); // > "1 day ag...
Intl.RelativeTimeFormat - 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. constructor intl.relativetimeformat.relativetimeformat() creates a new intl.relativetimeformat object. static methods intl.relativetimeformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
...ects representing the relative time format in parts that can be used for custom locale-aware formatting. intl.relativetimeformat.prototype.resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during initialization of the object. examples basic format usage the following example shows how to use a relative time formatter for the english language. // create a relative time formatter in your locale // with default values explicitly passed in. const rtf = new intl.relativetimeformat("en", { localematcher: "best fit", // other values: "lookup" numeric: "always", // other values: "auto" style: "long", // other values: "short" or "narrow" }); // format relative time using negative value (-1). rtf.format(-1, "day"); // > "1 day ag...
Intl.getCanonicalLocales() - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax intl.getcanonicallocales(locales) parameters locales a list of string values for which to get the canonical locale names. return value an array containing the canonical locale names. ...
...locales) parameters locales a list of string values for which to get the canonical locale names. return value an array containing the canonical locale names. examples using getcanonicallocales intl.getcanonicallocales('en-us'); // ["en-us"] intl.getcanonicallocales(['en-us', 'fr']); // ["en-us", "fr"] intl.getcanonicallocales('en_us'); // rangeerror:'en_us' is not a structurally valid language tag specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.getcanonicallocales' in that specification. ...
RegExp - JavaScript
uctor function, the normal string escape rules (preceding special characters with \ when included in a string) are necessary. for example, the following are equivalent: let re = /\w+/ let re = new regexp('\\w+') perl-like regexp properties note that several of the regexp properties have both long and short (perl-like) names. both names always refer to the same value. (perl is the programming language from which javascript modeled its regular expressions.). see also deprecated regexp properties. constructor regexp() creates a new regexp object. static properties get regexp[@@species] the constructor function that is used to create derived objects. regexp.lastindex the index at which to start the next match. instance properties regexp.prototype.flags a string that contains th...
...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 regex = /[\u0400-\u04ff]+/g let match = regex.exec(text) console.log(match[0]) // logs 'Образец' console.log(regex.lastindex) // l...
Destructuring assignment - JavaScript
ay literal expressions provide an easy way to create ad hoc packages of data. const x = [1, 2, 3, 4, 5]; the destructuring assignment uses similar syntax, but on the left-hand side of the assignment to define what values to unpack from the sourced variable. const x = [1, 2, 3, 4, 5]; const [y, z] = x; console.log(y); // 1 console.log(z); // 2 this capability is similar to features present in languages such as perl and python. examples array destructuring basic variable assignment const foo = ['one', 'two', 'three']; const [red, yellow, green] = foo; console.log(red); // "one" console.log(yellow); // "two" console.log(green); // "three" assignment separate from declaration a variable can be assigned its value via destructuring separate from the variable's declaration. let a, b; [a, b...
...); // 2 default values a variable can be assigned a default, in the case that the value unpacked from the array is undefined. let a, b; [a=5, b=7] = [1]; console.log(a); // 1 console.log(b); // 7 swapping variables two variables values can be swapped in one destructuring expression. without destructuring assignment, swapping two values requires a temporary variable (or, in some low-level languages, the xor-swap trick). let a = 1; let b = 3; [a, b] = [b, a]; console.log(a); // 3 console.log(b); // 1 const arr = [1,2,3]; [arr[2], arr[1]] = [arr[1], arr[2]]; console.log(arr); // [1,3,2] parsing an array returned from a function it's always been possible to return an array from a function. destructuring can make working with an array return value more concise. in this example, f() ret...
Exponentiation (**) - JavaScript
ccepts bigints as operands. 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 operator: var1 ** var2 description the exponentiation operator is right-associative: a ** b ** c is equal to a ** (b ** c). in most languages, such as php, python, and others that have an exponentiation operator (**), the exponentiation operator is defined to have a higher precedence than unary operators, such as unary + and unary -, but there are a few exceptions. for example, in bash, the ** operator is defined to have a lower precedence than unary operators. in javascript, it is impossible to write an ambiguous exponentiation expr...
...d unary -, but there are a few exceptions. for example, in bash, the ** operator is defined to have a lower precedence than unary operators. in javascript, it is impossible to write an ambiguous exponentiation expression. that is, you cannot put a unary operator (+/-/~/!/delete/void/typeof) immediately before the base number; doing so will cause a syntaxerror. -2 ** 2; // 4 in bash, -4 in other languages. // this is invalid in javascript, as the operation is ambiguous. -(2 ** 2); // -4 in javascript and the author's intention is unambiguous. note that some programming languages use the caret symbol ^ for exponentiation, but javascript uses that symbol for the bitwise logical xor operator. examples basic exponentiation 2 ** 3 // 8 3 ** 2 // 9 3 ** 2.5 // 15.588457268119896 10 ** -1 // ...
Expressions and operators - JavaScript
expressions and operators by category for an alphabetical listing see the sidebar on the left. primary expressions basic keywords and general expressions in javascript. this the this keyword refers to a special property of an execution context. function the function keyword defines a function expression. class the class keyword defines a class expression. function* the function* keyword defines a generator function expression. yield pause and resume a generator function. yield* delegate to another generator function or iterable object. async function the async function defines an async function expression. ...
... ...
Strict mode - JavaScript
nsiderable amount of magical behavior in normal code: eval to add or remove bindings and to change binding values, and arguments by its indexed properties aliasing named arguments. strict mode makes great strides toward treating eval and arguments as keywords, although full fixes will not come until a future edition of ecmascript. first, the names eval and arguments can't be bound or assigned in language syntax. all these attempts to do so are syntax errors: 'use strict'; eval = 17; arguments++; ++eval; var obj = { set p(arguments) { } }; var eval; try { } catch (arguments) { } function x(eval) { } function arguments() { } var y = function eval() { }; var f = new function('arguments', "'use strict'; return 17;"); second, strict mode code doesn't alias properties of arguments objects created wi...
...e websites now provide ways for users to write javascript which will be run by the website on behalf of other users. javascript in browsers can access the user's private information, so such javascript must be partially transformed before it is run, to censor access to forbidden functionality. javascript's flexibility makes it effectively impossible to do this without many runtime checks. certain language functions are so pervasive that performing runtime checks has a considerable performance cost. a few strict mode tweaks, plus requiring that user-submitted javascript be strict mode code and that it be invoked in a certain manner, substantially reduce the need for those runtime checks. first, the value passed as this to a function in strict mode is not forced into being an object (a.k.a. "boxed"...
Web technology reference
together, can be used to create everything from simple sites to powerful web applications. below you'll find links to a selection of key documentation for each. if you're new to web development, consider starting with our learning area, which is filled with step-by-step tutorials that will guide you from total webdev newbie to at least semi-pro! html — structuring the web hypertext markup language is used to define and describe semantically the content (markup) of a web page in a well-structured format. html provides a means to create structured documents made up of blocks called html elements that are delineated by tags, written using angle brackets. some introduce content into the page directly, others provide information about document text and may include other tags as sub-elements. ob...
...terpret the content of the page. introduction to html | learn html | html5 | developer guide | element reference | reference css — styling the web cascading style sheets are used to describe the appearance of web content. introduction to css | getting started with css | learn css | common css questions | reference javascript — dynamic client-side scripting the javascript programming language is used to add interactivity and other dynamic features to web sites. learn javascript | developer guide | reference ...
contentStyleType - SVG: Scalable Vector Graphics
the contentstyletype attribute specifies the style sheet language for the given document fragment on the <svg> element. this language is used for all instances of style that do not specify their own styling language, such as the style attribute that is available on many elements. the value specifies a media type, per mime part two: media types [rfc2046]. usage notes value one of the content types specified in the media types default value text/css animatable no since css is the only widely deployed style sheet language for online styling and it's already defined as default value if contentstyletype is ommitted, the attribute is not well supported in user agents. ...
...ia types [rfc2046]. usage notes value one of the content types specified in the media types default value text/css animatable no since css is the only widely deployed style sheet language for online styling and it's already defined as default value if contentstyletype is ommitted, the attribute is not well supported in user agents. if other style sheet languages become more popular they might not use the style attribute, instead it could be easily declared which style language is used in the <style>'s type attribute. the use of contentstyletype is therefore deprecated. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'contentscripttype' in that specification. ...
lang - SVG: Scalable Vector Graphics
Web › SVG › Attribute › lang
the lang attribute specifies the primary language used in contents and attributes containing text content of particular elements. there is also an xml:lang attribute (with namespace). if both of them are defined, the one with namespace is used and the one without is ignored. in svg 1.1 there was a lang attribute defined with a different meaning and only applying to <glyph> elements. that attribute specified a list of languages in bcp 47 format. the glyph was meant to be used if the xml:lang attribute exactly matched one of the languages given in the value of this parameter, or if the xml:lang attribute exactly equaled a prefix of one of the languages given in the value of this parameter such that the first tag character following the prefix was "-". all elements are using this attribute. <sv...
...e of this parameter, or if the xml:lang attribute exactly equaled a prefix of one of the languages given in the value of this parameter such that the first tag character following the prefix was "-". all elements are using this attribute. <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <text lang="en-us">this is some english text</text> </svg> usage notes value <language-tag> default value none animatable no <language-tag> this value specifies the language used for the element. the syntax of this value is defined in the bcp 47 specification. the most common syntax is a value formed by a lowercase two-character part for the language and an uppercase two-character part for the region or country, separated by a minus sign, e.g. ...
text-anchor - SVG: Scalable Vector Graphics
ld 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> usage notes default value start value start | middle | end animatable yes start the rendered characters are aligned such that the start of the text string is at the initial current text position. for an element with a direction property value of ltr (typical for most european languages), the left side of the text is rendered at the initial text position. for an element with a direction property value of rtl (typical for arabic and hebrew), the right side of the text is rendered at the initial text position. for an element with a vertical primary text direction (often typical for asian text), the top side of the text is rendered at the initial text position. middle the render...
... determined. then, the text string is mapped onto the path with this midpoint placed at the current text position.) end the rendered characters are shifted such that the end of the resulting rendered text (final current text position before applying the text-anchor property) is at the initial current text position. for an element with a direction property value of ltr (typical for most european languages), the right side of the text is rendered at the initial text position. for an element with a direction property value of rtl (typical for arabic and hebrew), the left side of the text is rendered at the initial text position. for an element with a vertical primary text direction (often typical for asian text), the bottom of the text is rendered at the initial text position. specifications ...
xml:lang - SVG: Scalable Vector Graphics
the xml:lang attribute specifies the primary language used in contents and attributes containing text content of particular elements. it is a universal attribute allowed in all xml dialects to mark up the natural human language that an element contains. there is also a lang attribute (without namespace). if both of them are defined, the one with namespace is used and the one without is ignored. all elements are using this attribute. <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <text xml:lang="en-us">this is some english text</text> </svg> usage notes value <language-tag> default value none animatable no <language-tag> this value specifies the language used for the element. the syntax of this value is defined in the bcp 47...
...en-us for us english or de-at for austrian german. ...
SVG Attribute reference - SVG: Scalable Vector Graphics
Web › SVG › Attribute
s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stddeviation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-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 vie...
...k:href xlink:role xlink:show xlink:title xlink:type xml:base xml:lang xml:space y y y1 y2 ychannelselector z z zoomandpan svg attributes by category generic attributes core attributes id, lang, tabindex, xml:base, xml:lang, xml:space style attributes class, style conditional processing attributes externalresourcesrequired, requiredextensions, requiredfeatures, systemlanguage. xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate presentation attributes note that all svg presentation attributes can be used as css properties. alignment-baseline, baseline-shift, clip, clip-path, clip-rule, color, color-interpolation, color-interpolation-filters, color-profile, color-rendering, cursor, direction, display, dominant...
<a> - SVG: Scalable Vector Graphics
Web › SVG › Element › a
ment. try the @namespace rule to distinguish the two. attributes download instructs browsers to download a url instead of navigating to it, so the user will be prompted to save it as a local file. value type: <string> ; default value: none; animatable: no href the url or url fragment the hyperlink points to. value type: <url> ; default value: none; animatable: yes hreflang the human language of the url or url fragment that the hyperlink points to. value type: <string> ; default value: none; animatable: yes ping a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. for a more widely-supported feature addressing the same use cases, see navigator.sendbea...
... yes xlink:href deprecated since svg 2 the url or url fragment that the hyperlink points to. may be required for backwards compatibility for older browsers. ...
<svg> - SVG: Scalable Vector Graphics
Web › SVG › Element › svg
lements or inside html documents. html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg" stroke="red" fill="grey"> <circle cx="50" cy="50" r="40" /> <circle cx="150" cy="50" r="4" /> <svg viewbox="0 0 10 10" x="200" width="100"> <circle cx="5" cy="5" r="4" /> </svg> </svg> attributes baseprofile deprecated since svg 2 the minimum svg language profile that the document requires. value type: <string> ; default value: none; animatable: no contentscripttype deprecated since svg 2 the default scripting language used by the svg fragment. value type: <string> ; default value: application/ecmascript; animatable: no contentstyletype deprecated since svg 2 the default style sheet language used by the svg fragment. value type: <string> ; ...
...vg elements. value type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning these attributes can also be used as css properties. ...
lang - XPath
Web › XPath › Functions › lang
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the lang function determines whether the context node matches the given language and returns boolean true or false. syntax lang(string ) arguments string the language code or localization (language and country) code to be matched. returns true if the context node matches the given languages. otherwise, false. notes a node's language is determined by its xml:lang attribute. if the current node does not have an xml:lang attribute, then the value of the xml:lang attribute of the nearest ancestor that has an xml:lang attribute will determine the current node's language. if the language cannot be determined (no ancestor has an xml:lang attribute), this function will return false. if the...
...the converse is not true. ...
Index - XPath
Web › XPath › Index
it uses a non-xml syntax to provide a flexible way of addressing (pointing to) different parts of an xml document. it can also be used to test addressed nodes within a document to determine whether they match a pattern or not. ...
...slt, xslt_reference the id function finds nodes matching the given ids and returns a node-set containing the identified nodes. 33 key xslt, xslt_reference the key function returns a node-set of nodes that have the given value for the given key. 34 lang xslt, xslt_reference the lang function determines whether the context node matches the given language and returns boolean true or false. 35 last xslt, xslt_reference the last function returns a number equal to the context size from the expression evaluation context. 36 local-name xslt, xslt_reference the local-name function returns a string representing the local name of the first node in a given node-set. 37 name xslt, xslt_reference ...
XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes xpath stands for xml path language. it uses a non-xml syntax to provide a flexible way of addressing (pointing to) different parts of an xml document. it can also be used to test addressed nodes within a document to determine whether they match a pattern or not. xpath is mainly used in xslt, but can also be used as a much more powerful way of navigating through the dom of any xml-like language document using xpathexpression, such as html and svg, instead of relying on the document.getelementbyid() or parentnode.queryselectorall() methods, the node.childnodes properties, and other dom core features. xpath uses a path notation (as in urls) for navigating through the hierarchical structure of an xml doc...
...e of the technologies, and guides the reader through background, context, structure, concepts, and introductory terminology. jxon jxon (lossless javascript xml object notation) is a generic name by which is defined the representation of javascript objects using xml. there are some cases in which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example). in these cases jxon could represent the most practical way and valid alternative to xpath. view all... tools chropath xpath panel that integrates tightly into firebug, providing an editor and inspector (firefox add-on). xmlquire (formerly known as sketchpath) a graphical xpath builder/debugger(.net). xpath tester an online xpath builder/debug...
Converting WebAssembly text format to wasm - WebAssembly
tation, an intermediate form designed to be exposed in text editors, browser developer tools, etc. this article explains a little bit about how it works, and how to use available tools to convert text format files to the .wasm assembly format. note: text format files are usually saved with a .wat extension. historically, a .wast extension was also used, however that's now used for the scripting language used by the webassembly testsuite. a first look at the text format let’s look at a simple example of this — the following program imports a function called imported_func from a module called imports, and exports a function called exported_func: (module (func $i (import "imports" "imported_func") (param i32)) (func (export "exported_func") i32.const 42 call $i ) ) the webass...
...nction called imported_func, which is run with the value (42) provided as a parameter. converting the text .wat into a binary .wasm file let’s have a go at converting the above .wat text representation example into .wasm assembly format. to start with, make a copy of the above listing inside a text file; call it simple.wat. we need to assemble this textual representation into the assembly language the browser actually reads before we can use it. to do this, we can use the wabt tool, which includes compilers to convert between webassembly’s text representation and wasm, and vice versa, plus more besides. go to https://github.com/webassembly/wabt — follow the instructions on this page to set up the tool. once you’ve got the tool built, add the /wabt/out/clang/debug directory to your s...
Classes and Inheritance - Archive of obsolete content
es of the class. each class defines one or more members, which are initialized to a given value when the class is instantiated. data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior. inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. unlike languages like c++ and java, javascript does not have native support for classical inheritance. instead, it uses something called prototypal inheritance. as it turns out, it is possible to emulate classical inheritance using prototypal inheritance, but not without writing a significant amount of boilerplate code. classes in javascript are defined using constructor functions. each constructor function has...
Two Types of Scripts - Archive of obsolete content
ou should store them under the data directory under your add-on's root. to learn all about content scripts read the working with content scripts guide. api access for add-on code and content scripts the table below summarizes the apis that are available to each type of script. api add-on code content script the global objects defined in the core javascript language, such as math, array, and json. see the reference at mdn. ✔ ✔ the require() and exports globals defined by version 1.0 of the commonjs module specification. you use require() to import functionality from another module, and exports to export functionality from your module. if require() is available, then so are the modules supplied in the sdk. ✔ ✘ th...
l10n - Archive of obsolete content
_string= hello! and the following code: var _ = require("sdk/l10n").get; console.log(_("hello_string")); the following output will be logged: info: hello! if this function can't find the string referenced by the identifier parameter, it returns the identifier itself. this enables you to write functional, localizable code without localizing any strings - just make the identifiers the default language: var _ = require("sdk/l10n").get; console.log(_("hello!")); however, this will make it more difficult to maintain your code if you have many localizations, because any changes to the identifier values break all your .properties files. if you're supplying different localizations for a string depending on the number of items (that is, whether to use a singular or plural form) then get() takes a ...
Bootstrapped extensions - Archive of obsolete content
nifest compatibility landed. js and jsm files - using property files to localize your .js and .jsm files you have to use property files. the absolute minimum needed here is: file: install.rdf file: chrome.manifest file: bootstrap.js folder: locale folder: valid_locale_here file: anything.properties in the locale folder you must have folders for each of the languages you want to provide; each folder must be named a valid locale (ex: en-us). inside this folder must be a property file. inside the chrome.manifest file these locale must be defined. for example if you had a subfolder of en-us in locale folder your chrome.manifest file will have to contain: locale name_of_your_addon en-us locale/ here is an example: github :: l10n-properties - on startup of this ...
Embedding SVG - Archive of obsolete content
embedding in xhtml make sure you use the right namespace when embedding. notice the template and example use xhtml to handle the namespacing. ...
Examples and demos from articles - Archive of obsolete content
e has changed since last visit here is a possible example of how to show an alert message when an external page changes. import scripts here is a possible example of how to dynamically import scripts with javascript. css css tutorial aimed at complete beginners, this css tutorial for beginners introduces you to cascading style sheets (css). it guides you through the basic features of the language with practical examples that you can try for yourself on your own computer and illustrates the standard features of css that work in modern browsers. dropdown menus rules how to create pure-css dropdown menus. ...
JavaScript Daemons Management - Archive of obsolete content
here are some code snippets that simplify and abstract the management of daemons. the following daemons management framework is the major version of setinterval – a little framework. introduction sometimes a page uses dozens and dozens of animations. ...
JavaScript timers - Archive of obsolete content
cancels repeated action which was set up using setinterval(). clearimmediate() cancels the immediate actions, just like cleartimeout() for settimeout(). using javascript timers within animations (javascript daemons management) in computer science a daemon is a task that runs as a background process, rather than being under the direct control of an interactive user. in javascript programming language, all daemons are processes created by javascript timers or by a worker instantiation. here are some code snippets which simplify and abstract the management of daemons. requestanimationframe() requestanimationframe() tells the browser that you wish to perform an animation and requests that the browser schedule a repaint of the window for the next animation frame. the method takes as an argument...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
implementations for all methods so you don't have any additional linking dependencies. otherwise you will have to link statically to your module if you use these public headers in other modules. personally i would discourage this practice (among other things, static linking means the same code gets loaded more than once into memory, and the code won't be available from javascript or other non-c++ languages) and encourage the use of xpcom wherever possible. the makefile in the public/ directory should follow this model: depth = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = myextension xpidl_module = myextension xpi_name = myextension exports = \ myheader.h \ $(null) xpidlsrcs = \ myifirstco...
Extension Versioning, Update and Compatibility - Archive of obsolete content
n-interactive use: sha256sum file there is also md5deep, which is cross platform: sha256deep file openssl also generates hashes for you: openssl sha256 file if you're on windows, hashtab is a shell extension... simple right-click gives you hash values for any file. there is also an enhancement bug about adding automatic hash generation of xpi files to mccoy. and all popular (scripting) languages offer support, for examples: python, perl: cpan digest, php signing update manifests if you wish to serve your update rdf over regular http, gecko 1.9 based applications will require that you digitally sign the update manifest to ensure that it's information isn't tampered with between you creating it and applications retrieving it. the mccoy tool should be used to sign the update rdf. the ...
Extension Etiquette - Archive of obsolete content
cument. ids firefox/thunderbird 1.5 or later are much more strict about the ids of extensions than their 1.0 counterparts. make sure they're valid. version numbering please follow the mozilla pattern: major version dot current incarnation dot security/bugfix release (like 1.0.7). internationalization locales always use locale dtds and property files, even if providing your extension in one language. it will make translation of your extension to another language easier. it occurs more often than you would think. options firefox users like options. lots of options. try to include everything a user could ever want to customize in your extension, remembering more can be added later. for a large number of options for your extension, break the options window into multiple pages (tabs) that are ...
Chapter 1: Introduction to Extensions - Archive of obsolete content
firms and runs updates provides access to add-ons' settings dialogs provides access to add-ons' support sites development environment amenities initially, there wasn't adequate documentation available, and extension developers were largely left to fend for themselves1; however, now there's a considerable store of knowledge. because firefox and its extensions are designed to support multiple languages, excellent extensions come from all over the world, and can be quickly localized by anyone interested. this lowers the threshold both to using and to developing extensions; that fact, combined with firefox's rapidly growing popularity, has created a positive feedback loop, with the number of extension users and extension developers growing explosively—there are now more than 7000 extensions a...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
in line with that framework are referred to as xpcom components, and sometimes the components are simply referred to as xpcoms. firefox itself includes a great number of xpcom components, and they can be used in extensions as well. sometimes an extension will be packaged with a special xpcom component developed specifically for it. note: if you're developing components in c++ or other compiled languages, be sure to include binaries for every platform. reference materials to get an idea of what kinds of functions embedded xpcom can handle, take a look at the api reference and the interface definitions from xpidl in the actual source code. note: interface definition language (idl) is a language for giving standard definitions of objects, methods, and so forth. the xpidl (cross-platform idl) ...
Getting Started with Firefox Extensions - Archive of obsolete content
new to one or more mozilla applications. this tutorial focuses on extensions for firefox, but the same (or very similar) principles apply to creating extensions for other applications such as thunderbird, seamonkey, and flock. it is also worth noting that there are differences between the definition of extension and add-on. all extensions are add-ons, but add-ons can also be themes, plugins, or language packs. this tutorial is about extension development, but themes and language packs are developed in a very similar way. plugins are entirely different, and they will not be covered here. you can read more about plugins and their development in the plugins page. firefox provides a very rich and flexible architecture that allows extension developers to add advanced features, customize the user's e...
JavaScript Object Management - Archive of obsolete content
an anonymous function. that is, something like function() { /* your code, usually a single function call. */ }. if you have to use a reference to this inside the function, declare a variable called that that equals this, and use that in the anonymous function. javascript has a host of features that make it extremely flexible, but it also has some disadvantages, as it is not as strict as other languages, such as java. a clear example of this is the fact that there are no private or public keywords that allow you to protect object members. as a alternative for this, a naming standard is frequently used to distinguish private and public members. there's no scope enforcement whatsoever, but this standard give others the chance to "play nice" and don't use private members. use "_" at the beginni...
Local Storage - Archive of obsolete content
ers. localdir.create(ci.nsifile.directory_type, 0774); } return localdir; }, profd is a special identifier for the profile directory that exists so that you don't need to figure out its location. in general this is the only directory flag you'll need, but sometimes you'll need access to other system directories, and you don't want to have to worry about which operating system or system language your extension is running on. a full list of these flags can be found in the firefox source. having that function in place, we do something like the following: let myfile = xulschool.getlocaldirectory(); myfile.append("somefile.txt"); // do stuff with the file. files are handled with the nsifile interface. an nsifile doesn't necessarily represent an existing file, as in the previous examples.
Setting Up a Development Environment - Archive of obsolete content
« previousnext » getting the right tools there are 3 tools that we think are essential for effective add-on development (or any kind of development, really): a source code editor, a source control system, and a build system. in regards to code editing, there's no official mozilla ide. on the other hand, extensions use the same (or similar) languages that are used for web development, so most text editors and ides are up to the task. most xul tools and plugins you'll find online are merely templates that generate the folder structure for the project, and that's not much help. we recommend komodo edit. it's free, open source, and cross-platform. it's based on the mozilla xulrunner platform, so it has support for some of the particularities in firefox extension development. komodo edit has...
The Box Model - Archive of obsolete content
n reader, the label will be read when the focus is placed on the textbox. the description element is used for the rest of the cases, where the text is only meant as additional information and is not related to input elements. handling text in xul may seem simple, but it's actually quite a tricky subject. you always have to keep in mind that localized strings may be significantly longer in other languages, specially much longer than english strings. you should avoid using long blocks text, and also avoid designing your ui so that everything fits just right around text. you should always keep in mind that the text can be much longer, and your ui should adapt to it. labels should generally be short, and they should always be displayed in a single line. descriptions may be longer, and in general yo...
Useful Mozilla Community Sites - Archive of obsolete content
nsion, and once it's approved it will be pushed as an update to all your users. if you decide to host your own extension, you'll have to learn about the update system in order to push your own updates. babelzilla babelzilla is a worldwide community of localizers. developers submit their extensions using the web translation system (wts) and volunteers around the world translate them to different languages. the community is very active, and you can be sure to get translations for the most commonly used languages within a few days of submitting your extension. you'll also receive feedback that you wouldn't notice by testing only in one language, which can reveal other bugs in your locale handling. there's a significant portion of users that use a localized version of firefox, so you shouldn't negl...
XPCOM Objects - Archive of obsolete content
ing parameters passing parameters to xpcom methods is no different from other js objects, with some exceptions. in general, you can rely on javascript's ability to transform values to the correct type, but it's usually best to pass the right type in the first place. this section is a quick guide on how to read xpcom documentation, which basically amounts to understanding the syntax of xpidl, the language used to specify xpcom interfaces. at mdc, you'll see stuff like this: void setcharpref(in string aprefname, in string avalue); one of the most important details to notice is that both paratemers have the in keyword. this specifies that these are input parameters, values that the method will use to perform its actions. when is a parameter not an in parameter? in some methods the out keyword...
Overlay extensions - Archive of obsolete content
apis described here can still be used in these newer types of add-ons. xul school xul school is a comprehensive add-on development tutorial, focusing on firefox extension development but mostly applicable to other gecko-based applications. more resources setting up your environment setting up the application for extension development. xul tutorials and reference for the user interface language used by xul extensions. code snippets sample code for many of the things you'll want to do. installing extensions how to install an extension by copying the extension files into the application's install directory. firefox add-ons developer guide a guide to developing overlay extensions. javascript code modules javascript modules available to extension developers. extension preferen...
Underscores in class and ID Names - Archive of obsolete content
rate for most circumstances. summary: the use of the underscore character in css can lead to major display problems in multiple browsers. learn why this is so, and how to keep your sites from being bitten by this problem. this technical note examines the use of underscores in css, and why they should be generally avoided in most circumstances. it is a fairly common practice in many programming languages to use the underscore character (_) in the place of a "space" in variable and function names. for example, a function whose job is to "get the length of a string" might be called get_string_length, and a variable representing the number of people who voted republican might be voted_republican. given this fact, authors who write css often attempt to employ the underscore in a similar fashion whe...
XML data - Archive of obsolete content
this page contains an example of how you can use css with xml data. you create a sample xml document, and a stylesheet that you can use to display it in your browser. this is the 3rd section of part ii of the css tutorial. previous section: svg next section: xbl binding information: xml data xml (extensible markup language) is a general-purpose language for any kind of structured data. by default, your mozilla browser displays xml in a format very similar to the original data in the xml file. you see the actual tags that define the data's structure. by linking a css stylesheet with the xml document, you can define other ways to display it. to do this, your stylesheet uses rules that map tags in the xml document to the display types used by html. example data in an xml document use...
Beginner tutorials - Archive of obsolete content
n lead to major display problems in multiple browsers. learn why this is so, and how to keep your sites from being bitten by this problem. this technical note examines the use of underscores in css, and why they should be generally avoided in most circumstances.xml datathis page contains an example of how you can use css with xml data.xul user interfacesthis page illustrates mozilla's specialized language for creating user interfaces. ...
Index of archived content - Archive of obsolete content
xpjs components proposal xre xtech 2005 presentations directions of the mozilla rdf engine extending gecko with xbl and xtf mozilla e4x rich web svg and canvas in mozilla xul - mozilla's xml user interface language xtech 2006 presentations xul explorer xulrunner application update article building xulrunner building xulrunner with python commandline components creating xulrunner apps with the mozilla build system creating a windows inno ...
JXON - Archive of obsolete content
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. there are some cases in which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example). in these cases jxon could represent the most practical way. in this article we will show how to convert a parsed xml document (i.e. an instance of document) to a javascript object tree (i.e. a tree of nested instances of object) and viceversa, with some different algorithms. it could be useful to read the xml introduction article first. if you want a complete bidirectional jxon ...
List of Former Mozilla-Based Applications - Archive of obsolete content
nex communicator internet software last news item on site from 2004 chameleon theme builder inactive civil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve client internet software no longer available doczilla sgml/xml/html browser last release on site from july 2005 fabula language learning application inactive galeon browser last news item on site from september 2006 gencatrss rss reader domain switched over to domain parking service ghostzilla browser archived version of ghostzilla site from 2005 homebase desktop operating environment for internet computers no longer available hp printer assistant ...
Defining Cross-Browser Tooltips - Archive of obsolete content
ip." gecko-based browsers such as mozilla, netscape 6+, and compuserve 7 do not support this behavior. see bug 25537 for a lengthy, sometimes passionate discussion of gecko's behavior in this regard. the problem according to the html 4.01 definition of the alt attribute: alt = text cs for user agents that cannot display images, forms, or applets, this attribute specifies alternate text. the language of the alternate text is specified by the lang attribute. in other words, alt text should only be displayed when a user agent cannot display the primary content of the element (e.g., a text-mode browser that cannot display images). in a visual browser, the image should be displayed and the alt text should not. this assumes that the browser can find the image and that it supports the image forma...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
tems (i suspect mac osx would be fine too). instead of configuring end user individual preferences files (~/.mozilla/default/randomdir/prefs.js) we now use a centralized default set of preferences. this centralized preference file can lock preferences (lockpref) or initialize them (defaultpref) based on environment variables (user, home...) and/or ldap queries (fetch email address, common name , language, homepage etc...) from the enterprise directory. central configuration file that feature is provided through a javascript file. file location (not tested since 2012 ...) in thunderbird , firefox, the javascript preference file that calls the centralized preference file is located in $install_dir_moz_app/defaults/pref, for example in thunderbird this would be repectively for windows/linux: c:...
Source code directories overview - Archive of obsolete content
rsive; it can apply to submodules, sub-submodules and so on. base contains the basic (core) functionality for the module. base contains all the source code that cannot be categorized into a submodule. build contains any special makefiles for building the particular module. doc contains any documentation associated with this module. idl contains the xpidl (cross platform interface definition language) interface files. interfaces are used so functionality can be available to both javascript scripts and c code with as little effort as possible. xpidl files have their own mini-language and processing tools. public contains source code that will be exported to the dist/include directory. they are not all necessarily public in the general sense; some are only meant for internal use in a certain m...
Using content preferences - Archive of obsolete content
th of a filesystem directory related about:config preferences: browser.download.lastdir the last directory for any site use downloadlastdir.jsm for access to these preferences. browser.upload.lastdir path of a filesystem directory this preference is stored and retrieved automatically by file upload controls. spellcheck.lang language code (e.g., "en-us") private browsing requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) prior to gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), the content preference service always stores preferences on disk. because of this, in private browsing mode, use of the content preference service needed to be avoided while in private browsing mode; inst...
Other Mozilla customization pages - Archive of obsolete content
this because the program was developped for mozilla configuration in a german administration with about 2000 users. ...
Finding the file to modify - Archive of obsolete content
note: these layers are not completely mutually exclusive. in particular, positioning information can be specified in both the structure layer and the style layer, and some behavior can be partly defined in the style layer.) we're going to add code to all three ui layers, starting with the structure layer. the structure layer consists of xul files. xul, which is short for xml-based user interface language (and is pronounced like "zool"), is an xml-based language specifically designed for describing application interfaces. it contains elements for all common ui widgets (menus, buttons, toolbars, etc.) and many sophisticated ones (trees, browsers, color pickers). each window and dialog box in mozilla is defined by a single xul file (in some cases other xul files called overlays contribute portions ...
Prerequisites - Archive of obsolete content
you might install mozilla multiple times in the course of this tutorial, so you will find it handy to keep around a mozilla installer. ...
Installing Dehydra - Archive of obsolete content
tml for alternate mirrors) wget http://www.netgull.com/gcc/releases/gcc-4.5.3/gcc-4.5.3.tar.bz2 tar -jxvf gcc-4.5.3.tar.bz2 # apply plugin_finish_decl patch wget https://bug559964.bugzilla.mozilla.o....cgi?id=457606 -o finish_decl.diff cd gcc-4.5.3 patch -p0 < ../finish_decl.diff # build gcc cd .. mkdir gcc-objdir mkdir gcc-dist cd gcc-objdir ../gcc-4.5.3/configure --disable-bootstrap --enable-languages=c,c++ --prefix=$pwd/../gcc-dist make make install building dehydra and treehydra building dehydra requires spidermonkey development headers from the previous step. cxx should point to your copy of gcc 4.5. it is recommended to get the latest dehydra sources by checking out from mercurial. (obsolete dehydra releases can be found on the mozilla ftp site.) hg clone http://hg.mozilla.org/rewriting-...
Building Firefox with Rust code - Archive of obsolete content
this page is a rough guide for people using rust in firefox. see also the documentation on this topic on the oxidation wiki page. adding rust code we generally target stable rust, but sometimes issues temporarily require a beta or custom toolchain build. ...
Documentation for BiDi Mozilla - Archive of obsolete content
...
Layout System Overview - Archive of obsolete content
for managing the lines. note that lines may contain only inline elements, whereas block may contain both inline elements and other blocks.other layout models: xul in addition to managing css-defined formatting, the layout system provides a way to integrate other layout schemes into the presentation. currently layout supports the formatting of xul elements, which utilize a constraint-based layout language. the box is introduced into the layout system's frame model via an adapter (boxtoblockadapter) that translates the normal layout model into the box formatting model. conceptually, this could be used to introduce other layout systems, but it might be worth noting that there was no specific facility designed into the layout system to accommodate this. layout deals with frames, but as long as the la...
Creating a Help Content Pack - Archive of obsolete content
what's currently displayed in the glossary as the entry's title. nc:link contains a uri referencing what will be displayed in the viewer when the entry is accessed. the index file one important note on the index file is that there is no automatically generated set of top-level letters (e.g., a for accessibility and automation or b for book and border). help documentation may be written in any language, so such automatic splitting is not desirable. you must implement such splitting if you wish to have it. the index data source structurally differs from the glossary in that it is more likely to have multiple levels. a single-level index may be accomplished in exactly the same way as a glossary file, but multiple levels can make it easier to navigate to specific information. let's start with a ...
Meta - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development. read the experiment report for what we learned from it and the blog post announcing the first sdk release for what we're up to next! future imports experimental new language and api features. used often. first run control over the content and experience of your jetpack's initial use me introspection of your jetpack's dynamic state settings interface for defining and accessing user settings with built-in ui ...
LIR - Archive of obsolete content
the lir instruction set is best learnt by reading nanojit/liropcode.tbl. code for manipulating lir is in nanojit/lir.h. nanojit lir instruction cheat sheet.also in pdf format see attachment. category op code code name return type featured description miscellaneous 0 start void start of a fragment 1 regfence void a register fence causes no code to be generated, but it affects register allocation so that no registers are live when it is reached. 2 skip void links code chunks. ...
Table Layout Regression Tests - Archive of obsolete content
der to include your file. additional notes there is a special type of frame dumps - the printing regression tests, they are invoked by the -prt command line argument to the viewer and include first a display then a frame dump taking into account the printer pages. please contact if you need help with running those tests. i would like to thank chris karnaze for his guidance and fantasai for her language support. original document information author(s): bernd mielke other contributors: boris zbarsky last updated date: february 5, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Abc Assembler Tests - Archive of obsolete content
this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is [open source virtual machine.]. * * the initial developer of the original code is * adobe system incorporated. * portions created by the initial developer are copyright (c) 2009 * the initial developer. all rights reserved. * * contributor(s): * adobe as3 team * * alternatively, the contents of this file...
Tamarin Acceptance Test Template - Archive of obsolete content
this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is [open source virtual machine.]. * * the initial developer of the original code is * adobe system incorporated. * portions created by the initial developer are copyright (c) 2005-2010 * the initial developer. all rights reserved. * * contributor(s): * adobe as3 team * * alternatively, the contents of this...
Actionscript Performance Tests - Archive of obsolete content
by default the time for each test is output. ...
Tamarin - Archive of obsolete content
instructions for installing and using the mercurial hook for tamarin. tamarin acceptance testing instructions on how to validate changes to the tamarin source code. tamarin pages at wiki.mozilla.org more documentation. mmgc overview an overview of the tamarin garbage collector. nanojit lir in nanojit, lir is the source language for compilation to machine code. tamarin strings documentation the implementation of tamarin strings has changed. this page is a how-to about the changes, and what can be done to adapt source code to the changes. tamarin doxygen documentation documentation for the latest release. get involved! log a bug against tamarin t...
Treehydra - Archive of obsolete content
ommunity view treehydra forums... mailing list newsgroup rss feed #static on irc.mozilla.org blogs taras glek david mandelin related topics pork c/c++ refactoring tools, mozilla 2, spidermonkey categories interwiki language links ...
Using Breakpoints in Venkman - Archive of obsolete content
breakpoints are places in code where execution is suspended. when you set a breakpoint in a debugging application such as venkman, you can take advantage of the suspension to examine variables, objects, and other featues of the execution. this article describes breakpoints in javascript and how to use venkman to set and examine breakpoints. ...
Binding Implementations - Archive of obsolete content
52 for some details. implementations can be named using a name attribute specified on the implementation element. when an implementation has a name, that name can be used to disambiguate the desired method or property. note: the following paragraphs suggest a syntax for how javascript might enable access to base class methods and properties. this is an open issue. should we attempt to define a language-independent abstraction, or specify that it must be possible to access base bindings' methods and properties? for example, given a binding with an implementation colorpickergrid that derives from an implementation colorpicker where the two implementations both specify the setcolor method, a caller could invoke colorpicker's method with the following syntax: ... // myelement is a colorpickergri...
Example Sticky Notes - Archive of obsolete content
</p> </body> </html> notes.xml <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- in above only xbl namespace declaration is mandatory. the others are only needed if you plan to handle xul (xml user interface language) or/and svg (scalable vector graphics) in your bindings; xlink in xml also may come useful sometimes. all namespaces above are supported by default and they do not require any additional downloads or initializations. --> <binding id="default"> <!-- a separate binding. you add a binding file using -moz-binding style rule and you address a particular binding by its id: -moz-binding: ur...
XBL 1.0 Reference - Archive of obsolete content
the element with a binding specified, called the bound element, acquires the new behavior specified by the binding. bindings can be bound to elements using cascading style sheets (css) or dom. one element can be bound to several bindings at once. functionally bindings should be correlated with behaviors and viewlink but being implemented as one integrated xml solution. ...
Using XPInstall to Install Plugins - Archive of obsolete content
stallation. this includes instructions on where to install the software, and what messages to feed to the user. you can create an xpinstall file by first zipping all the items you want installed with winzip (create a zip archive) and then renaming it with the xpi file extension instead of the zip file extension. unlike native code installers (for example, files called setup.exe), the programming language for install operations in xpi is javascript. since the file format that contains the software and the install.js javascript file is a cross-platform file (zip) and since javascript is understood by mozilla browsers on all platforms, often one single xpi package can be deployed on all platforms. this is, in fact, how skins and themes are installed to mozilla browsers, changing their look and feel.
registerChrome - Archive of obsolete content
registerchrome registers chrome with the chrome registry. method of install object syntax int registerchrome( switch, srcdir, xpipath); parameters the registerchrome method has the following parameters: switch switch is the chrome switch indicating what type of file is being registered. skin is used to register skins, locale is used to register language packs. package, a third possibility is the equivalent of skin and/or locale, and ensures that everything in the xpi is registered. one final option for the switch parameter is delayed_chrome, which registers the switch only after a relaunch of the browser. note that you can combine switches as in the example below. srcdir srcdir is a filespecobject representing the source destination of the installati...
XPJS Components Proposal - Archive of obsolete content
xpconnect will convert the js object returned from the js module's nsgetfactory function into an xpcom object. the component manager (and anyone else with a reference to that factory) can then call the factory's createinstance method at will. the js module is free to implement factories and components and services that the factories construct on command. any code anywhere and implemented in any language can get to these things via the component and service managers. the xpjsmanager is loosely in charge of the lifetime of each xpjs module. javascript is garbage collected and one can not force an object to be deleted or the compiled code to be unloaded [except by deleting the jsruntime; i.e. erasing the entire js universe]. in c if a module gets unloaded when there are still references to objects...
XTech 2005 Presentations - Archive of obsolete content
uses 3d graphics processors to accelerate all rendering. this work provides additional benefits to web developers such as the ability to apply svg effects to html content. extending gecko with xbl and xtf - brian ryner this session explored ways to extend mozilla/firefox to handle new xml tags and namespaces via drop-in extensions to the layout engine. xul - mozilla's xml user interface language - ben goodger ben goodger, lead engineer for mozilla firefox, talked about xul, mozilla's xml user interface toolkit. ...
XTech 2006 Presentations - Archive of obsolete content
nd discuss application deployment using mozilla xulrunner. etna, a wysiwyg xml relax ng- and gecko-based editor - daniel glazman this presentation describes etna, a new wysiwyg xml editor based on gecko, the relax ng parser and validator disruptive innovations implemented for it and its query api, and relax ng extensions that were necessary to solve very old and well known problems in markup languages. an html version of the paper is available here. ...
oninput - Archive of obsolete content
« xul reference home oninput type: script code this event is sent when a user enters text in a textbox. this event is only called when the text displayed would change, thus it is not called when the user presses non-displayable keys. example <!-- this sets the label's text to the textbox value on each keystroke. --> <script language="javascript"> function setlabel(txtbox){ document.getelementbyid('lbl').value = txtbox.value; } </script> <label id="lbl"/> <textbox oninput="setlabel(this);"/> this is similar to the onkeypress event used in html documents. ...
script.type - Archive of obsolete content
usually, you would set this to application/javascript. note: if the javascript file is in chrome://, setting this attribute to application/javascript will always use the latest available javascript version. ...
Building accessible custom components in XUL - Archive of obsolete content
t dhtml accessibility; it maps the declarations within the html page to the underlying accessibility architecture so that assistive technologies can "read" a web page and know how to present these complex controls to the end user. this has all been well-documented for some time. however, it is less well-known that the same dhtml accessibility techniques can be applied to xul, mozilla's xml markup language for building user interfaces. (the firefox interface itself is built in xul, as well as the graphical interface presented by firefox extensions.) xul itself has a much richer set of built-in controls than html. there is generally no need to build your own xul tab bar or treeview. firefox ships with a tabbox element and a tree element, and these elements are fully accessible out-of-the-box. howeve...
International characters in XUL JavaScript - Archive of obsolete content
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. ...
appendItem - Archive of obsolete content
« xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. ...
insertItemAt - Archive of obsolete content
this method creates a new item and inserts it at the specified position. you may optionally set a value. the new item element is returned. ...
removeItemAt - Archive of obsolete content
« xul reference home removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item. ...
currentIndex - Archive of obsolete content
focused), the value will be -1. you cannot rely on this property to change or determine a tree selection, except for trees with seltype="single". (all trees have seltype="multiple" by default.) to reliably change or determine a selection, instead use the nsitreeselection interface methods available via tree.view.selection. example // one way of retrieving the text of a cell. ...
Multiple Rule Example - Archive of obsolete content
ts listed above, the palace photo appears twice so the second one will be removed, leaving only three matches. although the builder actually generates mutliple matches for one resource, in many cases it isn't necessary to be aware of this detail when creating templates. it is usually sufficient to assume that earlier rules are used to filter results much like an if-else construct in a programming language. if the last rule has no specific conditions (for example a simple rule with no attributes on the <rule> element), it could be considered to be the final else block that matches all data. since results generated by earlier rules override those of later results, you will want to ensure that the rules are placed in the right order. the rules should be ordered from most specific to least specific. i...
Sorting Results - Archive of obsolete content
another way to sort by dates is to use the the parsetype="date" construct in the rdf datasource. this marks a literal as being a date value rather than a string. the builder will recognize this and sort chronologically instead. this also has the advantage that the dates will be displayed according to the user's current locale (meaning that the date is formatted so as to be suitable for the user's language). here is a sample of how to specify this in the rdf/xml datasource: <rdf:rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:r="http://www.xulplanet.com/rdf/" xmlns:nc="http://home.netscape.com/nc-rdf#"> <rdf:description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg"> <r:date nc:parsetype="da...
Template Guide - Archive of obsolete content
plate builder interface template and tree listeners rdf modifications additional topics sorting results additional template attributes template logging xml namespaces alternative approaches javascript templates xuljsdatasource: a component for extensions, which bring a "javascript template syntax". it allows to use javascript objects as a data source for xul templates. interwiki language links ...
Accesskey display rules - Archive of obsolete content
. xul elements check "intl.menuitems.alwaysappendaccesskeys" pref value whether they should append accesskey text always. if the value is "true" (string), the accesskey text will be appended always. don't change the pref value from your xul applications. and also note that there are no spaces between the original labels and accesskey text in the above japanese example. because typically, japanese language doesn't use spaces as word separator. this is controled by "intl.menuitems.insertseparatorbeforeaccesskeys" pref value. if the value is "true" (string), a spece will be inserted before accesskey text. don't change the pref value from your xul applications too. don't include accesskey text in labels xul applications should use dtd for localizable ui resource. at that time, accesskeys are specified...
Adding Methods to XBL-defined Elements - Archive of obsolete content
ok like the start of a tag. you can also use a cdata section to escape the entire block of code. you can call the method by using code such as element.getmaximum(5, 10) where element is a reference to an element defined by the xbl containing the getmaximum method. (the bound element.) the parameter tag allows you to define parameters for a method. because mozilla uses javascript as its scripting language, and javascript is a non-typed language, you do not need to specify the types of the parameters. however, in the future, other languages may be used with xbl. methods are only available to call after the page is rendered, which may cause problems if using createelement. for example, the following code will probably fail: var element = document.createelement("my_element"); element.getmaximum() /...
Document Object Model - Archive of obsolete content
ugh there is only ever one document associated with a window at a time, you may load additional documents using various methods. in mozilla, the dom may be accessed and manipulated using javascript. the various dom objects have functions which may be accessed in script, however, it is important to note that the dom is an api that is accessible by javascript. javascript itself is just a scripting language that can access these objects because mozilla provides these objects for use. in javascript, there is always a single global object that is always available. you can refer to the properties and methods of the global object without having to qualify them with an object. for example, if the global object has a 'name' property, you can change the name with the code 'name = 7', without having to spe...
Introduction to RDF - Archive of obsolete content
e data. this makes it very convenient to display trees with lots of rows in them. rdf can also populate other xul elements as well such as listboxes and menus. we'll see this in the next section. a very brief overview of rdf will be provided here. for more information about rdf, see the rdf specification. rdf/xml rdf consists of a model, which is a graph representation of data. rdf/xml is an xml language which can be used to represent rdf data. it contains a fairly simple set of elements. the sample below shows a simple rdf template. <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> ... </rdf:rdf> this has some similarities to the xul header. instead of the window element, the rdf element is used. you can see the namespace for rdf was declared so that th...
Manifest Files - Archive of obsolete content
error in the manifest or in the jar file referenced by the manifest. for example, in <!doctype window system "chrome://fireclipse/locale/fireclipse.dtd"> the dtd file must exist and its directory must be correctly addressed in the "locale" manifest or xml parsing will fail. for more information about manifest files, see chrome registration. in the next section, we will start looking into the xul language. « previousnext » ...
Property Files - Archive of obsolete content
esultmessage", [ dir, count ]); alert(result); this example will display following message in an alert box. 10 files found in the /usr/local/document directory. you will notice the formatting codes %1$s and %2$s is used, and replaced different order in the array. formatting code %n$s is specify the position of corresponding parameter directly. although the word order is not the same in all the languages, by using getformattedstring() the specification of the order can be put out the property files. in case you need to format a string that already contains the percentage character in it (to get something like "50% off" returned), escape the percentage character with another percentage character, like this: my.percentage.string = %s%% off not escaping the percentage character will generate an in...
Skinning XUL Files by Hand - Archive of obsolete content
on" of interface design and ofapplications development, about which we will have more to say in a later article. in short, xul provides the tools for anybody to create interfaces as complex and as attractive as any c++/mfc/visual ide/templates toolkit user's, and it does so in a way that makes these interfaces available on any platform. you don't have to know the vagueries of a "4gl" programming language or acquaint yourself with the innards of a particular platform and its native widgetry at the expense of others. xul's technologies are interoperable, consistent, cross-platform, free, and readily available. not only is the production of such interfaces democratized, in other words; the consumption and distribution of these interfaces is equally democratic. as with anything truly democratic, you...
Using Spacers - Archive of obsolete content
find out how to add some spacing in between the elements we have created. adding spacers one of the problems with developing user interfaces is that each user has a different display. some users may have larger displays with higher resolutions and others may have lower resolutions. in addition, different platforms may have special requirements on the user interface. if adding support for multiple languages, the text for one language may require more room than another. applications that need to support multiple platforms and languages usually have their windows laid out with lots of space to allow for this. some platforms and user interface toolkits provide components that are smart enough to resize and re-position themselves to fit the needs of the user. (java uses layout managers for example.) xu...
XUL Tutorial - Archive of obsolete content
this tutorial describes xul, the xml user-interface language. this language was created for the mozilla application and is used to describe its user interface. introduction introduction xul structure the chrome url manifest files simple elements creating a window adding buttons adding labels and images input controls numeric controls list controls progress meters adding html elements using spacers more button features the box model the box model element positioning box model details groupboxes adding more elements more layout elements stacks and decks stack positioning tabboxes grids content panels splitters toolbars and menus toolbars simple menu bars more menu features popup menus scrolling menus events and scripts adding event handle...
XUL FAQ - Archive of obsolete content
other faqs you may be interested in: extension faq, ... if your question is not answered here, you can try looking for the answer in the xul documentation or ask in the xul newsgroup. are there decent visual editors for laying out xul applications? there are no production-quality visual editors available for xul. the recommended way is to edit xul by hand, possibly with the help of a good text or xml editor. ted mielczarek's live xul editor (also part of extension developer's extension) often proves useful. ...
XUL and RDF - Archive of obsolete content
e of this document is two-fold. the first section of the document describes the motivation and reasoning behind using rdf as the foundation of xul. this section makes a technical argument both for having xul in the first place and for using rdf as the underlying implementation of xul's content model. the second section describes the xul/rdf architecture itself and outlines enhancements to the xul language in order to allow the markup language to reference local data and to indicate how and when it would like to be annotatable with local data. ...
editor - Archive of obsolete content
built-in rich text editor. ...
script - Archive of obsolete content
d to by the src attribute, but you may also place the script inline inside the opening and closing script tags. more information is available in the xul tutorial. attributes src, type examples <script src="test.js"/> <script src="http://example.com/js/test.js"/> <script> function foo(){ // code } </script> attributes src type: uri the uri of the script. type type: language content type the language of the script. usually, you would set this to application/javascript. note: if the javascript file is in chrome://, setting this attribute to application/javascript will always use the latest available javascript version. if you omit this attribute, the default (and older) javascript version is used (like you get when including a javascript file from web content with...
XUL - Archive of obsolete content
the term xul is sometimes used to refer to the whole mozilla platform (e.g. xul applications are applications using xul and other components of the platform). xul controls lists some of the common controls provided by xul. ...
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
ce code? here. ...
Building XULRunner - Archive of obsolete content
erefore the xulrunner version for this firefox version is : 1.8.1.9 fetching sources from mercurial as with all other mozilla products, one would fetch recent sources from mercurial. for example, to build xulrunner with the top of the tree: hg clone http://hg.mozilla.org/mozilla-central/ src cd src echo ". \$topsrcdir/xulrunner/config/mozconfig" > .mozconfig make -f client.mk build interwiki language links ...
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
ozilla.org/en/docs/getting_started_with_xulrunner appsupporturl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner appupdatesurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner defaultdirname={pf}\my app defaultgroupname=my app allownoicons=yes outputdir=..\build\output outputbasefilename=myapp-1.0-win32 ; setupiconfile= compression=lzma solidcompression=yes [languages] name: english; messagesfile: compiler:default.isl [components] name: main; description: my app; types: full compact custom; flags: fixed name: runtime; description: xul runner runtime; types: full custom [tasks] name: desktopicon; description: {cm:createdesktopicon}; groupdescription: {cm:additionalicons}; flags: unchecked name: quicklaunchicon; description: {cm:createquicklaunchicon}; groupd...
XULRunner FAQ - Archive of obsolete content
et (or python or ...)? the goal of xulrunner is to facilitate development and deployment of internet applications. it is not meant to be a full-featured runtime; this allows xulrunner to maintain a smaller footprint and simpler deployment strategy than generic full-featured runtimes. if i use xulrunner do i have to write my application in xul? no! you can write your application in any language supported by the mozilla web platform, including html, xhtml, svg, or xul. so why is it called xulrunner, instead of htmlrunner or something? xul was always the original language of choice for ui in mozilla applications and the main library is called libxul, mostly the name is a hangover from that that has now stuck. when will firefox be based on xulrunner? there is no intention t...
XULRunner Hall of Fame - Archive of obsolete content
so contains a built in email marketing system that is tightly integrated with the associated web site. one example of this tight integration is that the form in a web site can collect payment and set up a login for a members only section. a newsletter can be sent to members who sign up on a regular bases. instantbird multi-protocol im client. build instructions komodo edit a multi-language code development tool. build instructions pencil the pencil project's unique mission is to build a free and opensource tool for making diagrams and gui prototyping that everyone can use. source qiqqa research manager, reference manager, and pdf manager. xulrunner is embedded to provide automatic search against journal archives, automatic acquisition of bibtex information, and aut...
xbDesignMode.js - Archive of obsolete content
this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is netscape cross browser design mode code. * * the initial developer of the original code is * netscape communications corporation. * portions created by the initial developer are copyright (c) 2003 * the initial developer. all rights reserved. * * contributor(s): doron rosenberg <doron@netscape.com> (original ...
2006-10-20 - Archive of obsolete content
17th j. paul reed announced that: sparky, the linux performance test machine for the 1.8 branchs, is being decommissioned. he also added that the linux performance test data is now being provided by bl-bldlnx01. paul would like to hear from anyone who is against this decision. he can be contacted via: email: preed@mozilla.com irc: preed on irc.mozilla.org phone: 650.903.0800 x256 uploading language packs to amo on october 17th benjamin smedberg brought the following to the attention of the localizers and the build team: that he is planning to upload the firefox 2 language packages currently located at http://releases.mozilla.org/pub/mozi...rc3/win32/xpi/ to addons.mozilla.org in the next few days. this will make the language packages available to everyone. if you anyone has questions ple...
Extentsions FAQ - Archive of obsolete content
contact and other features the thunderbird address book lacks. ...
2006-09-22 - Archive of obsolete content
authors dean woodside sherman fernandes ...
2006-10-20 - Archive of obsolete content
implified chinese firefox 2 attention dictionary providers, or: warning, amo sucks there was at amo (addons.mozilla.org), which has been being fixed. people who want to upload dictionaries should be advised and check #amo at irc.mozilla.org. feedback from localizers regarding sunbird/lightning 0.3 release the sunbird/lightning developers are requesting feedback on release 0.3. uploading language packs to amo benjamin smedberg is ready to upload languange packs from here to addons.mozilla.org. if there are issues or questions, contact mozilla.dev.builds. firefox rc 3 is there, staging servers, too firefox rc3 build is located here. community was encouraged to do testing. discussions how to file a legal approval for a dictionary? discussion about how to file a legal approval for...
2006-11-17 - Archive of obsolete content
illa.org seamonkey 1.0.6 in russian (ru-ru) seamonkey 1.0.6 in russian (ru-ru) is uploaded to ftp.mozilla.org seamonkey 1.0.6 in czech (cs-cz) seamonkey 1.0.6 in czech (cs-cz) is uploaded to ftp.mozilla.org seamonkey 1.0.6 he-il seamonkey 1.0.6 he-il is released. seamonkey 1.0.6 in french seamonkey 1.0.6 in french (fr-fr) is released. discussions how to translate mozilla to a language called quiché how to translate mozilla to a language called quiché. how to start a localization how to start a localization po format usage discussion on how to make l10n easier due to expansion to 100 locales. quick builds for localisers (full or partial) discussion on moz-l10n-builder, which automates many of the functions required in localization process. link is located here. go...
2006-12-08 - Archive of obsolete content
summary: mozilla.dev.l10n - december 8, 2006 announcements mozilla sponsored server for l10n the server for mozilla sponsored server for l10n should be up and running soon. seamonkey 1.1b es-es language and region packs language and region packs for seamonkey 1.1b is ready for downloading. new strings in thunderbird new strings in thunderbird new bugzilla-staging.mozilla.org a staging server for a new bugzilla upgrade. discussions none for this week. meetings none for this week. authors paul yanchun gu (gpaul) aditya nanda kuswanto(vipers101) ...
2006-11-10 - Archive of obsolete content
...
Multi-process plugin architecture - Archive of obsolete content
in order to make the browser user experience better, it is possible to separate plugin execution from the process in which the browser normally executes. when multi-process plugins are enabled, a shim layer in the browser implements the plugin api (the npp_ functions which would normally be implemented directly by the plugin). the calls are transferred to the plugin process via the ipdl protocol language. in the plugin process, the shim layer serves as a plugin host, implementing the npn_ functions used by the plugin, and forwards the calls to the plugin dll: multi-process plugins, also called out of process plugins or oopp first shipped in firefox 3.6.4 on windows and linux, and in firefox 4 on mac os x. in addition to crash protection, the multi-process plugin architecture allows firefox to...
Adobe Flash - Archive of obsolete content
installed multiple mozilla based browsers onto the same machine (see bug 32048 and bug 233533). in example 2, a javascript function first obtained a handle to the html that spawned the plugin (the object element or the embed element) and then called a published method of the flash plugin on the reference to the html element. with fscommands, developers may choose to use macromedia's actionscript language to make a call back into the environment that contains the flash animation -- in this case, the html page. the example below shows both types of communication in action: example 3: javascript to flash communication and fscommands -- flash to javascript communication the example is missing. in example 3, clicking the html button causes a ball to move in the flash animation. this exemplifies ja...
Plugins - Archive of obsolete content
est cases. external resources for plugin creation external projects, frameworks, and blog posts that may be useful. ...
Element - Archive of obsolete content
lement) <copyright> (rss copyright element) d <day> (rss day element) <description> (rss description element) <docs> (rss docs element) e <enclosure> (rss enclosure element) f g <generator> (rss generator element) <guid> (rss guid element) h <height> (rss height element) <hour> (rss hour element) i <image> (rss image element) <item> (rss item element) j k l <language> (rss language element) <lastbuilddate> (rss last build date element) <link> (rss link element) m <managingeditor> (rss managing editor element) n <name> (rss name element) o p <pubdate> (rss published date element) q r <rating> (rss rating element) <rss> (rss's root "rss" element) s <skipdays> (rss skip days element) <skiphours> (rss skip hours element) <source> (...
SAX - Archive of obsolete content
starting with firefox 2, a sax parser is available to xul applications and extensions. for more information, please see sax homepage. quick start the sax parser functionality is available through the xml reader component. ...
Settings - Archive of obsolete content
show variables filter box enabling this option adds a "filter variables" search box to the variables pane, so that you can filter the displayed list of variables. show original sources enabling this option will make the debugger use source maps, if they are available, to display the original source for code which has been combined, minified, or even compiled to javascript from a language like coffeescript. defaults to true. automatically black box minified sources new in firefox 33. automatically black box sources whose url ends with ".min.js". defaults to true. ...
E4X - Archive of obsolete content
Archive › Web › E4X
k in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. warning: e4x is obsolete. it has been disabled by default for webpages (content) in firefox 17, disabled by default for chrome in firefox 20, and has been removed in firefox 21. use domparser/domserializer or a non-native jxon algorithm instead. ecmascript for xml (e4x) is a programming language extension that adds native xml support to javascript. it does this by providing access to the xml document in a form that feels natural for ecmascript programmers. the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces. a valid alternative to e4x is a non-native jxon algorithm. e4x is standardized by ecma international in ecma-357 standard (curr...
Expression closures - Archive of obsolete content
e the function name. can be omitted, in which case the function is anonymous. the name is only local to the function body. paramn the name of an argument to be passed to the function. a function can have up to 255 arguments. expression the expression which comprise the body of the function. description this addition is nothing more than a shorthand for writing simple functions, giving the language something similar to a typical lambda notation. javascript 1.7 and older: function(x) { return x * x; } javascript 1.8: function(x) x * x this syntax allows you to leave off the braces and 'return' statement - making them implicit. there is no added benefit to writing code in this manner, other than having it be syntactically shorter. examples a shorthand for binding event listeners: doc...
ScriptEngine() - Archive of obsolete content
syntax scriptengine() remarks the scriptengine function returns "jscript", which indicates that javascript is the current scripting engine. example the following example illustrates the use of the scriptengine function: if (window.scriptengine) { console.log(window.scriptengine()); } // output: jscript requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards. ...
ScriptEngineBuildVersion - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the scriptenginebuildversion function bets the build version number of the scripting engine in use. syntax scriptenginebuildversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptenginebuildversion function: if(window.scriptenginebuildversion) { console.log(window.scriptenginebuildversion()); } // output: <current build version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standa...
ScriptEngineMajorVersion - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the scriptenginemajorversion function gets the major version number of the scripting engine in use. syntax scriptenginemajorversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptenginemajorversion function: if (window.scriptenginemajorversion) { console.log(window.scriptengine()); } output: <current major version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet ...
ScriptEngineMinorVersion - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the scriptengineminorversion function gets the minor version number of the scripting engine in use. syntax scriptengineminorversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptengineminorversion function. if (window.scriptengineminorversion) { console.log(window.scriptengineminorversion()); } //output: <current minor version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 stand...
New in JavaScript 1.1 - Archive of obsolete content
the following is a changelog for javascript from netscape navigator 2.0 to 3.0. the old netscape documentation references this as "features added after version 1". netscape navigator 3.0 was released on august 19, 1996. netscape navigator 3.0 was the second major version of the browser with javascript support. javascript versions netscape navigator 3.0 also introduced javascript language versions. <script language="javascript"> <!-- javascript for navigator 2.0. --> <script language="javascript1.1"> <!-- javascript for navigator 3.0. --> new features in javascript 1.1 new objects array boolean function number new properties number.max_value number.min_value nan number.negative_infinity number.positive_infinity new methods array.prototype.join() array.prototype.reverse...
New in JavaScript 1.2 - Archive of obsolete content
the following is a changelog for javascript from netscape navigator 3.0 to 4.0. the old netscape documentation can be found on archive.org. netscape navigator 4.0 was released on june 11, 1997. netscape navigator 4.0 was the third major version of the browser with javascript support. javascript versions netscape navigator 4.0 executes javascript language versions up to 1.2. note that netscape navigator 3.0 and earlier ignored scripts with the language attribute set to "javascript1.2" and higher. <script language="javascript1.1"> <!-- javascript for navigator 3.0. --> <script language="javascript1.2"> <!-- javascript for navigator 4.0. --> new features in javascript 1.2 new objects you can create objects using literal notation (inspired by dictionary literal syntax from python 1.x). array...
New in JavaScript 1.7 - Archive of obsolete content
using javascript 1.7 in order to use some of the new features of javascript 1.7, you need to specify that you wish to use javascript 1.7. ...
New in JavaScript 1.8 - Archive of obsolete content
avascript 1.8. this version was included in firefox 3 and is part of gecko 1.9. see bug 380236 for a tracking development bug for javascript 1.8. using javascript 1.8 in order to use some of the new features of javascript 1.8 in html, use: <script type="application/javascript;version=1.8"> ... your code ... </script> another way (not recommended) to do this is to use the deprecated <script> language attribute and define it as "javascript1.8". when using the javascript shell, javascript xpcom components, or xul <script> elements, the latest js version (js1.8 in mozilla 1.9) is used automatically (bug 381031, bug 385159). the features that require the use of the new keywords "yield" and "let" require you to specify version 1.7 or higher because existing code might use those keywords as varia...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
it defines the standard for the javascript implementation in spidermonkey, the engine used in firefox and other mozilla applications. code-named "es.next", "harmony", or "ecmascript 6", the first working draft (based on ecmascript 5.1) was published on july 12, 2011 as "es.next". in august 2014, the ecmascript 2015 draft specification was feature frozen and went through a stabilization and bug fixing period. finally, ecma-262 edition 6 got officially approved and published as a standard on june 17, 2015 by the ecma general assembly. it will also appear as the international industry standard iso/iec 16262:2016. ...
MSX Emulator (jsMSX) - Archive of obsolete content
what is it? jsmsx is the first msx emulator 100% written in javascript. yes, you read it: javascript! it emulates the underlying z80 cpu, tms9918 video display processor (vdp), ppi, ram slots, and megaram. in its present form, it should be able to run any program or game developed for msx 1.0. since javascript currently is mostly an interpreted language in web browsers, it is at least an order of magnitude slower than other languages such as c and java. therefore, jsmsx requires a very fast computer to emulate msx at the normal 50-60 interrupts per second inside a web browser. why? the initial motivation was to find some interesting project to develop while exploring the possibilities of the <canvas> tag and javascript language in the most recent web browsers like firefox 2. as you may have reali...
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
if you're writing xhtml (as opposed to regular html) you should understand the fundamental differences between html 4 and xhtml. xhtml is xml, not html one of the primary misunderstandings about xhtml is that it is just another version of html. this misunderstanding is compounded by the fact that, prior to version 9, microsoft® internet explorer only supports xhtml if it is served with mime media type text/html rather than the recommended application/xhtml+xml. when an xhtml page is served with mime type text/html it is treated by all browsers as if it were nothing more than html. ...
RDF: Resource Description Framework for metadata - Archive of obsolete content
Archive › Web › RDF
framework, at xml.com. ...
Implementation Status - Archive of obsolete content
model item properties section title status notes bugs 6.1...
RFE to the Custom Controls - Archive of obsolete content
y need to be more extensive to address the wider spectrum of requirements that a xul application will have on its controls. note: xul is a feature of mozilla only and custom control authors should be aware their controls won't work on other browser platforms. rfe put your requests here. output that shows the dom if output contains cdata section or text node and its data is any mozilla known language like xhtml/xul/svg then output should parse and display it (see bug 316817). output should show data in current locale format the bug 331585 address the issue. probably this feature should be implemented by adding a new custom control. input that shows/modifies the dom like the request above for output. the related bug is bug 348562. ...
Requests For Enhancement - Archive of obsolete content
Archive › Web › XForms › RFE
is a great way to show that 14 year old html hacks can build really powerful web apps and reduce the need for javascript by 90%. now we need to start teaching xforms to web newcomers before they are brainwashed into believing that the only way to build cool web apps is to do dom surgery with javascript! dan mccreary. one of the outstanding features of xforms is that it can work with any xml host language. natively, the mozilla xforms implementation supports xforms elements being hosted in xhtml and xul documents. but a form author is not restricted to only those xml languages that gecko knows. a lot of the xforms capabilities are reachable by using our custom controls interfaces. our custom control interfaces allows for the exchange of data between any xml element and and an xforms model. this me...
XForms Group Element - Archive of obsolete content
eate complex hierarchies. attributes single-node binding type restrictions the group element can be bound to a node containing data of any type. actually, the group element doesn't interact with the data in the bound node. however, having a relevant model item property on the bound node has an effect on a group. all content elements (e.g. core form controls, groups, switches, repeats and host language content) within a non-relevant group are handled as non-relevant. if a group is non-relevant, then the rendering approach used to signify non-relevance is applied to the entire content of the group. representations the group element doesn't have visual presentation. example <group ref="address"> <label>shipping address</label> <input ref="line_1"> <label>address line 1</label> </input> ...
XForms Repeat Element - Archive of obsolete content
thus, one might wish to use element repeat within a table to create the rows of a table, where each row of the table binds to a distinct member of a homogeneous collection. since html:table doesn't (and probably never will) allow xforms:repeat elements as children, another syntax is needed. to ...
XForms Switch Module - Archive of obsolete content
nd node has an effect on a switch. binding a switch to a data node will also set a context that the expressions contained inside the case elements can build upon. representations the switch element doesn't have a visual representation. case element this element (see the spec) encloses markup to be conditionally rendered. the content elements (e.g. form controls, groups, switches, repeats and host language elements) within a non-selected case are not rendered. correspondingly, content elements in a case that becomes selected are visible. attributes special selected - determines the initial selected state of the case. if multiple cases within a switch are marked as selected="true", the first selected case will appear and all others will not be visible. if no case is initially selected,...
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
ndards all the time. memos, time cards, and accounting procedures are all standardized across groups. in the development world, there is a need for standards because applications are designed across multiple development groups. many organizations publish internal development standards and practices. for example, an organization may decide that c++, java, and javascript will be the primary coding languages. they may require that each project be comprised of marketing requirements documents, product requirements documents, functional requirements documents, quality assurance test plans, and certification documents. as organizations mature, they discover that they need more processes to give them greater control, which allows them to more easily plan and predict. with processes, organizations can m...
Mozilla's DOCTYPE sniffing - Archive of obsolete content
td, i.e., <!doctype html>. a doctype declaration with an internal subset. any unknown doctype, which should include the following (technically known) doctypes: the public identifier "-//w3c//dtd html 4.01//en". the public identifier "-//w3c//dtd html 4.0//en". the public identifier "-//w3c//dtd xhtml 1.0 strict//en". the public identifier "iso/iec 15445:2000//dtd hypertext markup language//en". the public identifier "iso/iec 15445:2000//dtd html//en". the public identifier "-//ietf//dtd html i18n//en". almost standards mode the following trigger almost standards mode. almost standards mode was created after 1.0 and 1.1alpha, but before 1.0.1 and 1.1beta. before almost standards mode was created these doctypes triggered full standards mode. the public identifier "-...
RDF in Fifty Words or Less - Archive of obsolete content
tually implements the ui to the bookmarks is notified that it should begin drawing some icons for the latest message about yam soup from aunt helga. this isexactly how smartmail works. contact: chris waterson (waterson@netscape.com) original document information author(s): chris waterson last updated date: november 19, 1998 copyright information: copyright (c) chris waterson interwiki language link ...
The Business Benefits of Web Standards - Archive of obsolete content
g an unsuspected ally in the battle: web standards. this article discusses how adhering to web standards, and leaving behind proprietary markup and technologies, can contribute to a company's business goals. site wide consistent look and feel by separating structure (or content) from presentation, web designers have a lot to gain. specifically, presentation is defined using layout-oriented css language. storing css in a separate document (aka style sheet) and applying it to a set of html documents permits a complete change of presentation for all these documents in a snap. strict html (as opposed to the often-used transitional html markup), forces the designer not to use presentation tags in the html documents, naturally enforcing the separation of content from presentation. by locating all th...
XUL Parser in Python - Archive of obsolete content
in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for a in el_list[item].values(): w.write('<tr><td class="at">' + a + '</td>') with these modifications, the script creates an output more like a periodic table of xul elements. until i spruce it up a little, this is just a very basic demonstration of using python's xml parser with xul. but mozilla's upcoming support for languages like perl and python will really open up the mozilla platform to tools and approaches of this kind--and make now a good time to start thinking about how these various technologies will be put together. the first level of support for python in mozilla will apparently be for python modules made available as xpcom objects. extending on the approach in this script, then, you could imagine a kind of ...
Building up a basic demo with A-Frame - Game development
the webxr and webgl apis already enable us to start creating virtual reality (vr) experiences inside web browsers, but the community is still waiting for tools and libraries to appear, to make this easier. mozilla's a-frame framework provides a markup language allowing us to build 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without having to write a lot of javascript or glsl. this article explains how to get up and running with a-frame, and how to use it to build up a simple demo. high level overview the current version of a-frame is 0.3.2, which means it's highly experimental, but it already works and you can test it right away in the browser. it runs on ...
GLSL Shaders - Game development
glsl is executed directly by the graphics pipeline. there are two types of shaders: vertex shaders and fragment (pixel) shaders. vertex shaders transform shape positions into 3d drawing coordinates. fragment shaders compute the renderings of a shape's colors and other attributes. glsl is not as intuitive as javascript. glsl is strongly typed and there is a lot of math involving vectors and matrices. it can get very complicated — very quickly. in this article we will make a simple code example that renders a cube. to speed up the background code we will be using the three.js api. ...
3D games on the Web - Game development
heory article for all the information you need. advanced concepts you can do a lot more with webgl. there are some advanced concepts which you should dive into and learn more about — like shaders, collision detection, or the latest hot topic: virtual reality on the web. shaders it's worth mentioning shaders, which are a separate story on their own. shaders use glsl, a special opengl shading language, with syntax similar to c, that is executed directly by the graphics pipeline. they can be split into vertex shaders and fragment shaders (or pixel shaders) — the former transforms shape positions to real 3d drawing coordinates, while the latter computes rendering colors and other attributes. you should definitely check out glsl shaders article to learn more about them. collision detection it...
Tiles and tilemaps overview - Game development
of small, regular-shaped images called tiles. this results in performance and memory usage gains — big image files containing entire level maps are not needed, as they are constructed by small images or image fragments multiple times. this set of articles covers the basics of creating tile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) besides the performance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a path-finding graph, or handling collisions) or to create a level editor. some popular games that use this technique are super mario bros, pacman, zelda: link's awakening, starcraft, and sim city 2000. think about any game that uses regular...
asm.js - Game development
can consult the asm.js spec and know that it will run fast if they adhere to asm.js patterns. emscripten, a c/c++ to javascript compiler, emits asm.js code to make it run with near native performance on several browsers. additionally, if an engine chooses to specially recognize asm.js code, there even more optimizations that can be made. firefox is the only browser to do this right now. asm.js language summary asm.js is an intermediate programming language. asm.js has a very predictable perfomance rate because it is limited to an extremely restricted subset of javascript that provides only strictly-typed integers, floats, arithmetic, function calls, and heap accesses. the performance characteristics are closer to native code than that of standard javascript. using a subset of javascript asm...
Tools for game development - Game development
on this page you can find links to our game development tools articles, which eventually aims to cover frameworks, compilers, and debugging tools. asm.js asm.js is a very limited subset of the javascript language, which can be greatly optimized and run in an ahead-of-time (aot) compiling engine for much faster performance than your typical javascript performance. this is, of course, great for games. emscripten an llvm to javascript compiler; with emscripten, you can compile c++ and other languages that can compile to llvm bytecode into high-performance javascript. this is a great tool for porting applications to the web! there is a useful emscripten tutorial available on the wiki. note that we are aiming to cover emscripten in its own section of mdn. gecko profiler the gecko profi...
2D breakout game using pure JavaScript - Game development
the ball bounce off the walls paddle and keyboard controls game over build the brick field collision detection track the score and win mouse controls finishing up starting with pure javascript is the best way to get a solid knowledge of web game development. after that, you can pick any framework you like and use it for your projects. frameworks are just tools built with the javascript language; so even if you plan on working with them, it's good to learn about the language itself first to know what exactly is going on under the hood. frameworks speed up development time and help take care of boring parts of the game, but if something is not working as expected, you can always try to debug that or just write your own solutions in pure javascript. note: if you are interested in learnin...
Visual JS GE - Game development
ing in the console: resource.test_res. resource objects contain the path data for all your images. the actual image objects will be created after you add animation to the game objects. this is good because it is memory safe. visual js.exe windows gui freeware only for windows users. contains the following tools. visual_js.exe version 1.0 — comes with source editor. ml_sys.exe — multilanguage tool for string labels (smart xml operation; no empty tags). scriptingjs.exe — based on javascriptobfuscator.com api. makelib.exe — neede for font bug fixing. video tutorials pencil component particle virtual kayboard ...
Game development
a is a good place to go to get started with the basics. port native games to the web if you are a native developer (for example writing games in c++), and you are interested in how you can port your games over to the web, you should learn more about our emscripten tool — this is an llvm to javascript compiler, which takes llvm bytecode (e.g. generated from c/c++ using clang, or from another language) and compiles that into asm.js, which can be run on the web. to get started, see: about emscripten for an introduction including high-level details. download and install for installing the toolchain. emscripten tutorial for a tutorial to teach you how to get started. examples for a list of web game examples, see our examples page. also, check out games.mozilla.org for more useful res...
Gecko FAQ - Gecko Redirect 1
of specifications html 4.0 elements, form controls, frames, tables, and form submission bug reports marked with the html4 keyword "meta bug" for tracking outstanding issues with html 4.01 compliance css: style system component (see also bug reports marked with the css1, css2, and css3 keywords) dom: see dom0, dom1, dom2 and event handling components xml rdf core javascript language interpreter (javascript engine) http 1.1 compliance bugs should generally be found on the networking, networking - general, and networking: cache components oji imagelib image library (see also jpeg image handling and png image handling) ssl-related bugs are filed on the crypto component for information about the known bugs of a specific commercial product based on gecko, see that product's...
BiDi - MDN Web Docs Glossary: Definitions of Web-related terms
bidi (bidirectional) refers to a document containing both right-to-left and left-to-right text. even when both directionalities occur in the same paragraph, the text in each language must appear in its proper directionality. learn more general knowledge bi-directional text on wikipedia ...
BigInt - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, bigint is a numeric data type that can represent integers in the arbitrary precision format. in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums. learn more general knowledge numeric types on wikipedia technical reference the javascript data structure: bigint the javascript global object bigint ...
CORS-safelisted request header - MDN Web Docs Glossary: Definitions of Web-related terms
a cors-safelisted request header is one of the following http headers: accept, accept-language, content-language, content-type. when containing only these headers (and values that meet the additional requirements laid out below), a requests doesn't need to send a preflight request in the context of cors. you can safelist more headers using the access-control-allow-headers header and also list the above headers there to circumvent the following additional restrictions: additional restrictions cors-safelisted headers must also fulfill the following requirements in order to be a cors-safelisted request header: for accept-language and content-language: can only have values consisting of 0-9, a-z, a-z, space or *,-.;=. for accept and content-type: can't contain a cors-unsafe requ...
CORS-safelisted response header - MDN Web Docs Glossary: Definitions of Web-related terms
a cors-safelisted response header is an http header which has been safelisted so that it will not be filtered when responses are processed by cors, since they're considered safe (as the headers listed in access-control-expose-headers). ...
Class - MDN Web Docs Glossary: Definitions of Web-related terms
in object-oriented programming, a class defines an object's characteristics. ...
Compile - MDN Web Docs Glossary: Definitions of Web-related terms
compiling is the process of transforming a computer program written in a given language into an equivalent program of another language. a compiler is a software to execute this task. sometimes, this task is also referred to as "assembling" or "build", which typically indiciates more than just compilation is done, e.g. packaging it in a binary format. usually, a compiler transforms a higher-level language such as c or java, which humans understand, into a machine language, such as assembly, that the cpu can understand. some compilers which translate between similar level languages are called transpilers or cross-compilers, for instance to compile from typescript to javascript. those are considered productivity tools. most compilers work either ahead-of-time (aot) or just-in-time (jit). as...
Constructor - MDN Web Docs Glossary: Definitions of Web-related terms
essentially, a constructor in javascript is usually declared at the instance of a class. ...
Dynamic typing - MDN Web Docs Glossary: Definitions of Web-related terms
dynamically-typed languages are those (like javascript) where the interpreter assigns variables a type at runtime based on the variable's value at the time. learn more learn about it javascript data types and data structures general knowledge type system on wikipedia ...
ECMA - MDN Web Docs Glossary: Definitions of Web-related terms
ecma international (formally european computer manufacturers association) is a non-profit organization that develops standards in computer hardware, communications, and programming languages. on the web it is famous for being the organization which maintain the ecma-262 specification (aka. ecmascript) which is the core specification for the javascript language. learn more ecma international on wikipedia the ecma international web site ...
ECMAScript - MDN Web Docs Glossary: Definitions of Web-related terms
ecma international is in charge of standardizing ecmascript. ...
Entity header - MDN Web Docs Glossary: Definitions of Web-related terms
even if they are neither request, nor response headers, entity headers are often included in such terms. ...
FTU - MDN Web Docs Glossary: Definitions of Web-related terms
ftu (first time use) is the app that loads when you run a newly-installed version of gecko on a firefox os device. you can use ftu to set many important options (e.g. timezone, wifi details, default language, importing contacts), or take the "phone tour" to find out more about your device. ...
First-class Function - MDN Web Docs Glossary: Definitions of Web-related terms
example | assign a function to a variable javascript const foo = function() { console.log("foobar"); } // invoke it using the variable foo(); we assigned an anonymous function in a variable, then we used that variable to invoke the function by adding parentheses () at the end. even if your function was named, you can use the variable name to invoke it. naming it will be helpful when debugging your code. but it won't affect the way we invoke it. ...
Function - MDN Web Docs Glossary: Definitions of Web-related terms
hether the function name is a declaration or expression. different types of functions an anonymous function is a function without a function name. only function expressions can be anonymous, function declarations must have a name: // when used as a function expression (function () {}); // or using the ecmascript 2015 arrow notation () => {}; the following terms are not used in the ecmascript language specification, they're jargon used to refer to different types of functions. a named function is a function with a function name: // function declaration function foo() {}; // named function expression (function bar() {}); // or using the ecmascript 2015 arrow notation const foo = () => {}; an inner function is a function inside another function (square in this case). an outer function is a f...
Grid Axis - MDN Web Docs Glossary: Definitions of Web-related terms
rows and columns. therefore in any grid we have two axes. the block or column axis, and the inline or row axis. it is along these axes that items can be aligned and justified using the properties defined in the box alignment specification. in css the block or column axis is the axis used when laying out blocks of text. if you have two paragraphs and are working in a right to left, top to bottom language they lay out one below the other, on the block axis. the inline or row axis runs across the block axis and is the direction along which regular text flows. these are our rows in css grid layout. the physical direction of these axes can change according to the writing mode of the document. learn more further reading css grid layout guide: basic concepts of grid layout css grid layout g...
Grid Lines - MDN Web Docs Glossary: Definitions of Web-related terms
border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 100px 100px; } lines can be addressed using their line number. in a left-to-right language such as english, column line 1 will be on the left of the grid, row line 1 on the top. lines numbers respect the writing mode of the document and so in a right-to-left language for example, column line 1 will be on the right of the grid. the image below shows the line numbers of the grid, assuming the language is left-to-right. lines are also created in the implicit grid when implicit tracks ...
HTML - MDN Web Docs Glossary: Definitions of Web-related terms
brief history in 1990, as part of his vision of the web, tim berners-lee defined the concept of hypertext, which berners-lee formalized the following year through a markup mainly based on sgml. the ietf began formally specifying html in 1993, and after several drafts released version 2.0 in 1995. in 1994 berners-lee founded the w3c to develop the web. in 1996, the w3c took over the html work and published the html 3.2 recommendation a year later. html 4.0 was released in 1999 and became an iso standard in 2000. at that time, the w3c nearly abandoned html in favor of xhtml, prompting the founding of an independent group called whatwg in 2004. ...
Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms
hoisting was thought up as a general way of thinking about how execution contexts (specifically the creation and execution phases) work in javascript. however, the concept can be a little confusing at first. conceptually, for example, a strict definition of hoisting suggests that variable and function declarations are physically moved to the top of your code, but this is not in fact what happens. instead, the variable and function declarations are put into memory during the compile phase, but stay exactly where you typed them in your code. ...
I18N - MDN Web Docs Glossary: Definitions of Web-related terms
i18n (from "internationalization", a 20-letter word) is 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. (the w3c definition) among other things, i18n requires support for multiple character sets (usually via unicode) units of measure (currency, °c/°f, km/miles, etc.) time and date formats keyboard layouts text directions learn more general knowledge i18n on wikipedia technical reference i18n on w3c i18n on gala-global.org learn about it i18n material on i18nguy.com ...
Inheritance - MDN Web Docs Glossary: Definitions of Web-related terms
inheritance is a major feature of object-oriented programming. data abstraction can be carried up several levels, that is, classes can have superclasses and subclasses. as an app developer, you can choose which of the superclass's attributes and methods to keep and add your own, making class definition very flexible. some languages let a class inherit from more than one parent (multiple inheritance). learn more learn about it inheritance and the prototype chain ...
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
json can represent numbers, booleans, strings, null, arrays (ordered sequences of values), and objects (string-value mappings) made up of these values (or of other arrays and objects). json does not natively represent more complex data types like functions, regular expressions, dates, and so on. ...
Java - MDN Web Docs Glossary: Definitions of Web-related terms
java is a compiled, object-oriented, highly portable programming language. java is statically typed and features a similar syntax to c. it comes with a large library of readily usable functions, the java software development kit (sdk). programs are compiled only once ahead of time into a proprietary byte code and package format that runs inside the java virtual machine (jvm). the jvm is available across many platforms, which allows java programs to run almost everywhere without the need to be compiled or packaged again. this makes it a preferred language in many large enterprises with heterogenous landscapes, but may be perceived "heavy". learn more general knowledge java on wikipedia ...
Locale - MDN Web Docs Glossary: Definitions of Web-related terms
among other things, locales represent paper format, currency, date format, and numbers according to the protocols in the given region. ...
Localization - MDN Web Docs Glossary: Definitions of Web-related terms
localization (l10n) is the process of adapting a software user interface to a specific culture. the following are common factors to consider: language unit of measure (e.g., kilometers in europe, miles in u.s.) text direction (e.g., european languages are left-to-right, arabic right-to-left) capitalization in latin script (e.g., english uses capitals for weekdays, spanish uses lowercase) adaptation of idioms (e.g., "raining cats and dogs" makes no sense when translated literally) use of register (e.g., in japanese respectful speech differs exceptionally from casual speech) number format (e.g., 10 000,00 in germany vs. 10,000.00 in the u.s.) date format currency cultural references paper size color psychology compliance with local laws local holidays personal names learn...
Null - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, null is marked as one of the primitive values, because its behaviour is seemingly primitive. ...
Number - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, number is a numeric data type in the double-precision 64-bit floating point format (ieee 754). in other programming languages different numeric types exist; for example, integers, floats, doubles, or bignums. learn more general knowledge numeric types on wikipedia technical reference the javascript data structure: number the javascript global object number ...
Object - MDN Web Docs Glossary: Definitions of Web-related terms
object refers to a data structure containing data and instructions for working with the data. objects sometimes refer to real-world things, for example a car or map object in a racing game. javascript, java, c++, python, and ruby are examples of object-oriented programming languages. learn more general knowledge object-oriented programming on wikipedia object in the javascript reference object data structures in javascript ...
OpenGL - MDN Web Docs Glossary: Definitions of Web-related terms
the api is typically used to interact with a graphics processing unit (gpu), to achieve hardware-accelerated rendering. ...
PHP - MDN Web Docs Glossary: Definitions of Web-related terms
php (a recursive initialism for php: hypertext preprocessor) is an open-source server-side scripting language that can be embedded into html to build web applications and dynamic websites. examples basic syntax // start of php code <?php // php code goes here ?> // end of php code printing data on screen <?php echo "hello world!"; ?> php variables ​​​​​​​​​​​​​​<?php // variables $nome='danilo'; $sobrenome='santos'; $pais='brasil'; $email='danilocarsan@gmailcom'; ​​​​​​​ // printing the variables echo $nome; echo $sobrenome; echo $pais; echo $email; ?> ...
Parameter - MDN Web Docs Glossary: Definitions of Web-related terms
unctions. note the difference between parameters and arguments: function parameters are the names listed in the function's definition. function arguments are the real values passed to the function. parameters are initialized to the values of the arguments supplied. two kinds of parameters: input parameters the most common kind; they pass values into functions. depending on programming language, input parameters can be passed several ways (e.g., call-by-value, call-by-address, call-by-reference). output/return parameters primarily return multiple values from a function, but not recommended since they cause confusion learn more general knowledge difference between parameter and argument on wikipedia technical reference function declaration function expression ...
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
type) is data that is not an object and has no methods. there are 6 primitive data types: string, number, bigint, boolean, undefined, and symbol. there also is null, which is seemingly primitive, but indeed is a special case for every object: and any structured type is derived from null by the prototype chain. most of the time, a primitive value is represented directly at the lowest level of the language implementation. all primitives are immutable, i.e., they cannot be altered. it is important not to confuse a primitive itself with a variable assigned a primitive value. the variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered. example this example will help you understand that primitive values are immu...
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
ke text/html;level=1. these increase the specificity of the value. their use is extremely rare. browser-specific information firefox starting with firefox 18, the quality factor values are clamped to 2 decimal places. they used to be clamped to only 1 decimal place in earlier versions (bug 672448). more information http headers using q-values in their syntax: accept, accept-charset, accept-language, accept-encoding, te. ...
RDF - MDN Web Docs Glossary: Definitions of Web-related terms
rdf provides a standard way of encoding resource information so that it can be exchanged in a fully automated way between applications. ...
Regular expression - MDN Web Docs Glossary: Definitions of Web-related terms
on the web, javascript provides another regex implementation through the regexp object. ...
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
headers, request headers that are always considered authorized and are not explicitly listed in responses to preflight requests. ...
Ruby - MDN Web Docs Glossary: Definitions of Web-related terms
in a web context, ruby is often used server-side with the ruby on rails (ror) framework to produce websites/apps. ruby is also a method for annotating east asian text in html documents to provide pronunciation information; see the <ruby> element. ...
SQL - MDN Web Docs Glossary: Definitions of Web-related terms
sql (structured query language) is a descriptive computer language designed for updating, retrieving, and calculating data in table-based databases. learn more general knowledge sql on wikipedia learn sql learn sql on sqlzoo.net tutorial point ...
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
ature) defines input and output of functions or methods. a signature can include: parameters and their types a return value and type exceptions that might be thrown or passed back information about the availability of the method in an object-oriented program (such as the keywords public, static, or prototype). in depth signatures in javascript javascript is a loosely typed or a dynamic language. that means you don't have to declare the type of a variable ahead of time. the type will get determined automatically while the program is being processed. a signature in javascript can still give you some information about the method: myobject.prototype.myfunction(value) the method is installed on an object called myobject. the method is installed on the prototype of myobject (thus it is a...
Specification - MDN Web Docs Glossary: Definitions of Web-related terms
a specification is a document that lays out in detail what functionality or attributes a product must include before delivery. in the context of describing the web, the term "specification" (often shortened to simply "spec") generally means a document describing a language, technology, or api which makes up the complete set of open web technologies. learn more general knowledge specification on wikipedia technical reference open web platform specifications ...
Statement - MDN Web Docs Glossary: Definitions of Web-related terms
every program consists of a sequence of statements. ...
Static typing - MDN Web Docs Glossary: Definitions of Web-related terms
a statically-typed language is a language (such as java, c, or c++) where variable types are known at compile time. in most of these languages, types must be expressly indicated by the programmer; in other cases (such as ocaml), type inference allows the programmer to not indicate their variable types. learn more general knowledge type system on wikipedia ...
String - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, a string is one of the primitive values and the string object is a wrapper around a string primitive. ...
Validator - MDN Web Docs Glossary: Definitions of Web-related terms
a validator is a program that checks for syntax errors in code. validators can be created for any format or language, but in our context we speak of tools that check html, css, and xml. learn more general knowledge validator on wikipedia short list of validators ...
WebIDL - MDN Web Docs Glossary: Definitions of Web-related terms
webidl is the interface description language used to describe the data types, interfaces, methods, properties, and other components which make up a web application programming interface (api). it uses a somewhat stylized syntax which is independent of any specific programming language, so that the underlying code which is used to build each api can be written in whatever language is most appropriate, while still being possible to map the api's components to javascript-compatible constructs. webidl is used in nearly every api specification for the web, and due to its standard format and syntax, the programmers who create web browsers can more easily ensure that their browsers are compatible with one another, regardless of how they choose to write the code to implement the api. learn more ...
Web standards - MDN Web Docs Glossary: Definitions of Web-related terms
ly usable and accessible. web standards also must evolve to improve the current status and adapt to new circumstances. ...
World Wide Web - MDN Web Docs Glossary: Definitions of Web-related terms
s first made public. the system we know today as "the web" consists of several components: the http protocol governs data transfer between a server and a client. to access a web component, a client supplies a unique universal identifier, called a url (uniform resource location) or uri (uniform resource identifier) (formally called universal document identifier (udi)). html (hypertext markup language) is the most common format for publishing web documents. linking, or connecting resources through hyperlinks, is a defining concept of the web, aiding its identity as a collection of connected documents. soon after inventing the web, tim berners-lee founded the w3c (world wide web consortium) to standardize and develop the web further. this consortium consists of core web interest groups, such...
Wrapper - MDN Web Docs Glossary: Definitions of Web-related terms
for example, sdk libraries for aws are examples of wrappers. ...
XPath - MDN Web Docs Glossary: Definitions of Web-related terms
xpath is a query language that can access sections and content in an xml document. learn more technical reference xpath documentation on mdn xpath specification general knowledge official website xpath on wikipedia ...
XQuery - MDN Web Docs Glossary: Definitions of Web-related terms
xquery is a computer language for updating, retrieving, and calculating data in xml databases. learn more general knowledge official website xquery on wikipedia technical reference discussion about using xquery from firefox ...
XSLT - MDN Web Docs Glossary: Definitions of Web-related terms
xslt has its own processor that accepts xml input, or any format convertible to an xquery and xpath data model. the xslt processor produces a new document based on the xml document and an xslt stylesheet, making no changes to the original files in the process. ...
Array - MDN Web Docs Glossary: Definitions of Web-related terms
arrays are used to store multiple values in a single variable. this is compared to a variable that can store only one value. each item in an array has a number attached to it, called a numeric index, that allows you to access it. in javascript, arrays start at index zero and can be manipulated with various methods. what an array in javascript looks like: let myarray = [1, 2, 3, 4]; let catnamesarray = ["jacqueline", "sophia", "autumn"]; //arrays in javascript can hold different types of data, as shown above. ...
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 encoding - MDN Web Docs Glossary: Definitions of Web-related terms
pping between bytes and text. a sequence of bytes allows for different textual interpretations. by specifying a particular encoding (such as utf-8), we specify how the sequence of bytes is to be interpreted. for example, in html we normally declare a character encoding of utf-8, using the following line: <meta charset="utf-8"> this ensures that you can use characters from just about any human language in your html document, and they will display reliably. learn more general knowledge character encoding on w3c character encoding 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. ...
LTR (Left To Right) - MDN Web Docs Glossary: Definitions of Web-related terms
ltr (left to right) is a locale property indicating that text is written from left to right. for example, the en-us locale (for us english) specifies left-to-right. most western languages, as well as many others around the world, are written ltr. the opposite of ltr, rtl (right to left) is used in other common languages, including arabic (ar) and hebrew (he). technical reference localization and internationalization ...
RTL (Right to Left) - MDN Web Docs Glossary: Definitions of Web-related terms
rtl (right to left) is a locale property indicating that text is written from right to left. for example, the he locale (for hebrew) specifies right-to-left. arabic (ar) is another common language written rtl. the opposite of rtl, ltr (left to right) is used in other languages, including english (en, en-us, en-gb, etc.), spanish (es), and french (fr). ...
Mobile accessibility - Learn web development
rs around the screen like a dial to show the rotor and move between its options. here are a few examples of the options available: speaking rate: change the speaking rate. containers: move between different semantic containers on the page. headings: move between headings on the page. links: move between links on the page. form controls: move between form controls on the page. language: move between different translations, if they are available. select headings. now you'll be able to swipe up and down to move between headings on the page. note: for a more complete reference covering the voiceover gestures available and other hints on accessibility testing on ios, see test accessibility on your device with voiceover. control mechanisms in our css and javascript acces...
Attribute selectors - Learn web development
hes any attribute value where a appears anywhere in the string, so it matches all of our list items. case-sensitivity if you want to match attribute values case-insensitively you can use the value i before the closing bracket. this flag tells the browser to match ascii characters case-insensitively. without the flag the values will be matched according to the case-sensitivity of the document language — in html's case it will be case sensitive. in the example below, the first selector will match a value that begins with a — it only matches the first list item because the other two list items start with an uppercase a. the second selector uses the case-insensitive flag and so matches all of the list items. note: there is also a newer value s, which will force case-sensitive matching in...
Pseudo-classes and pseudo-elements - Learn web development
urrent element. :hover matches when the user hovers over an element. :indeterminate matches ui elements whose value is in an indeterminate state, usually checkboxes. :in-range matches an element with a range when its value is in-range. :invalid matches an element, such as an <input>, in an invalid state. :lang matches an element based on language (value of the html lang attribute). :last-child matches an element which is last among its siblings. :last-of-type matches an element of a certain type that is last among its siblings. :left in paged media, matches left-hand pages. :link matches unvisited links. :local-link matches links pointing to pages that are in the same site as the...
Sizing items in CSS - Learn web development
he left and right. you might expect for example the percentage top and bottom margins to be a percentage of the element's height, and the percentage left and right margins to be a percentage of the element's width. however, this is not the case! when you use margin and padding set in percentages, the value is calculated from the inline size — therefore the width when working in a horizontal language. in our example, all of the margins and padding are 10% of the width. this means you can have equal-sized margins and padding all around the box. this is a fact worth remembering if you do use percentages in this way. min- and max- sizes in addition to giving things a fixed size, we can ask css to give an element a minimum or a maximum size. if you have a box that might contain a variable amoun...
CSS values and units - Learn web development
uoted color keywords along with a quoted generated content string. functions the final type of value we will take a look at is the group of values known as functions. in programming, a function is a reusable section of code that can be run multiple times to complete a repetitive task with minimum effort on the part of both the developer and the computer. functions are usually associated with languages like javascript, python, or c++, but they do exist in css too, as property values. we've already seen functions in action in the colors section — rgb(), hsl(), etc. the value used to return an image from a file — url() — is also a function. a value that behaves more like something you might find in a traditional programming language is the calc() css function. this function gives you the ...
Flexbox - Learn web development
subsequent sections. you can always refer back to it if you get confused about any of the terms being used. columns or rows? flexbox provides a property called flex-direction that specifies what direction the main axis runs in (what direction the flexbox children are laid out in) — by default this is set to row, which causes them to be laid out in a row in the direction your browser's default language works in (left to right, in the case of an english browser). try adding the following declaration to your <section> rule: flex-direction: column; you'll see that this puts the items back in a column layout, much like they were before we added any css. before you move on, delete this declaration from your example. note: you can also lay out flex items in a reverse direction using the row-reve...
Positioning - Learn web development
ty. "z-index" is a reference to the z-axis. you may recall from previous points in the course where we discussed web pages using horizontal (x-axis) and vertical (y-axis) coordinates to work out positioning for things like background images and drop shadow offsets. (0,0) is at the top left of the page (or element), and the x- and y-axes run across to the right and down the page (for left to right languages, anyway.) web pages also have a z-axis: an imaginary line that runs from the surface of your screen, towards your face (or whatever else you like to have in front of the screen). z-index values affect where positioned elements sit on that axis; positive values move them higher up the stack, and negative values move them lower down the stack. by default, positioned elements all have a z-index of...
Getting started with CSS - Learn web development
prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, and html basics (study introduction to html.) objective: to understand the basics of linking a css document to an html file, and be able to do simple text formatting with css. starting with some html our starting point is an html document. you can copy the code from below if you want to work on your own computer. ...
How CSS works - Learn web development
step is called a render tree). the render tree is laid out in the structure it should appear in after the rules have been applied to it. the visual display of the page is shown on the screen (this stage is called painting). the following diagram also offers a simple view of the process. about the dom a dom has a tree-like structure. each element, attribute, and piece of text in the markup language becomes a dom node in the tree structure. the nodes are defined by their relationship to other dom nodes. some elements are parents of child nodes, and child nodes have siblings. understanding the dom helps you design, debug and maintain your css because the dom is where your css and the document's content meet up. when you start working with browser devtools you will be navigating the dom as yo...
CSS first steps - Learn web development
es this module contains the following articles, which will take you through all the basic theory of css, and provide opportunities for you to test out some skills. what is css? css (cascading style sheets) allows you to create great-looking web pages, but how does it work under the hood? this article explains what css is, with a simple syntax example, and also covers some key terms about the language. getting started with css in this article we will take a simple html document and apply css to it, learning some practical things about the language along the way. how css is structured now that you have an idea about what css is and the basics of using it, it is time to look a little deeper into the structure of the language itself. we have already met many of the concepts discussed here; yo...
Styling text - Learn web development
here we look at text styling fundamentals including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features. we round off the module by looking at applying custom fonts to your page, and styling lists and links. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. ...
What text editors are available? - Learn web development
you will learn more about customizing your editors and tools as you gain experience, and more importantly you will learn what features are more useful to your purpos...
How do you make sure your website works properly? - Learn web development
nd more efficient use of bandwidth. 403: forbidden you aren't allowed to display the resource. usually it has to do with a configuration mistake (e.g. your hosting provider forgot to give you access rights to a directory). 404: not found self-explanatory. we'll discuss how to solve this below. 500: internal server error something went wrong on the server. for instance, maybe the server-side language (php, .net, etc.) stopped working, or the web server itself has a configuration problem. usually it's best to resort to your hosting provider's support team. 503: service unavailable usually resulting from a shortterm system overload. the server has some sort of problem. try again in a little while. as beginners checking our (simple) website, we'll deal most often with 200, 304, 403, and 4...
What is the difference between webpage, website, web server, and search engine? - Learn web development
n in the library (two books cannot be kept at the same place) which is specified by the catalog number. active learning there is no active learning available yet. deeper dive so, let's dig deeper into how those four terms are related and why they are sometimes confused with each other. web page a web page is a simple document displayable by a browser. such documents are written in the html language (which we look into in more detail in other articles). a web page can embed a variety of different types of resources such as: style information — controlling a page's look-and-feel scripts — which add interactivity to the page media — images, sounds, and videos. note: browsers can also display other documents such as pdf files or images, but the term web page specifically refers to...
What is a URL? - Learn web development
the building where your mail should be delivered; the parameters represent extra information such as the number of the apartment in the building; and, finally, the anchor represents the actual person to whom you've addressed your mail. how to use urls any url can be typed right inside the browser's address bar to get to the resource behind it. ...
What is a Domain Name? - Learn web development
domain name. tld (top-level domain). tlds tell users the general purpose of the service behind the domain name. the most generic tlds (.com, .org, .net) don't require web services to meet any particular criteria, but some tlds enforce stricter policies so it is clearer what their purpose is. for example: local tlds such as .us, .fr, or .se can require the service to be provided in a given language or hosted in a certain country — they are supposed to indicate a resource in a particular language or country. tlds containing .gov are only allowed to be used by government departments. the .edu tld is only for use by educational and academic institutions. tlds can contain special as well as latin characters. a tld's maximum length is 63 characters, although most are around 2–3. th...
What is accessibility? - Learn web development
a few necessities for basic web accessibility include: whenever your site needs an image to convey meaning, include text as an alternative for visually-challenged users or those with slow connections. make sure all users can operate graphical interfaces (like unfolding menus) solely with a keyboard (e.g., with tab and the return key). provide an attribute explicitly specifying your content's language, so that screen readers read your text properly. make sure that a user can navigate to all widgets on a page solely with the keyboard, without getting trapped. (at least let them tab in and out.) and that's just the beginning. accessibility champions since 1999, the w3c has operated a working group called the web accessibility initiative (wai) promoting accessibility through guidelines, supp...
Client-side form validation - Learn web development
u saw in the html5 validation constraint examples earlier, each time a user tries to submit an invalid form, the browser displays an error message. the way this message is displayed depends on the browser. these automated messages have two drawbacks: there is no standard way to change their look and feel with css. they depend on the browser locale, which means that you can have a page in one language but an error message displayed in another language, as seen in the following firefox screenshot. customizing these error messages is one of the most common use cases of the constraint validation api. let's work through a simple example of how to do this. we'll start with some simple html (feel free to put this in a blank html file; use a fresh copy of fruit-start.html as a basis, if you like...
Your first form - Learn web development
he form will send 3 pieces of data named "user_name", "user_email", and "user_message". that data will be sent to the url "/my-handling-form-page" using the http post method. on the server side, the script at the url "/my-handling-form-page" will receive the data as a list of 3 key/value items contained in the http request. the way this script will handle that data is up to you. each server-side language (php, python, ruby, java, c#, etc.) has its own mechanism of handling form data. it's beyond the scope of this guide to go deeply into that subject, but if you want to know more, we have provided some examples in our sending form data article later on. summary congratulations, you've built your first web form. it looks like this live: that's only the beginning, however — now it's time to t...
Front-end web developer - Learn web development
b developer. simply work through each section, learning new skills (or improving existing ones) as you go along. each section includes exercises and assessments to test your understanding before you move forward. subjects covered the subjects covered are: basic setup and learning how to learn web standards and best practices (such as accessibility and cross-browser compatibility) html, the language that gives web content structure and meaning css, the language used to style web pages javascript, the scripting language used to create dynamic functionality on the web tooling that is used to facilitate modern client-side web development. you can work through sections in order, but each one is also self-contained. for example, if you already know html, you can skip ahead to the css section...
CSS basics - Learn web development
g started with the web next css (cascading style sheets) is the code that styles web content. css basics walks through what you need to get started. we'll answer questions like: how do i make text red? how do i make content display at a certain location in the (webpage) layout? how do i decorate my webpage with background images and colors? what is css? like html, css is not a programming language. it's not a markup language either. css is a style sheet language. css is what you use to selectively style html elements. for example, this css selects paragraph text, setting the color to red: p { color: red; } let's try it out! using a text editor, paste the three lines of css (above) into a new file. save the file as style.css in a directory named styles. to make the code work, we still ...
Dealing with files - Learn web development
roughout this article, we ask you to name folders and files completely in lowercase with no spaces. this is because: many computers, particularly web servers, are case-sensitive. so for example, if you put an image on your website at, test-site/myimage.jpg and then in a different file you try to invoke the image as test-site/myimage.jpg, it may not work. browsers, web servers, and programming languages do not handle spaces consistently. for example, if you use spaces in your filename, some systems may treat the filename as two filenames. some servers will replace the areas in your filenames with "%20" (the character code for spaces in uris), resulting in all your links being broken. it's better to separate words with dashes, rather than underscores: my-file.html vs. my_file.html. the short a...
How the Web works - Learn web development
b address in your browser, the browser looks at the dns to find the website's real address before it can retrieve the website. the browser needs to find out which server the website lives on, so it can send http messages to the right place (see below). this is like looking up the address of the shop so you can access it. http: hypertext transfer protocol is an application protocol that defines a language for clients and servers to speak to each other. this is like the language you use to order your goods. component files: a website is made up of many different files, which are like the different parts of the goods you buy from the shop. these files come in two main types: code files: websites are built primarily from html, css, and javascript, though you'll meet other technologies a bit late...
Add a hitmap on top of an image - Learn web development
it clear what happens when people follow image links. alt text is mandatory, of course, but many people never see it. the image must clearly indicate where hotspots begin and end. hotspots must be large enough to tap comfortably, at any viewport size. how large is large enough? 72 × 72 css pixels is a good minimum, with additional generous gaps between touch targets. the map of the world at 50languages.com (as of time of writing) illustrates the problem perfectly. it’s much easier to tap russia or north america than albania or estonia. you insert your image much the same way as always (with an <img> element and alt text). if the image is only present as a navigation device, you may write alt="", provided you furnish appropriate alt text in the <area> elements later on. you will need a spe...
Define terms with HTML - Learn web development
ept foreign to html, but there are tags for indicating emphasis. special case: abbreviations it's best to mark abbreviations specially with <abbr>, so that screen readers read them appropriately and so that you can operate on all abbreviations uniformly. just as with any new keyword, you should define your abbreviations the first time they occur. <p> <dfn><abbr>html</abbr> (hypertext markup language)</dfn> is a description language used to structure documents on the web. </p> the html spec does indeed set aside the title attribute for expanding the abbreviation. however, this is not an acceptable alternative for providing an inline expansion. the contents of title are completely hidden from your users, unless they're using a mouse and they happen to hover over the abbreviation. the spec...
Use HTML to solve common problems - Learn web development
Learn › HTML › Howto
l of html line breaking how to mark changes (added and removed text) — see the <ins> and <del> elements. ...
Advanced text formatting - Learn web development
xtarea.value; } else { solutionentry = textarea.value; } updatecode(); }; abbreviations another fairly common element you'll meet when looking around the web is <abbr> — this is used to wrap around an abbreviation or acronym, and provide a full expansion of the term (included inside a title attribute.) let's look at a couple of examples: <p>we use <abbr title="hypertext markup language">html</abbr> to structure our web documents.</p> <p>i think <abbr title="reverend">rev.</abbr> green did it in the kitchen with the chainsaw.</p> these will come out looking something like this (the expansion will appear in a tooltip when the term is hovered over): note: there is another element, <acronym>, which basically does the same thing as <abbr>, and was intended specifically for ac...
Adding vector graphics to the Web - Learn web development
in each case representing a raster image, and the right-hand star representing a vector image. again, go to the vector-versus-raster.html demo for a real example! moreover, vector image files are much lighter than their raster equivalents, because they only need to hold a handful of algorithms, rather than information on every pixel in the image individually. what is svg? svg is an xml-based language for describing vector images. it's basically markup, like html, except that you've got many different elements for defining the shapes you want to appear in your image, and the effects you want to apply to those shapes. svg is for marking up graphics, not content. at the simplest end of the spectrum, you've got elements for creating simple shapes, like <circle> and <rect>. more advanced svg featu...
Test your skills: Multimedia and embedding - Learn web development
s the sources point to, so it can make an informed choice of which one to download ahead of time. give the <video> a width and height equal to its intrinsic size (320 by 240 pixels). make the video muted by default. display the text tracks contained in the media folder, in a file called subtitles_en.vtt, when the video is playing. you must explicitly set the type as subtitles, and the subtitle language to english. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. multimedia and embedding 3 for this final task you have two tasks to do: embed a pdf into the page. the pdf is called mypdf.pdf, and is contained in the media folder. go to a sharing site like youtube or google map...
HTML table advanced features and accessibility - Learn web development
d on the <table> element to provide a description — this is also read out by screenreaders. we'd recommend using the <caption> element instead, however, as summary is deprecated by the html5 spec, and can't be read by sighted users (it doesn't appear on the page.) active learning: adding a caption let's try this out, revisiting an example we first met in the previous article. open up your language teacher's school timetable from the end of html table basics, or make a local copy of our timetable-fixed.html file. add a suitable caption for the table. save your code and open it in a browser to see what it looks like. note: you can find our version on github — see timetable-caption.html (see it live also). adding structure with <thead>, <tfoot>, and <tbody> as your tables get a bit ...
HTML table basics - Learn web development
Learn › HTML › Tables › Basics
could just include one <col> element with a span attribute on it, like this: <colgroup> <col style="background-color: yellow" span="2"> </colgroup> just like colspan and rowspan, span takes a unitless number value that specifies the number of columns you want the styling to apply to. active learning: colgroup and col now it's time to have a go yourself. below you can see the timetable of a languages teacher. on friday she has a new class teaching dutch all day, but she also teaches german for a few periods on tuesday and thursdays. she wants to highlight the columns containing the days she is teaching. recreate the table by following the steps below. first, make a local copy of our timetable.html file in a new directory on your local machine. the html contains the same table you saw a...
Making asynchronous programming easier with async and await - Learn web development
these features basically act as syntactic sugar on top of promises, making asynchronous code easier to write and to read afterwards. they make async code look more like old-school synchronous code, so they're well worth learning. this article gives you what you need to know. prerequisites: basic computer literacy, a reasonable understanding of javascript fundamentals, an understanding of async code in general and promises. ...
General asynchronous programming concepts - Learn web development
uce the concept of threads. threads a thread is basically a single process that a program can use to complete tasks. each thread can only do a single task at once: task a --> task b --> task c each task will be run sequentially; a task has to complete before the next one can be started. as we said earlier, many computers now have multiple cores, so can do multiple things at once. programming languages that can support multiple threads can use multiple cores to complete multiple tasks simultaneously: thread 1: task a --> task b thread 2: task c --> task d javascript is single-threaded javascript is traditionally single-threaded. even with multiple cores, you could only get it to run tasks on a single thread, called the main thread. our example from above is run like this: main thread: rend...
Introducing asynchronous JavaScript - Learn web development
cond one, or by simply moving it inside the second then() block. try fixing this now. note: if you get stuck, you can find an answer here (see it running live also). you can also find a lot more information on promises in our graceful asynchronous programming with promises guide, later on in the module. conclusion in its most basic form, javascript is a synchronous, blocking, single-threaded language, in which only one operation can be in progress at a time. but web browsers define functions and apis that allow us to register functions that should not be executed synchronously, and should instead be invoked asynchronously when some kind of event occurs (the passage of time, the user's interaction with the mouse, or the arrival of data over the network, for example). this means that you can le...
Graceful asynchronous programming with Promises - Learn web development
this is useful for setting up a sequence of async operations to work correctly. this article shows you how promises work, how you'll see them in use with web apis, and how to write your own. prerequisites: basic computer literacy, a reasonable understanding of javascript fundamentals. objective: to understand promises and how to use them. ...
Asynchronous JavaScript - Learn web development
s and intervals here we look at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g. a set number of times per second), talk about what they are useful for, and look at their inherent issues. handling async operations gracefully with promises promises are a comparatively new feature of the javascript language that allow you to defer further actions until after the previous action has completed, or respond to its failure. this is really useful for setting up a sequence of operations to work correctly. this article shows you how promises work, where you'll see them in use in webapis, and how to write your own. making asynchronous programming easier with async and await promises can be somewhat complex...
Looping code - Learn web development
here we'll look at the loop structures available in javascript that handle such needs. prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps. objective: to understand how to use loops in javascript. keep me in the loop loops, loops, loops. as well as being associated with popular breakfast cereals, roller coasters, and musical production, they are also a critical concept in programming. ...
Making decisions in your code — conditionals - Learn web development
for example, in a game, if the player's number of lives is 0, then it's game over. in a weather app, if it is being looked at in the morning, show a sunrise graphic; show stars and a moon if it is nighttime. in this article, we'll explore how so-called conditional statements work in javascript. prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps. objective: to understand how to use conditional structures in javascript. ...
JavaScript building blocks - Learn web development
of html and css, and you should have also worked through our previous module, javascript first steps. note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch. guides making decisions in your code — conditionals in any programming language, code needs to make decisions and carry out actions accordingly depending on different inputs. for example, in a game, if the player's number of lives is 0, then it's game over. in a weather app, if it is being looked at in the morning, show a sunrise graphic; show stars and a moon if it is nighttime. in this article we'll explore how conditional structures work in javascript. looping code some...
Fetching data from the server - Learn web development
nt is only reloaded from the server when it has been updated. a basic ajax request let's look at how such a request is handled, using both xmlhttprequest and fetch. for these examples, we'll request data out of a few different text files and use them to populate a content area. this series of files will act as our fake database; in a real application, we'd be more likely to use a server-side language like php, python, or node to request our data from a database. here, however, we want to keep it simple and concentrate on the client-side part of this. xmlhttprequest xmlhttprequest (which is frequently abbreviated to xhr) is a fairly old technology now — it was invented by microsoft in the late '90s, and has been standardized across browsers for quite a long time. to begin this exampl...
A first splash into JavaScript - Learn web development
javascript is. objective: to have a first bit of experience at writing some javascript, and gain at least a basic understanding of what writing a javascript program involves. you won't be expected to understand all of the code in detail immediately — we just want to introduce you to the high-level concepts for now, and give you an idea of how javascript (and other programming languages) work. in subsequent articles, you'll revisit all these features in a lot more detail! note: many of the code features you'll see in javascript are the same as in other programming languages — functions, loops, etc. the code syntax looks different, but the concepts are still largely the same. thinking like a programmer one of the hardest things to learn in programming is not the syntax yo...
Object-oriented JavaScript for beginners - Learn web development
fer to, which is sometimes called a namespace), making it easy to structure and access; objects are also commonly used as data stores that can be easily sent across the network. defining an object template let's consider a simple program that displays information about the students and teachers at a school. here we'll look at oop theory in general, not in the context of any specific programming language. to start this off, we could return to our person object type from our first objects article, which defines the generic data and functionality of a person. there are lots of things you could know about a person (their address, height, shoe size, dna profile, passport number, significant personality traits ...) , but in this case we are only interested in showing their name, age, gender, and inte...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
to show the correct number of todos still to complete, and correctly apply styling to completed todos (i.e. where the checkbox has been checked). we'll also wire up our "clear completed" button. along the way, we'll learn about using conditional rendering in our templates. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to continue our learning about components classes, start looking at conditional rendering, and wire up some of our footer functionality. connecting the behavio...
Ember interactivity: Events, classes and state - Learn web development
our app, providing the ability to add and display new todo items. along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep track of the data state of our app. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to learn how to create component classes and use events to control interactivity, and keep track of app state using a service. adding interactivity now we've ...
Ember resources and troubleshooting - Learn web development
previous overview: client-side javascript frameworks next our final ember article provides you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other information. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to provide further resource links and troubleshooting information. further resources ember.js guides tutorial: super rentals ember.js api documentation ember.js discord serv...
Routing in Ember - Learn web development
previous overview: client-side javascript frameworks next in this article we learn about routing, or url-based filtering as it is sometimes referred to. we'll use it to provide a unique url for each of the three todo views — "all", "active", and "completed". prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to learn about implementing routing in ember. url-based filtering ember comes with a routing system that has a tight integration with the browser url. typical...
Ember app structure and componentization - Learn web development
previous overview: client-side javascript frameworks next in this article we'll get right on with planning out the structure of our todomvc ember app, adding in the html for it, and then breaking that html structure into components. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to learn how to structure an ember app, and then break that structure into components. planning out the layout of the todomvc app in the last article we set up a new ember project, t...
Accessibility in React - Learn web development
previous overview: client-side javascript frameworks next in our final tutorial article, we'll focus on (pun intended) accessibility, including focus management in react, which can improve usability and reduce confusion for both keyboard-only and screenreader users. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to learn about implementing keyboard accessibility in react. including keyboard users at this point, we've accomplished all of the features we set out to implement. a user can add a new task, check and uncheck tasks, delete tasks, or edit task names. and they can filter their task list by all, active, or completed tasks. or, at least: they can do all of the...
Componentizing our React app - Learn web development
his point, our app is a monolith. before we can make it do things, we need to break it apart into manageable, descriptive components. react doesn’t have any hard rules for what is and isn’t a component – that’s up to you! in this article we will show you a sensible way to break our app up into components. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to show a sensible way of breaking our todo list app into components. defining our first component defining a component can seem tricky until you have some practice, but the gist is: if it represents an obvious "chunk" of your app, it's probably a component if it gets reused often, it's probably a component. that s...
Getting started with React - Learn web development
ent-side javascript frameworks next in this article we will say hello to react. we'll discover a little bit of detail about its background and use cases, set up a basic react toolchain on our local computer, and create and play with a simple starter app — learning a bit about how react works in the process. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. react uses an html-in-javascript syntax called jsx (javascript and xml). familiarity with both html and javascript will help you to learn jsx, and better identify whether bugs in your application are related to javascript or to the more specific domain of react. objective: to set up a local react development environment, create a star...
React interactivity: Events and state - Learn web development
it's now time to start updating our app from a completely static ui to one that actually allows us to interact and change things. in this article we'll do this, digging into events and state along the way, and ending up with an app in which we can successfully add and delete tasks, and toggle tasks as completed. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to learn about handling events and state in react, and use those to start making the case study app interactive. handling events if you've only written vanilla javascript before now, you might be used to having a separate javascript file, where you query for some dom nodes and attach listeners to them. for example: cons...
React interactivity: Editing, filtering, conditional rendering - Learn web development
d of our react journey (for now at least), we'll add the finishing touches to the main areas of functionality in our todo list app. this includes allowing you to edit existing tasks, and filtering the list of tasks between all, completed, and incomplete tasks. we'll look at conditional ui rendering along the way. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to learn about conditional rendering in react, and implementing list filtering and an editing ui in our app. editing the name of a task we don’t have a user interface for editing the name of a task yet. we'll get to that in a moment. to start with, we can at least implement an edittask() function in app.js. it’ll be ...
React resources - Learn web development
objective: to provide further resources for learning more about react. ...
Beginning our React todo list - Learn web development
lace, ready for individual component definition and interactivity, which we'll add later. note: if you need to check your code against our version, you can find a finished version of the sample react app code in our todo-react repository. for a running live version, see https://mdn.github.io/todo-react-build/. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to introduce our todo list case study, and get the basic app structure and styling in place. our app's user stories in software development, a user story is an actionable goal from the perspective of the user. defining user stories before we begin our work will help us focus our work. our app should fulfill the following...
Starting our Svelte Todo list app - Learn web development
in subsequent articles. we want our users to be able to browse, add and delete tasks, and also to mark them as complete. this will be the basic functionality that we'll be developing in this tutorial series, plus we'll look at some more advanced concepts along the way too. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: to learn how to create a svelte component, render it inside another component, pass data into it using props, and save its state. code along with us git clone the github repo (if you haven't already done it) with: git clone ht...
Componentizing our Svelte app - Learn web development
tarted developing our todo list app. the central objective of this article is to look at how to break our app into manageable components and share information between them. we'll componentize our app, then add more functionality to allow users to update existing components. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: to learn how to break our app into components and share information among them. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git ...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
ntize our app. we will learn how to deal with reactivity issues related to updating objects and arrays. to avoid common pitfalls, we'll have to dig a little deeper into svelte's reactivity system. we'll also look at solving some accessibility focus issues, and more besides. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn some advanced svelte techniques involving solving reactivity issues, keyboard accessibility problems to do with component lifecycle, and more. we'll focus on some accessibility issues involving focus management. to do so, w...
Working with Svelte stores - Learn web development
nd exposing component functionality. in this article we will show another way to handle state management in svelte — stores. stores are global global data repositories that hold values. components can subscribe to stores and receive notifications when their values change. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn how to use svelte stores using stores we will create an alert component that shows notifications on screen, which can receive messages from any component. in this case, the alert component is independent from the rest — i...
Dynamic behavior in Svelte: working with variables and props - Learn web development
e have our markup and styles ready we can start developing the required features for our svelte to-do list app. in this article we'll be using variables and props to make our app dynamic, allowing us to add and delete todos, mark them as complete, and filter them by status. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn and put into practice some basic svelte concepts, like creating components, passing data using props, render javascript expressions into our markup, modify the components state and iterating over lists. code along with us ...
Using Vue computed properties - Learn web development
previous overview: client-side javascript frameworks next in this article we'll add a counter that displays the number of completed todo items, using a feature of vue called computed properties. these work similarly to methods, but only re-run when one of their dependencies changes. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to l...
Vue conditional rendering: editing existing todos - Learn web development
o edit existing todo items. to do this, we will take advantage of vue's conditional rendering capabilities — namely v-if and v-else — to allow us to toggle between the existing todo item view, and an edit view where you can update todo item labels. we'll also look at adding functionality to delete todo items. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. ...
Creating our first Vue component - Learn web development
lling components inside other components, passing data to them via props, and saving data state. note: if you need to check your code against our version, you can find a finished version of the sample vue app code in our todo-vue repository. for a running live version, see https://mdn.github.io/todo-vue/dist/. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. ...
Getting started with Vue - Learn web development
vue, the third of our frameworks. in this article we'll look at a little bit of vue background, learn how to install it and create a new project, study the high-level structure of the whole project and an individual component, see how to run the project locally, and get it prepared to start building our example. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. ...
Adding a new todo form: Vue events, methods, and models - Learn web development
next is the ability to allow our users to enter their own todo items into the app, and for that we'll need a text <input>, an event to fire when the data is submitted, a method to fire upon submission to add the data and rerender the list, and a model to control the data. this is what we'll cover in this article. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. ...
Focus management with Vue refs - Learn web development
put another way, how we can improve our app's keyboard accessibility. we'll look at using vue refs to handle this — an advanced feature that allows you to have direct access to the underlying dom nodes below the virtual dom, or direct access from one component to the internal dom structure of a child component. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. ...
Rendering a list of Vue components - Learn web development
works next at this point we've got a fully working component; we're now ready to add multiple todoitem components to our app. in this artcle we'll look at adding a set of todo item data to our app.vue component, which we'll then loop through and display inside todoitem components using the v-for directive. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. ...
Vue resources - Learn web development
previous overview: client-side javascript frameworks next now we'll round off our study of vue by giving you a list of resources that you can use to go further in your learning, plus some other useful tips. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn where to go to find further information on vue, to continue your learnin...
Styling Vue components with CSS - Learn web development
previous overview: client-side javascript frameworks next the time has finally come to make our app look a bit nicer. in this article we'll explore the different ways of styling vue components with css. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn about styling vue components. styling vue components with css before...
Understanding client-side JavaScript frameworks - Learn web development
ork choices, to provide you with enough context and familiarity to start going into greater depth yourself. we want you to go forward and learn about frameworks in a pragmatic way that doesn't forget about web platform fundamental best practices such as accessibility. get started now, with "introduction to client-side frameworks" prerequisites you should really learn the basics of the core web languages first before attempting to move on to learning client-side frameworks — html, css, and especially javascript. your code will be richer and more professional as a result, and you'll be able to troubleshoot problems with more confidence if you understand the fundamental web platform features that the frameworks are building on top of. looking to become a front-end web developer? we have put ...
Handling common accessibility problems - Learn web development
previous overview: cross browser testing next next we turn our attention to accessibility, providing information on common problems, how to do simple testing, and how to make use of auditing/automation tools for finding accessibility issues. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross browser testing. objective: to be able to diagnose common accessibility problems, and use appropriate tools and techniques to fix them. what is accessibility? when we say accessibility in the context of web technology, most people immediately think of making sure websites/apps are usable by people with disabilities, for example: visually impaired people using screen readers or magnification/zo...
Introduction to automated testing - Learn web development
, can get tedious, and time-consuming. to handle this efficiently, you should become familiar with automation tools. in this article, we look at what is available, how to use task runners, and how to use the basics of commercial browser test automation apps such as lambdatest, sauce labs, browserstack, and testingbot. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing. objective: to provide an understanding of what automated testing entails, how it can make your life easier, and how to make use of some of the commercial products that make things easier. automation makes things easy throughout this module we have detailed loads of different ways in which you can test your websit...
Implementing feature detection - Learn web development
on whether it does (or doesn't), so that the browser can always provide a working experience rather than crashing/erroring in some browsers. this article details how to write your own simple feature detection, how to use a library to speed up implementation, and native features for feature detection such as @supports. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross-browser testing. objective: to understand what the concept of feature detection is, and be able to implement suitable solutions in css and javascript. the concept of feature detection the idea behind feature detection is that you can run a test to determine whether a feature is supported in the current browser, and then condition...
Introduction to cross browser testing - Learn web development
objective: to gain an understanding of the high-level concepts involved in cross browser testing. what is cross browser testing? cross browser testing is the practice of making sure that the web sites and web apps you create work across an acceptable number of web browsers. as a web developer, it is your responsibility to make sure that not only do your projects work, but th...
Strategies for carrying out testing - Learn web development
objective: to gain an understanding of the high-level concepts involved in cross-browser testing. gotta test 'em all? when doing cross-browser testing, you need to work out a list of browsers you will need to test on to start with. there is no way you can test on every combination of browser and device your users...
Cross browser testing - Learn web development
and how to mitigate them, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here. guides introduction to cross browser testing this article starts the module off by providing an overview of the topic of cross browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fix...
Deploying our app - Learn web development
evious overview: understanding client-side tools in the final article in our series, we take the example toolchain we built up in the previous article and add to it so that we can deploy our sample app. we push the code to github, deploy it using netlify, and even show you how to add a simple test into the process. prerequisites: familiarity with the core html, css, and javascript languages. objective: to finish working through our complete toolchain case study, focusing on deploying the app. post development there's potentially a large range of problems to be solved in this section of the project's lifecycle. as such, it's important to create a toolchain that handles these problems in a way that requires as little manual intervention as possible. here's just a...
Understanding client-side web development tools - Learn web development
most common client-side tool types, explain the tools you can chain together, how to install them using package managers, and control them using the command line. we finish up by providing a complete toolchain example showing you how to get productive. get started now, with our "client-side tooling overview" prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started guides 1. client-side tooling overview in this article we provide an overview of modern web tooling, what kinds of tools are available and where you’ll meet them ...
Tools and testing - Learn web development
ood industry support. in most cases there are other tools available, old ones will go out of fashion, and new ones will no doubt appear. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use many the tools detailed here. for example, you'll need to know the fundamentals of these languages before you start debugging problems in complex web code, making effective use of javascript frameworks, or writing tests and running them against your code using test runners. in addition, you should start with the first module in this topic, which gives a useful ove...
Accessibility API cross-reference
accessibility initiative, which uses markup syntax quite familiar to users of html, xml, sgml and others. the roles it specifies have already informed the 'semantic elements' of html5 (such as main and footer), but there is not a one-to-one mapping between the aria roles and the semantics of html5. aria can be used to 'fill out' the missing semantics of html, but may also be used in other markup languages (such as svg) and expresses semantics using attributes, compared with html, which tends to have distinct named elements for its roles. for all these reasons, aria and html are given separate columns. aria abstract roles should not be used by content authors. the gnome accessibility architecture is implemented via atk and at-spi, and was implemented by sun microsystems. it will be reused for kde...
Multiprocess on Windows
midl. this does not (yet) work as transparently as we would like. com metadata midl outputs two different types of metadata: "fast format strings" (also known as oicf) and (optionally, if a library statement is included in the idl) type libraries (also known as typelib). oicf metadata is much richer than typelib metadata, however com requires typelibs whenever it is being used with interpreted languages. in particular, typelibs were originally designed to work with 1990s-era visual basic. typelib metadata is limited to supporting the same language features which were supported by vb at that time. given those two options, it may seem that oicf is the preferred format. however, for various reasons, our com interceptor currently only supports typelib metadata. in order for the interceptor to be a...
Mozilla’s UAAG evaluation report
h: not supported summary for table: supported title for frame: ? longdesc for frame: not supported, see bug 3658 noframe for frame: must use user style sheets to render this. a ui for this would be good. noscript for script: must use user style sheets to render this. a ui for this would be good. 2.10 toggle placeholders. (p3) ni 2.11 alert unsupported language. (p3) nr ? guideline 3. allow configuration not to render some content that may reduce accessibility. checkpoint title status notes/plans 3.1 toggle background images. (p1) c preferences, appearance, colors - "use my chosen colors, ignoring the colors and background image specified" 3.2 toggle audio, video, animated images. (p1) p a...
Frequently Asked Questions for Lightweight themes
s create two graphics files in your favorite graphics editing program (e.g., photoshop). to get started read more about how to create a theme. are there any content guidelines? yes. we are big fans of creativity, but want to ensure that the art displayed in the themes gallery meets a basic set of guidelines. please review the terms of service and conditions of use for authoritative and complete language. do i still retain ownership over artwork that i upload? yes. your artwork will always be your artwork. after creating a lightweight theme, can i edit the design? yes. if at any point you need to edit or delete your theme design after it has been submitted to the gallery, you can access it from the submissions dashboard. from there, you can view your current designs. by clicking on each, you ...
Add-ons
on amo, but your add-on must be signed by mozilla else users will not be able to install it. for an overview for the process of publishing your add-on see signing and distributing your add-on. other types of add-ons in addition to extensions, there are a few other add-on types that allow users to customize firefox. those add-ons include: user dictionaries let you spell-check in different languages. language packs let you have more languages available for the user interface of firefox. ...
Testopia
o the new testopia folder (capital t). if you are on windows or another case insensitive file system you should first rename the folder (testopia-old for example) and then unzip the tarball. you can then merge your changes before deleting the old version. api users take note: positional parameters are now deprecated. all params should now be sent in a hash (struct, dict, hashmap or whatever your language of choice calls key, value pairs). though all attempts have been made to provide continuing support for positional parameters, please be aware that some api calls may fail until you make this change. also, future versions may remove this support completely. as always please backup your installation before attempting to install or upgrade. testopia 2.3 this version supports bugzilla 3.4. the ma...
The Firefox codebase: CSS Guidelines
all the background-image when high contrast mode is enabled. consider using an actual <img> tag (for html documents) or list-style-image (for xul documents) if rendering the image is important. if you are not using windows, one way to test against those adjustments on other platforms is: going to about:preferences clicking on the "colors..." button in the "fonts & colors" sub-section of the "language and appearance" section under "override the colors specified by the page with your selections above", select the "always" option chrome area the automatic adjustments previously mentioned only apply to pages rendered in the content area. the chrome area of firefox uses colors as authored, which is why using pre-defined variables, currentcolor or inheritance is useful to integrate with the sys...
Eclipse CDT Manual Setup
the project. doing this prevents the "searching for binaries" which eclipse constantly starts from taking too long. select "c/c++ general > preprocessor include paths, macros, and so on." select the providers tab. make sure that "cdt gcc build output parser" is selected, and that "cdt managed build settings entries" is not selected. highlight (select) "cdt gcc build output parser", then in the "language settings provider options" that appear below, make sure that "share setting entries between projects (global provider)" is not ticked. if the main object directory for your source tree is a fennec build: in the "cdt gcc build output parser", change the compiler command pattern to (.*gcc)|(.*[gc]\+\+)|(clang) (before this change it should have been "(gcc)|([gc]\+\+)|(clang)"). this pattern is ...
Eclipse
there are versions of eclipse for several of the different languages that are used by mozilla. for documentation on using eclipse cdt for mozilla c/c++ development, see the eclipse cdt page. ...
Interface Compatibility
web content apis which are visible to web content are not modified, except as a last resort when inherent security vulnerabilities or incompatibility with other browsers make it the only option. any changes, including new features, must have super-review. ...
Interface development guide
idl interface rules design guidelines and rules when creating and changing xpcom interfaces. ...
Obsolete Build Caveats and Tips
lity, you should probably not need to do this, since that code is very obsolete. this note below seems redundant as this is true by default https://msdn.microsoft.com/en-us/library/dh8che7s%28v=vs.110%29.aspx note: starting with gecko 7.0, you should no longer include "-zc:wchar_t-" in the command line when building on windows. if you're using visual studio, go to project properties > c/c++ > language > treat wchar_t as built-in type and set it to "yes". from source_code/mercurial mozilla-2.0 (firefox 4.0) code for the firefox 4.0 (gecko 2.0) release lives in releases/mozilla-2.0. to get this code, do the following: # pull the mozilla source to the folder 20src/ - may take a while # as hundreds of megabytes of history is downloaded to .hg hg clone https://hg.mozilla.org/releases/mozilla...
Reviewer Checklist
ure the patch doesn't create any unused code (e.g., remove strings when removing a feature) all caught exceptions should be logged at the appropriate level, bearing in mind personally identifiable information, but also considering the expense of computing and recording log output. [fennec: checking for log levels is expensive unless you're using logger.] style follow the style guide for the language and module in question. follow local style for the surrounding code, even if that local style isn't formally documented. new files have license declarations and modelines. new js files should use strict mode. trailing whitespace (git diff and splinter view both highlight this, as does hg with the color extension enabled). whitespace can be fixed easily in mercurial using the checkfiles extens...
mach
ch core to execute. the canonical source repository for the mach core is the python/mach directory in mozilla-central. the main mach routine lives in main.py. the mach driver is the mach file in the root directory of mozilla-central. as you can see, the mach driver is a shim that calls into the mach core. as you may have inferred, mach is implemented in python. python is our tooling programming language of choice at mozilla. mach is also python 3 compliant (at least it should be). adding features to mach most mach features come in the form of new commands. implementing new commands is as simple as writing a few lines of python and registering the created file with mach. the first step to adding a new feature to mach is to file a bug. you have the choice of filing a bug in the core :: mach com...
Index
ary 1 firefox firefox, landing, mozilla here you can learn about how to contribute to the firefox project and you will also find links to information about the construction of firefox add-ons, using the developer tools in firefox, and other topics. 3 building firefox with rust code build documentation, gecko, build, rust in may 2015 the rust programming language reached its 1.0 stability milestone, and various experiments with writing parts of gecko in rust began. rust code first shipped in august 2016 with the release of firefox 48. it became a requirement for building gecko in february 2017 with firefox 54. 8 experimental features in firefox experimental, firefox, preferences, features this page lists features that are in nightly v...
Script security
eferred to as chrome code, runs with system privileges. if the code is compromised, the attacker can take over the user's computer. legacy sdk extensions also run with chrome privileges. having the browser front end in javascript has benefits: it can be much quicker to develop in javascript than in c++, and contributors do not need to learn c++. however, javascript is a highly dynamic, malleable language, and without help it's difficult to write system-privileged code that interacts safely with untrusted web content. from the point of view of chrome code, the script security model in gecko is intended to provide that help to make writing secure, system-privileged javascript a realistic expectation. security policy gecko implements the following security policy: objects that are same-origin a...
IME handling guide
mpts to input, commits composition string as a selected item off the list and commits composition string without any conversion. ime is used by chinese, japanese, korean and taiwan users for inputting chinese characters because the number of them is beyond thousands and cannot be input from the keyboard directly. however, especially on mobile devices nowadays, ime is also used for inputting latin languages like autocomplete. additionally, ime may be used for handwriting systems or speech input systems on some platforms. if ime is available on focused elements, we call that state "enabled". if ime is not fully available(i.e., user cannot enable ime), we call this state "disabled". if ime is enabled but users use direct input mode (e.g., for inputting latin characters), we call it "ime is closed".
PBackground
pbackground is a mechanism available since gecko 30 (see bug 956218) that builds on top of ipdl to provide a solution to common problems that arise when handling multiple threads in the chrome process, for example communication between workers and multiple child processes and other parent-process worker threads. this article outlines what pbackground is, and how it works. ipdl recap ipdl is a language used to define "protocols" — essentially formalized versions of how two things can communicate. it is similar in some respects to idl and webidl. at build time the ipdl compiler automatically generates a large amount of c++ glue code from the ipdl files. ipdl protocols are used to specify how the chrome and content processes talk to each other and verify that a content process is "following the...
Promise
bugging by design, the instant state and value of a promise cannot be inspected synchronously from code, without calling the then() method. to help with debugging, only when inspecting a promise object manually, you can see more information as special properties that are inaccessible from code (this, at present, is implemented by randomizing the property name, for the lack of more sophisticated language or debugger support). these code-inaccessible, inspectable properties are: {{private:status}}: 0 for pending, 1 for fulfilled, or 2 for rejected. {{private:value}}: fulfillment value or rejection reason, for fulfilled or rejected promises only. {{private:handlers}}: array of objects holding references to functions registered by the then() method, for pending promises only. examples see...
Encodings for localization files
chinesebig5_charset cp950 136 easteurope_charset cp1250 238 gb2312_charset cp936 134 greek_charset cp1253 161 hangul_charset cp949 129 russian_charset cp1251 204 shiftjis_charset cp932 128 turkish_charset cp1254 162 vietnamese_charset cp1258 163 middle east language editions of windows: arabic_charset cp1256 178 hebrew_charset cp1255 177 thai language editions of windows: thai_charset cp874 222 ...
L10n Checks
mode l10n checks gathers the locales to compare from the chrome.manifest file inside the xpi file. you pass the path to the xpi file (optionally) followed by the locale codes of the locales you want to compare. if you want to test the localization for de, run: check-l10n-completeness -i xpi my-extension.xpi de to check all locales in an extension: check-l10n-completeness -i xpi my-extension.xpi language packs (xpis) mode l10n checks can compare two locales found in different xpi files. you pass both paths to the xpi file and both paths to the locales inside the files, e.g.: check-l10n-completeness -i xpis en-us-langpack.xpi my-langpack.xpi jar:chrome/en-us.jar!locale/ jar:chrome/my.jar!locale/my/ jar/zip file (jar) mode l10n checks can compare two locales found in different jar files. you pass ...
L10n testing with xcode
ton. xcode will import your translated strings into the project by adding them to the project folder and replacing the existing strings. next, you need to configure the ios app simulator to run the app in your locale. choose product > scheme > edit scheme from the toolbar menu. in the edit scheme screen, select run from the left pane and then navigate to the options tab. select your language from the application language menu and click close. tah dah! you're ready to test your localization of firefox on ios. launching & testing your firefox on ios localization the ios simulator is fairly easy to use once you launch your app. to perform the next steps, you'll need to be familiar with how user gestures and hardware interactions work in the simulator. this guide should help...
Localizing XLIFF files for iOS
your copy of the github repo and navigate there in your terminal. enter the command git clone https://github.com/mozilla-l10n/firefoxios-l10n/your-locale-code/ you should now see the firefox-ios project in your selected directoy with the firefox-ios.xliff file in it. translating the xliff file open the firefox-ios.xliff file in your favorite text editor. in the <file> tag, add the target-language attribute with your locale code as the value (e.g., target-language="xx-xx"). be aware that there may be many <file> tags within one xliff document. each <file> tag requires the target-language attribute with your locale code as the value (e.g., target-language="xx-xx"). strings are located within <trans-unit> tags. source english strings are contained in <source> child tags. here is an example ...
Localizing extension descriptions
o not currently have them, create localized properties files. make sure to use utf-8 encoding (without bom) to ensure foreign characters display correctly. add the following line to each of your localization properties files (where extension_id matches your extension id (<em:id> from install.rdf) and localized_description is the description of your extension that you want to appear in the given language): extensions.extension_id.description=localized_description if you do not currently have one, create a default preferences file. add the following line to it (where extension_id matches your application id from install.rdf and path_to_localization_file is the chrome path to the localization file you added to earlier): pref("extensions.extension_id.description", "path_to_localization_file...
Localizing with Mozilla Translator
anslation empty struggling to get empty lists when running "untranslated strings" and "view fuzzy" if you are up to date in localization regularly running qa checks and trying to minimize them. you will always do better if you can export a partial glossary and reimport it as needed. see the following example. let's assume you have a firefox product in mt with the directory layout present in language packs, as you probably would need for a initial localization. the directory structure will look like this: (ab-cd jar root) locale |-- branding | |-- brand.dtd | `-- brand.properties |-- browser | |-- aboutdialog.dtd . . |-- browser-region | `-- region.properties `-- ab-cd |-- alerts | `-- notificationnames.properties |-- autoconfig | `...
Localizing without a specialized tool
ation document, an interested localizer can follow a technical step-by-step process that starts the localization process by focusing on how to localize two of the primary types of localization files (dtd and properties) used in the mozilla source code. with that document, users can see immediately two localized files in their user interface by following closely and carefully the steps to create a language pack or a binary file that is ready for installation. repeating the process allows a localizer to create a testable package to see his or her work as they progress to a final version. if you choose to localize mozilla with nothing more than a text editing application and not a specialized tool, this document (along with create a new localization) will enable you to learn just what needs to be don...
Patching a Localization
prerequisites wiki page. if you do not have these tools, take a few steps back, grab a cookie (because, let's face it, you deserve it for all of your work), and visit the l10n prerequisites page. there you'll learn what tools you need, where to find them, and how to install them. get the source first, you need to get the source for the localization in question using its two or three character iso language code. for our example, i'll use gl (galician). whenever you see gl in blue text, replace it with the locale code for your language. next thing you need to know is which localization version you want to patch. all of our localizations work on the aurora branch. the repository for this version is releases/l10n/mozilla-aurora. for more information about branches see l10n:branches. now let's get a li...
Uplifting a localization from Central to Aurora
a typo in the string that still exists in release+1. so you fixed the string on aurora, and you removed the broken string on central. that's gonna conflict, and you need to resolve that with your merge tool so that the resulting localized file doesn't have the string any more. now, if you read this far, you may be overwhelmed, and that's ok. ask for help. the folks on #l10n won't be able to make language decisions for you, but there will be folks around to explain why you're seeing a merge conflict, and if you're looking for a fix on one branch, on the other, or on both. at this point, your resulting workrepo has no more conflicts, and thus it's time to publish it again. in the workrepo directory, do #verify that we didn't forget changesets hg inc ../l10n-central/ab-cd comparing with ../l10n-...
Creating localizable web content
localized. image 1. bad. if the screenshot shows the application that the website directly relates to (firefox on mozilla.com/firefox, personas on getpersonas.com), try to use screenshots from the localized version. image 2. acceptable. if however the screenshot shows a third-party application or website, it's acceptable to use the english version if it's not available in the target language. ...
Web Localizability
tions. how to set up the infrastructure for localization. why localizability is important there are many reasons why you should start thinking about making your web app localizable as soon as possible. you will make localizer's life easier, for which they will be grateful. you will have quality content, localized and adapted to the needs of the local market. extending you web app to support new languages will be easy. the content will be easier to maintain and update. you will end up writing more semanticly-correct code, which is good for your seo. by reviewing your content and code for l12y, you will find and fix bugs in your original language too. ...
Writing localizable code
espect to localization. it is aimed at mozilla and extension developers. for technical details please also look at xul_tutorial:localization. about localizers a few notes about localizers for developers who rarely deal with them: localizers like tools, and they don't like editors, localization tools are often based on key-value pairs, at least some localizers have their talents focused on language skills and are not savvy in programming, or even building applications. guidelines thus, there are a few guidelines you should follow to make localization of your code easier: choose good key names the names chosen for your keys (regardless of whether that's a dtd or a properties file) should be descriptive. think of them as long variable names. if you change the semantics of a localized st...
Localization at Mozilla
these resources are for anyone with an interest in the technical aspects involved in localization. they are for developers and all contributors. the documentation here is no longer being maintained and is inaccurate. l10n documentation has moved to https://mozilla-l10n.github.io/localizer-documentation/ . ...
Mozilla MathML Project
mathml engine mathml version 3.0 - w3c recommendation, 21 october 2010 w3c mathml test suite - designed to check the implementation of each element one attribute (or built-in rendering behavior) at a time in a fairly thorough manner. mathml in mozilla developer network mathml accessibility in mozilla sample mathml documents screenshots mathml start page - with translations in different languages ( arabic, chinese, hebrew, thai) mathml basics - document tailored to display correctly with just the symbol font that is pre-installed by default on most os configurations. mathml torture test - comparative testing of mathml rendering against tex. demo of some mathml tags: mfrac, mo, mtable, mspace, mmultiscripts, msqrt-mroot. mathml extras - technology demonstration of some interesting ups...
Mozilla projects on GitHub
-metrics tools used to collect metrics about mozilla code. mozilla-services mozilla cloud services projects. opennews the knight-mozilla open news project, helping the journalism/technology community do great work through shared knowledge and code. pluotsorbet a j2me-compatible virtual machine written in javascript. rust-lang the rust programming language, designed for safe concurrent code. servo the next-generation rendering engine. ...
A brief guide to Mozilla preferences
update channel. this is kept separate from other preferences because it can affect how updates are applied. browser/app/profile/firefox.js - defaults specific to firefox browser/app/profile/firefox-branding.js - defaults specific to the specific kind of firefox being installed (nightly, aurora, beta, release) browser/defaults/preferences/firefox-l10n.js - defaults specific to the installed language of firefox. none of the other preference files contain locale-specific preferences. config. file a configuration file, usually with .cfg extension, may be called from a default pref file via the general.config.filename preference. this file allows preference locking via the lock_pref() function. details on the config file is beyond the scope of this document. user pref. files in the...
Productization guide
productization is the choice of ''default'' search engines, content and protocol handlers, bookmarks, links to recommended sites on the in-product pages, etc. the web services that make up the productization of mozilla software are often specific to a local market. for example, a search provider can deliver a very good quality of search results — but only in a specific country or language, and we have to take this into account when considering default search engines for a locale. hence there is a need to customize the set of default web services on a per-locale basis in order to ensure a good user experience across all locales. purpose of productization there are two main purposes of adding default web services to mozilla products: provide users with useful and relevant content demo...
JSHydra
installing jshydra download, installation and dependency info for jshydra community view jshydra forums... mailing list newsgroup rss feed #static on irc.mozilla.org blogs joshua cranmer related topics dehydra, treehydra, spidermonkey categories interwiki language links ...
About NSPR
e systems offer as it can. it is a goal of nspr that nspr impose as little overhead as possible in accessing those appropriate system features. thread synchronization thread synchronization is loosely based on monitors as described by c.a.r. hoare in monitors: an operating system structuring concept , communications of the acm, 17(10), october 1974 and then formalized by xerox' mesa programming language ("mesa language manual", j.g. mitchell et al, xerox parc, csl-79-3 (apr 1979)). this mechanism provides the basic mutual exclusion (mutex) and thread notification facilities (condition variables) implemented by nspr. additionally, nspr provides synchronization methods more suited for use by java. the java-like facilities include monitor reentrancy, implicit and tightly bound notification capabili...
NSPR Contributor Guide
lity because many different applications, besides the mozilla client, use the nspr api, the api must remain downward compatible across even major releases. this means that the behavior of an existing public api item in nspr cannot change. should you need to have a similar api, with some slightly different behavior or different function prototype, then suggest a new api with a different name. c language api the nspr api is a c language api. please do not contribute java, c or other language wrappers. coding style nspr does not have a documented coding style guide. look at the extant code. make yours look like that. some guidelines concerning naming conventions can be found in nspr naming conventions in the nspr reference. see also: xxx ownership of your contribution when you contribute so...
NSPR's Position On Abrupt Thread Termination
much fun either). the implementation of either strategy within the nspr runtime is not difficult. that is not what this memo is about. this is about providing an api that coaxes people to do the right thing in as many ways as possible. the existence of exit() in the unix/c environment is a perfect example of how programmers will employ the most expediant solution available. the definition of the language c is such that returning from main() is a perfectly fine thing to do. but what percentage of c programs actually bother? in unix, with its complex definition of a protection domain, it happens to work (one might even say it's more efficient) to exit from anywhere. but threads are not processes. if threads have to maintain the same type of resource knowledge as a process, they loose all of their b...
Optimizing Applications For NSPR
there is no enforceable mechanism to guarantee thread scheduling fairness. calendar time facilities are limited on macintosh. one can only determine the immediate setting of daylight savings time, not what it would be at some arbitrary time in the past or the future. initialization of nspr may fail if the host is not connected to a network of some kind. win-16 http://www.sybase.com/products/languages/watccpl.html the win-16 port is unique in the nspr world in that it uses the watcom development environment. this environment does bring along some of its own special trappings. win16 uses co-operative non-preemptive dispatching for its own processes. this means that when the application using nspr is dispatched, a thread within that application will run until that thread voluntarily gives up...
PR_ASSERT
returns nothing description this macro evaluates the specified expression. when the result is zero (false) the application terminates; otherwise the application continues. ...
An overview of NSS Internals
a high-level overview to the internals of network security services (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming...
Getting Started With NSS
s? we are looking forward to your contributions! we have a large list of tasks waiting for attention, and we are happy to assist you in identifying areas that match your interest or skills. you can find us on mozilla irc in channel #nss or you could ask your questions on the mozilla.dev.tech.crypto newsgroup. the nss library and its supporting command line tools are written in the c programming language. its build system and the automated tests are based on makefiles and bash scripts. over time, many documents have been produced that describe various aspects of nss. you can start with: the current primary nss documentation page from which we link to other documentation. a general overview of the applications that use nss and the features it provides. a high level introduction to the intern...
Index
i, intermediate, intro, nss, tools a high-level overview to the internals of network security services (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communicati...
NSS Developer Tutorial
uture). universal character names are not permitted, as are wide character types (char16_t and char32_t). nss source should only include ascii text. escape non-printing characters (with \x if there is no special escape such as \r, \n, and \t) and avoid defining string literals that use non-ascii characters. one line comments starting with // are permitted. check with nss-dev@ before using a language feature not already used, if you are uncertain. please update this list if you do. these restrictions are different for c++ unit tests, which can use most c++11 features. the mozilla c++ language features guide, and the chromium c++ usage guide, list c++ features that are known to be widely available and compatible. you should limit features to those that appear in both guides. ask on nss-dev@ ...
Enc Dec MAC Output Public Key as CSR
rortostring was introduced with nss 3.13. * though pr_errortostring was available, support for it in nss wasn't. * fixme: samples should determine the version of nss that's available and refuse * to run if not 3.13 or higher. ...
sample2
2000) typedef enum { sec_error_io = sec_error_base + 0, sec_error_token_not_logged_in = (sec_error_base + 155), sec_error_end_of_list } secerrorcodes; #endif /* port_errortostring introduced in nss 3.13. on earlier versions of nss that * don't support error tables, pr_errortostring will return "unknown code". ...
Rhino JavaScript compiler
optlevel optimizes at level optlevel, which must be an integer between -1 and 9. see optimization for more details. if optlevel is greater than zero, -debug may not be specified. -package packagename specifies the package to generate the class into. the string packagename must be composed of valid identifier characters optionally separated by periods. -version versionnumber specifies the language version to compile with. the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160, or 170. see javascript language versions for more information on language versions. examples $ cat test.js java.lang.system.out.println("hi, mom!"); $ java org.mozilla.javascript.tools.jsc.main test.js $ ls *.class test.class $ java test hi, mom! $ java org.mozilla.javascript.tools.jsc.main -exte...
Rhino optimization
y lookup, but in the future more expressions may be optimized). all local variables and parameters are allocated to java vm registers. function call targets are speculatively pre-cached (based on the name used in the source) so that dispatching can be direct, pending runtime confirmation of the actual target. arguments are passed as object/number pairs to reduce conversion overhead. note some language features (indirect calls to eval, use of the arguments property of function objects) were previously not supported in higher optimization levels. these features have been removed from the language in ecma, so higher optimization levels are now conformant. future versions may allocate more aggressive optimizations to higher optimization levels. for compatibility with future versions, use level 1.
The JavaScript Runtime
double representation of a long may lose precision. string java.lang.charsequence (java.lang.string or org.mozilla.javascript.consstring) object org.mozilla.javascript.scriptable in addition, ecma refers to objects that implement [[call]] as functions. these object types are represented by implementing the function interface. since javascript is a dynamically typed language, the static java type of a javascript value is java.lang.object. the behavior of the javascript engine is undefined if a value of any type other than the ones described above is introduced into javascript. (this caveat does not apply to scripts that use liveconnect; the java values are wrapped and unwrapped as appropriate to conform to the above type constraints.) property access properties in...
Rhino scopes and contexts
ct has two properties, 'a' for the argument, and 'v' for the variable. the top-level scope has properties for the variable g and the function f. an example scope chain for a simple script. when the statement x = v + a; is executed, the scope chain is traversed looking for a 'x' property. when none is found, a new property 'x' is created in the top-level scope. sharing scopes javascript is a language that uses delegation rather than traditional class-based inheritance. this is a large topic in itself, but for our purposes it gives us an easy way to share a set of read-only variables across multiple scopes. to do this we set an object's prototype. when accessing a property of an object in javascript, the object is first searched for a property with the given name. if none is found, the object...
Rhino shell
rl [script-arguments] where options are: -e script-source executes script-source as a javascript script. -f script-filename-or-url reads script-filename-or-url content and execute it as a javascript script. -opt optlevel / -o optlevel optimizes at level optlevel, which must be -1 or an integer between 0 and 9. see rhino optimization for more details. -version versionnumber specifies the language version to compile with. the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160 or 170. see javascript language versions for more information on language versions. -strict enable strict mode. -continuations enable experimental support for continuations and set the optimization level to -1 to force interpretation mode. starting with rhino 1.7 this options is no longer availa...
Creating JavaScript tests
there are two large spidermonkey test suites: jstests (in js/src/tests) and jit-tests (in js/src/jit-test). see running automated javascript tests for details. in which test suite does your new test belong? jit-tests are intended to test the implementation of the jit. only add tests to these suites which test jit correctness or functionality. jstests is intended for tests of language-visible functionality. please put tests of functionality into jstests even if related tests are in jit-tests, since jstests are closer to (and more easily converted to) test262 tests. (in fact, the test262 test suite is run as part of jstests.) practical differences between the two test suites: jstest new jstest files should be put the code in the appropriate subdirectory of js/src/tests/non262/, or, ...
FOSS
s jsapigen - generates bindings for embedding spidermonkey in c applications extensions http://code.google.com/p/jslibs/ - zlib, sqlite, nspr, ode, libpng, libjpeg, libffi, (...) libraries for spidermonkey http://www.jsdb.org/ - a js shell with native objects for files, networks, databases, compression, email, etc. http://code.google.com/p/gpsee/ - commonjs platform, native-language module interoperability methods, modules, etc. for spidermonkey. designed to supplement existing embeddings, gpsee ships with a sample trivial embedding, a scripting host, and an augmented version of mozilla's js shell. bundled modules include support for bytearray, bytestring, cgi, posix signals, ffi, and more. http://javalikescript.free.fr/ - a general-purpose javascript platform that aim...
Future directions
ot intend to provide a stable api, because too many things are changing. also, we will someday want a more modern c++ api. going forward from now, the api will likely be semi-stable, but there is no guarantee. the public api is gradually moving from jsapi.h and jsfriendapi.h into header files in js/public. much more cleanup and organization is still required. practical coding bits experimental language features new language features (es6+) and apis often get added to spidermonkey while the spec is still being drafted, or before the feature has stabilized. this is good, because it helps the spec work. for these features: do not add vendor prefixes. see http://hsivonen.iki.fi/vendor-prefixes/ for an extended argument. disable the feature before the beta channel. nightly and aurora are the go...
Tracing JIT
the jstracer component consists of a monitor and a recorder. ...
JSExtendedClass
s that uses any of the jsextendedclass callbacks: create a jsextendedclass and populate both the base fields and the extended fields. ensure that the additional reserved fields at the end of the jsextendedclass are null. jsclass and jsextendedclass structs should usually be global, and in this case the compiler automatically initializes these fields to null. (this is a feature of the c and c++ languages.) otherwise, use memset. set the jsclass_is_extended flag in myextendedclass.base.flags. pass &myextendedclass.base to functions like js_initclass or js_newobject that require a jsclass *. see also bug 571789 ...
JSObjectOps.defaultValue
the conversion is needed. obj jsobject * the object to be converted. type jstype the target type. vp jsval * out parameter. on success, the callback must store the converted value here. description the jsobjectops.defaultvalue callback corresponds to the [[defaultvalue]] method defined in ecma 262-3 §8.6.2.6. many expressions in the ecmascript language, such as a+b, involve implicit conversion of the operands using [[defaultvalue]]. the default [[defaultvalue]] behavior for ordinary objects is as described in es5 §8.12.8. it calls the javascript methods obj.valueof() and/or obj.tostring(). provide a custom jsobjectops.defaultvalue callback to implement customized [[defaultvalue]] behavior. the jsclass.convert callback should convert obj to t...
JSRuntime
ically has only one jsruntime, even if it has many threads. the jsruntime is the universe in which javascript objects live; they can't travel to other jsruntimes. all javascript code and most jsapi calls run within a jscontext. the jscontext is a child of the jsruntime. a context can run scripts. it contains the global object and the execution stack. exception handling, error reporting, and some language options are per-jscontext. once created, a context can be used any number of times for different scripts or jsapi queries. for example, a browser might create a separate context for each html page; every script in the page could use the same context. objects may be shared among jscontexts within a jsruntime. there's no fixed association between an object and the context in which it is created. ...
JS_ConvertArgumentsVA
argv jsval * pointer to the vector of arguments to convert. obsolete since jsapi 30 format const char * character array containing the recognized format to which to convert. ap va_list the list of pointers into which to store the converted types. there should be one pointer for each converted value. the type va_list is a standard feature of the c programming language. it is defined in <stdarg.h>. description js_convertargumentsva is to js_convertarguments as vprintf is to printf. see js_convertarguments for further information. if js_convertargumentsva successfully converts all arguments, it returns true. otherwise it returns false. see also mxr id search for js_convertargumentsva js_convertarguments bug 969798 - added args bug 1125784 ...
JS_DefineProperty
kes 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 does not behave like ordinary property assignment in the javascript language; it allows the application to specify additional details (getter, setter, and attrs) governing the new property's behavior; it never calls a setter; it can call the jsclass.addproperty callback when js_setproperty would not, because it can replace an existing property. the parameters specify the new property's name, initial stored value, getter, setter, and property attributes (attrs). if o...
JS_GetFunctionFlags
re for the javascript engine’s internal use. most applications can’t do anything useful with them. function flags are a value of type unsigned int, the bitwise or of zero or more of the jsfun flags described below. once a function is created, its flags cannot be modified. jsfun_generic_native the function is an array generic, such as array.map. jsfun_heavyweight the function uses language features such as closures, with, or eval that require extra work on the part of the interpreter. jsfun_lambda the function is a javascript function written as a functionexpression rather than a functiondeclaration, a syntactic distinction. see ecma 262-3 §13. jsfun_constructor the function is native can be used as a constructor with the new keyword. (the meaning of this flag may chan...
JS_GetFunctionObject
iption js_getfunctionobject returns the javascript function object for a specified function pointer, fun. fun must be either a function implemented by a jsnative (or jsfastnative) or the result of a call to js_compilefunction or similar functions. in other cases, the object returned by js_getfunctionobject is not necessarily safe to call and should not be exposed to script. in the javascript language, functions are objects. but in the jsapi there are two separate concepts: a jsobject is what is exposed to scripts and has properties and can be stored in variables; and the corresponding jsfunction contains the code of a function. for certain functions, the two have a strictly one-to-one relationship, and for those functions it is safe to call js_getfunctionobject to move from the jsfunction to ...
JS_GetImplementationVersion
get the version number of the js engine. syntax const char * js_getimplementationversion(void); description js_getimplementationversion returns a hard-coded, english language string that specifies the version number of the js engine currently in use, and its release date. see also mxr id search for js_getimplementationversion js_getversion js_setversionforcompartment ...
JS_GetVersion
ersion(jscontext *cx); name type description cx jscontext * the context to query. description js_getversion returns the javascript version currently used by the given jscontext, cx. the result is one of the jsversion constants. when a context is created, its version is initially jsversion_default. scripts are compiled using the latest version of the javascript language. to configure a context to run scripts using a specific version of javascript, use js_setversion. see also mxr id search for js_getversion js_versiontostring js_stringtoversion js_setversionforcompartment ...
JS_InitClass
private data is null. the jsclass_construct_prototype flag is one way to avoid this inconsistency. warning: if the class is a jsextendedclass, make sure that the additional reserved fields at the end of the jsextendedclass are null. jsextendedclass structs should usually be global, and in this case the compiler automatically initializes these fields to null. (this is a feature of the c and c++ languages.) otherwise, use memset. see also mxr id search for js_initclass js_getclass js_instanceof ...
JS_LookupElement
the object to search. index uint32_t the numeric id of the property to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the stored value of obj[index], or undefined if the element does not exist. description js_lookupelement examines a specified javascript object, obj, for a numeric property numbered index. note: in the javascript language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings. for example, obj[6] is always exactly the same as obj["6"]. the ecmascript standard also specifies this behavior: see ecma 262-3 §11.2.1, step 6. so any call to js_lookupelement is equivalent to a call to js_lookupproperty passing a numeric string for the name. if the property obj[index] e...
JS_PushArguments
. ... various (in js_pusharguments) a variable number of arguments to be converted to jsvals. there must be one argument for each argument described in format. ap va_list (in js_pushargumentsva) the list of arguments to be converted to jsvals. there must be one argument for each argument described in format. the type va_list is a standard feature of the c programming language. it is defined in <stdarg.h>. description js_pusharguments provides a convenient way to translate a series of native c/c++ values to jsvals with a single function call. cx is the context for the call. markp points to a void * to hold the internally allocated stack frame pointer to pass back to js_poparguments. format is a sequential character array, where each element of the array indicates...
JS_SetVersion
syntax jsversion js_setversion(jscontext *cx, jsversion version); name type description cx jscontext * pointer to a js context from which to derive runtime information. version jsversion version of javascript to set context to. ...
JS_SetVersionForCompartment
syntax void js_setversionforcompartment(jscompartment *compartment, jsversion version); name type description compartment jscompartment * pointer to a js compartment. version jsversion version of javascript to set compartment to. description js_setversionforcompartment attempts to set the version of javascript to version for a specified compartment, compartment. the version comes from the jsversion enumerated type. ...
Property attributes
red. this is the ecma standard readonly attribute. mxr id search for jsprop_readonly jsprop_permanent the property cannot be deleted. in javascript 1.2 and lower, it is an error to attempt to delete a permanent property. in javascript 1.3 and higher, as in ecmascript, such attempts are ignored. this is the ecma standard dontdelete attribute. the javascript language does not provide any way for a script to delete a permanent property. mxr id search for jsprop_permanent jsprop_propop_accessors passed to js_define(uc)property* and js_defineelement if getters/setters are jspropertyop/jsstrictpropertyop added in spidermonkey 38. mxr id search for jsprop_propop_accessors jsprop_getter the property's getter is a ...
Parser API
ggerstatement <: statement { type: "debuggerstatement"; } a debugger statement. note: the debugger statement is new in ecmascript 5th edition, although spidermonkey has supported it for years. declarations interface declaration <: statement { } any declaration node. note that declarations are considered statements; this is because declarations can appear in any statement context in the language recognized by the spidermonkey parser. note: declarations in arbitrary nested scopes are spidermonkey-specific. interface functiondeclaration <: function, declaration { type: "functiondeclaration"; id: identifier; params: [ pattern ]; defaults: [ expression ]; rest: identifier | null; body: blockstatement | expression; generator: boolean; expression: boolean; } ...
Running Automated JavaScript Tests
any substring that is a substring of that test filename only. you can run all tests in a directory by giving the directory path. you can run three specific tests by giving the three names. or you can run all but selected tests with the --exclude option. now that the full set of test262 tests is included in the tree, jstests take a long time to complete. ...
Zest implementation
the first version of zest has been released but is intentionally very basic. future versions of zest are planned which will significantly increase the scope of the language. the first version is aimed at creating scripts for reproducing basic security vulnerabilities includes a java reference implementation, which conforms to jsr 223 has been included in a proof-of-concept owasp zap add-on the next version is underdevelopment - more details soon. related links zest overview ...
Redis Tips
heartbeats and time-based event logs it's a common pattern to use numerical timestamps for ranking members in a zset. i'll show this in the node console, to illustrate how the optional parameters are done. > var r = require('redis').createclient(); // and i'll define these utility functions just for this example > function now() { return (new date()).gettime() / 1000 ...
Secure Development Guidelines
ention escape all dynamic input that will be sent back to the user html encoding &amp; → & &lt; → < &gt; → > &quot; → " &apos; → ' url encoding % encoding java/vbscript escaping depends on the context; in a single-quoted string, escaping ' would suffice sql injection occurs when un-trusted input is mixed with a sql string sql is a language used to interact with databases code injection attack that is similar to xss but targeted at sql rather than html and javascript if input is mixed with sql, it could itself become an sql instruction and be used to: query data from the database (passwords) insert value into the database (a user account) change application logic based on results returned by the database sql inj...
Accessing the Windows Registry Using XPCOM
in this function, wrk is expected to be an already opened nsiwindowsregkey. function readregistryvalue(wrk, value) { switch (wrk.getvaluetype(value)) { case wrk.type_string: return wrk.readstringvalue(value); case wrk.type_binary: return wrk.readbinaryvalue(value); case wrk.type_int: return wrk.r...
Aggregating the In-Memory Datasource
n on writing a datasource, see the rdf datasource how-to document. you could also forward other interfaces to the minner that youknow it can support; however, this is extremely risky. it's risky because another implementation of the same object mightnot support those interfaces. then the queryinterface() will be forwarded back to you, and we'll recurse off to infinity (and beyond!... interwiki language links ...
Creating the Component Code
t, and may allow for multiple nsifactory objects. the key to this interface is that the return type of getclassobject does not have to be an nsifactory. instead, the nsimodule can ask for implementation details about the xpcom object. this is very useful if the caller is required to know information about the component like its threading module, whether or not it's a singleton, its implementation language, and so forth. the interface used in this case is nsiclassinfo. starting from the outside in, onion peel view of xpcom component creation represents the sequence for constructing an xpcom object. onion peel view of xpcom component creation before we begin looking at the various parts of the component and how they'll be implemented in the source, let's look at the module in weblock.cpp to see ...
Setting up the Gecko SDK
the xpcom include subdirectory. if your component will use other parts of the sdk (e.g., necko), you will have to add these include directories to this field as well. assuming you are using the example location for your project, these paths are the following: c:\gecko-sdk\embedstring\include c:\gecko-sdk\xpcom\include c:\gecko-sdk\nspr\include c:\gecko-sdk\string\include under the c++ language category, disable exception handling. as described in the section exceptions in xpcom, exception handling isn't supported across interface boundaries, so setting this option may catch problems during development. the weblock component needs to link against the appropriate libraries to uses xpcom glue. to add these libraries, select the link tab, then choose the input category. in this panel, ins...
Introduction to XPCOM for the DOM
object, or to respect an eventual "interface freeze". first we will take a look at xpidl and how it can help you define interfaces. next we will describe the build system, makefiles, etc... and finally, we will look at the implementation of our new interface through the creation of an nsidomfabian interface (fabian is my first name ;-). xpidl xpidl stands for cross-platform interface definition language. instead of coding interfaces directly in c++ , one can use xpidl. it simplifies greatly the task of defining interfaces, and offers some interesting features, like automatic generation of documentation, and xpt generation. the first thing to do is to decide what our interface, nsidomfabian, will do. for the purpose of this document, i have chosen to implement a new html interface called nsidomfa...
PlXPCOM
plxpcom (perl xpcom) provides language bindings letting you use xpcom from perl code. the resources here provide information about this language binding and how to use it. project page (mozdev) perl object definition (mozdev) developer's guide to perl xpcom (mozdev) newsgroup (mozdev) mailing list (mozdev) ...
Community
if you know of useful mailing lists, newsgroups, forums, or other communities related to pyxpcom, please link to them here. activestate python xpcom bindings mailing list discussion of the bindings between the python language and the xpcom (cross-platform com) technology from the mozilla project. #pyxpcom on irc.mozilla.org chat with other pyxpcom developers on mozilla's irc network. ...
RbXPCOM
you can find additional information using the resource links below. ...
xpcshell
derbird, etc.) $ cd /opt/mozilla $ ./run-mozilla.sh ./xpcshell js> execute xpcshell from window the built xpcshell.exe can't be executed under the mozilla build shell(bash). it should be executed under the window command prompt source_directory/obj-xxxxx/dist/bin> xpcshell.exe using the latest version of javascript at present, xpcshell doesn't use the latest version of javascript, so newer language features, such as the let statement introduced in javascript 1.7, are not available. to rectify this, run xpcshell with the -v 180 command-line option, which tells xpcshell to use javascript 1.8. example you can input javascript, straight to mozilla. js> 5+7 12 js> print("hello, world!") hello, world! js> see also howto for common problems in writing xpcshell scripts, e.g., doing async ne...
jsdIStackFrame
/ seamonkey 2.1) strict mode is on. warnings reported as errors. makes eval() use the last object on its 'obj' param's scope chain as the ecma 'variables object'. private data for this object is an nsisupports object. attempting to alter this bit will result in an ns_error_illegal_value. opt_* values above, or'd together. last version set on this context. scripts typically select this with the "language" attribute. see the version_* consts on jsdidebuggerservice. unique tag among all valid jsdicontext objects, useful as a hash key. private data for this context, if it is an nsisupports, |null| otherwise. retrieve the underlying context wrapped by this jsdicontext. top of the scope chain for this context. |true| if this context should be allowed to run scripts, |false| otherwise. this attribute i...
mozISpellCheckingEngine
note: setting this value to a value that doesn't match an existing dictionary throws a ns_error_file_not_found exception. when this attribute's value is changed, a "spellcheck-dictionary-update" notification is sent. if the dictionary was set to "no dictionary" (that is, by specifying an empty string), the observer may select another dictionary before returning. language wstring the language this spell checker is using when checking. this is the language of dictionary. read only. when this changes, the spell checker sends a "spellcheck-dictionary-update" notification. name wstring the name of the engine. not currently used. read only. personaldictionary mozipersonaldictionary ...
nsIAccessNode
domnode node the dom node this nsiaccessnode is associated with. read only. firstchildnode nsiaccessnode the first nsiaccessnode child. read only. obsolete since gecko 2.0 innerhtml domstring the innerhtml for the dom node this is a text string of all the markup inside the dom node, not including the start and end tag for the node. read only. language domstring the language for the current dom node, for example en, de, and so on. read only. lastchildnode nsiaccessnode the last nsiaccessnode child. read only. obsolete since gecko 2.0 nextsiblingnode nsiaccessnode the next nsiaccessnode sibling. read only. obsolete since gecko 2.0 numchildren long the number of dom children for the dom node, wh...
nsIAlertsService
tion; this is not displayed in the alert. however, certain notification systems (such as growl on mac os x) allow the user to disable alerts by name. this name is used in that configuration panel. on android the name is hashed and used as a notification id. dir optional bidi override for the title. valid values are "auto", "ltr" or "rtl". only available on supported platforms. lang optional language of title and text of the alert. only available on supported platforms. data optional the value of the cookie parameter passed to showalertnotification. principal optional the principal of the page that created the alert. used for ipc security checks, and to determine whether the alert is actionable. inprivatebrowsing optional controls the image loading behavior. if true, the image url will ...
nsIDOMFontFace
turned in a list you can get using inidomutils.getusedfontfaces(). attributes font source attributes these attributes indicate how the font was found during the font matching process. note: the same physical font may have been found in multiple ways within a range. attribute type description fromfontgroup boolean indicates whether or not the font was located in a font group. read only. fromlanguageprefs boolean indicates whether or not the font was located using language preferences. read only. fromsystemfallback boolean indicates whether or not the font is the system fallback font. read only. attributes available for all fonts these attributes are always available. attribute type description cssfamilyname domstring a family name that could be used in css font-family (not necessar...
nsIDOMXPathEvaluator
espace resolver if you wish to take the latter approach. ...
nsIDebug
inherits from: nsisupports last changed in gecko 1.7 note: c/c++ consumers who are planning to use the nsidebug interface with the @mozilla.org/xpcom;1 contract should use ns_debugbreak() from xpcom glue instead, or alternatively the ns_abort, ns_assertion, ns_break, and ns_warning macros, which also call ns_debugbreak() if used in a debugging build. ...
nsIException
type description columnnumber pruint32 valid column numbers begin at 0. there is no unambiguous indicator for unknown. read only. data nsisupports arbitary data for the implementation. read only. filename string filename location. this is the location that caused the error, which may or may not be a source file location. for example, standard language errors would generally have the same location as their top stack entry. file parsers may put the location of the file they were parsing. null indicates "no data" read only. inner nsiexception an inner exception that triggered this, if available. read only. linenumber pruint32 valid line numbers begin at '1'. '0' indicates unknown. read only. location ...
nsIFeedTextConstruct
ting nsifeedtextconstruct. method overview nsidomdocumentfragment createdocumentfragment(in nsidomelement element); astring plaintext(); attributes attribute type description base nsiuri if the text construct contains html or xhtml, relative references in the content should be resolved against this base uri. lang astring the language of the text (such as "en-us" for u.s. english). text astring the actual text content. this string may contain markup if the type is either "html" or "xhtml". type astring the type of content described; one of "text", "html", or "xhtml". methods createdocumentfragment() creates a new document fragment on a given dom element, containing the text and (if the te...
nsIINIParser
// get all sections in the ini file var sectenum = iniparser.getsections(); // save the sections in an array var sections = []; while (sectenum && sectenum.hasmore()) { var section = sectenum.getnext(); // add an array entry for each section sections.push(section); } enumerating keys this example shows h...
nsILocale
on order. how strings are sorted. nsilocale_ctype - character classification and case conversion. nsilocale_monetary - monetary formatting. nsilocale_numeric - numeric, non-monetary formatting. nsilocale_time - date and time formats. nsilocale_messages - related to fonts, character encodings and so on. return value the locale code to be used for the given category. a locale code is of the form language[-country[-region]], where "language" is an iso 639 language code (two letter codes preferred over three letter codes when available), "country" is an iso 3166 two letter country code, and "region" is a string of up to 5 letters. see also stringbundle ...
nsIPropertyBag
hat name doesn't exist. examples get user agent information (operating system specifics. the window scope is not always accessible so the window.navigator cannot be accessed. ...
nsIScriptableInputStream
: the init method may be called more than once, allowing a nsiscriptableinputstream instance to be reused. void init( 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...
nsIServiceManager
ds are provided to test whether or not a service has already been instantiated. users of the service manager must first obtain a pointer to the global service manager by calling ns_getservicemanager. after that, they can request specific services by calling getservice(). when they are finished they should call nsisupports.release() on the service as they would with any interface pointer. in some language bindings, such as javascript, this step is unnecessary. and, moreover such languages typically offer more convenient mechanisms to acquire references to xpcom services and components. a user of a service may keep references to services until application shutdown. this interface was frozen for gecko 1.0. see bug 99147 for details. from gecko 2.0 interfaces are no longer frozen. see also ns_g...
nsIStackFrame
om/base/nsiexception.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview string tostring(); attributes attribute type description caller nsistackframe read only. filename string filename location. this is the location that caused the error, which may or may not be a source file location. for example, standard language errors would generally have the same location as their top stack entry. file parsers may put the location of the file they were parsing, and so forth. null indicates "no data" read only. language pruint32 see nsiprogramminglanguage for a list of language constants. read only. languagename string see nsiprogramminglanguage for a list of language constants. read only. linenumber print32 valid...
XPCOM Interface Reference
streamcallbacknsiparentalcontrolsservicensiparserutilsnsipasswordnsipasswordmanagernsipermissionnsipermissionmanagernsipipensiplacesimportexportservicensiplacesviewnsipluginhostnsiprefbranch2nsipreflocalizedstringnsiprefservicensiprincipalnsiprinterenumeratornsiprintingpromptnsiprivatebrowsingservicensiprocessnsiprocess2nsiprocessscriptloadernsiprofilensiprofilelocknsiprofileunlockernsiprogramminglanguagensiprogresseventsinknsipromptnsipromptservicensipropertiesnsipropertynsipropertybagnsipropertybag2nsipropertyelementnsiprotocolhandlernsiprotocolproxycallbacknsiprotocolproxyfilternsiprotocolproxyservicensiproxyinfonsipushmessagensipushservicensipushsubscriptionnsiradiointerfacelayernsirandomgeneratornsirequestnsirequestobservernsiresumablechannelnsirunnablensishentrynsishistorynsishistorylistener...
XPCOM Interface Reference by grouping
nsiwintaskbar nsialertsservice nsiwebprogress nsiwebprogresslistener nsiwebprogresslistener2 update nsiupdate nsiupdatechecker nsiupdatechecklistener nsiupdateitem nsiupdatemanager nsiupdatepatch nsiupdateprompt nsiupdatetimermanager nsiprogramminglanguage thunderbird credentials nsimsgaccountmanagerextension element nsieditormailsupport message nsidbchangeannouncer nsidbchangelistener nsimessenger nsimsgcompfields nsimsgcustomcolumnhandler nsimsgdatabase nsimsgdbhdr nsimsgdbview nsimsgdbviewcommandupdater ...
Setting HTTP request headers
front of our name.) no longer the case: http://tools.ietf.org/html/rfc6648 notifications the question that may be coming to your mind right now is, how do you get the nsihttpchannel when an http request is made. in the case your code initiates the request, you probably already have one. trapping other requests is done with notifications, which are a lot like events or signals found in other languages and frameworks. in particular, to get the nsihttpchannel just before the http request is made we need to observe the "http-on-modify-request" topic. (and yes, "http-on-modify-request" is a string.) note: there are many topics, besides just "http-on-modify-request", that you can get notifications about, for example "http-on-examine-response" and "xpcom-shutdown". you can also make up your own t...
Frequently Asked Questions
t of heart. some com ownership guidelines. interface pointers considered harmful by don box originally appeared in the september 1995 issue of "the c++ report". com smart pointers even more harmful by don box is a follow-up article that originally appeared in the february 1996 issue of "the c++ report". books essential com by don box. effective com by don box, et al. the c++ programming language (3rd edition) by bjarne stroustrup. effective c++ (2nd edition): 50 specific ways to improve your programs and designs by scott meyers. more effective c++ : 35 new ways to improve your programs and designs by scott meyers. effective c++ cd: 85 specific ways to improve your programs and designs by scott meyers. people don box is a smart guy who has been writing about com programming for a ...
Getting Started Guide
his short section. if this is unfamiliar material, you're not ready for nscomptrs yet. a good place to learn about the basic rules and reasoning behind com is in essential com by don box. don box gets into more of the details, traps, and pitfalls of com in effective com. you should also have a reasonable knowledge of c++. probably the three most helpful books on this topic are the c++ programming language by bjarne stroustrup, effective c++, and more effective c++ by scott meyers. all xpcom objects are allocated on the heap. clients don't get to know much about the implementation of any such object. they reference it only through a pointer to an `interface', i.e., the static type of the pointer is a pointer to an abstract base class, the actual object pointed to is a class derived from that abstr...
XPCOM ABI
often, compiled xpcom components are called 'binary' or 'native'. a binary xpcom component consists of an .xpt file which fits all platforms and a dll (.dll on windows, .so on unix) which is platform-specific and has a certain abi. only applications which use this abi could use this xpcom component. ...
xptcall FAQ
porting this code is required in order to make mozilla run on any given platform. why does xptcall exist? xptcall exists for two reasons: to support invoking arbitrary methods on xpcom interfaces. to support dynamically impersonating any xpcom interface. both of these facilities are required by xpconnect. these facilities are also used by xpcom/proxy. it may also be used by other subsystems in the future. ...
XPIDL Syntax
Mozilla › Tech › XPIDL › Syntax
mar, i will not mention them in the grammar, especially since they are handled as a preprocessing step before the idl source code is actually parsed. a `%{' that appears at the beginning of a line is the start of a raw code fragment, which extends until the end of a line that begins with `%}'. text inside raw code fragments are not otherwise parsed by xpidl directly. this may be followed by the language, as in `%{c++', to output the raw fragment only in the specified language. a `#include "file"' line instructs the xpidl processor to include that file in the same sense that the c preprocessor includes a file. note that includes within comments or raw code fragments are not processed by xpidl. unlike the c preprocessor, when a file is included multiple times, it acts as if the subsequent include...
XPIDL
xpidl is expected to converge towards webidl in the future. note: starting in gecko 9.0, the older xpidl utility, which was previously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk. pyxpidl has been used for some time now, but now the older tool has been fully retired. ...
Xray vision
ct access by content code. the security machinery in gecko ensures that there's asymmetric access between code at different privilege levels: so for example, content code can't access objects created by chrome code, but chrome code can access objects created by content. however, even the ability to access content objects can be a security risk for chrome code. javascript's a highly malleable language. scripts running in web pages can add extra properties to dom objects (also known as expando properties) and even redefine standard dom objects to do something unexpected. if chrome code relies on such modified objects, it can be tricked into doing things it shouldn't. for example: window.confirm() is a dom api that's supposed to ask the user to confirm an action, and return a boolean dependin...
Index
velopers. however, in many cases you only need to learn a few concepts to write an extension. 74 building a thunderbird extension 1: introduction add-ons, extensions, thunderbird thunderbird is a community managed open-source email application. it shares many of the technologies used by mozilla firefox, including javascript, the gecko layout engine, the xul xml user interface language and the xpcom cross-platform component object model. similar to firefox, thunderbird functionality can be enhanced and customized via extensions. 75 building a thunderbird extension 2: extension file layout extensions, thunderbird extensions are packaged and distributed in archive files (also known as bundles), with the xpi (pronounced “zippy”) file extension. at a minimu...
Using JS in Mozilla code
js standard library features feature standard can be used in code new proxy(target, handler) es2015 yes, but getprototypeof and setprototypeof handlers are not yet implemented. ...
Use a source map - Firefox Developer Tools
the javascript sources executed by the browser are often transformed in some way from the original sources created by a developer. for example: sources are often combined and minified to make delivering them from the server more efficient. javascript running in a page is often machine-generated, as when compiled from a language like coffeescript or typescript. in these situations, it's much easier to debug the original source, rather than the source in the transformed state that the browser has downloaded. a source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger. to enable the debugger to work with a source map, you must: generate the source map inc...
Debugger.Source - Firefox Developer Tools
considered to be loaded from a url; the url accessor on debugger.source instances for such sources should return undefined.) if the instance refers to webassembly code, the url of the script that called new webassembly.module with the string "> wasm" appended. sourcemapurl if the instance refers to javascript source, if this source was produced by a minimizer or translated from some other language, and we know the url of a source map document relating the source positions in this source to the corresponding source positions in the original source, then this property’s value is that url. otherwise, this is null. (on the web, the translator may provide the source map url in a specially formatted comment in the javascript source code, or via a header in the http reply that carried the gen...
Index - Firefox Developer Tools
before firefox 50, the memory tool is not enabled by default. to enable it, open the developer tool settings, and check the "memory" box under "default firefox developer tools": 40 dom allocation example this article describes a very simple web page that we'll use to illustrate some features of the memory tool. 41 dominators with a garbage-collected language, like javascript, the programmer doesn't generally have to worry about deallocating memory. they can just create and use objects, and when the objects are no longer needed, the runtime takes care of cleaning up, and frees the memory the objects occupied. 42 dominators view starting in firefox 46, the memory tool includes a new view called the dominators view. this is useful ...
Dominators - Firefox Developer Tools
this article provides an introduction to the concepts of reachability, shallow versus retained size, and dominators, as they apply in garbage-collected languages like javascript. these concepts matter in memory analysis, because often an object may itself be small, but may hold references to other much larger objects, and by doing this will prevent the garbage collector from freeing that extra memory. you can see the dominators in a page using the dominators view in the memory tool. with a garbage-collected language, like javascript, the programmer doesn't generally have to worry about deallocating memory. they can just create and use objects, and when the objects are no longer needed, the runtime takes care of cleaning up, and frees the memory the objects occupied. reachability in ...
Network request details - Firefox Developer Tools
"x-search-id", "value": "esvan0r5bnnwscyk2wq09i1im" }, { "name": "x-varnish", "value": "766019457, 417549316" } ] }, "request headers (665 b)": { "headers": [ { "name": "accept", "value": "*/*" }, { "name": "accept-encoding", "value": "gzip, deflate, br" }, { "name": "accept-language", "value": "en-us,en;q=0.5" }, { "name": "connection", "value": "keep-alive" }, { "name": "cookie", "value": "wmf-last-access=11-jun-2019; wmf-last-access-global=11-jun-2019; mwphp7seed=5c9; geoip=us:ny:port_jervis:41.38:-74.67:v4" }, { "name": "dnt", "value": "1" }, { "name": "host", ...
Allocations - Firefox Developer Tools
this is telling us that, of the 8904 allocations seen in signallater(), all but three came through the removeinner() branch. allocations and garbage collection of course, the memory allocated by a site is in itself useful information to know. but the main connection between the allocation profile of a site and its responsiveness is the cost of garbage collection (gc). with a garbage-collected language, like javascript, the runtime periodically needs to walk the heap looking for objects that are no longer reachable, and then freeing the memory they occupy. while gc events like this are executing, the javascript engine must be paused, so your program is suspended and will be completely unresponsive. to reduce the impact on responsiveness, spidermonkey (the javascript engine in firefox) can perf...
Shader Editor - Firefox Developer Tools
raphics and 2d graphics in the browser without using plugins. with webgl you provide 2 programs called shaders which are called at the appropriate stages of the opengl rendering pipeline: a vertex shader, which computes the clip space coordinates of each vertex to be drawn, and a fragment shader, which determines the color for each pixel to be drawn. these shaders are written in opengl shading language, or glsl. in webgl they can be included in a page in several ways: as text hardcoded in javascript strings, as separate files included using <script> tags, or retrieved from the server as plain text. javascript code running in the page then sends them for compilation using the webgl apis, and they're executed on the device's gpu when needed. with the shader editor, you can examine and edit the s...
AddressErrors - Web APIs
ct the problem. sortingcode a domstring which, if present, indicates that the sortingcode property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. obsolete properties these properties have been removed from the specification and should no longer be used. languagecode a domstring which, if present, indicates that the languagecode property of the paymentaddress could not be validated. the contents of the string provide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem. usage notes keep in mind that some violation errors may be outside the ability of the user to fix. try to avoid asking the user to m...
CanvasRenderingContext2D.textAlign - Web APIs
); ctx.textalign = 'center'; ctx.filltext('center-aligned', x, 85); ctx.textalign = 'right'; ctx.filltext('right-aligned', x, 130); result direction-dependent text alignment this example demonstrates the two direction-dependent values of the textalign property: "start" and "end". note that the direction property is manually specified as "ltr", although this is also the default for english-language text. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '30px serif'; ctx.direction = 'ltr'; ctx.textalign = 'start'; ctx.filltext('start-aligned', 0, 50); ctx.textalign = 'end'; ctx.filltext('end-aligned', canvas.width, 120); result specifications specification status commen...
Canvas API - Web APIs
y for desktop and mobile applications. p5.js has a full set of canvas drawing functionality for artists, designers, educators, and beginners. paper.js is an open-source vector graphics scripting framework that runs on top of the html5 canvas. phaser is a fast, free and fun open source framework for canvas and webgl powered browser games. processing.js is a port of the processing visualization language. pts.js is a library for creative coding and visualization in canvas and svg. rekapi is an animation key-framing api for canvas. scrawl-canvas is an open-source javascript library for creating and manipulating 2d canvas elements. the zim framework provides conveniences, components, and controls for coding creativity on the canvas — includes accessibility and hundreds of colorful tutorials. ...
Binary strings - Web APIs
Web › API › DOMString › Binary
miting the range to 127, it allows code points until 255. its purpose however is not to represent characters, but binary data. the size of the data so represented is twice as big as it would be in normal binary format, however this will not be visible to the final user, since the length of javascript strings is calculated using two bytes as the unit. binary strings are not part of the javascript language design. however at least one native function requires binary strings as its input, btoa(): invoking it on a string that contains codepoints greater than 255 will cause a character out of range error. the reason that brought to use utf-16 code units as placeholders for uint8 numbers is that as web applications become more and more powerful (adding features such as audio and video manipulation, ac...
Document Object Model (DOM) - Web APIs
the dom represents a document with a logical tree. each branch of the tree ends in a node, and each node contains objects. dom methods allow programmatic access to the tree. with them, you can change the document's structure, style, or content. nodes can also have event handlers attached to them. once an event is triggered, the event handlers get executed. ...
EXT_shader_texture_lod - Web APIs
webgl extensions are available using the webglrenderingcontext.getextension() method. for more information, see also using extensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default. it requires glsl #version 300 es. ...
Element.className - Web APIs
Web › API › Element › className
classname = cname; cname is a string variable representing the class or space-separated classes of the current element. example let el = document.getelementbyid('item'); if (el.classname === 'active'){ el.classname = 'inactive'; } else { el.classname = 'active'; } notes the name classname is used for this property instead of class because of conflicts with the "class" keyword in many languages which are used to manipulate the dom. classname can also be an instance of svganimatedstring if the element is an svgelement. it is better to get/set the classname of an element using element.getattribute and element.setattribute if you are dealing with svg elements. however, take into account that element.getattribute returns null instead of "" if the element has an empty class attribute. elm...
Element: select event - Web APIs
for example, in html, select events can be dispatched only on form <input type="text"> and <textarea> elements. ...
Element - Web APIs
Web › API › Element
ment objects (i.e. objects that represent elements) in a document inherit. it only has methods and properties common to all kinds of elements. more specific classes inherit from element. for example, the htmlelement interface is the base interface for html elements, while the svgelement interface is the basis for all svg elements. most functionality is specified further down the class hierarchy. languages outside the realm of the web platform, like xul through the xulelement interface, also implement element. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="...
HTMLAnchorElement - Web APIs
in the referenced url. htmlhyperlinkelementutils.hostname is a usvstring representing the hostname in the referenced url. htmlhyperlinkelementutils.href is a usvstring that is the result of parsing the href html attribute relative to the document, containing a valid url of a linked resource. htmlanchorelement.hreflang is a domstring that reflects the hreflang html attribute, indicating the language of the linked resource. htmlanchorelement.media is a domstring that reflects the media html attribute, indicating the intended media for the linked resource. htmlhyperlinkelementutils.password is a usvstring containing the password specified before the domain name. htmlhyperlinkelementutils.origin read only returns a usvstring containing the origin of the url, that is its scheme, its domai...
HTMLAreaElement - Web APIs
s not the default port) in the referenced url. htmlhyperlinkelementutils.hostname is a usvstring containing the hostname in the referenced url. htmlhyperlinkelementutils.href is a usvstring containing that reflects the href html attribute, containing a valid url of a linked resource. htmlareaelement.hreflang is a domstring containing that reflects the hreflang html attribute, indicating the language of the linked resource. htmlareaelement.media is a domstring containing that reflects the media html attribute, indicating target media of the linked resource. htmlareaelement.nohref is a boolean flag indicating if the area is inactive (true) or active (false). htmlhyperlinkelementutils.password is a usvstring containing the password specified before the domain name. htmlhyperlinkelement...
HTMLElement - Web APIs
scope. htmlelement.itemtype read only returns a domsettabletokenlist… htmlelement.itemid is a domstring representing the item id. htmlelement.itemref read only returns a domsettabletokenlist… htmlelement.itemprop read only returns a domsettabletokenlist… htmlelement.itemvalue returns a object representing the item value. htmlelement.lang is a domstring representing the language of an element's attributes, text, and element contents. htmlelement.nomodule is a boolean indicating whether an import script can be executed in user agents that support module scripts. htmlorforeignelement.nonce returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed. htmlelement.offsetheight read only...
HTMLLinkElement - Web APIs
rigin is a domstring that corresponds to the cors setting for this link element. see cors settings attributes for details. htmllinkelement.disabled is a boolean which represents whether the link is disabled; currently only used with style sheet links. htmllinkelement.href is a domstring representing the uri for the target resource. htmllinkelement.hreflang is a domstring representing the language code for the linked resource. htmllinkelement.media is a domstring representing a list of one or more media formats to which the resource applies. htmllinkelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use. htmllinkelement.rel is a domstring representing the forward relationship of the linked resource from the document to...
HTMLMedia​Element​.textTracks - Web APIs
"> <track kind="metadata" src="keystage3.vtt" srclang="en" label="key stage 3"> </video> the htmlmediaelement.texttracks returns a texttrackslist thru which we can iterate. here we print all the properties of each english track to the console. var tracks = document.queryselector('video').texttracks; for (var i = 0, l = tracks.length; i < l; i++) { /* tracks.length == 10 */ if (tracks[i].language == 'en') { console.dir(tracks[i]); } } properties & methods properties length returns the number of text tracks in texttracklist object. methods gettrackbyid() the gettrackbyid(id) method returns the first texttrack in the texttracklist object that matches the id, or null if there is no match. specifications specification status comment html livi...
HTMLTableCellElement - Web APIs
n virtual. it reflects the obsolete axis attribute. htmltablecellelement.bgcolor a domstring containing the background color of the cells. it reflects the obsolete bgcolor attribute. htmltablecellelement.ch a domstring containing one single chararcter. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablecellelement.choff a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablecellelement.ch. this property was optional and was not very well supp...
HTMLTableRowElement - Web APIs
tablerowelement.cells read only returns a live htmlcollection containing the cells in the row. the htmlcollection is live and is automatically updated when cells are added or removed. htmltablerowelement.ch is a domstring containing one single character. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablerowelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch. this property was optional and was not very well sup...
HTMLTableSectionElement - Web APIs
onelement.rows read only returns a live htmlcollection containing the rows in the section. the htmlcollection is live and is automatically updated when rows are added or removed. htmltablesectionelement.ch is a domstring containing one single chararcter. this character is the one to align all the cell of a column on. it reflects the char and default to the decimal points associated with the language, e.g. '.' for english, or ',' for french. this property was optional and was not very well supported. htmltablesectionelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch. this property was optional and was not very well...
HTMLTrackElement - Web APIs
omstring that reflects the kind html attribute, indicating how the text track is meant to be used. possible values are: subtitles, captions, descriptions, chapters, or metadata. htmltrackelement.src is a domstring that reflects the src html attribute, indicating the address of the text track data. htmltrackelement.srclang is a domstring that reflects the srclang html attribute, indicating the language of the text track data. htmltrackelement.label is a domstring that reflects the label html attribute, indicating a user-readable title for the track. htmltrackelement.default a boolean reflecting the default attribute, indicating that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate. htmltrackelement.readystate read only ret...
Headers.keys() - Web APIs
Web › API › Headers › keys
the headers.keys() method returns an iterator allowing to go through all keys contained in this object. ...
installChrome - Web APIs
e name in the internal manifest.rdf file. returns a boolean value indicating false if the software install feature has been turned off, and true if it's on. note that this return value does not indicate anything about the success of the installation. description installchrome is a special method for installing new chrome in netscape 6 and mozilla. the method performs a simplified installation of language packs or netscape 6/mozilla skins, and saves you the trouble of writing separate installation scripts in the xpi files or using the more sophisticated methods of the install and file objects. ...
InstallTrigger - Web APIs
principal method on the installtrigger object is install, which downloads and installs one or more software packages archived in the xpi file format. the following is a basic example of an install trigger on a web page: xpi={'xpinstall dialog display name':'simple.xpi'}; installtrigger.install(xpi); you can also use the installtrigger object to install netscape 6/mozilla skins and language packs, and perform multiple-package installations with install. compareversion compares the version of a file or package with the version of an existing file or package. enabled indicates whether or not software installation is enabled for this client machine. getversion returns an object representing the version number from the client vers...
KeyboardEvent - Web APIs
e key represented by the event. keyboardevent.locale read only returns a domstring representing a locale string indicating the locale the keyboard is configured for. this may be the empty string if the browser or device doesn't know the keyboard's locale. note: this does not describe the locale of the data being entered. a user may be using one keyboard layout while typing text in a different language. keyboardevent.location read only returns a number representing the location of the key on the keyboard or other input device. a list of the constants identifying the locations is shown above in keyboard locations. keyboardevent.metakey read only returns a boolean that is true if the meta key (on mac keyboards, the ⌘ command key; on windows keyboards, the windows key (⊞)) was active w...
MSCandidateWindowHide - Web APIs
. there may also be large incompatibilities between implementations and the behavior may change in the future. mscandidatewindowhide fires after the input method editor (ime) candidate window closes and is fully hidden. this proprietary method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowhide = handler; addeventlistener method object.addeventlistener("mscandidatewindowhide", handler, usecapture) nbsp; parameters pevtobj [in] typ...
MSCandidateWindowShow - Web APIs
incompatibilities between implementations and the behavior may change in the future. mscandidatewindowshow fires immediately after the input method editor (ime) candidate window is set to appear, but before it renders. this proprietary method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowshow = handler; addeventlistener method object.addeventlistener("mscandidatewindowshow", handler, usecapture) parameters pevtobj [in] type: ih...
MSCandidateWindowUpdate - Web APIs
s and the behavior may change in the future. mscandidatewindowupdate fires after the input method editor (ime) candidate window has been identified as needing to change size, but before any visual updates have rendered. this proprietary method is specific to internet explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowupdate = handler; addeventlistener method object.addeventlistener("mscandidatewindowupdate", handler, usecapture) parameters pevtobj [in] type...
Media Source API - Web APIs
mlmediaelement via a mediasource object. sourcebufferlist a simple container list for multiple sourcebuffer objects. videoplaybackquality contains information about the quality of video being played by a <video> element, such as number of dropped or corrupted frames. returned by the htmlvideoelement.getvideoplaybackquality() method. trackdefault provides a sourcebuffer with kind, label, and language information for tracks that do not contain this information in the initialization segments of a media chunk. trackdefaultlist a simple container list for multiple trackdefault objects. extensions to other interfaces url.createobjecturl() creates an object url pointing to a mediasource object that can then be specified as the src value of an html media element to play a media stream. html...
Microdata DOM API - Web APIs
</section> ...it would result in the following output: name http://example.com/fn desc http://example.com/color img (the duplicate occurrence of "http://example.com/color" is not included in the list.) htmlpropertiescollection the htmlpropertiescollection interface is used for collections of elements that add name-value pairs to a particular item in the microdata model. interface description language interface htmlpropertiescollection : htmlcollection { // inherits length and item() getter propertynodelist? nameditem(domstring name); // shadows inherited nameditem() readonly attribute domstring[] names; }; typedef sequence<any> propertyvaluearray; interface propertynodelist : nodelist { propertyvaluearray getvalues(); }; collection . length returns the number of elements in the...
NDEFRecord - Web APIs
ndefrecord.id read only represents the identificator of the record. note: the uniqueness of the identifier is enforced only by the generator of the record. ndefrecord.data read only represents the payload of the record. ndefrecord.encoding read only represents the encoding name used for encoding the payload in the case it is textual data. ndefrecord.lang read only represents a language tag of the content, if it was encoded. methods ndefrecord.torecords() coverts ndefrecord.data to sequence of records. specifications specification status comment web nfc, ndefrecord draft initial definition. ...
Notification.Notification() - Web APIs
new notification(title, options); parameters title defines a title for the notification, which is shown at the top of the notification window. options optional an options object containing any custom settings that you want to apply to the notification. the possible options are: dir: the direction in which to display the notification. it defaults to auto, which just adopts the browser's language setting behavior, but you can override that behaviour by setting values of ltr and rtl (although most browsers seem to ignore these settings.) lang: the notification's language, as specified using a domstring representing a bcp 47 language tag. see the sitepoint iso 2 letter language codes page for a simple reference. badge: a usvstring containing the url of the image used to represent the no...
Notification.dir - Web APIs
Web › API › Notification › dir
note: this feature is available in web workers. the dir read-only property of the notification interface indicates the text direction of the notification, as specified in the dir option of the notification() constructor. syntax var direction = notification.dir; value a domstring specifying the text direction. possible values are: auto: adopts the browser's language setting behaviour (the default.) ltr: left to right. rtl : right to left. note: most browsers seem to ignore explicit ltr and rtl settings, and just go with the browser-wide setting. examples the following snippet fires a notification; a simple options object is created, then the notification is fired using the notification() constructor. var options = { body: 'do you like my body?', dir: 'rtl' } var n = ...
Notification - Web APIs
o display the notification itself. notification.body read only the body string of the notification as specified in the constructor's options parameter. notification.data read only returns a structured clone of the notification’s data. notification.dir read only the text direction of the notification as specified in the constructor's options parameter. notification.lang read only the language code of the notification as specified in the constructor's options parameter. notification.tag read only the id of the notification (if any) as specified in the constructor's options parameter. notification.icon read only the url of the image used as an icon of the notification as specified in the constructor's options parameter. notification.image read only the url of an image to be dis...
PaymentAddress - Web APIs
land, australia, "ca" for california, and so on). paymentaddress.sortingcode read only a domstring providing a postal sorting code such as is used in france. note: properties for which values were not specified contain empty strings. obsolete properties the following properties are obsolete and should no longer be used, but may still be present in some browser versions. paymentaddress.languagecode read only a domstring indicating the language code of the address. this identifies the language in which the address is given, and is intended to aid in localization of the display of the address. methods paymentaddress.tojson() a standard serializer that returns a json representation of the paymentaddress object's properties. examples in the following example, the paymentrequest...
Payment Request API - Web APIs
er their details once into the browser and are then ready to pay for goods and services on the web. they no longer have to fill out the same details repeatedly across different sites. consistent experience on every site (that supports the api): as the payment sheet is controlled by the browser, it can tailor the experience to the user. this can include localizing the ui into the user's preferred language. accessibility: as the browser controls the input elements of the payment sheet, it can assure consistent keyboard and screen reader accessibility on every website without developers needing to do anything. a browser could also adjust the font size or color contrast of the payment sheet, making it more comfortable for the user to make a payment. credentials management: users can manage their cr...
SVGAElement - Web APIs
well as methods to manipulate them. properties this interface also inherits properties from its parent, svggraphicselement, and implements properties from svgurireference and htmlhyperlinkelementutils. svgaelement.download see htmlanchorelement.download. svgaelement.href see htmlanchorelement.href. svgaelement.hreflang is a domstring that reflects the hreflang attribute, indicating the language of the linked resource. svgaelement.ping is a domstring that reflects the ping attribute, containing a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. svgaelement.referrerpolicy see htmlanchorelement.referrerpolicy. svgaelement.rel see htmlanchorelement.rel. ...
SVGElement - Web APIs
all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" s...
SVGExternalResourcesRequired - Web APIs
a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. properties svgexternalresourcesrequired.externalresourcesrequired corresponds to the externalresourcesrequired attribute of the given element. note: the svg dom defines the attribute externalresourcesrequired as being of type svganimatedboolean, whereas the svg language definition says that the attribute is not animated. because the svg language definition states that externalresourcesrequired cannot be animated, the animval will always be the same as the baseval. methods this interface doesn't implement any specific methods. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definiti...
SVGTests - Web APIs
Web › API › SVGTests
onditional processing attributes and is mixed into other interfaces for elements that support these attributes. properties svgtests.requiredfeatures read only an svgstringlist corresponding to the requiredfeatures attribute of the given element. svgtests.requiredextensions read only an svgstringlist corresponding to the requiredextensions attribute of the given element. svgtests.systemlanguage read only an svgstringlist corresponding to the systemlanguage attribute of the given element. methods svgtests.hasextension() read only returns true if the browser supports the given extension, specified by a uri. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgtests' in that specification. candidate recom...
Selection.modify() - Web APIs
Web › API › Selection › modify
position, using simple textual commands. syntax sel.modify(alter, direction, granularity) parameters alter the type of change to apply. specify "move" to move the current cursor position or "extend" to extend the current selection. direction the direction in which to adjust the current selection. you can specify "forward" or "backward" to adjust in the appropriate direction based on the language at the selection point. if you want to adjust in a specific direction, you can specify "left" or "right". granularity the distance to adjust the current selection or cursor position. you can move by "character", "word", "sentence", "line", "paragraph", "lineboundary", "sentenceboundary", "paragraphboundary", or "documentboundary". note: gecko does not implement "sentence", "paragraph", "sente...
ServiceWorkerRegistration.showNotification() - Web APIs
ed with the notification. this can be of any data type. dir : the direction of the notification; it can be auto, ltr or rtl icon: a usvstring containing the url of an image to be used as an icon by the notification. image: a usvstring containing the url of an image to be displayed in the notification. lang: specify the lang used within the notification. this string must be a valid bcp 47 language tag. renotify: a boolean that indicates whether to suppress vibrations and audible alerts when reusing a tag value. if options’s renotify is true and options’s tag is the empty string a typeerror will be thrown. the default is false. requireinteraction: indicates that on devices with sufficiently large screens, a notification should remain active until the user clicks or dismisses it. if ...
SourceBuffer.trackDefaults - Web APIs
syntax var mytrackdefaults = sourcebuffer.trackdefaults; sourcebuffer.trackdefaults = mytrackdefaultlist; value a trackdefaultlist object. exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidstateerror one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. ...
SourceBuffer - Web APIs
any order, or they have to be kept in a strict sequence. sourcebuffer.texttracks read only a list of the text tracks currently contained inside the sourcebuffer. sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer. sourcebuffer.trackdefaults specifies the default values to use if kind, label, and/or language information is not available in the initialization segment of the media to be appended to the sourcebuffer. sourcebuffer.updating read only a boolean indicating whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() operation is currently in progress. sourcebuffer.videotracks read only a list...
SpeechRecognition - Web APIs
or speechrecognition.speechrecognition() creates a new speechrecognition object. properties speechrecognition also inherits properties from its parent interface, eventtarget. speechrecognition.grammars returns and sets a collection of speechgrammar objects that represent the grammars that will be understood by the current speechrecognition. speechrecognition.lang returns and sets the language of the current speechrecognition. if not specified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either. speechrecognition.continuous controls whether continuous results are returned for each recognition, or only a single result. defaults to single (false.) speechrecognition.interimresults controls whether interim results should be ret...
SpeechRecognitionError.error - Web APIs
quested speech recognition service, either because the user agent doesn't support it or because of reasons of security, privacy or user preference. in this case it would allow another more suitable speech recognition service to be used instead. bad-grammar there was an error in the speech recognition grammar or semantic tags, or the chosen grammar format or semantic tag format was unsupported. language-not-supported the language was not supported. examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } ...
SpeechRecognitionErrorEvent.error - Web APIs
quested speech recognition service, either because the user agent doesn't support it or because of reasons of security, privacy or user preference. in this case it would allow another more suitable speech recognition service to be used instead. bad-grammar there was an error in the speech recognition grammar or semantic tags, or the chosen grammar format or semantic tag format was unsupported. language-not-supported the language was not supported. examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } specifications specification status comment web speech apithe definition of 'error' in that specifica...
SpeechRecognitionEvent.emma - Web APIs
you can see muliple emma examples in the spec. syntax var myemma = event.emma; value a valid xml document. the exact contents can vary across user agents and recognition engines, but all supporting implementations will expose a valid xml document complete with an emma namespace. if the speech recognition system does not supply emma data then the user agent will return null. ...
SpeechRecognitionEvent - Web APIs
the speechrecognitionevent interface of the web speech api represents the event object for the result and nomatch events, and contains all the data associated with an interim or final speech recognition result. properties speechrecognitionevent also inherits properties from its parent interface, event. speechrecognitionevent.emma read only returns an extensible multimodal annotation markup language (emma) — xml — representation of the result. speechrecognitionevent.interpretation read only returns the semantic meaning of what the user said. speechrecognitionevent.resultindex read only returns the lowest index value result in the speechrecognitionresultlist "array" that has actually changed. speechrecognitionevent.results read only returns a speechrecognitionresultlist object re...
SpeechSynthesisErrorEvent.error - Web APIs
ettings.) network the operation couldn't be completed at this time because some required network communication failed. synthesis-unavailable the operation couldn't be completed at this time because no synthesis engine was available (for example, the user may need to install or configure a synthesis engine.) synthesis-failed the operation failed because the synthesis engine raised an error. language-unavailable no appropriate voice was available for the language set in speechsynthesisutterance.lang. voice-unavailable the voice set in speechsynthesisutterance.voice was not available. text-too-long the contents of the speechsynthesisutterance.text attribute was too long to synthesize. invalid-argument the content of the speechsynthesisutterance.rate, speechsynthesisutterance.pitch or sp...
SpeechSynthesisUtterance - Web APIs
the speechsynthesisutterance interface of the web speech api represents a speech request. it contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.) constructor speechsynthesisutterance.speechsynthesisutterance() returns a new speechsynthesisutterance object instance. properties speechsynthesisutterance also inherits properties from its parent interface, eventtarget. speechsynthesisutterance.lang gets and sets the language of the utterance. speechsynthesisutterance.pitch gets and sets the pitch at which the utterance will be spoken at. speechsynthesisutterance.rate gets and sets the speed at which the utterance will be spoken at. speechsynthesisutterance.text gets and sets the text that will be synthesised whe...
SpeechSynthesisVoice.default - Web APIs
the spec is not very clear on which it should be, so some implementations may differ. syntax var amidefault = speechsynthesisvoiceinstance.default; value a boolean. ...
SpeechSynthesisVoice.lang - Web APIs
the lang read-only property of the speechsynthesisvoice interface returns a bcp 47 language tag indicating the language of the voice. syntax var mylang = speechsynthesisvoiceinstance.lang; value a domstring representing the language of the device. examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'lang' in that specification. draft ...
SpeechSynthesisVoice - Web APIs
the speechsynthesisvoice interface of the web speech api represents a voice that the system supports. every speechsynthesisvoice has its own relative speech service including information about language, name and uri. properties speechsynthesisvoice.default read only a boolean indicating whether the voice is the default voice for the current app language (true), or not (false.) speechsynthesisvoice.lang read only returns a bcp 47 language tag indicating the language of the voice. speechsynthesisvoice.localservice read only a boolean indicating whether the voice is supplied by a local speech synthesizer service (true), or a remote speech synthesizer service (false.) speechsynthesisvoice.name read only returns a human-readable name that represents the voice. speechsynthesisvoice.vo...
StyleSheet.type - Web APIs
Web › API › StyleSheet › type
the type property of the stylesheet interface specifies the style sheet language for the given style sheet. syntax string = stylesheet.type example mystylesheet.type = 'text/css'; specifications specification status comment css object model (cssom)the definition of 'stylesheet: type' in that specification. working draft ...
StyleSheet - Web APIs
rnode read only returns a node associating this style sheet with the current document. stylesheet.parentstylesheet read only returns a stylesheet including this one, if any; returns null if there aren't any. stylesheet.title read only returns a domstring representing the advisory title of the current style sheet. stylesheet.typeread only returns a domstring representing the style sheet language for this style sheet. specifications specification status comment css object model (cssom)the definition of 'stylesheet' in that specification. working draft no change from document object model (dom) level 2 style specification. document object model (dom) level 2 style specificationthe definition of 'stylesheet' in that specification. obsolete ini...
TextTrack - Web APIs
Web › API › TextTrack
ttrack describes. the value must be one of those in the texttrackkind enum. texttrack.label read only a human-readable domstring which contains the text track's label, if one is present; otherwise, this is an empty string (""), in which case a custom label may need to be generated by your code using other attributes of the track, if the track's label needs to be exposed to the user. texttrack.language read only a domstring which specifies the text language in which the text track's contents is written. the value must adhere to the format specified in the tags for identifying languages (bcp 47) document from the ietf, just like the html lang attribute. for example, this can be "en-us" for united states english or "pt-br" for brazilian portuguese. texttrack.mode a domstring specifying the tr...
VideoTrack.kind - Web APIs
Web › API › VideoTrack › kind
of those found in video track kind strings below. video track kind strings the kinds available for video tracks are: "alternative" a potential alternative to the main track, such as a different video take or a version of the soundtrack with only the music and no dialogue. "captions" a version of the main video track with captions burnt in. "main" the primary video track. "sign" a sign-language interpretation of an audio track. "subtitles" a version of the main video track with subtitles burnt in. "commentary" a video track containing a commentary. this might be used to contain the director's commentary track on a movie, for example. "" (empty string) the track doesn't have an explicit kind, or the kind provided by the track's metadata isn't recognized by the user agent. specifi...
VideoTrack.label - Web APIs
Web › API › VideoTrack › label
a string specifying the video track's human-readable label, if one is available; otherwise, it returns an empty string. syntax var videotracklabel = videotrack.label; value a domstring specifying the track's human-readable label, if one is available in the track metadata. otherwise, an empty string ("") is returned. for example, a track whose kind is "sign" might have a label such as "a sign-language interpretation.". example this example returns an array of track kinds and labels for potential use in a user interface to select video tracks for a specified media element. the list is filtered to only allow certain track kinds through. function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "commentary" ]; el.videotracks.foreach(function(trac...
WebGLRenderingContext.getParameter() - Web APIs
fer_binding webglrenderbuffer or null see bindrenderbuffer. ...
WebGL constants - Web APIs
ectors 0x8dfb max_varying_vectors 0x8dfc max_combined_texture_image_units 0x8b4d max_vertex_texture_image_units 0x8b4c max_texture_image_units 0x8872 implementation dependent number of maximum texture units. at least 8. max_fragment_uniform_vectors 0x8dfd shader_type 0x8b4f shading_language_version 0x8b8c current_program 0x8b8d depth or stencil tests constants passed to webglrenderingcontext.depthfunc() or webglrenderingcontext.stencilfunc(). constant name value description never 0x0200 passed to depthfunction or stencilfunction to specify depth or stencil tests will never pass. i.e. nothing will be drawn. ...
Matrix math for the web - Web APIs
seudo-code. transformation = rotate * translate * scale composing multiple transformations the function that we will be using to compose our matrices is multiplyarrayofmatrices(), which is part of the set of utility functions introduced near the top of this article. it takes an array of matrices and multiplies them together, returning the result. in webgl shader code, this is built into the language and the * operator can be used. additionally this example uses scale() and translate() functions, which return matrices as defined above. let transformmatrix = mdn.multiplyarrayofmatrices([ rotatearoundzaxis(math.pi * 0.5), // step 3: rotate around 90 degrees translate(0, 200, 0), // step 2: move down 100 pixels scale(0.8, 0.8, 0.8), // step 1: scale down ]...
Adding 2D content to a WebGL context - Web APIs
we're still drawing in 3d space. it's just we're drawing a square and we're putting it directly in front of the camera perpendicular to the view direction. we need to define the shaders that will create the color for our simple scene as well as draw our object. these will establish how the square plane appears on the screen. the shaders a shader is a program, written using the opengl es shading language (glsl), that takes information about the vertices that make up a shape and generates the data needed to render the pixels onto the screen: namely, the positions of the pixels and their colors. there are two shader functions run when drawing webgl content: the vertex shader and the fragment shader. you write these in glsl and pass the text of the code into webgl to be compiled for execution on th...
WebGL model view projection - Web APIs
.uniformmatrix4fv(this.locations.model, false, new float32array(this.transforms.model)); in the shader, each position vertex is first transformed into a homogeneous coordinate (a vec4 object), and then multiplied against the model matrix. gl_position = model * vec4(position, 1.0); note: in javascript, matrix multiplication requires a custom function, while in the shader it is built into the language with the simple * operator. the results view on jsfiddle at this point the w value of the transformed point is still 1.0. the cube still doesn't have any perspective. the next section will take this setup and modify the w values to provide some perspective. exercises shrink down the box using the scale matrix and position it in different places within clip space. try moving it outside ...
Writing a WebSocket server in C# - Web APIs
this server conforms to rfc 6455 so it will only handle connections from chrome version 16, firefox 11, ie 10 and over. first steps websockets communicate over a tcp (transmission control protocol) connection. luckily, c# has a tcplistener class which does as the name suggests. it is in the system.net.sockets namespace. ...
Writing WebSocket servers - Web APIs
a websocket server is nothing more than an application listening on any port of a tcp server that follows a specific protocol. the task of creating a custom server tends to scare people; however, it can be straightforward to implement a simple websocket server on your platform of choice. a websocket server can be written in any server-side programming language that is capable of berkeley sockets, such as c(++), python, php, or server-side javascript. this is not a tutorial in any specific language, but serves as a guide to facilitate writing your own server. this article assumes you're already familiar with how http works, and that you have a moderate level of programming experience. depending on language support, knowledge of tcp sockets may be required. the scope of this guide is to present t...
Writing a WebSocket server in Java - Web APIs
this server conforms to rfc 6455, so it only handles connections from chrome version 16, firefox 11, ie 10 and higher. first steps websockets communicate over a tcp (transmission control protocol) connection. java's serversocket class is located in the java.net package. ...
Geometry and reference spaces in WebXR - Web APIs
however, in order to provide the ability to present scenes in true 3d using xr headsets and other such equipment, webxr has additional concepts that must be understood. ...
Web Animations API Concepts - Web APIs
ls the gap between declarative css animations and transitions, and dynamic javascript animations. this means we can use it to create and manipulate css-like animations that go from one pre-defined state to another, or we can use variables, loops, and callbacks to create interactive animations that adapt and react to changing inputs. history over a decade ago, synchronized multimedia integration language, or smil (pronounced "smile"), brought animation to svg. back then it was the only animation engine browsers had to worry about. while four out of five browsers supported smil, it only animated svg elements, could not be used from css, and was very complex — often leading to inconsistent implementations. ten years later, the safari team introduced the css animations and css transitions specs. ...
Web Animations API - Web APIs
to get more information on the concepts behind the api and how to use it, read using the web animations api. ...
Web Speech API - Web APIs
ny errors that occur while processing speechsynthesisutterance objects in the speech service. speechsynthesisevent contains information about the current state of speechsynthesisutterance objects that have been processed in the speech service. speechsynthesisutterance represents a speech request. it contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.) speechsynthesisvoice represents a voice that the system supports. every speechsynthesisvoice has its own relative speech service including information about language, name and uri. window.speechsynthesis specced out as part of a [nointerfaceobject] interface called speechsynthesisgetter, and implemented by the window object, the speechsynthesis property provides access ...
Functions and classes available to Web Workers - Web APIs
s defines worker-specific functions. (yes) 10.0 (yes) (yes) workerlocation the subset of the location interface available to workers. 3.6 (1.9.2) 10.0 (yes) (yes) workernavigator the subset of the navigator interface available to workers. basic implementation (yes) appcodename, product, taintenabled(): 28 (28) online: 29 (29) navigatorlanguage: (yes) appname, appversion, online, platform, useragent: 10.0 other: no support (yes) (yes) xmlhttprequest creates and returns a new xmlhttprequest object; this mimics the behavior of the standard xmlhttprequest() constructor. note that the responsexml and channel attributes on xmlhttprequest always return null. basic: 3.5 (1.9.1) response and responsetype a...
Using Web Workers - Web APIs
those names, but they will not register the function to receive messages sent by the web page that created the worker). this starts the recursion, spawning new copies of itself to handle each iteration of the calculation. ...
WorkerGlobalScope - Web APIs
a the workerglobalscope.onerror property. offline fired when the browser has lost access to the network and the value of navigator.online switched to false. also available via the workerglobalscope.onoffline property. online fired when the browser has gained access to the network and the value of navigator.online switched to true. also available via the workerglobalscope.ononline property. languagechange fired at the global/worker scope object when the user's preferred languages change. also available via the workerglobalscope.onlanguagechange property. close is an eventhandler representing the code to be called when the close event is raised. also available via the workerglobalscope.onclose property. rejectionhandled an event handler for handled promise rejection events. a...
Introduction - Web APIs
s one of the first ways proposed by the w3c. css is a simple way to apply style rules to a web document. these style rules define how the document (the content) should be laid out. however, it has several limitations, such as lack of programming structures and ability to create complex layout models. css also has limited support for changing the position of an element. xsl (extensible stylesheet language) transformations are composed of two parts: xsl elements, which allow the transformation of an xml tree into another markup tree and xpath, a selection language for trees. xslt takes an xml document (the content) and creates a brand new document based on the rules in the xsl stylesheet. this allows xslt to add, remove and reorganize elements from the original xml document and thus allows more fin...
Resources - Web APIs
...
Web APIs
Web › API
nstraints merchantvalidationevent messagechannel messageevent messageport metadata mimetype mimetypearray mouseevent mousescrollevent mousewheelevent mutationevent mutationobserver mutationobserverinit mutationrecord n ndefmessage ndefreader ndefreadingevent ndefrecord ndefwriter namelist namednodemap navigationpreloadmanager navigator navigatorconcurrenthardware navigatorid navigatorlanguage navigatoronline navigatorplugins navigatorstorage networkinformation node nodefilter nodeiterator nodelist nondocumenttypechildnode notation notification notificationaction notificationevent notifyaudioavailableevent o oes_element_index_uint oes_fbo_render_mipmap oes_standard_derivatives oes_texture_float oes_texture_float_linear oes_texture_half_float oes_texture_half_float_linear o...
Using the slider role - Accessibility
the slider's aria-valuenow (and possible aria-valuetext) attribute to reflect the current value. see the examples section below for more information. keyboard and focus the slider should be keyboard focusable and operable. when the user tabs focus to the slider, it should land on the thumb: the control a mouse user would drag. arrow keys should operate as follows (localization for right-to-left languages should reverse the direction of the arrows): key(s) action right and up arrows increase the selected value left and down arrows decrease the selected value page up and page down optionally increase and decrease the value by a set amount (e.g. by 10 on a range from 0 to 100) possible effects on user agents and assistive technology no...
Accessibility documentation index - Accessibility
igorously. 102 text labels and names accessibility, wcag, text labels there are many situations in which a control, dialog, or other website feature should be given a descriptive name or label to allow users of assistive technologies to understand what its purpose is and to be able to understand and operate it correctly. 103 understandable accessibility, help, language, navigation, principle 3, text, understandable, wcag, web content accessibility guidelines, abbreviations, consistency, error messages, form validation, labels, slang this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the understandable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1. under...
Accessibility Information for Web Authors - Accessibility
ess to make custom dhtml widgets such as menus or tree views keyboard accessible. accessible web page authoring ibm has put together a simple, practical resource for web authors to learn accessibility the fast and painless way. highly recommended, an excellent resource. dive into accessibility by mark pilgrim an excellent, easy-to-understand resource (available in english and in 9 other languages) on accessible website authoring, which goes into greater depth. in 30 days, you will know why your website should be accessible and how to make it more accessible. automated checking & repair cynthia says™ from hisoftware® company "cynthia says™" is a free online webpage accessibility validation service that is designed to identify errors in webpage related to section 508 standar...
Text labels and names - Accessibility
assistive technology is to infer what content a page contains by reading its title. if the title is not available, they have to navigate the page to determine its content, which can be a time consuming and potentially confusing process. ...
Accessibility
limited in some way. for many people, technology makes things easier. for people with disabilities, technology makes things possible. accessibility means developing content to be as accessible as possible no matter an individual's physical and cognitive abilities and no matter how they access the web. "the web is fundamentally designed to work for all people, whatever their hardware, software, language, culture, location, or physical or mental ability. when the web meets this goal, it is accessible to people with a diverse range of hearing, movement, sight, and cognitive ability." (w3c - accessibility) key tutorials the mdn accessibility learning area contains modern, up-to-date tutorials covering accessibility essentials: what is accessibility? this article starts off the module with a...
::first-line (:first-line) - CSS: Cascading Style Sheets
t-line, introduced in css2. ...
speak-as - CSS: Cascading Style Sheets
s extends, the value of speak-as will be the same as if speak-as: auto is specified on the extended style. for all other cases, specifying auto has the same effect as specifying speak-as: numbers. bullets a phrase or an audio cue defined by the user agent for representing an unordered list item will be read out. numbers the numerical value of the counter will be read out in the document language. words the user agent will generate a counter value as normal and read it out as a word in the document language. spell-out the user agent will generate a counter representation as normal and would read it out letter by letter. if the user agent doesn't know how to read out a partiular counter symbol, the user agent might read it out as if the value of speak-as was numbers. <counter-style-na...
Box alignment in grid layout - CSS: Cascading Style Sheets
oup by setting align-self to center. grid axes as a two-dimensional layout method, when working with grid layout we always have two axes on which to align our items. we have access to all of the box alignment properties to help us achieve this. the inline axis is the axis that corresponds to the direction that words in a sentence would run in the writing mode used. therefore, in a horizontal language such as english or arabic the inline direction runs horizontally. should you be in a vertical writing mode the inline axis will run vertically. to align things on the inline axis you use the properties that start with justify-, justify-content, justify-items and justify-self. the block axis crosses the inline axis in the direction that blocks are displayed down the page — for example paragr...
CSS Box Alignment - CSS: Cascading Style Sheets
al attributes of the screen, all of the other values are logical values and relate to the writing mode of the content. for example, when working in css grid layout, if you are working in english and set justify-content to start this will move the items in the inline dimension to the start, which will be the left as sentences in english start on the left. if you were using arabic, a right to left language, then the same value of start would result in the items moving to the right, as sentences in arabic start on the right-hand side of the page. both of these examples have justify-content: start, however the location of start changes according to the writing mode. baseline alignment the baseline alignment keywords are used to align the baselines of boxes across a group of alignment subjects. t...
Basic concepts of flexbox - CSS: Cascading Style Sheets
flow in. if the flex-direction is row and i am working in english, then the start edge of the main axis will be on the left, the end edge on the right. if i were to work in arabic, then the start edge of my main axis would be on the right and the end edge on the left. in both cases the start edge of the cross axis is at the top of the flex container and the end edge at the bottom, as both languages have a horizontal writing mode. after a while, thinking about start and end rather than left and right becomes natural, and will be useful to you when dealing with other layout methods such as css grid layout which follow the same patterns. the flex container an area of a document laid out using flexbox is called a flex container. to create a flex container, we set the value of the area's con...
Ordering Flex Items - CSS: Cascading Style Sheets
the first two values ​​keep the items in the same order that they appear in the document source order and display them sequentially from the start line. the second two values ​​reverse the items by switching the start and end lines. remember that the start line relates to writing modes. the row-related examples above demonstrate how row and row-reverse work in a left-to-right language such as english. if you are working in a right-to-left language like arabic then row would start on the right, row-reverse on the left. this can seem like a neat way to display things in reverse order however you should be mindful that the items are only visually displayed in reverse order. the specification says the following on this matter: “note: the reordering capabilities of flex layo...
Flow Layout and Overflow - CSS: Cascading Style Sheets
e way content looks in an overflow situation. inline-axis overflow the text-overflow property deals with text overflowing in the inline direction. it takes one of two values clip, in which case content is clipped when it overflows, this is the initial value and therefore the default behaviour. we also have ellipsis which renders an ellipsis, which may be replaced with a better character for the language or writing mode in use. block-axis overflow there is also a proposal for a block-overflow property, although at the time of writing the name is still up for discussion. this proposal would enable the adding of an ellipsis when text overflows in the block dimension. this is useful in the situation where you have a listing of articles, for example, and you display the listings in fixed height ...
OpenType font features guide - CSS: Cascading Style Sheets
ific scenarios. in addition to broad feature sets like ligatures or lining figures (numerals that line up evenly as opposed to 'oldstyle', which look more like lower-case letters), there are also very specific ones such as stylistic sets (which might include several specific variants of glyphs meant to be used together), alternates (which might be one or more variants of the letter 'a'), or even language-specific alterations for east asian languages. in the latter case, these alterations are actually necessary to properly express the language, so they go beyond the more stylistic preference of most other opentype features. caution: there are many css attributes defined to leverage font features, but unfortunately many are not fully implemented. they are all defined and shown here, but many will...
CSS Fonts - CSS: Cascading Style Sheets
Web › CSS › CSS Fonts
eep<br> i stretched myself out onna antique bed<br> an' my spirit did a midnite creep</p> the result is as follows: variable fonts examples you can find a number of variable fonts examples at v-fonts.com and axis-praxis.org; see also our variable fonts guide for more information and usage information. ...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
ixels.</p> </div> <div>three</div> <div>four</div> <div>five</div> </div> grid lines it should be noted that when we define a grid we define the grid tracks, not the lines. grid then gives us numbered lines to use when positioning items. in our three column, two row grid we have four column lines. lines are numbered according to the writing mode of the document. in a left-to-right language, line 1 is on the left-hand side of the grid. in a right-to-left language, it is on the right-hand side of the grid. lines can also be named, and we will look at how to do this in a later guide in this series. positioning items against lines we will be exploring line based placement in full detail in a later article. the following example demonstrates doing this in a simple way. when placing an...
Comments - CSS: Cascading Style Sheets
Web › CSS › Comments
low is used to disable specific styling */ /* span { color: blue; font-size: 1.5em; } */ notes the /* */ comment syntax is used for both single and multiline comments. there is no other way to specify comments in external style sheets. however, when using the <style> element, you may use <!-- --> to hide css from older browsers, although this is not recommended. as with most programming languages that use the /* */ comment syntax, comments cannot be nested. in other words, the first instance of */ that follows an instance of /* closes the comment. specifications css 2.1 syntax and basic data types #comments ...
Questions about CSS - CSS: Cascading Style Sheets
Web › CSS › FAQ
css gives more control over the appearance of a web page to the page creator than to the browser designer or the viewer. with css, the sources of style definition for a given document element are in this order of precedence: the style attribute on an individual element tag the style element that defines a specific style sheet containing style declarations or a link element that links to a separate document containing the style element. in a web page, the style element is placed between the title statement and the body statement. ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
ill accepted] -moz-column-rule [prefixed version still accepted] -moz-column-rule-width [prefixed version still accepted] -moz-column-rule-style [prefixed version still accepted] -moz-column-rule-color [prefixed version still accepted] -moz-context-properties f–m filter [applying to more than svg] -moz-font-feature-settings [prefixed version still accepted] -moz-font-language-override [prefixed version still accepted] -moz-hyphens [prefixed version still accepted] -moz-margin-end [superseded by the standard version margin-inline-end] -moz-margin-start [superseded by the standard version margin-inline-start] mask [applying to more than svg] o -moz-opacityobsolete since gecko 1.9.1 -moz-outlineobsolete since gecko 1.9.2 -moz-outline-colorobsolete ...
CSS reference - CSS: Cascading Style Sheets
Web › CSS › Reference
empty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settingsfont-feature-settings (@font-face)@font-feature-valuesfont-kerningfont-language-overridefont-optical-sizingfont-sizefont-size-adjustfont-stretchfont-stretch (@font-face)font-stylefont-style (@font-face)font-synthesisfont-variantfont-variant (@font-face)font-variant-alternatesfont-variant-capsfont-variant-east-asianfont-variant-ligaturesfont-variant-numericfont-variant-positionfont-variation-settingsfont-variation-settings (@font-face)font-weightfont-weight (@font-face)format...
Syntax - CSS: Cascading Style Sheets
Web › CSS › Syntax
the basic goal of the cascading stylesheet (css) language is to allow a browser engine to paint elements of the page with specific features, like colors, positioning, or decorations. the css syntax reflects this goal and its basic building blocks are: the property which is an identifier, that is a human-readable name, that defines which feature is considered. the value which describe how the feature must be handled by the engine. each property has a set of valid values, defined by a formal grammar, as well as a semantic meaning, implemented by the browser engine. css declarations setting css properties to specific values is the core function of the css language. a property and value pair is called a declaration, and any css engine calculates which declarations apply to every single element...
CSS Tutorials - CSS: Cascading Style Sheets
Web › CSS › Tutorials
choose the most appropriate for your level. editor's note: we should look at using "difficulty level" tags on the tutorial/guide pages so that difficulty-based lists can be automatically built. beginner-level css tutorials getting started this guide is aimed at complete beginners: you haven't written one single line of css? — this is for you. it explains the fundamental concepts of the language and guides you in writing basic stylesheets. using multiple backgrounds backgrounds are fundamental for nice styling: css allows you to set several of them on each box. this tutorial explains how they interact and how to achieve nice effects. scaling background images css allows you to resize images used as an element's background. this tutorial describes how to achieve this in a simple way. ...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
the value is computed where it is needed, not stored for use in other rules. for instance, you cannot set a property for an element and expect to retrieve it in a sibling's descendant's rule. the property is only set for the matching selector and its descendants, like any normal css. custom property fallback values using the var() function, you can define multiple fallback values when the giv...
Visual formatting model - CSS: Cascading Style Sheets
of the page when the viewport size changes — for example, if you resize your window, or change the orientation of a mobile device. if the viewport is smaller than the size of the document then the user agent needs to offer a way to scroll to the parts of the document that are not displayed. we most often see this as scrolling in the block dimension — vertically in a horizontal, top-to-bottom language. however, you might design something that requires scrolling in the inline dimension too. box generation box generation is the part of the css visual formatting model that creates boxes from the document's elements. generated boxes are of different types, which affect their visual formatting. the type of the box generated depends on the value of the css display property. initially defined in c...
direction - CSS: Cascading Style Sheets
Web › CSS › direction
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note 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. ...
font-variant-caps - CSS: Cascading Style Sheets
ite capital glyphs are not available, they are rendered using small capital glyphs. if these are not present, the browser synthesizes them from the uppercase glyphs. fonts sometimes include special glyphs for various caseless characters (such as punctuation marks) to better match the capitalized characters around them. however, small capital glyphs are never synthesized for caseless characters. language-specific rules this property accounts for language-specific case mapping rules. for example: in turkic languages, such as turkish (tr), azerbaijani (az), crimean tatar (crh), volga tatar (tt), and bashkir (ba), there are two kinds of i (one with the dot, one without) and two case pairings: i/İ and ı/i. in german (de), the ß may become ẞ (u+1e9e) in uppercase. in greek (el), vowels lose...
font-variant-ligatures - CSS: Cascading Style Sheets
*/ /* global values */ font-variant-ligatures: inherit; font-variant-ligatures: initial; font-variant-ligatures: unset; the font-variant-ligatures property is specified as one of the keyword values listed below. values normal this keyword leads to the activation of the usual ligatures and contextual forms needed for correct rendering. the ligatures and forms activated depend on the font, language and kind of script. this is the default value. none this keyword specifies that all ligatures and contextual forms are disabled, even common ones. <common-lig-values> these values control the most common ligatures, like for fi, ffi, th or similar. they correspond to the opentype values liga and clig. two values are possible: common-ligatures activating these ligatures. note that the keywo...
<image> - CSS: Cascading Style Sheets
Web › CSS › image
ith the element() function, if "realid" is an existing id on the page */ image(ltr 'arrow.png#xywh=0,0,16,16', red) /* a section 16x16 section of <url>, starting from the top, left of the original image as long as arrow.png is a supported image, otherwise a solid red swatch. if language is rtl, the image will be horizontally flipped. */ cross-fade(20% url(twenty.png), url(eighty.png)) /* cross faded images, with twenty being 20% opaque and eighty being 80% opaque. */ image-set('test.jpg' 1x, 'test-2x.jpg' 2x) /* a selection of images with varying resolutions */ invalid images nourl.jpg ...
image() - CSS: Cascading Style Sheets
se as a fallback if no image-src is found, supported, or declared. bi-directional awareness the first, optional parameter of the image() notation is the directionality of the image. if included, and the image is used on an element with opposite directionality, the image will be flipped horizontally in horizontal writing modes. if the directionality is omitted, the image won't be flipped if the language direction is changed. image fragments one key difference between url() and image() is the ability to add a media fragment identifier — a starting point along the x and y axis, along with a width and height — onto the image source to display only a section of the source image. the section of the image defined in the parameter becomes a standalone image. the syntax looks like so: background-...
initial-letter-align - CSS: Cascading Style Sheets
a paragraph. /* keyword values */ initial-letter-align: auto; initial-letter-align: alphabetic; initial-letter-align: hanging; initial-letter-align: ideographic; /* global values */ initial-letter-align: inherit; initial-letter-align: initial; initial-letter-align: unset; syntax one of the keyword values listed below. values auto the user agent selects the value which corresponds to the language of the text. western languages would default to alphabetic, cjk languages to ideographic, and some indic languages to hanging. alphabetic as described above, the cap height of the initial letter aligns with the cap height of the first line of text. the baseline of the initial letter aligns with the baseline of the nth text baseline. hanging the hanging baseline of the initial letter aligns wi...
list-style-type - CSS: Cascading Style Sheets
r-armenian * example disclosure-open symbol indicating that a disclosure widget such as <details> is opened. disclosure-closed symbol indicating that a disclosure widget, like <details> is closed. non-standard extensions a few more predefined types are provided by mozilla (firefox), blink (chrome and opera) and webkit (safari) to support list types in other languages. see the compatibility table to check which browsers supports which extension. -moz-ethiopic-halehame example -moz-ethiopic-halehame-am example ethiopic-halehame-ti-er -moz-ethiopic-halehame-ti-er example ethiopic-halehame-ti-et -moz-ethiopic-halehame-ti-et example hangul -moz-hangul example example example hangul-consonant -moz-h...
text-orientation - CSS: Cascading Style Sheets
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. ...
Event reference
invalid event html5 a submittable element has been checked and doesn't satisfy its constraints. keydown keyboardevent dom l3 a key is pressed down. keypress keyboardevent dom l3 a key is pressed down, and that key normally produces a character value (use input event instead). keyup keyboardevent dom l3 a key is released. languagechange event html 5.1the definition of 'navigatorlanguage.languages' in that specification. the user's preferred languages have changed. levelchange event battery status the level attribute has been updated. load uievent dom l3 a resource and its dependent resources have finished loading. load progressevent progress and xmlhttprequest ...
Overview of events and handlers - Developer guides
for reacting to incidents occurring when a browser accesses a web page, including events from preparing a web page for display, from interacting with the content of the web page, relating to the device on which the browser is running, and from many other causes such as media stream playback or animation timing. events and event handling become central to web programming with the addition of the language to browsers, accompanying a switch in the rendering architecture of browsers from fetch and load page rendering to event driven, reflow based, page rendering. initially, browsers wait, until they receive all of the resources associated with a page, to parse, process, draw, and present the page to the user. the displayed page remains unchanged until the browser requests a new page. with the change...
Content categories - Developer guides
elements that belong to this category include: <audio>, <canvas>, <embed>, <iframe>, <img>, <math>, <object>, <picture>, <svg>, <video>. interactive content interactive content includes elements that are specifically designed for user interaction. elements that belong to this category include: <a>, <button>, <details>, <embed>, <iframe>, <keygen>, <label>, <sele...
HTML5 - Developer guides
Web › Guide › HTML › HTML5
this set is sometimes called html5 & friends and often shortened to just html5. designed to be usable by all open web developers, this reference page links to numerous resources about html5 technologies, classified into several groups based on their function. semantics: allowing you to describe more precisely what your content is. ...
Common MIME types - HTTP
penxml) application/vnd.openxmlformats-officedocument.wordprocessingml.document .eot ms embedded opentype fonts application/vnd.ms-fontobject .epub electronic publication (epub) application/epub+zip .gz gzip compressed archive application/gzip .gif graphics interchange format (gif) image/gif .htm .html hypertext markup language (html) text/html .ico icon format image/vnd.microsoft.icon .ics icalendar format text/calendar .jar java archive (jar) application/java-archive .jpeg .jpg jpeg images image/jpeg .js javascript text/javascript, per the following specifications: https://html.spec.whatwg.org/multipage/#scriptinglanguage...
MIME types (IANA media types) - HTTP
heckbox" name="mycheckbox"> check</label> <label>upload file: <input type="file" name="myfile" value="test.txt"></label> <button>send the file</button> </form> will send this message: post / http/1.1 host: localhost:8000 user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate connection: keep-alive upgrade-insecure-requests: 1 content-type: multipart/form-data; boundary=---------------------------8721656041911415653955004498 content-length: 465 -----------------------------8721656041911415653955004498 content-disposition: form-data; name="mytextfield" test -----------------------------8721656041911415653955004498 conten...
Basics of HTTP - HTTP
ing. this article explains both concepts. connection management in http/2 http/2 completely revisited how connections are created and maintained. this article explains how http frames allow multiplexing and solve the 'head-of-line' blocking problem of former http versions. content negotiation http introduces a set of headers, starting with accept as a way for a browser to announce the format, language, or encoding it prefers. this article explains how this advertisement happens, how the server is expected to react, and how it chooses the most adequate response. ...
Access-Control-Expose-Headers - HTTP
the access-control-expose-headers response header indicates which headers can be exposed as part of the response by listing their names. by default, only the 7 cors-safelisted response headers are exposed: cache-control content-language content-length content-type expires last-modified pragma if you want clients to be able to access other headers, you have to list them using the access-control-expose-headers header. header type response header forbidden header name no syntax access-control-expose-headers: <header-name>, <header-name>, ... access-control-expose-headers: * directives <header-name> a list of exposed headers consisting of zero or more header names other than the cors-safelisted request headers that the resource might use and can be e...
Content-Location - HTTP
the different filetypes with any url patterns it wishes, such as a query string parameter: /documents/foo?format=json, /documents/foo?format=xml, and so on. then the client could remember that the json version is available at that particular url, skipping content negotation the next time it requests that document. the server could also consider other content negotiation headers, such as accept-language. pointing to a new document (http 201 created) say you're creating a new blog post through a site's api: put /new/post host: example.com content-type: text/markdown # my first blog post! i made this through `example.com`'s api. i hope it worked. the site returns a generic success message confirming the post was published. the server specifies where the new post is with content-location: h...
HTTP Messages - HTTP
Web › HTTP › Messages
and a value whose structure depends upon the header. the whole header, including the value, consist of one single line, which can be quite long. there are numerous request headers available. they can be divided in several groups: general headers, like via, apply to the message as a whole. request headers, like user-agent, accept-type, modify the request by specifying it further (like accept-language), by giving context (like referer), or by conditionally restricting it (like if-none). entity headers, like content-length which apply to the body of the request. obviously, there is no such header transmitted if there is no body in the request. body the final part of the request is its body. not all requests have one: requests fetching resources, like get, head, delete, or options, usually...
OPTIONS - HTTP
Web › HTTP › Methods › OPTIONS
preflight request tells the server that when the actual request is sent, it will have a post request method. the access-control-request-headers header tells the server that when the actual request is sent, it will have the x-pingother and content-type headers. options /resources/post-here/ http/1.1 host: bar.example accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip,deflate connection: keep-alive origin: https://foo.example access-control-request-method: post access-control-request-headers: x-pingother, content-type the server now can respond if it will accept a request under these circumstances. in this example, the server response says that: access-control-allow-origin the https://foo.example origin is permitted t...
An overview of HTTP - HTTP
Web › HTTP › Overview
swer. the client may open a new connection, reuse an existing connection, or open several tcp connections to the servers. send an http message: http messages (before http/2) are human-readable. with http/2, these simple messages are encapsulated in frames, making them impossible to read directly, but the principle remains the same. for example: get / http/1.1 host: developer.mozilla.org accept-language: fr read the response sent by the server, such as: http/1.1 200 ok date: sat, 09 oct 2010 14:28:02 gmt server: apache last-modified: tue, 01 dec 2009 20:18:22 gmt etag: "51142bc1-7449-479b075b2891b" accept-ranges: bytes content-length: 29769 content-type: text/html <!doctype html... (here comes the 29769 bytes of the requested web page) close or reuse the connection for further requests.
406 Not Acceptable - HTTP
Web › HTTP › Status › 406
rtext transfer protocol (http) 406 not acceptable client error response code indicates that the server cannot produce a response matching the list of acceptable values defined in the request's proactive content negotiation headers, and that the server is unwilling to supply a default representation. proactive content negotiation headers include: accept accept-charset accept-encoding accept-language in practice, this error is very rarely used. instead of responding using this error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user. it is assumed that even if the user won't be completely happy, they will prefer this to an error code. if a server returns such an error status, the body of the message sh...
CSS Houdini
ks to the main reference pages covering the apis that fall under the houdini umbrella, along with links to guides to help you if you need guidance in learning how to use them. start by reading houdini, an introduction — this provides a brief history of houdini and an overview of its many features. css parser api an api exposing the css parser more directly, for parsing arbitrary css-like languages into a mildly typed representation. no guide or reference has currently been written for this api. css properties and values api defines an api for registering new css properties. properties registered using this api are provided with a parse syntax that defines a type, inheritance behaviour, and an initial value. css properties and values api reference css properties and values api gu...
Expressions and operators - JavaScript
note: (=>) is not an operator, but the notation for arrow functions. arithmetic operators an arithmetic operator takes numerical values (either literals or variables) as their operands and returns a single numerical value. the standard arithmetic operators are addition (+), subtraction (-), multiplication (*), and division (/). these operators work as they do in most other programming languages when used with floating point numbers (in particular, note that division by zero produces infinity). for example: 1 / 2; // 0.5 1 / 2 == 1.0 / 2.0; // this is true in addition to the standard arithmetic operations (+, -, *, /), javascript provides the arithmetic operators listed in the following table: arithmetic operators operator description example remainder (...
Iterators and generators - JavaScript
« previousnext » processing each of the items in a collection is a very common operation. javascript provides a number of ways of iterating over a collection, from simple for loops to map() and filter(). iterators and generators bring the concept of iteration directly into the core language and provide a mechanism for customizing the behavior of for...of loops. for details, see also: iteration_protocols for...of function* and generator yield and yield* iterators in javascript an iterator is an object which defines a sequence and potentially a return value upon its termination. specifically, an iterator is any object which implements the iterator protocol by having a next() method that returns an object with two properties: value the next value in the iteration se...
Meta programming - JavaScript
property lookup, assignment, enumeration, function invocation, etc). with the help of these two objects you are able to program at the meta level of javascript. proxies introduced in ecmascript 6, proxy objects allow you to intercept certain operations and to implement custom behaviors. ...
Numbers and dates - JavaScript
object of your own. you always use the built-in math object. date object javascript does not have a date data type. however, you can use the date object and its methods to work with dates and times in your applications. the date object has a large number of methods for setting, getting, and manipulating dates. it does not have any properties. javascript handles dates similarly to java. the two languages have many of the same date methods, and both languages store dates as the number of milliseconds since january 1, 1970, 00:00:00, with a unix timestamp being the number of seconds since january 1, 1970, 00:00:00. the date object range is -100,000,000 days to 100,000,000 days relative to 01 january, 1970 utc. to create a date object: var dateobjectname = new date([parameters]); where dateobj...
Character classes - JavaScript
the "basic multilingual plane" of unicode contains most of the characters used around the world and we can use character classes and ranges to match words written with those characters. var nonenglishtext = "Приключения Алисы в Стране чудес"; var regexpbmpword = /([\u0000-\u0019\u0021-\uffff])+/gu; // bmp goes through u+0000 to u+ffff but spa...
Text formatting - JavaScript
e of the syntactic sugar making substitutions like this more readable: const five = 5; const ten = 10; console.log(`fifteen is ${five + ten} and not ${2 * five + ten}.`); // "fifteen is 15 and not 20." for more information, read about template literals in the javascript reference. internationalization the intl object is the namespace for the ecmascript internationalization api, which provides language sensitive string comparison, number formatting, and date and time formatting. the constructors for collator, numberformat, and datetimeformat objects are properties of the intl object. date and time formatting the datetimeformat object is useful for formatting date and time. the following formats a date for english as used in the united states. (the result is different in another time zone.) c...
Working with objects - JavaScript
a name (or key) and a value. a property's value can be a function, in which case the property is known as a method. in addition to objects that are predefined in the browser, you can define your own objects. this chapter describes how to use objects, properties, functions, and methods, and how to create your own objects. objects overview objects in javascript, just as in many other programming languages, can be compared to objects in real life. the concept of objects in javascript can be understood with real life, tangible objects. in javascript, an object is a standalone entity, with properties and type. compare it with a cup, for example. a cup is an object, with properties. a cup has a color, a design, weight, a material it is made of, etc. the same way, javascript objects can have properti...
JavaScript Guide - JavaScript
the javascript guide shows you how to use javascript and gives an overview of the language. if you need exhaustive information about a language feature, have a look at the javascript reference. chapters this guide is divided into several chapters: introduction about this guide about javascript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures arguments & paramete...
Private class fields - JavaScript
{ } let error = null try { subclass.basepublicstaticmethod() } catch(e) { error = e} console.assert(error instanceof typeerror) private instance fields private instance fields are declared with # names (pronounced "hash names"), which are identifiers prefixed with #. the # is a part of the name itself. it is used for declaration and accessing as well. the encapsulation is enforced by the language. it is a syntax error to refer to # names from out of scope. class classwithprivatefield { #privatefield constructor() { this.#privatefield = 42 this.#randomfield = 666 // syntax error } } const instance = new classwithprivatefield() instance.#privatefield === 42 // syntax error private methods private static methods like their public equivalent, private static methods are ca...
RangeError: radix must be an integer - JavaScript
, specifying the base of the number system to be used for representing numeric values. for example, the decimal (base 10) number 169 is represented in hexadecimal (base 16) as a9. why is this parameter's value limited to 36? a radix that is larger than 10 uses alphabetical characters as digits; therefore, the radix can't be larger than 36, since the latin alphabet (used by english and many other languages) only has 26 characters. the most common radixes: 2 for binary numbers, 8 for octal numbers, 10 for decimal numbers, 16 for hexadecimal numbers. examples invalid cases (42).tostring(0); (42).tostring(1); (42).tostring(37); (42).tostring(150); // you cannot use a string like this for formatting: (12071989).tostring('mm-dd-yyyy'); valid cases (42).tostring(2); // "101010" (binary...
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
rmat method is deprecated and will be removed (no cross-browser support, available in firefox only). var today = new date(); var date = today.tolocaleformat('%a, %e. %b %y'); console.log(date); // in german locale // "freitag, 10. märz 2017" alternative standard syntax using the ecmascript intl api the ecma-402 (ecmascript intl api) standard specifies standard objects and methods that enable language sensitive date and time formatting (available in chrome 24+, firefox 29+, ie11+, safari10+). you can now either use the date.prototype.tolocaledatestring method if you just want to format one date. var today = new date(); var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; var date = today.tolocaledatestring('de-de', options); console.log(date); /...
SyntaxError: missing name after . operator - JavaScript
// syntaxerror: missing name after . operator obj.foo."bar"+i; // syntaxerror: missing name after . operator to fix this code, you need to access the object like this: obj.foo.bar; // "baz" // or alternatively obj["foo"]["bar"]; // "baz" // computed properties require square brackets obj.foo["bar" + i]; // "baz2" property access vs. concatenation if you are coming from another programming language (like php), it is also easy to mix up the dot operator (.) and the concatenation operator (+). console.log("hello" . "world"); // syntaxerror: missing name after . operator instead you need to use a plus sign for concatenation: console.log("hello" + "world"); ...
SyntaxError: missing ; before statement - JavaScript
with var you cannot declare properties of an object or array with a var declaration. ...
SyntaxError: "x" is a reserved identifier - JavaScript
otatoes", "rice", "fries"]; // syntaxerror: package is a reserved identifier you'll need to rename these variables. var colorenum = { red: 0, green: 1, blue: 2 }; var list = ["potatoes", "rice", "fries"]; update older browsers if you are using an older browser that does not yet implement let or class, for example, you should update to a more recent browser version that does support these new language features. "use strict"; class docarchiver {} // syntaxerror: class is a reserved identifier // (throws in older browsers only, e.g. firefox 44 and older) ...
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
typeerror: right-hand side of 'in' should be an object, got 'x' (firefox) typeerror: cannot use 'in' operator to search for 'x' in 'y' (firefox, chrome) error type typeerror what went wrong? the in operator can only be used to check if a property is in an object. you can't search in strings, or in numbers, or other primitive types. examples searching in strings unlike in other programming languages (e.g. python), you can't search in strings using the in operator. "hello" in "hello world"; // typeerror: cannot use 'in' operator to search for 'hello' in 'hello world' instead you will need to use string.prototype.indexof(), for example. "hello world".indexof("hello") !== -1; // true the operand can't be null or undefined make sure the object you are inspecting isn't actually null or unde...
Array.prototype.sort() - JavaScript
ringarray: 80,9,700 sorted without a compare function: 700,80,9 sorted with comparenumbers: 9,80,700 mixednumericarray: 80,9,700,40,1,5,200 sorted without a compare function: 1,200,40,5,700,80,9 sorted with comparenumbers: 1,5,9,40,80,200,700 sorting non-ascii characters for sorting strings with non-ascii characters, i.e. strings with accented characters (e, é, è, a, ä, etc.), strings from languages other than english, use string.localecompare. this function can compare those characters so they appear in the right order. var items = ['réservé', 'premier', 'communiqué', 'café', 'adieu', 'éclair']; items.sort(function (a, b) { return a.localecompare(b); }); // items is ['adieu', 'café', 'communiqué', 'éclair', 'premier', 'réservé'] sorting with map the comparefunction can be ...
Array.prototype.toLocaleString() - JavaScript
the tolocalestring() method returns a string representing the elements of the array. the elements are converted to strings using their tolocalestring methods and these strings are separated by a locale-specific string (such as a comma “,”). syntax arr.tolocalestring([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. options optional an object with configuration properties, for numbers see number.prototype.tolocalestring(), and for dates see date.prototype.tolocalestring(). return value a string representing the elements of the array. polyfill // https://tc39.github.io/ecma402/#sup-array.prototype.tolocalestring if (!array.proto...
ArrayBuffer - JavaScript
the arraybuffer() constructor creates a new arraybuffer of the given length in bytes. you can also get an array buffer from existing data, for example from a base64 string or from a local file. ...
BigInt - JavaScript
boolean(12n) // ↪ true !12n // ↪ false !0n // ↪ true constructor bigint() creates a new bigint value. static methods bigint.asintn() wraps a bigint value to a signed integer between -2width-1 and 2width-1 - 1. bigint.asuintn() wraps a bigint value to an unsigned integer between 0 and 2width - 1. instance methods bigint.prototype.tolocalestring() returns a string with a language-sensitive representation of this number. overrides the object.prototype.tolocalestring() method. bigint.prototype.tostring() returns a string representing the specified object in the specified radix (base). overrides the object.prototype.tostring() method. bigint.prototype.valueof() returns the primitive value of the specified object. overrides the object.prototype.valueof() method. usage r...
Function.name - JavaScript
however, es2015 specifies the static keyword such that static methods will be set as ownproperty of the class constructor function (ecmascript2015, 14.5.14.21.b + 12.2.6.9). therefore we can't obtain the class name for virtually any class with a static method property name(): class foo { constructor() {} static name() {} } with a static name() method foo.name no longer ho...
Intl.Collator.prototype.resolvedOptions() - JavaScript
e to the interactive examples project, please clone 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 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. usage sensitivity ignorepunctuation the values provided for these properties in the options argument or filled in as defaults. collation the value requested...
Intl.DateTimeFormat.prototype.format() - JavaScript
atetimeformat = new intl.datetimeformat('pt-br', options); var formatted = a.map(datetimeformat.format); console.log(formatted.join('; ')); // → "setembro de 2012; dezembro de 2012; abril de 2012" avoid comparing formatted date values to static values most of the time, the formatting returned by format() is consistent. however, this might change in the future and isn't guaranteed for all the languages — output variations are by design and allowed by the specification. most notably, the ie and edge browsers insert bidirectional control characters around dates, so the output text will flow properly when concatenated with other text. for this reason you cannot expect to be able to compare the results of format() to a static value: let d = new date("2019-01-01t00:00:00.000000z"); let formatte...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
es project, please clone https://github.com/mdn/interactive-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 val...
Intl​.ListFormat.prototype​.format() - JavaScript
the format() method returns a string with a language-specific representation of the list. syntax listformat.format([list]); parameters list an iterable object, such as an array return value a language-specific formatted string representing the elements of the list description the format() method returns a string that has been formatted based on parameters provided in the intl.listformat object. the locales and options parameters customize the behavior of format() and let applications specify the language conventions that should be used to format the list. examples using format the following example shows how to create a list formatter using the english language. const list = ['motorcycle', 'bus', 'car']; console.log(new intl.listformat('en-gb', { style: 'long', type: 'conjunct...
Intl​.List​Format​.prototype​.resolvedOptions() - JavaScript
locale and style formatting options computed during 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 "na...
Intl.Locale.prototype.toString() - 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 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 identifier string for that particular locale. the tostring method allows locale instances to be provided as an argument to existing intl constructors, seri...
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
tive examples project, please clone https://github.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 fille...
Intl.PluralRules() constructor - JavaScript
for the general form and interpretation of the locales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. type the type to use. ...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
reflecting the locale and plural formatting options 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 ...
Intl.RelativeTimeFormat.prototype.format() - JavaScript
"quarter", "month", "week", "day", "hour", "minute", "second". plural forms are also permitted. description the function returned by the format getter formats a value and a unit into a string according to the locale and formatting options of this intl.relativetimeformat object. examples basic format usage the following example shows how to create a relative time formatter using the english language. // create a relative time formatter in your locale // with default values explicitly passed in. const rtf = new intl.relativetimeformat("en", { localematcher: "best fit", // other values: "lookup" numeric: "always", // other values: "auto" style: "long", // other values: "short" or "narrow" }); // format relative time using negative value (-1). rtf.format(-1, "day"); // > "1 day ag...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
s project, please clone https://github.com/mdn/interactive-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., ...
Math.round() - JavaScript
eger. description if the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. if it is less than 0.5, the argument is rounded to the integer with the lower absolute value. if the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. note that this differs from many languages' round() functions, which often round this case to the next integer away from zero, instead giving a different result in the case of negative numbers with a fractional part of exactly 0.5. because round() is a static method of math, you always use it as math.round(), rather than as a method of a math object you created (math has no constructor). examples using round math.round( 20.49); // 2...
Number - JavaScript
er.parseint(string, [radix]) this is the same as the global parseint() function. instance methods number.prototype.toexponential(fractiondigits) returns a string representing the number in exponential notation. number.prototype.tofixed(digits) returns a string representing the number in fixed-point notation. number.prototype.tolocalestring([locales [, options]]) returns a string with a language sensitive representation of this number. overrides the object.prototype.tolocalestring() method. number.prototype.toprecision(precision) returns a string representing the number to a specified precision in fixed-point or exponential notation. number.prototype.tostring([radix]) returns a string representing the specified object in the specified radix ("base"). overrides the object.prototype.to...
Object.prototype.__proto__ - JavaScript
eb browsers. for better support, use object.getprototypeof() instead. the __proto__ property of object.prototype is an accessor property (a getter function and a setter function) that exposes the internal [[prototype]] (either an object or null) of the object through which it is accessed. the use of __proto__ is controversial and discouraged. it was never originally included in the ecmascript language spec, but modern browsers implemented it anyway. only recently was the __proto__ property standardized by the ecmascript 2015 specification for compatibility with web browsers, so it will be supported into the future. it is deprecated in favor of object.getprototypeof/reflect.getprototypeof and object.setprototypeof/reflect.setprototypeof (though still, setting the [[prototype]] of an object is a...
Object.setPrototypeOf() - JavaScript
optimize property accesses, currently a very slow operation in every browser and javascript engine. in addition, the effects of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in the object.setprototypeof(...) statement, but may extend to any code that has access to any object whose [[prototype]] has been altered. because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). until engine developers address this issue, if you are concerned about performance, you should avoid setting the [[prototype]] of an object. instead, create a new object with the desired [[prototype]] using object.create(). syntax object.setprototypeof(obj, prototype) parameters obj the object w...
Object - JavaScript
ways // on the same prototype chain, i want to modify object.prototype: object.prototype.valueof = function() { if (this.hasownproperty('-prop-value')) { return this['-prop-value']; } else { // it doesn't look like one of my objects, so let's fall back on // the default behavior by reproducing the current behavior as best we can. // the apply behaves like "super" in some other languages. // even though valueof() doesn't take arguments, some other hook may. return current.apply(this, arguments); } } since javascript doesn't exactly have sub-class objects, prototype is a useful workaround to make a “base class” object of certain functions that act as objects. for example: var person = function(name) { this.name = name; this.cantalk = true; }; person.prototyp...
Promise - JavaScript
hod are called. if the promise has already been fulfilled or rejected when a corresponding handler is attached, the handler will be called, so there is no race condition between an asynchronous operation completing and its handlers being attached. as the promise.prototype.then() and promise.prototype.catch() methods return promises, they can be chained. not to be confused with: several other languages have mechanisms for lazy evaluation and deferring a computation, which they also call "promises", e.g. scheme. promises in javascript represent processes that are already happening, which can be chained with callback functions. if you are looking to lazily evaluate an expression, consider the arrow function with no arguments: f = () => expression to create the lazily-evaluated expression, and f(...
String.prototype.padEnd() - JavaScript
ull request. syntax str.padend(targetlength [, padstring]) parameters targetlength the length of the resulting string once the current str has been padded. if the value is lower than str.length, the current string will be returned as-is. padstring optional the string to pad the current str with. if padstring is too long to stay within targetlength, it will be truncated: for left-to-right languages the left-most part and for right-to-left languages the right-most will be applied. the default value for this parameter is " " (u+0020). return value a string of the specified targetlength with the padstring applied at the end of the current str. examples using padend 'abc'.padend(10); // "abc " 'abc'.padend(10, "foo"); // "abcfoofoof" 'abc'.padend(6, "123456"); // "abc123...
String.prototype.toLocaleLowerCase() - JavaScript
le to be used to convert to lower case according to any locale-specific case mappings. if multiple locales are given in an array, the best available locale is used. the default locale is the host environment’s current locale. return value a new string representing the calling string converted to lower case, according to any locale-specific case mappings. exceptions a rangeerror ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag. a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string. description the tolocalelowercase() method returns the value of the string converted to lower case according to any locale-specific case mappings. tolocalelowercase() does not affect the value of the string itself. in m...
String.prototype.toLocaleUpperCase() - JavaScript
le to be used to convert to upper case according to any locale-specific case mappings. if multiple locales are given in an array, the best available locale is used. the default locale is the host environment’s current locale. return value a new string representing the calling string converted to upper case, according to any locale-specific case mappings. exceptions a rangeerror ("invalid language tag: xx_yy") is thrown if a locale argument isn't a valid language tag. a typeerror ("invalid element in locales argument") is thrown if an array element isn't of type string. description the tolocaleuppercase() method returns the value of the string converted to upper case according to any locale-specific case mappings. tolocaleuppercase() does not affect the value of the string itself. in m...
String - JavaScript
ecified location through the specified number of characters. string.prototype.substring(indexstart [, indexend]) returns a new string containing characters of the calling string from (or between) the specified index (or indeces). string.prototype.tolocalelowercase( [locale, ...locales]) the characters within a string are converted to lowercase while respecting the current locale. for most languages, this will return the same as tolowercase(). string.prototype.tolocaleuppercase( [locale, ...locales]) the characters within a string are converted to uppercase while respecting the current locale. for most languages, this will return the same as touppercase(). string.prototype.tolowercase() returns the calling string value converted to lowercase. string.prototype.tostring() return...
SyntaxError - JavaScript
constructor syntaxerror() creates a new syntaxerror object. instance properties syntaxerror.prototype.message error message. although ecma-262 specifies that syntaxerror should provide its own message property, in spidermonkey, it inherits error.prototype.message. syntaxerror.prototype.name error name. inherited from error. ...
TypedArray.prototype.toLocaleString() - JavaScript
gorithm as array.prototype.tolocalestring() and, as the typed array elements are numbers, the same algorithm as number.prototype.tolocalestring() applies for each element. typedarray is one of the typed array types here. syntax typedarray.tolocalestring([locales [, options]]); parameters the locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. in implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. see the intl.numberformat() constructor for details on these parameters and how to use them. return value a string representing the elements of the typed array. examples using tolocalestrin...
WebAssembly - JavaScript
the webassembly javascript object acts as the namespace for all webassembly-related functionality. unlike most other global objects, webassembly is not a constructor (it is not a function object). you can compare it to math, which is also a namespace object for mathematical constants and functions, or to intl which is the namespace object for internationalization constructors and other language-sensitive functions. description the primary uses for the webassembly object are: loading webassembly code, using the webassembly.instantiate() function. creating new memory and table instances via the webassembly.memory()/webassembly.table() constructors. providing facilities to handle errors that occur in webassembly via the webassembly.compileerror()/webassembly.linkerror()/webassembly.runtimeer...
escape() - JavaScript
… … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. ...
globalThis - JavaScript
iframe and cross-window security considerations, it references a proxy around the actual global object (which you can't directly access). this distinction is rarely relevant in common usage, but important to be aware of. naming several other popular name choices such as self and global were removed from consideration because of their potential to break compatibility with existing code. see the language proposal's "naming" document for more details. examples search for the global across environments prior to globalthis, the only reliable cross-platform way to get the global object for an environment was function('return this')(). however, this causes csp violations in some settings, so es6-shim uses a check like this, for example: var getglobal = function () { if (typeof self !== 'undefine...
undefined - JavaScript
// these statements execute } one reason to use typeof is that it does not throw an error if the variable has not been declared. // x has not been declared before if (typeof x === 'undefined') { // evaluates to true without errors // these statements execute } if (x === undefined) { // throws a referenceerror } however, there is another alternative. javascript is a statically scoped language, so knowing if a variable is declared can be read by seeing whether it is declared in an enclosing context. the global scope is bound to the global object, so checking the existence of a variable in the global context can be done by checking the existence of a property on the global object, using the in operator, for instance: if ('x' in window) { // these statements execute only if x is def...
unescape() - JavaScript
… … programmers should not use or assume the existence of these features and behaviours when writing new ecmascript code. ...
Standard built-in objects - JavaScript
javascript object notation (json). arraybuffer sharedarraybuffer atomics dataview json control abstraction objects control abstractions can help to structure code, especially async code (without using deeply nested callbacks, for example). promise generator generatorfunction asyncfunction reflection reflect proxy internationalization additions to the ecmascript core for language-sensitive functionalities. intl intl.collator intl.datetimeformat intl.listformat intl.numberformat intl.pluralrules intl.relativetimeformat intl.locale webassembly webassembly webassembly.module webassembly.instance webassembly.memory webassembly.table webassembly.compileerror webassembly.linkerror webassembly.runtimeerror other arguments ...
Lexical grammar - JavaScript
nsertion 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 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 whit...
delete operator - JavaScript
pression evaluating to an object. property the property to delete. return value true for all cases except when the property is an own non-configurable property, in which case, false is returned in non-strict mode. exceptions throws typeerror in strict mode if the property is an own non-configurable property. description unlike what common belief suggests (perhaps due to other programming languages like delete in c++), the delete operator has nothing to do with directly freeing memory. memory management is done indirectly via breaking references. see the memory management page for more details. the delete operator removes a given property from an object. on successful deletion, it will return true, else false will be returned. however, it is important to consider the following scenarios:...
this - JavaScript
it also has some differences between strict mode and non-strict mode. in most cases, the value of this is determined by how a function is called (runtime binding). it can't be set by assignment during execution, and it may be different each time the function is called. es5 introduced the bind() method to set the value of a function's this regardless of how it's called, and es2015 introduced arrow functions which don't provide their own this binding (it retains the this value of the enclosing lexical context). the source for this interactive example is stored in a github repository. ...
block - JavaScript
a block statement (or compound statement in other languages) is used to group zero or more statements. the block is delimited by a pair of braces ("curly brackets") and may optionally be labelled: 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 block statement { statementlist } labelled block statement labelidentifier: { statementlist } statementlist statements grouped within the block statement. labelidentifier an optional label for visual identification or as a target for break. description the block statement is often called compound statement in other languages. it allows you to use multipl...
for await...of - JavaScript
e and await yielded promises explicitly inside the loop. (async function() { try { for (let numorpromise of generatorwithrejectedpromises()) { console.log(await numorpromise); } } catch (e) { console.log('catched', e) } })() // 0 // 1 // 2 // catched 3 // called finally specifications specification ecmascript (ecma-262)the definition of 'ecmascript language: the for-in, for-of, and for-await-of statements' in that specification. ...
Statements and declarations - JavaScript
ctions exported from an external module, another script. import.meta an object exposing context-specific metadata to a javascript module. label provides a statement with an identifier that you can refer to using a break or continue statement. with extends the scope chain for a statement. specifications specification ecmascript (ecma-262)the definition of 'ecmascript language: statements and declarations' in that specification. ...
Template literals (Template strings) - JavaScript
the ecmascript proposal template literal revision (stage 4, to be integrated in the ecmascript 2018 standard) removes the syntax restriction of ecmascript escape sequences from tagged templates. however, illegal escape sequences must still be represented in the “cooked” representation. they will show up as undefined ele...
JavaScript reference - JavaScript
read more about this reference. built-ins javascript standard built-in objects, along with their methods and properties. ...
description - Web app manifests
type string mandatory no the description member is a string in which developers can explain what the application does. description is directionality-capable, which means it can be displayed left to right or right to left based on the values of the dir and lang manifest members. examples simple description in left-to-right language: "description": "awesome application that will help you achieve your dreams." description in arabic, which will be displayed right-to-left: "dir": "rtl", "lang": "ar", "description": ".تطبيق رائع سيساعدك على تحقيق أحلامك" specification specification status comment feedback web app manifestthe definition of 'description' in that specification. working draft...
dir - Web app manifests
Web › Manifest › dir
type string mandatory no the base direction in which to display direction-capable members of the manifest. 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 manifest...
lang - Web app manifests
Web › Manifest › lang
examples "lang": "en-us" specification specification status comment feedback web app manifestthe definition of 'lang' in that specification. ...
name - Web app manifests
Web › Manifest › name
tory yes the name member is a string that represents the name of the web application as it is usually displayed to the user (e.g., amongst a list of other applications, or as a label for an icon). name is directionality-capable, which means it can be displayed left-to-right or right-to-left based on the values of the dir and lang manifest members. examples simple name in left-to-right language: "name": "awesome application" right-to-left name in arabic: "dir": "rtl", "lang": "ar", "name": "!أنا من التطبيق" specification specification status comment feedback web app manifestthe definition of 'name' in that specification. working draft initial definition. web app manifest working group drafts ...
short_name - Web app manifests
name member is a string that represents the name of the web application displayed to the user if there is not enough space to display name (e.g., as a label for an icon on the phone home screen). short_name is directionality-capable, which means it can be displayed left-to-right or right-to-left based on the value of the dir and lang manifest members. examples simple short_name in left-to-right language: "name": "awesome application", "short_name": "awesome app" short_name in arabic, which will be displayed right-to-left: "dir": "rtl", "lang": "ar", "name": "تطبيق رائع", "short_name": "رائع" specification specification status comment feedback web app manifestthe definition of 'short_name' in that specification. working draft ...
<ms> - MathML
Web › MathML › Element › ms
by default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display. note that quotation marks should not be specified unless they are part of the string literal. the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements. attributes class, id, style provided for use with stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). ...
<semantics> - MathML
recommendation current specification mathml 2.0the definition of 'combining presentation and content markup ' in that specification. recommendation initial specification ...
MathML
here you'll find links to documentation, examples, and tools to help you work with this powerful technology. for a quick overview, see the slides for the innovation fairs at mozilla summit 2013. mathml reference mathml element reference details about each mathml element and compatibility information for desktop and mobile browsers. mathml attribute reference information about mathml attributes that modify the appearance or behavior of elements. mathml examples mathml samples and examples to help you understand how it works. ...
Web audio codec guide - Web media technologies
see the number of audio channels written in the form x.y (such as 2.1 or 5.1), the number after the decimal point, y, is the number of lfe channels. for example, mp3 supports one lfe channel, while aac supports up to 16. in addition to providing audio for specific speakers in a sound system, some codecs may allow audio channels to be used to provide alternative audio, such as vocals in different languages or descriptive audio for visually impaired people. audio frequency bandwidth the audio frequency bandwidth of a codec indicates the range of audio frequencies that can be represented using the codec. some codecs operate specifically by eliminating audio that falls outside a given frequency range. there is a correlation between the sample rate and the maxium sound frequency that can be represen...
Guide to streaming audio and video - Web media technologies
errors from occurring due to this assumption being incorrect. the desktop version of android, however, does not support hls. hls uses playlists to allow the user to not only select the media to stream, but also to choose among versions or forms of the same media. for example, hls lets the server stream a video with multiple audio streams which the user can choose from, in order to hear their own language. additionally, forms of the stream can be provided which are optimized for different network conditions. in this way, live streams can be made flexible and highly performant. as of mid-2017, hls has been standardized as rfc 8217. ...
Graphic design for responsive sites - Progressive web apps (PWAs)
te animations, and any other type of interactivity you want. it is very powerful when combined with other technologies, although its complexity is a barrier for non-developers. svg svg, just like html/css, can be manipulated via javascript. so adding interactivity is not difficult. you can also add links direcly into svg and can create animations using smil (synchronized multimedia intergration language). webgl/canvas you can create a canvas to draw interactive graphics on using the html <canvas> element, then use the canvas api to create shapes, lines, import image files, create text, do compositing operations, and much more. standard javascript can then be used to animate the image output, etc. you can create 2d imagery using the regular 2d canvas context, or 3d imagery using the more nascen...
baseProfile - SVG: Scalable Vector Graphics
the attribute does not specify any processing restrictions; it can be considered metadata. for example, the value of the attribute could be used by an authoring tool to warn the user when they are modifying the document beyond the scope of the specified base profile. each svg profile should define the text that is appropriate for this attribute. ...
direction - SVG: Scalable Vector Graphics
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, such as when using right-to-left languages, it may be sufficient to add the direction attribute to the outermost <svg> element, and allow that direction to inherit to all text elements: note: as a presentation attribute, direction can be used as a css property. see css direction for further information. as a presentation attribute, it can be applied to any element but it only has effect on shapes and text context elements, including: <...
glyph-orientation-vertical - SVG: Scalable Vector Graphics
he glyph. text which is not fullwidth will be set with a glyph orientation of 90 degrees. this reorientation rule applies only to the first-level non-ideographic text. all further embedding of writing modes or bidirectional processing will be based on the first-level rotation. note: text set in this "rotated" manner may contain ligatures or other glyph combining and reordering common to the language and script. (this presentation form does not disable auto-ligature formation or similar context-driven variations.) the determination of which characters should be auto-rotated may vary across user agents. the determination is based on a complex interaction between country, language, script, character properties, font, and character context. <angle> the value of the angle is restricted ...
href - SVG: Scalable Vector Graphics
Web › SVG › Attribute › href
target element to discard. see the definition of href on animation elements for details on identifying a target element. note: unlike other animation elements, the <discard> element does not support the deprecated xlink:href attribute. note that if the target element is not part of the current svg document fragment, then whether the target element will be removed or not is defined by the host language. if the href attribute is not provided, then the target element will be the immediate parent element of the <discard> element. value <url> default value none animatable no feimage for <feimage>, href defines a url referring to an image resource or to an element. if both, the xlink:href and the href attribute are specified, the latter overrides the for...
requiredExtensions - SVG: Scalable Vector Graphics
each extension is identified by an url reference. usage notes value <list-of-extensions> default value none animatable no <list-of-extensions> the value is a list of references (iri references in svg 1, url references in svg 2) which identify the required extensions, with the individual values separated by white space. determines whether all of the named extensions are supported by the user agent. ...
style - SVG: Scalable Vector Graphics
Web › SVG › Attribute › style
attribute. html,body,svg { height:100% } <svg viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <rect width="80" height="40" x="10" y="10" style="fill: skyblue; stroke: cadetblue; stroke-width: 2;"/> </svg> usage notes value <style> default value none animatable no <style> the syntax of style data depends on the style sheet language. by default, the style sheet language is css. note: in theory, the contentstyletype attribute could be used to specify styling languages other than css, like xsl(t). however, this was never implemented satisfactorily in browsers, so you should not rely on it. specifications specification status comment scalable vector graphics (svg) 2the definition of 'style' i...
<altGlyph> - SVG: Scalable Vector Graphics
Web › SVG › Element › altGlyph
yphs is located from processing the <altglyphdef> element, then those alternate glyphs are rendered instead of the character(s) that are inside of the <altglyph> element. ...
<circle> - SVG: Scalable Vector Graphics
Web › SVG › Element › circle
in user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2, cx, cy, and r are geometry properties, meaning those attributes can also be used as css properties for that element. ...
<clipPath> - SVG: Scalable Vector Graphics
Web › SVG › Element › clipPath
vents outside the smaller radius. attributes clippathunits defines the coordinate system for the contents of the <clippath> element. ...
<ellipse> - SVG: Scalable Vector Graphics
Web › SVG › Element › ellipse
user units. value type: <number> ; default value: none; animatable: yes note: starting with svg2 cx, cy, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element. ...
<foreignObject> - SVG: Scalable Vector Graphics
ue type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning those attributes can also be used as css properties for that element. ...
<g> - SVG: Scalable Vector Graphics
Web › SVG › Element › g
tation attributes --> <g fill="white" stroke="green" stroke-width="5"> <circle cx="40" cy="40" r="25" /> <circle cx="60" cy="60" r="25" /> </g> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stro...
<line> - SVG: Scalable Vector Graphics
Web › SVG › Element › line
the line ending point. value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes pathlength defines the total path length in user units. ...
<marker> - SVG: Scalable Vector Graphics
Web › SVG › Element › marker
ter|bottom|<coordinate> ; default value: 0; animatable: yes viewbox this attribute defines the bound of the svg viewport for the current svg fragment. ...
<mask> - SVG: Scalable Vector Graphics
Web › SVG › Element › mask
of the top-left corner of the masking area. value type: <coordinate> ; default value: -10%; animatable: yes width this attribute defines the width of the masking area. ...
<path> - SVG: Scalable Vector Graphics
Web › SVG › Element › path
e path. value type: <string> ; default value: ''; animatable: yes pathlength this attribute lets authors specify the total length for the path, in user units. ...
<pattern> - SVG: Scalable Vector Graphics
Web › SVG › Element › pattern
xlink:href are set, xlink:href will be ignored and only href will be used. y this attribute determines the y coordinate shift of the pattern tile. ...
<polygon> - SVG: Scalable Vector Graphics
Web › SVG › Element › polygon
w the polygon. value type: <number>+ ; default value: ""; animatable: yes pathlength this attribute lets specify the total length for the path, in user units. ...
<polyline> - SVG: Scalable Vector Graphics
Web › SVG › Element › polyline
w the polyline value type: <number>+ ; default value: ""; animatable: yes pathlength this attribute lets specify the total length for the path, in user units. ...
<rect> - SVG: Scalable Vector Graphics
Web › SVG › Element › rect
value type: <number> ; default value: none; animatable: yes note: starting with svg2, x, y, width, height, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element. ...
<script> - SVG: Scalable Vector Graphics
Web › SVG › Element › script
ll = getcolor() }) }) // ]]> </script> <circle cx="5" cy="5" r="4" /> </svg> attributes crossorigin this attribute defines cors settings as define for the html <script> element. value type: <string>; default value: ?; animatable: yes href the url to the script to load. value type: <url> ; default value: none; animatable: no type this attribute defines type of the script language to use. value type: <string>; default value: application/ecmascript; animatable: no xlink:href deprecated since svg 2 the url to the script to load. value type: <url> ; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes catego...
<style> - SVG: Scalable Vector Graphics
Web › SVG › Element › style
he corresponding element in html (see html's <style> element). html,body,svg { height:100%; margin: 0; padding: 0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <style> circle { fill: gold; stroke: maroon; stroke-width: 2px; } </style> <circle cx="5" cy="5" r="4" /> </svg> attributes type this attribute defines type of the style sheet language to use as a media type string. value type: <string>; default value: text/css; animatable: no media this attribute defines to which media the style applies. value type: <string>; default value: all; animatable: no title this attribute the title of the style sheet which can be used to switch between alternate style sheets. value type: <string>; default value: none; animatable: no global at...
<text> - SVG: Scalable Vector Graphics
Web › SVG › Element › text
ength a width that the text should be scaled to fit. ...
<textPath> - SVG: Scalable Vector Graphics
Web › SVG › Element › textPath
pe: <length>|<percentage>|<number> ; default value: 0; animatable: yes textlength the width of the space into which the text will render. ...
<tspan> - SVG: Scalable Vector Graphics
Web › SVG › Element › tspan
ttribute. value type: spacing|spacingandglyphs; default value: spacing; animatable: yes textlength a width that the text should be scaled to fit. ...
<use> - SVG: Scalable Vector Graphics
Web › SVG › Element › use
ey only have an effect when use refers to a svg or symbol element. note: starting with svg2, x, y, width, and height are geometry properties, meaning those attributes can also be used as css properties for that element. ...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
never implemented, svgsvgelement.usecurrentview not removed yet (bug 1174097) svgunknownelement not implemented (bug 1239218) lang attribute without namespace implemented (bug 721920) svgsvgelement.viewport removed never implemented xml:base attribute removed implementation status unknown reorder descendent elements of <switch> having systemlanguage attribute according to allowreorder smil attribute implementation status unknown made <tspan> and <textpath> graphics elements implementation status unknown allow x, y, width, and height on <symbol> implementation status unknown made <use> element shadow trees consistent with shadow dom spec implementation status unknown role mapping of <a> element ...
SVG animation with SMIL - SVG: Scalable Vector Graphics
smil allows you to: animate the numeric attributes of an element (x, y, ...) animate transform attributes (translation or rotation) animate color attributes follow a motion path this is done adding an svg element like <animate> inside the svg element to animate. ...
SVG Filters Tutorial - SVG: Scalable Vector Graphics
with the filter element <filter> it is possible to add these effects and later on attach them to an object. filters act like layers. when creating them, try applying and testing the effect step by step. this element has different attributes that help us create the clipping region. between the filter tags, we can define the primitives that allow us to implement the desired effect. one of these primitives is the fegaussianblur. the keyword sourcealpha identifies the input for this primitive, is in this case input 'in'. ...
SVG and CSS - SVG: Scalable Vector Graphics
below you'll create a simple demonstration that runs in your svg-enabled browser. note: elements referenced by <use> elements inherit the styles from that element. so to apply different styles to them you should use css custom properties. example make a new svg document as a plain text file, doc8.svg. ...
SVG fonts - SVG: Scalable Vector Graphics
<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> and <vkern>. each carries references to at least two characters (attributes u1 and u2) and an attribute k that determines how much the distance between those ch...
Tools for SVG - SVG: Scalable Vector Graphics
ics. usage of headless browsers such as slimerjs and phantomjs are also popular for this purpose, as the image produced is closer to what the svg will look like in the browser. raphael js url: raphaeljs.com this is a javascript library, that acts as an abstraction layer between browser implementations. notably older versions of internet explorer are supported by generating vml, a vector markup language, that is one of two ancestors of svg and exists since ie 5.5. snap.svg url: snapsvg.io a newer javascript abstraction layer from the same author of raphael js. snap.svg is designed for modern browsers and therefore supports the newest svg features like masking, clipping, patterns, full gradients, groups. it does not support the older browsers that raphael does. google docs url: www.google...
SVG: Scalable Vector Graphics
Web › SVG
as such, it's a text-based, open web standard for describing images that can be rendered cleanly at any size and are designed specifically to work well with other web standards including css, dom, javascript, and smil. svg is, essentially, to graphics what html is to text. svg images and their related behaviors are defined in xml text files, which means they can be searched, indexed, scripted, and compressed. ...
translate - XPath
ts string the string to evaluate. abc the string of characters that will be replaced. xyz the string of characters used for replacement. the first character in xyz will replace every occurrence of the first character in abc that appears in string. returns the translated string. notes xpath notes that the translate function is not a sufficient solution for case conversion in all languages. a future version of xpath may provide additional functions for case conversion. however, this is the closest we have at present to a function that can convert a string to uppercase or lowercase. example <xsl:value-of select="translate('the quick brown fox.', 'abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz')" /> output the quick brown fox. if abc is longer than xyz, then ever...
Introduction to using XPath in JavaScript - XPath
at they appear in the document. any_unordered_node_type 8 a result node-set containing any single node that matches the expression. the node is not necessarily the first node in the document that matches the expression. first_ordered_node_type 9 a result node-set containing the first node in the document that matches the expression. see also xpath xml path language from what is xslt? by g. ken holman original document information based upon original document mozilla xpath tutorial original source author: james graham. other contributors: james thompson. last updated date: 2006-3-25. ...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
let’s look at how it works. emscripten environment setup first, let's set up the required development environment. prerequisites get the emscripten sdk, using these instructions: https://emscripten.org/docs/getting_started/downloads.html compiling an example with the environment set up, let's look at how to use it to compile a c example to emscripten. there are a number of options available when compiling with emscripten, but the main two scenarios we'll cover are: compiling to wasm and creating html to run our code in, plus all the javascript "glue" code needed to run the wasm in the web environment. ...
Compiling from Rust to WebAssembly - WebAssembly
elude::*; #[wasm_bindgen] extern { pub fn alert(s: &str); } #[wasm_bindgen] pub fn greet(name: &str) { alert(&format!("hello, {}!", name)); } this is the contents of our rust project. it has three main parts; let's talk about them in turn. we give a high-level explanation here, and gloss over some details; to learn more about rust, please check the free online book the rust programming language. using wasm-bindgen to communicate between rust and javascript the first part looks like this: use wasm_bindgen::prelude::*; libraries are called "crates" in rust. get it? cargo ships crates. the third line contains a use command, which imports code from a library into your code. in this case, we're importing everything in the wasm_bindgen::prelude module. we use these features in the next ...
WebAssembly
webassembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as c/c++, c# and rust with a compilation target so that they can run on the web. it is also designed to run alongside javascript, allowing both to work together. in a nutshell webassembly has huge implications for the web platform — it provides a way to run code written in multiple languages on the web at near native speed, with client apps running on the web that previously couldn’t have done so. webassembly is designed to complement and run alongside javascript — using the webassembly javascript apis, you can load webassembly modules into a javascript app and share functional...