Search completed in 1.10 seconds.
RTCDataChannel.onclosing - Web APIs
the function receives as its sole input parameter the event itself, as an object of type event. ...
...the function receives as its sole input parameter the event itself, as an object of type event. ...
...the function receives as its sole input parameter the event itself, as an object of type event. ...
...handler which specifies a function to be called by the browser when the
closing event is received by the rtcdatachannel. this is a simple event which indicates that the data channel is being closed, that is, rtcdatachannel transitions to "
closing" state. for example, after rtcdatachannel.close() was called but the underlying data transport might not have been closed yet. syntax rtcdatachannel.on
closing = function; value a function which the browser will call to handle the
closing event. the function receives as its sole input parameter the event itself, as an object of type event. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.on
closing' in that specification. candidate recommen...
Index - Web APIs
obal scope, but available on it, are listed in the javascript reference. see also: functions available to workers. 815 dedicatedworkerglobalscope.close() api, dom, dedicatedworkerglobalscope, method, reference, web workers, close the close() method of the dedicatedworkerglobalscope interface discards any tasks queued in the dedicatedworkerglobalscope's event loop, effectively
closing this particular scope. 816 dedicatedworkerglobalscope.name api, dom, dedicatedworkerglobalscope, property, reference, worker, name the name read-only property of the dedicatedworkerglobalscope interface returns the name that the worker was (optionally) given when it was created. this is the name that the worker() constructor can pass to get a reference to the dedicatedworkerg...
... element, method, reference returns the specified attribute of the specified element, as an attr node. 1116 element.getattributenodens() api, dom, method, reference returns the attr node for the attribute with the given namespace and name. 1117 element.getboundingclientrect() api, boundary, bounding, bounds, cssom view, client, containing, dom, element, en
closing, method, minimum, rectangle, reference, smallest, clientheight, getboundingclientrect, getclientrects, offsetheight, scrollheight the element.getboundingclientrect() method returns the size of an element and its position relative to the viewport. 1118 element.getclientrects() api, cssom view, element, method, reference, clientheight, getboundingclientrect, getclientrects, off...
...o get and manage versions of the database. 2011 idbdatabase.close() api, database, idbdatabase, indexeddb, method, reference, storage the connection is not actually closed until all transactions created using this connection are complete. no new transactions can be created for this connection once this method is called. methods that create transactions throw an exception if a
closing operation is pending. 2012 idbdatabase.createobjectstore() api, database, idbdatabase, indexeddb, method, reference, storage the method takes the name of the store as well as a parameter object that lets you define important optional properties. you can use the property to uniquely identify individual objects in the store. as the property is an identifier, it should be unique...
...And 6 more matches
Getting started with HTML - Learn web development
at is html? html (hypertext markup language) is not a programming language. it is a markup language that tells web browsers how to structure the web pages you visit. 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. the en
closing tags can make content into a hyperlink to connect to another page, italicize words, and so on. for example, consider the following line of text: my cat is very grumpy if we wanted the text to stand by itself, we could specify that it is a paragraph by en
closing it in a paragraph (<p>) element: <p>my cat is very grumpy</p> note: tags in html are case-insensitive. this means they can be writ...
...>, <title>, etc., and it will work. however, it is best practice to write all tags in lowercase for consistency, readability, and other reasons. anatomy of an html element let's further explore our paragraph element from the previous section: the anatomy of our element is: the opening tag: this consists of the name of the element (in this example, p for paragraph), wrapped in opening and
closing angle brackets. this opening tag marks where the element begins or starts to take effect. in this example, it precedes the start of the paragraph text. the content: this is the content of the element. in this example, it is the paragraph text. the
closing tag: this is the same as the opening tag, except that it includes a forward slash before the element name. this marks where the element ends.
...opening tag marks where the element begins or starts to take effect. in this example, it precedes the start of the paragraph text. the content: this is the content of the element. in this example, it is the paragraph text. the
closing tag: this is the same as the opening tag, except that it includes a forward slash before the element name. this marks where the element ends. failing to include a
closing tag is a common beginner error that can produce peculiar results. the element is the opening tag, followed by content, followed by the
closing tag. ...
...And 5 more matches
Bytecode Descriptions
: getsuperbase, except that instead of the environment, the argument supplies the callee. getpropsuper operands: (uint32_t nameindex) stack: receiver, obj ⇒ super.name get the value of receiver.name, starting the property search at obj. in spec terms, obj.[[get]](name, receiver). implements: getvalue for references created by super.name. the receiver is this and obj is the superbase of the en
closing method. format: jof_atom, jof_prop, jof_typeset, jof_ic getelemsuper stack: receiver, key, obj ⇒ super[key] get the value of receiver[key], starting the property search at obj. in spec terms, obj.[[get]](key, receiver). implements: getvalue for references created by super[key] (where the receiver is this and obj is the superbase of the en
closing method); reflect.get(obj, key, receiver). form...
... key, receiver). format: jof_elem, jof_typeset, jof_ic setpropsuper operands: (uint32_t nameindex) stack: receiver, obj, val ⇒ val assign val to receiver.name, starting the search for an existing property at obj. in spec terms, obj.[[set]](name, val, receiver). implements: putvalue for references created by super.name in non-strict code. the receiver is this and obj is the superbase of the en
closing method. format: jof_atom, jof_prop, jof_propset, jof_checksloppy strictsetpropsuper operands: (uint32_t nameindex) stack: receiver, obj, val ⇒ val like jsop::setpropsuper, but for strict mode code. format: jof_atom, jof_prop, jof_propset, jof_checkstrict setelemsuper stack: receiver, key, obj, val ⇒ val assign val to receiver[key], strating the search for an existing property at obj. in...
...ut for strict mode code. format: jof_atom, jof_prop, jof_propset, jof_checkstrict setelemsuper stack: receiver, key, obj, val ⇒ val assign val to receiver[key], strating the search for an existing property at obj. in spec terms, obj.[[set]](key, val, receiver). implements: putvalue for references created by super[key] in non-strict code. the receiver is this and obj is the superbase of the en
closing method. format: jof_elem, jof_propset, jof_checksloppy strictsetelemsuper stack: receiver, key, obj, val ⇒ val like jsop::setelemsuper, but for strict mode code. format: jof_elem, jof_propset, jof_checkstrict enumeration iter stack: val ⇒ iter set up a for-in loop by pushing a propertyiteratorobject over the enumerable properties of val. implements: forin/ofheadevaluation step 6, enum...
...And 5 more matches
HTML basics - Learn web development
ta tables. as the title suggests, this article will give you a basic understanding of html and its functions. so what is html? 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. ...
..., or wrap, different parts of the content to make it appear a certain way, or act a certain way. the en
closing 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 following line of content: my cat is very grumpy if we wanted the line to stand by itself, we could specify that it is a paragraph by en
closing it in paragraph tags: <p>my cat is very grumpy</p> anatomy of an html element let's explore this paragraph element a bit further. the main parts of our element are as follows: the opening tag: this consists of the name of the element (in this case, p), wrapped in opening and
closing angle brackets. this states where the element begins or starts to take effect — in this case where the p...
... <p>my cat is very grumpy</p> anatomy of an html element let's explore this paragraph element a bit further. the main parts of our element are as follows: the opening tag: this consists of the name of the element (in this case, p), wrapped in opening and
closing angle brackets. this states where the element begins or starts to take effect — in this case where the paragraph begins. the
closing tag: this is the same as the opening tag, except that it includes a forward slash before the element name. this states where the element ends — in this case where the paragraph ends. failing to add a
closing tag is one of the standard beginner errors and can lead to strange results. the content: this is the content of the element, which in this case, is just text. the element: the opening tag...
...And 3 more matches
Debugging HTML - Learn web development
ents properly is also very important for code behaving correctly. <strong>strong <em>strong emphasised?</strong> what is this?</em> <li>unclosed attributes: another common source of html problems. let's look at an example: <a href="https://www.mozilla.org/>link to mozilla homepage</a> </ul> let's review the problems: the paragraph and list item elements have no
closing tags. looking at the image above, this doesn't seem to have affected the markup rendering too badly, as it is easy to infer where one element should end and another should begin. the first <strong> element has no
closing tag. this is a bit more problematic, as it isn't easy to tell where the element is supposed to end. in fact, the whole of the rest of the text has been strongly emphasised. ...
...tag. this is a bit more problematic, as it isn't easy to tell where the element is supposed to end. in fact, the whole of the rest of the text has been strongly emphasised. this section is badly nested: <strong>strong <em>strong emphasised?</strong> what is this?</em>. it is not easy to tell how this has been interpreted because of the previous problem. the href attribute value is missing a
closing double quote. this seems to have caused the biggest problem — the link has not rendered at all. now let's look at the markup the browser has rendered, as opposed to the markup in the source code. to do this, we can use the browser developer tools. if you are not familiar with how to use your browser's developer tools, take a few minutes to review discover browser developer tools. in the ...
...eloper tools, take a few minutes to review discover browser developer tools. in the dom inspector, you can see what the rendered markup looks like: using the dom inspector, let's explore our code in detail to see how the browser has tried to fix our html errors (we did the review in firefox; other modern browsers should give the same result): the paragraphs and list items have been given
closing tags. it isn't clear where the first <strong> element should be closed, so the browser has wrapped each separate block of text with its own strong tag, right down to the bottom of the document! the incorrect nesting has been fixed by the browser as shown here: <strong>strong <em>strong emphasised?</em> </strong> <em> what is this?</em> the link with the missing double quote has...
...And 2 more matches
Functions
void actually creating the scope chain at all, if possible. general closures force the interpreter to verify the whole scope chain. so we optimize this when we can. these optimizations depend on being sure that we will never have to walk the scope chain, so with and eval inhibit them all. null closures. if we can prove at compile time that a function does not refer to any locals or arguments of en
closing functions, it is a null closure. since it will never need to walk the scope chain, its parent is the global object. this is the best case. barring with and eval, all outermost functions are null closures. null closures with upvars. a nested function is algol-like if it is only ever defined and called, and it isn't accessed in any other way (and it is not a generator-function). such a function is ...
...never need to walk the scope chain, its parent is the global object. this is the best case. barring with and eval, all outermost functions are null closures. null closures with upvars. a nested function is algol-like if it is only ever defined and called, and it isn't accessed in any other way (and it is not a generator-function). such a function is guaranteed never to be called again after the en
closing function exits. an algol-like function may read the local variables and arguments of its immediate en
closing function from the stack, as if by magic. (jscontext::display caches the en
closing function's stack frame.) if that function is also algol-like, its child can read locals and variables from the next en
closing function, and so on. the compiler detects these cases and makes such functions nul...
...if the function does not assign to any closed-on vars/args, and it only reads closed-on local variables and arguments that never change value after the function is created, then the function can be implemented as a flat closure. ...
...And 2 more matches
HTML5 Parser - Developer guides
s that serve racy code to firefox, perhaps while serving safe code to ie, will see a difference due to this change. firefox writes a warning to the javascript console when it ignores a call to document.write(). lack of reparsing prior to html5, parsers reparsed the document if they hit the end of the file within certain elements or within comments. for example, if the document lacked a </title>
closing tag, the parser would reparse to look for the first '<' in the document, or if a comment was not closed, it would look for the first '>'. this behavior created a security vulnerability. if an attacker could force a premature end-of-file, the parser might change which parts of the document it considered to be executable scripts. in addition, supporting reparsing led to unnecessarily complex parsin...
...his behavior created a security vulnerability. if an attacker could force a premature end-of-file, the parser might change which parts of the document it considered to be executable scripts. in addition, supporting reparsing led to unnecessarily complex parsing code. with html5, parsers no longer reparse documents. this change has the following consequences for web developers: if you omit the
closing tag for <title>, <style>, <textarea>, or <xmp>, the page will fail to be parsed. ie already fails to parse documents with a missing </title> tag, so if you test with ie, you probably don't have that problem. if you forget to close a comment, the page will most likely fail to be parsed. however, unclosed comments often already break in existing browsers for one reason or another, so it's unlikely...
...es that are tested in multiple browsers. in an inline script, in order to use the literal strings <script, </script>, and <!--, you should prevent them from being parsed literally by expressing them as \u003cscript,\u003c/script>, and \u003c!--. the older practice of escaping the string </script> by surrounding it with comment markers, while supported by html5, is problematic in cases where the
closing comment marker is omitted (see preceding point). you can avoid such problems by using the character code for the initial '<' instead. (it is valid to use an escape character, e.g., <\/script>, but this strategy does not work for <script and <!--, because \s and \! are not valid javascript escapes; the character code strategy is more general-purpose.) inline svg and mathml support as a complete...
...And 2 more matches
OpenClose - Archive of obsolete content
opening menus menus will display themselves automatically when needed without extra work. for instance, a menu's popup will open when the menu label is clicked, and a submenu will open when the mouse is hovered over the parent menu element. however, there may be situations when you wish to open a menu manually. the menu element has an open property which may be set to true to open the menu, or false to close the menu. a simple example: somemenu.open = true; this single line of code will open a menu referenced by the variable 'somemenu'. note that the open property applies to the menu or button, not to the menupopup. ...
...t to open a submenu, open the parent menu first, and then open the child menu in a popupshown event listener. see the popupshown event for an example of how to do this. a menu in an unprivileged content window (such as a web page) can only open a popup while its window is focused, and it is in the currently active tab. that means that a document in a background tab cannot open a menu or popup.
closing menus menus will close automatically once the user has made a selection from the menu. when an menu item is selected, it fires a command event so that code may be used to perform an action. the user may cancel selecting a command from a menu by pressing the escape key. this will close a single menu, but if this menu has a parent menu, the parent menu will remain open. a user may also cancel sele...
...perty on the submenu is set to false, the submenu will close, yet the parent file menu will remain open. on the other hand, if the open property on the file menu is set to false, both menus will close. this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to other elements using the popup or context attributes, see
closing a popup below. when a menu is closed, the popuphiding event is fired at the menupopup. attaching an event listener which listens for the popuphiding event can be used to remove any commands that were adding during the popupshowing event. menus and popups are also closed when the document or window they are contained within is closed, or if the menupopup element is removed from the document. the...
...the same as the corresponding argument for the openpopup method. in the following example, the popup is opened at horizontal positon 100 and vertical position 200: popup.openpopupatscreen(100, 200, false); note that if the supplied coordinates would cause the popup to be partially or completely off screen, the popup will be moved such that it is fully visible, and may be resized if necessary.
closing a popup with the hidepopup method a popup menu is closed by the user pressing the escape key or by clicking somewhere outside the popup. for
closing menupopups that use the menu tag, the button tag and the toolbarbutton tag, see
closing menus above. to close a popup with a script, use the popup's hidepopup method. it takes no arguments. popup.hidepopup(); determining if a popup is open for...
MathML Accessibility in Mozilla
lower c upper d end multi-scripts __________ not supported yet. see bug 1176983 and webkit's bug 146454 a. pre-subscript e pre-superscript f pre-superscript g subscript b subscript c superscript d a base b subscript c subscript d superscript e presubscript f presuperscript g presuperscript scripted x+y __________ long division symbol en
closing x plus y end symbol __________ not supported. see webkit's bug 146543. x plus y enclosed by: a long division sign x + y long division enclosed x+y __________ long division symbol en
closing x plus y end symbol __________ not supported. see webkit's bug 146543. x plus y enclosed by: a long divisi...
...see webkit's bug 146543. ...
... x plus y enclosed by: a line on the left and a line on the right x + y right left enclosed x+y __________ x plus y __________ not supported. see webkit's bug 146543. x plus y enclosed by: a line at the bottom, a line on the left, a line on the right, and, a line at the top x + y bottom top right enclosed x+y __________ cross out en
closing x plus y end crossout __________ not supported. see webkit's bug 146543. x plus y enclosed by: an up diagonal strike x + y up diagonal strike enclosed x+y __________ cross out en
closing x plus y end crossout __________ not supported. see webkit's bug 146543. x plus y enclosed by: a down diagonal strike ...
...d. see webkit's bug 146543. x plus y enclosed by: an up diagonal strike x + y up diagonal strike enclosed x+y __________ cross out en
closing x plus y end crossout __________ not supported. see webkit's bug 146543. x plus y enclosed by: a down diagonal strike x + y down diagonal strike enclosed x+y __________ cross out en
closing x plus y end crossout __________ not supported. see webkit's bug 146543. x plus y enclosed by: a vertical strike x + y up vertical strike enclosed x+y __________ cross out en
closing x plus y end crossout __________ not supported. see webkit's bug 146543. x plus y enclosed by: a horizontal strike x + y ...
nsIAppShellService
void hidesplashscreen(); obsolete since gecko 1.8 void initialize(in nsicmdlineservice acmdlineservice, in nsisupports nativeappsupportorsplash...
... void hidesplashscreen(); obsolete since gecko 1.8 void initialize(in nsicmdlineservice acmdlineservice, in nsisupports nativeappsupportorsplashscreen); obsolete since gecko 1.8 void quit(in pruint32 aferocity);...
... obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) ensures that at least one window exists after creating the startup state. if one has not been made, this will create a browser window. void ensure1window( in nsicmdlineservice acmdlineservice ); parameters acmdlineservice the command line from which startup args can be read. enterlastwindow
closingsurvivalarea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) during application startup (and at other times!) we may temporarily encounter a situation where all application windows will be closed but we do not want to take this as a signal to quit the application. bracket the code where the last window could close with these. (and at application startup...
...tartup (and at other times!) we may temporarily encounter a situation where all application windows will be closed but we do not want to take this as a signal to quit the application. bracket the code where the last window could close with these. (and at application startup, on platforms that do not normally quit when the last window has closed, call enter once, but not exit) void enterlastwindow
closingsurvivalarea(); parameters none. exitlastwindow
closingsurvivalarea() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void exitlastwindow
closingsurvivalarea(); parameters none. native code only!gethiddenwindowandjscontext return the (singleton) application hidden window as an nsidomwindow, and, the corresponding javascript context pointer...
nsIAppStartup
indow(); boolean createstartupstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.9.1 void destroyhiddenwindow(); void doprofilestartup(in nsicmdlineservice acmdlineservice, in boolean caninteract); obsolete since gecko 1.9.1 void ensure1window(in nsicmdlineservice acmdlineservice); obsolete since gecko 1.9.1 void enterlastwindow
closingsurvivalarea(); void exitlastwindow
closingsurvivalarea(); void getstartupinfo(); void hidesplashscreen(); obsolete since gecko 1.9.1 void initialize(in nsisupports nativeappsupportorsplashscreen); obsolete since gecko 1.9.1 void quit(in pruint32 amode); void restartinsafemode(in pruint32 aquitmode); void run(); attributes ...
...ow() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) ensures that at least one window exists after creating the startup state. if one has not been made, this will create a browser window. void ensure1window( in nsicmdlineservice acmdlineservice ); parameters acmdlineservice the command line from which startup args can be read. ...
...sure1window( in nsicmdlineservice acmdlineservice ); parameters acmdlineservice the command line from which startup args can be read. enterlastwindow
closingsurvivalarea() serves for situations when all application windows will be closed but we don't want to take this as a signal to quit the application. bracket the code where the last window could close with these. void enterlastwindow
closingsurvivalarea(); parameters none. exitlastwindow
closingsurvivalarea() this method serves for situations when all application windows will be closed but we don't want to take this as a signal to quit the application. bracket the code where the last window could close with these. void exitlastwindow
closingsurvivalarea(); parameters none. getstartupinfo() returns a javascript object with ev...
... from the constants defined above. restartinsafemode() restart the application in safe mode. void quit( in pruint32 aquitmode ); parameters aquitmode this parameter modifies how the app is shutdown. run() runs an application event loop: normally the main event pump which defines the lifetime of the application. if there are no windows open and no outstanding calls to enterlastwindow
closingsurvivalarea() this method will exit immediately. void run(); parameters none. return value returns ns_success_restart_app code. this return code indicates that the application should be restarted because quit was called with the erestart flag. see also nsicmdlineservice nsiappstartup_mozilla_2_0 ...
Arrow function expressions - JavaScript
rval(function growup() { // the callback refers to the `that` variable of which // the value is the expected object. that.age++; }, 1000); } alternatively, a bound function could be created so that a preassigned this value would be passed to the bound target function (the growup() function in the example above). an arrow function does not have its own this. ...
...a preassigned this value would be passed to the bound target function (the growup() function in the example above). an arrow function does not have its own this. the this value of the en
closing lexical scope is used; arrow functions follow the normal variable lookup rules. so while searching for this which is not present in the current scope, an arrow function ends up finding the this from its en
closing scope. ...
...wn this. the this value of the en
closing lexical scope is used; arrow functions follow the normal variable lookup rules. so while searching for this which is not present in the current scope, an arrow function ends up finding the this from its en
closing scope. thus, in the following code, the this within the function that is passed to setinterval has the same value as the this in the lexically en
closing function: function person(){ this.age = 0; setinterval(() => { this.age++; // |this| properly refers to the person object }, 1000); } var p = new person(); relation with strict mode given that this comes from the surrounding lexical context, strict mode rules with regard to this are ignored. var f = () => { 'use strict'; return this; }; f() === window; // or the global object all...
...call: function(a) { var f = v => v + this.base; var b = { base: 2 }; return f.call(b, a); } }; console.log(adder.add(1)); // this would log 2 console.log(adder.addthrucall(1)); // this would log 2 still no binding of arguments arrow functions do not have their own arguments object. thus, in this example, arguments is simply a reference to the arguments of the en
closing scope: var arguments = [1, 2, 3]; var arr = () => arguments[0]; arr(); // 1 function foo(n) { var f = () => arguments[0] + n; // foo's implicit arguments binding. arguments[0] is n return f(); } foo(3); // 6 in most cases, using rest parameters is a good alternative to using an arguments object. function foo(n) { var f = (...args) => args[0] + n; return f(10); } foo(1); // 11 arro...
Session store API - Archive of obsolete content
session store makes it possible for extensions to easily save and restore data across firefox sessions. there is a simple api that lets extensions access the session store feature. one key scenario in which supporting this feature can be crucial for an extension: firefox 2 lets users undo the
closing of tabs. in order to properly restore your extension's state when a tab is restored, it needs to use the session store api's settabvalue() method to save any data it will need in order to restore its state, and then call gettabvalue() to retrieve the previous setting when the tab is restored. the session store api is implemented using the nsisessionstore interface. knowing when to restore each time firefox is about to restore a tab, an event of type sstabrestoring is sent. if your extension want...
...stored. an event of type sstabrestored fires each time a tab has finished restoring. it's worth noting that this event is sent even if tab loading at startup is deferred until the user selects the tab. firefox 3 note in firefox 3 and later, if you need to detect when a tab is about to be closed so that you can update data associated with the tab before it is closed, you can watch for the "sstab
closing" event, which is sent to the tab. restoring without restarting firefox 3.6 note this section applies to firefox 3.6 and later. firefox 3.6 knows how to save session store data when the last browser window closes, even if there are still other windows open. similarly, it can now restore the user's session while in that state. in other words, it's now possible for sessions to be restored eve...
...this means that you cannot currently tell if a tab has been saved or restored. however seamonkey reuses the browser element (up to the undo close tab limit) which means that you can set state on the browser element and it will be restored with the tab. ...
Panels - Archive of obsolete content
ing a panel with script the panel, like all popups, has an openpopup method which may be used to open the popup using a script. for example, the following would open a panel underneath a button: panel.openpopup(button, "after_start", 0, 0, false, false); likewise, the openpopupatscreen method will open a panel at a specific screen position. for more details about both methods, see opening and
closing popups.
closing a panel a panel is closed automatically when the user clicks outside of the panel. it is quite common however, to have an element such as a button within the panel to close it as well. for instance, using the search panel example above, we could add a button which closes the panel when pressed: <script> function dosearch() { document.getelementbyid("search-panel").hidepopup()...
...on="after_start"> <textbox id="search"/> <button label="search" oncommand="dosearch();"/> </panel> </toolbarbutton> in this example, the dosearch() function is called when the "search" button is pressed. this function retrieves the popup and calls the hidepopup method. naturally, this function would also include code to start the search operation. preventing panels from automatically
closing a panel will be closed when a user clicks outside of the panel or when the escape key is pressed. this is the normal way in which a user would cancel the operation. you may wish to also place a cancel or close button within the panel, especially if the panel is larger with a lot of controls within it. sometimes, however, you may wish to keep the panel open, even if the user clicks outside of it...
...ement was focused before the panel was opened is refocused. you can prevent the focus from being removed by setting the noautofocus attribute to true as above. in addition, the norestorefocus attribute should be set to true in order to prevent the previously focused element from being refocused. normally, only the latter would be set if needed. this process of removing the focus when opening and
closing a popup occurs after the popupshowing event or popuphiding event is fired, which means that if those events are cancelled, the focus is not adjusted. letting panels be dragged by grabbing the background requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), you can use the backdrag attribute to create pa...
prefwindow - Archive of obsolete content
ntents. this affects only on mac os x. lastselected type: string set this to the id of the last selected pane. it will be opened by default the next time the preferences dialog is opened. onbeforeaccept type: script code the code in this attribute is called when the ok button is pressed or the acceptdialog method is called. returning false doesn't currently prevent the dialog from
closing, but does prevent saving (bug 474527). ondialogaccept type: script code the code in this attribute is called when the accept button is pressed, or when the acceptdialog method is called. if the handler returns true, the dialog will indeed go away, but if it returns false it will not. ondialogcancel type: script code the code in this attribute is called when the "cancel" button i...
...sage patterns opening/initializing a prefwindow note that you can define an initwithparams() function in your sub window - to handle parameters passed using openwindow() in case the window was already open. for example the permissions manager ui in firefox uses the same window for three dialogs: images, software installation and popups. ...
...to do this, you can set the prefwindow's onunload attribute to a function that will be run when the prefwindow is closed. ...
Your first form - Learn web development
entering email addresses (e.g. with an @ symbol by default) to appear on devices with dynamic keyboards, like smartphones. you'll find out more about form validation in the client-side form validation article later on. last but not least, note the syntax of <input> vs. <textarea></textarea>. this is one of the oddities of html. the <input> tag is an empty element, meaning that it doesn't need a
closing tag. <textarea> is not an empty element, meaning it should be closed with the proper ending tag. this has an impact on a specific feature of forms: the way you define the default value. to define the default value of an <input> element you have to use the value attribute like this: <input type="text" value="by default this element is filled with this text"> on the other hand, if you want to de...
... the proper ending tag. this has an impact on a specific feature of forms: the way you define the default value. ...
... a click on a submit button (the default value) sends the form's data to the web page defined by the action attribute of the <form> element. ...
Invariants
essions might refer to a variable or global; or might at runtime turn out to reference another object property, due to with, or a variable that isn't in the source code at all but was injected into a local scope by eval. ...
...perty, due to with, or a variable that isn't in the source code at all but was injected into a local scope by eval. these cases can be detected statically by looking for with and eval "nearby" in the parse tree.) if a nested function contains a nameexpression that refers to a variable in an en
closing scope which the function can outlive (i.e. the function can be called after control exits that en
closing scope) then upvar instructions cannot be used for that nameexpression. ...
...sted function contains a nameexpression that refers to a variable in an en
closing scope which the function can outlive (i.e. the function can be called after control exits that en
closing scope) then upvar instructions cannot be used for that nameexpression. (wrong results or a potentially exploitable crash. the upvar ops depend on a per-context display of currently active stack frames. ...
Debugger.Object - Firefox Developer Tools
y); false otherwise. name the name of the referent, if it is a named function. if the referent is an anonymous function, or not a function at all, this is undefined. this accessor returns whatever name appeared after the function keyword in the source code, regardless of whether the function is the result of instantiating a function declaration (which binds the function to its name in the en
closing scope) or evaluating a function expression (which binds the function to its name only within the function’s body). displayname the referent’s display name, if the referent is a function with a display name. if the referent is not a function, or if it has no display name, this is undefined. if a function has a given name, its display name is the same as its given name. in this case, th...
...uld have the value: ["a", ["b", "c"], {d:"d", e:"f"}] script if the referent is a function that is debuggee code, this is that function’s script, as a debugger.script instance. if the referent is a function proxy or not debuggee code, this is undefined. environment if the referent is a function that is debuggee code, a debugger.environment instance representing the lexical environment en
closing the function when it was created. if the referent is a function proxy or not debuggee code, this is undefined. errormessagename if the referent is an error created with an engine internal message template this is a string which is the name of the template; undefined otherwise. errorlinenumber if the referent is an error object, this is the line number at which the referent was created; undefi...
...t of the execution context forcode is the referent, and thebindings appear in a new declarative environment, which is the eval code’s lexicalenvironment.) theoptions argument is as for debugger.frame.prototype.eval. asenvironment() if the referent is a global object, return the debugger.environment instance representing the referent’s global lexical scope. the global lexical scope’s en
closing scope is the global object. if the referent is not a global object, throw a typeerror. unwrap() if the referent is a wrapper that this debugger.object’s compartment is permitted to unwrap, return a debugger.object instance referring to the wrapped object. if we are not permitted to unwrap the referent, return null. if the referent is not a wrapper, return this debugger.object instance unchang...
Writing WebSocket client applications - Web APIs
connections unless they're on the same device or possibly on the same network). connection errors if an error occurs while attempting to connect, first a simple event with the name error is sent to the websocket object (thereby invoking its onerror handler), and then the closeevent is sent to the websocket object (thereby invoking its onclose handler) to indicate the reason for the connection's
closing. the browser may also output to its console a more descriptive error message as well as a
closing code as defined in rfc 6455, section 7.4 through the closeevent. examples this simple example creates a new websocket, connecting to the server at wss://www.example.com/socketserver. a custom protocol of "protocolone" is named in the request for the socket in this example, though this can be omitt...
... document.getelementbyid("userlistbox").innerhtml = ul; break; } if (text.length) { f.write(text); document.getelementbyid("chatbox").contentwindow.scrollbypages(1); } }; here we use json.parse() to convert the json object back into the original object, then examine and act upon its contents. text data format text received over a websocket connection is in utf-8 format. ...
... security considerations websockets should not be used in a mixed content environment; that is, you shouldn't open a non-secure websocket connection from a page loaded using https or vice-versa. most browsers now only allow secure websocket connections, and no longer support using them in insecure contexts. ...
Syntax - CSS: Cascading Style Sheets
different values. not all pairs of properties and values are allowed and each property defines what are the valid values. when a value is not valid for a given property, the declaration is deemed invalid and is wholly ignored by the css engine. css declaration blocks declarations are grouped in blocks, that is in a structure delimited by an opening brace, '{' (u+007b left curly bracket), and a
closing one, '}' (u+007d right curly bracket). blocks sometimes can be nested, so opening and
closing braces must be matched. such blocks are naturally called declaration blocks and declarations inside them are separated by a semi-colon, ';' (u+003b semicolon). a declaration block may be empty, that is containing null declaration. white spaces around declarations are ignored. the last declaration of a...
... last declaration of a block doesn't need to be terminated by a semi-colon, though it is often considered good style to do it as it prevents forgetting to add it when extending the block with another declaration. a css declaration block is visualized in the diagram below. note: the content of a css declaration block, that is a list of semi-colon-separated declarations, without the initial and
closing braces, can be put inside an html style attribute. css rulesets if style sheets could only apply a declaration to each element of a web page, they would be pretty useless. the real goal is to apply different declarations to different parts of the document. css allows this by associating conditions with declarations blocks. each (valid) declaration block is preceded by one or more comma-separat...
... consists of only a big list of them. but there is other information that a web author wants to convey in the style sheet, like the character set, other external style sheets to import, font face or list counter descriptions and many more. it will use other and specific kinds of statements to do that. a statement is a building block that begins with any non-space characters and ends at the first
closing brace or semi-colon (outside a string, non-escaped and not included into another {}, () or [] pair). there are two kinds of statements: rulesets (or rules) that, as seen, associate a collection of css declarations to a condition described by a selector. at-rules that start with an at sign, '@' (u+0040 commercial at), followed by an identifier and then continuing up to the end of the statem...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
l. as a rule of thumb to determine which one to use, try changing the order of the list items; if the meaning is changed, the <ol> element should be used, otherwise you can use <ul>. ...
... placed here! --> <ul> <li>second item first subitem</li> <li>second item second subitem <!-- same for the second nested unordered list! --> <ul> <li>second item second subitem first sub-subitem</li> <li>second item second subitem second sub-subitem</li> <li>second item second subitem third sub-subitem</li> </ul> </li> <!--
closing </li> tag for the li that contains the third unordered list --> <li>second item third subitem</li> </ul> <!-- here is the
closing </li> tag --> </li> <li>third item</li> </ul> the above html will output: ordered list inside unordered list <ul> <li>first item</li> <li>second item <!-- look, the
closing </li> tag is not placed here! --> <ol> <l...
... living standard html5the definition of '<ul>' in that specification. ...
Data URLs - HTTP
fix (data:), a mime type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:[<mediatype>][;base64],<data> the mediatype is a mime type string, such as 'image/jpeg' for a jpeg image file. if omitted, defaults to text/plain;charset=us-ascii if the data is textual, you can simply embed the text (using the appropriate entities or escapes based on the en
closing document's type). otherwise, you can specify base64 to embed base64-encoded binary data. you can find more info on mime types here and here. a few examples: data:,hello%2c%20world! simple text/plain data. note the use of percent-encoding (url-encoding) for the quote and space characters. also, for csv data (mime type "text/csv"), percent-encoding is needed to preserve the line endings that d...
..."text/csv"), percent-encoding is needed to preserve the line endings that delimit rows of the spreadsheet. data:text/plain;base64,sgvsbg8sifdvcmxkiq== base64-encoded version of the above data:text/html,%3ch1%3ehello%2c%20world!%3c%2fh1%3e an html document with <h1>hello, world!</h1> data:text/html,<script>alert('hi');</script> an html document that executes a javascript alert. note that the
closing script tag is required. encoding data into base64 format base64 is a group of binary-to-text encoding schemes that represent binary data in an ascii string format by translating it into a radix-64 representation. by consisting only in ascii characters, base64 strings are generally url-safe, and that's why they can be used to encode data in data urls. encoding in javascript the web apis have ...
...sents an html resource whose contents are: lots of text...<p><a name="bottom">bottom</a>?arg=val syntax the format for data urls is very simple, but it's easy to forget to put a comma before the "data" segment, or to incorrectly encode the data into base64 format. formatting in html a data url provides a file within a file, which can potentially be very wide relative to the width of the en
closing document. as a url, the data should be formatable with whitespace (linefeed, tab, or spaces), but there are practical issues that arise when using base64 encoding. length limitations although firefox supports data urls of essentially unlimited length, browsers are not required to support any particular maximum length of data. for example, the opera 11 browser limited urls to 65535 characters lo...
SyntaxError: missing } after function body - JavaScript
the javascript exception "missing } after function body" occurs when there is a syntax mistake when creating a function somewhere. check if any
closing curly brackets or parenthesis are in the correct order. message syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong? ...
...sing } after function body" occurs when there is a syntax mistake when creating a function somewhere. check if any
closing curly brackets or parenthesis are in the correct order. message syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong? ...
.... message syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong? ...
this - JavaScript
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 en
closing lexical context). 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 this value a property of an execution context (global, function or eval) that, in non–strict mode, is always a reference to an object and in ...
...bind, regardless of how the function is being used. function f() { return this.a; } var g = f.bind({a: 'azerty'}); console.log(g()); // azerty var h = g.bind({a: 'yoo'}); // bind only works once! console.log(h()); // azerty var o = {a: 37, f: f, g: g, h: h}; console.log(o.a, o.f(), o.g(), o.h()); // 37,37, azerty, azerty arrow functions in arrow functions, this retains the value of the en
closing lexical context's this. in global code, it will be set to the global object: var globalobject = this; var foo = (() => this); console.log(foo() === globalobject); // true note: if this arg is passed to call, bind, or apply on invocation of an arrow function it will be ignored. you can still prepend arguments to the call, but the first argument (thisarg) should be set to null. // call as a me...
... attempt to set this using call console.log(foo.call(obj) === globalobject); // true // attempt to set this using bind foo = foo.bind(obj); console.log(foo() === globalobject); // true no matter what, foo's this is set to what it was when it was created (in the example above, the global object). the same applies to arrow functions created inside other functions: their this remains that of the en
closing lexical context. // create obj with a method bar that returns a function that // returns its this. the returned function is created as // an arrow function, so its this is permanently bound to the // this of its en
closing function. the value of bar can be set // in the call, which in turn sets the value of the // returned function. var obj = { bar: function() { var x = (() => this); re...
Sidebar - Archive of obsolete content
this means that the function is available in all browser windows. you can use this function to show, hide, or toggle sidebars. ...
...okmarkssidebar"); // show the history sidebar, whether it's hidden or already showing sidebarui.show("viewhistorysidebar"); // hide the sidebar, if one is showing sidebarui.hide(); avoid opening the sidebar on startup. users have been known to complain about this "feature", and if two or more extensions try to open their sidebars on startup, the user will see a flurry of sidebars opening and
closing with which ever extension going last "winning". web panels sidebar content such as web pages can be safely loaded as sidebar in the "viewwebpanelssidebar". bookmarks with "load this bookmark in sidebar" checked in the properties open in the "viewwebpanelssidebar". a web page can use window.sidebar to create bookmark with that property. to open a page in the "viewwebpanelssidebar" from chrome ...
Index - Archive of obsolete content
in order to do so it implements the following interfaces: 1730 xul template primer - bindings outdated articles, outdated_articles, xul this document expands on the xul template primer by introducing the <bindings> element in the extended xul template syntax. 1731 xul tutorial tutorials, xul, xul_tutorial this tutorial describes xul, the xml u...
... horizontally or vertically allows the user to select a value by dragging a thumb on the bar. 1901 script xul elements, xul reference much like the html script element, this is used to declare a script to be used by the xul window. you should usually put scripts in a separate file pointed to by the src attribute, but you may also place the script inline inside the opening and
closing script tags. 1902 scrollbar xul elements, xul reference when a container's contents which are larger that the size of the container, scroll bars may be placed at the side of the container to allow the user to scroll around in the container. the scroll bar may also be used independently when a numeric value or percentage needs to be selected by the user. the user can adjust th...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
ndow (using window.opener). differences in javascript-generating html javascript can, through document.write, generate html on the fly from a string. the main issue here is when javascript, embedded inside an html document (thus, inside an <script> tag), generates html that contains a <script> tag. if the document is in strict rendering mode, it will parse the </script> inside the string as the
closing tag for the en
closing <script>. the following code illustrates this best: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "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 fi...
...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. ...
Index - Archive of obsolete content
in order to do so it implements the following interfaces: 999 xul template primer - bindings outdated articles, outdated_articles, xul this document expands on the xul template primer by introducing the <bindings> element in the extended xul template syntax. 1000 xul tutorial tutorials, xul, xul_tutorial this tutorial describes xul, the xml us...
... horizontally or vertically allows the user to select a value by dragging a thumb on the bar. 1170 script xul elements, xul reference much like the html script element, this is used to declare a script to be used by the xul window. you should usually put scripts in a separate file pointed to by the src attribute, but you may also place the script inline inside the opening and
closing script tags. 1171 scrollbar xul elements, xul reference when a container's contents which are larger that the size of the container, scroll bars may be placed at the side of the container to allow the user to scroll around in the container. the scroll bar may also be used independently when a numeric value or percentage needs to be selected by the user. the user can adjust th...
Floating Panels - Archive of obsolete content
ear above the main window. on mac, floating panels are invisible when another application is made active, and become visible again when the xul application is made active. a floating panel may contain any type of element. ...
...the hidepopup method would be used if you wish to place your own close button on the panel, or wish to close the panel in response to a user action. ...
Adding Event Handlers - Archive of obsolete content
some scripts which will execute when the user interacts with the dialog. we would want to add a script to handle the find button, the cancel button and to handle each menu command. we write this using javascript functions much in the same way as html. you can use the script element to include scripts in xul files. you can embed the script code directly in the xul file in between the opening and
closing script tags but it is much better to include code in a separate file as the xul window will load slightly faster. the src attribute is used to link in an external script file. our find files example let's add a script to the find file dialog. although it does not matter what the script file is called, usually it would be the same as the xul file with a .js extension. in this case, findfile.js ...
...ibute should be some script that should be executed when the event occurs. typically, this code will be short or just call a function defined in a separate script. an example of responding to a button being pressed: example 1 : source view <button label="ok" oncommand="alert('button was pressed!');"/> since the command event will bubble, it is also possible to place the event listener on an en
closing element. in the example below, the listener has been placed on a box and will receive events for both elements. example 2 : source view <vbox oncommand="alert(event.target.tagname);"> <button label="ok"/> <checkbox label="show images"/> </vbox> in this example, the command event will bubble up from the button or checkbox to the vbox, where it is handled. if a second listener (the oncomman...
Adding Labels and Images - Archive of obsolete content
ide a control, such as a button. an example is shown below: example 1 : source view <label value="this is some text"/> the value attribute can be used to specify the text that you wish to have displayed. the text will not wrap, so the text will all be displayed on a single line. this syntax is the most common of labels. if the text needs to wrap, you can place the text content inside opening and
closing tags as in the following example: example 2 : <label>this is some longer text that will wrap onto several lines.</label> as with html, line breaks and extra whitespace are collapsed into a single space. later, we'll find out how to constrain the width of elements so that we can see the wrapping more easily. control attribute you can use the control attribute to set which control the label is ass...
...will cause the button to be focused. description element for descriptive text not associated with any particular control, you can use the description tag. this element is useful for informative text at the top of a dialog or a group of controls for example. as with the label element, you can either use the value attribute for a single line of text or place text or xhtml content inside opening and
closing description tags for longer blocks of text. it is more common to use the attribute syntax for labels, and the text content syntax for descriptions. example 4 : source view <description> this longer section of text is displayed. </description> you can set the text via script using the textcontent property, as in the following example: <description id="text" width="200"/> document.getelementbyi...
Tree View Details - Archive of obsolete content
l after a given row. the code above uses a brute force method which simply iterates over the rows looking for one, returning true if a row exists with the same level and false once it finds a row that has a lower level. in this simple example, this method is fine, but a tree with a larger set of data will want to use a more optimal method of determining whether a later sibling exists. opening or
closing a row the final function of note is toggleopenstate, which is the most complex. it needs to modify the visibledata array when a row is opened or closed. toggleopenstate: function(idx) { var item = this.visibledata[idx]; if (!item[1]) return; if (item[2]) { item[2] = false; var thislevel = this.getlevel(idx); var deletecount = 0; for (var t = idx + 1; t < this.visibledata...
... all those that have a higher level will need to be removed, but a row at the same level will be the next container which should not be removed. finally, we use the splice function to remove the rows from the visibledata array and call the rowcountchanged function to redraw the tree. when deleting rows, you will need to supply a negative count of the number of rows to delete. whether opening or
closing a row, we need to tell the tree to repaint the twisty in the new state. the easiest way to do this is to invalidate the row. complete example there are several other view functions we can implement but they don't need to do anything in this example, so we can create functions that do nothing for those. they are added near the end of the complete example, shown here: <?xml version="1.0"?> <?xml...
scrollbox - Archive of obsolete content
to be used when an application wants to be able to adjust the scroll position itself. if you just want scrollbars to appear, add style='overflow: auto;'. this may also be used with any other container element. examples the following shows the xul for a bunch of labels. they come out in a box. if their container doesn't give enough room to hold them (geometrically) what happens depends on the en
closing elements; often the content is just clipped off on the bottom or right (depending on what's too big to fit). <vbox> <label value="01 four score and seven years ago "/> <label value="02 our fathers brought forth on "/> <label value="03 this continent, a new nation, "/> <label value="04 conceived in liberty, and "/> <label value="05 dedicated to the proposition "/> <label value="06 tha...
...label value="01 four score and seven years ago "/> <label value="02 our fathers brought forth on "/> <label value="03 this continent, a new nation, "/> <label value="04 conceived in liberty, and "/> <label value="05 dedicated to the proposition "/> <label value="06 that all men are created equal."/> </vbox> the flex="1" above may or may not be needed, or even desired. in our case an en
closing element also was overflow:auto. if the user made the window smaller, the outer box would get smaller in response and sprout its scroll bars. we wanted our vbox to get smaller and sprout its scroll bars instead. note that this example doesn't use a scrollbox tag; you only need that tag if you want to programmatically scroll in addition to the automatic scroll bars. note: avoid nested scroll boxe...
Common causes of memory leaks in extensions - Extensions
document.body.someproperty = leakref; } see also kris maglione's guide to cleaning up bootstrapped extensions. failing to clean up event listeners extensions can be disabled and removed by user actions, but it also happens when an add-on is updated. if a bootstrapped (restartless) extension fails to clean up event listeners when disabled or removed, the listeners will still reference the en
closing scope — usually the bootstrap.js sandbox — and therefore keep that scope (and its en
closing compartment) alive until the window is unloaded. if the window in question is browser.xul or some long-lived web app such as gmail, the leaked compartment might survive for quite some time. function leakref() {} function main(window) { // this is a potential leak, as the window (e.g. browser.xul) w...
... window.addeventlistener("leaky", leakref, true); // the following line still fails to avoid the leak, as usecapture differs // and removeeventlistener will not remove anything. // this kind of subtle bug is very common. ...
Debugging CSS - Learn web development
ou see when you view the source of a webpage, or look at the html file you put on the server, and what you can see in the html pane of the devtools. while it looks roughly similar to what you can see via view source there are some differences. in the rendered dom the browser may have corrected some badly-written html for you. if you incorrectly closed an element, for instance opening an <h2> but
closing with an </h3>, the browser will figure out what you were meaning to do and the html in the dom will correctly close the open <h2> with an </h2>. the browser will also normalize all of the html, and the dom will also show any changes made by javascript. view source in comparison, is simply the html source code as stored on the server. the html tree in your devtools shows exactly what the browser ...
... update in real time on the page. in a similar fashion, you could change the width or style of the border. adding a new property you can add properties using the devtools. perhaps you have realised that you don't want your box to inherit the <body> element's font size, and want to set its own specific size? you can try this out in devtools before adding it to your css file. you can click the
closing curly brace in the rule to start entering a new declaration into it, at which point you can start typing the new property and devtools will show you an autocomplete list of matching properties. after selecting font-size, enter the value you want to try. you can also click the + button to add an additional rule with the same selector, and add your new rules there. note: there are other useful ...
Practical positioning examples - Learn web development
b is pressed, and style the tab itself. you won't need to understand the javascript itself at this stage, but you should think about learning some basic javascript as soon as possible — the more complex your ui features become, the more likely it is that you'll need some javascript to implement your desired functionality. general setup to begin with, add the following between your opening and
closing <style> tags: html { font-family: sans-serif; } * { box-sizing: border-box; } body { margin: 0; } this is just some general setup to set a sans-serif font on our page, use the border-box box-sizing model, and get rid of the default <body> margin. next, add the following just below your previous css: .info-box { width: 450px; height: 400px; margin: 0 auto; } this sets a specific...
...vascript at the appropriate time. .info-box article { position: absolute; top: 0; left: 0; height: 352px; padding: 10px; color: white; background-color: #a60000; } .info-box .active-panel { z-index: 1; } adding our javascript the final step to getting this feature working is to add some javascript. ...
Fetching data from the server - Learn web development
play (the <pre> element) to the value of the request.response property. request.onload = function() { poemdisplay.textcontent = request.response; }; the above is all set up for the xhr request — it won't actually run until we tell it to, which is done using the send() method. add the following below your previous addition to complete the function. ...
... using the send() method. add the following below your previous addition to complete the function. this line should rest just above the
closing curly brace of your updatedisplay() function. request.send(); one problem with the example as it stands is that it won't show any of the poem when it first loads. to fix this, add the following two lines at the bottom of your code (just above the
closing </script> tag) to load verse 1 by default, and make sure the <select> element always shows the correct value: updatedisplay('verse 1'); versechoose.value = 'verse 1'; serving your example from a server modern browsers will not run xhr requests if you just run the example from a local file. this is because of security restrictions (for more on web security, read website security). to get ...
What went wrong? Troubleshooting JavaScript - Learn web development
signment and strict equality operators. for example, if we were to change this line inside checkguess(): if (userguess === randomnumber) { to if (userguess = randomnumber) { the test would always return true, causing the program to report that the game has been won. be careful! syntaxerror: missing ) after argument list this one is pretty simple — it generally means that you've missed the
closing parenthesis at the end of a function/method call. note: see our syntaxerror: missing ) after argument list reference page for more details about this error. syntaxerror: missing : after property id this error usually relates to an incorrectly formed javascript object, but in this case we managed to get it by changing function checkguess() { to function checkguess( { this has caused the b...
... to function checkguess( { this has caused the browser to think that we are trying to pass the contents of the function into the function as an argument. be careful with those parentheses! syntaxerror: missing } after function body this is easy — it generally means that you've missed one of your curly braces from a function or conditional structure. we got this error by deleting one of the
closing curly braces near the bottom of the checkguess() function. syntaxerror: expected expression, got 'string' or syntaxerror: unterminated string literal these errors generally mean that you've left off a string value's opening or
closing quote mark. in the first error above, string would be replaced with the unexpected character(s) that the browser found instead of a quote mark at the start of a s...
Getting started with React - Learn web development
they're a signal to you (and your computer) that the multiple lines of code inside are part of the same expression. you could just as well write the header expression like this: const header = <header> <h1>mozilla developer network</h1> </header> however, this looks kind of awkward, because the <header> tag that starts the expression is not indented to the same position as its corresponding
closing tag. of course, your browser can't read jsx without help. when compiled (using a tool like babel or parcel), our header expression would look like this: const header = react.createelement("header", null, react.createelement("h1", null, "mozilla developer network") ); it's possible to skip the compilation step and use react.createelement() to write your ui yourself. in doing this, however, y...
...e dom element inside which we want the component to be rendered, in this case the element with an id of root. if you look inside public/index.html, you'll see that this is a <div> element just inside the <body>. all of this tells react that we want to render our react application with the app component as the root, or first component. note: in jsx, react components and html elements must have
closing slashes. writing just <app> or just <img> will cause an error. service workers are interesting pieces of code that help application performance and allow features of your web applications to work offline, but they’re not in scope for this article. you can delete line 5, as well as lines 9 through 12. your final index.js file should look like this: import react from 'react'; import reactdom ...
NSPR's Position On Abrupt Thread Termination
t for some time (exit()), and i assume that the basic semantics defined there are applicable here. in that environment, exit() may be called and any time, and results in the calling thread's immediate termination. in the situation where it was defined (unix), which has only a single thread of execution, that is equivalent to terminating the process. the process abstraction is then responsible for
closing all open files and reclaiming all storage that may have been allocated during the process' lifetime. this practice does not extend to threads. threads run within the confines of a process (or similar abstractions in other environments). threads are lightweight because they do not maintain the full protection domain provided by a process. so in a threaded environment, what is the parallel to unix'...
... are lightweight because they do not maintain the full protection domain provided by a process. so in a threaded environment, what is the parallel to unix' exit()? nspr has defined a function, callable by any thread within a process at any time, called pr_processexit(). this is identical to unix exit() and was so named in an effort to make the obvious even more so. when called, the process exits,
closing files and reclaiming the process' storage. certain people have been disappointed when nspr did not provide a functional equivalent to exit just a particular thread. apparently they have failed to consider the ramifications. if a thread was to abruptly terminate, there is no recording of what resources it owns and should therefore be reclaimed. those resources are in fact, owned by the process and...
Index
elper class encapsulating access to the callee, this value, arguments, and argument count for a function call. 30 js::clonefunctionobject jsapi reference, reference, référence(2), spidermonkey js::clonefunctionobject creates a new function object from funobj. the new object has the same code and argument list as funobj. if scopechain is supplied, it uses scopechain as its en
closing scope. if scopechain is omitted, it creates a new function object in cx's global. this can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object. 31 js::compile jsapi reference, reference, référence(2), spidermonkey js::compile compiles a script, srcbuf, chars, bytes, or file, for execution. 32 js:...
...wn properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj's prototype chain are not affected. 205 js_clonefunctionobject jsapi reference, spidermonkey js_clonefunctionobject creates a new function object from funobj. the new object has the same code and argument list as funobj, but uses parent as its en
closing scope. this can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object. 206 js_comparestrings jsapi reference, spidermonkey js_comparestrings compares two js strings, str1 and str2. if the strings are identical in content and length, js_comparestrings stores 0 in *result. if str1 is less than str2, *result is le...
JS_LeaveLocalRootScopeWithResult
syntax void js_leavelocalrootscopewithresult(jscontext *cx, jsval rval); name type description cx jscontext * pointer to the context. this must be the same context that was passed to js_enterlocalrootscope. requires request. ...
...text that was passed to js_enterlocalrootscope. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rval jsval the result value that should remain protected from garbage collection. description see js_enterlocalrootscope for an explanation of local root scopes. the protection this function affords to rval is tenuous. if there is an en
closing local root scope, then rval is transferred to it. otherwise, the value is stored in an internal per-jscontext slot. this slot is rooted, but the value will eventually be overwritten by some other operation, and it is very difficult to figure out exactly when this will happen—or more to the point, guarantee that it won't happen in the time it takes some specific chunk of code to run. in any case...
History Service Design
rvice will eventually upgrade the database, moving and fixing its datas accordingly. in case the database has been created for the first time history service will create all tables, indexes and triggers, calling related inittables static methods of other dependant services. finally temporary tables, indexes and triggers are created, this happens at every run since those entities are removed when
closing the connection. temporary storage is used to avoid too frequent writes to the disk, since those are most likely to cause fsyncs (to ensure data integrity) on the target filesystem. the temporary data (actually visits and pages) are synced to disk either on a timer and on bookmark's inserts. performance to ensure performance a bunch of statements, commonly used when adding or reading visit infor...
...syncs (to ensure data integrity) on the target filesystem. the temporary data (actually visits and pages) are synced to disk either on a timer and on bookmark's inserts. performance to ensure performance a bunch of statements, commonly used when adding or reading visit informations, are created at startup. these statements can be reused avoiding the overhead due to createstatement calls, before
closing the connection these statements need to be finalized though, since not doing that would cause leaking. the internal syncing service takes care of initializing places, syncing data to disk and finalize statements, so usually that's not a problem. the same pre-compiled statements approach is used in other dependant services and in autocomplete. another step to improve performance is mainly dedicat...
nsIDOMWindowUtils
as modifier_*. aignorerootscrollframes a boolean value indicating whether or not the event should ignore viewport bounds during dispatch. return value true if the page called event.preventdefault(), indicating that default processing of the event should not occur. setcssviewport() sets the dimensions of the css viewport to the specified size in css pixels, regardless of the size of the en
closing widget/view. this triggers reflow. the caller of this method must have universalxpconnect privileges. note: after calling this method, the window.innerwidth and window.innerheight properties return the size of the viewport you've specified instead of the size of the browser widget. void setcssviewport( in float awidthpx, in float aheightpx ); parameters awidthpx the width of the view...
...e of the viewport you've specified instead of the size of the browser widget. void setcssviewport( in float awidthpx, in float aheightpx ); parameters awidthpx the width of the viewport in css pixels. aheightpx the height of the viewport in css pixels. setdisplayport() set the "displayport" to be <xpx, ypx, widthpx, heightpx> in units of css pixels, regardless of the size of the en
closing widget/view. this will *not* trigger reflow. <x, y> is relative to the top-left of the css viewport. this means that the pixels rendered to the displayport take scrolling into account, for example. the displayport will be used as the window's visible region for the purposes of invalidation and painting. the displayport can approximately be thought of as a "persistent" drawwindow() (albeit with ...
Storage
warning: it may be tempting to give your database a name ending in '.sdb' for sqlite database, but this is not recommended. this extension is treated specially by windows as a known extension for an 'application compatibility database' and changes are backed up by the system automatically as part of system restore functionality. this can result in significantly higher overhead file operation. ...
... statements this section demonstrates how you can execute sql statements on your database. for a complete reference see mozistoragestatement. creating a statement there are actually two ways to execute a statement. ...
MailNews fakeserver
good way to do so server.resettest(); // set up second test server.performtest(); transaction = server.playtransaction(); // finished with tests server.stop(); } currently, fakeserver provides no means to keep a persistent connection past a test, requiring connections to be closed, possibly forcibly. alternatively, one can wait for the timeout, which occurs after 3 minutes, so not
closing connections would make the tests take unbearably long. the server provides the following api to xpcshell tests: <caption> nsmailserver xpcshell api </caption> name arguments returns description performtest none nothing runs until the test is forcibly aborted or stopped normally isstopped none if the server is stopped helper for performtest istestfinished none if the test is finished help...
...to enable/disable debugging, call setdebuglevel on your nsmailserver instance with one of the ...
Plug-in Basics - Plugins
e. in particular, the object element allows you to invoke another object if the browser cannot support the object invoked by the element. the embed element, which is also used for plug-ins, does not. the object element is also a part of the html w3c standard. also, unlike the <applet> element, object can contain other html elements including other object elements, nested between its opening and
closing tags. so, for example, though gecko does not support the classid attribute of the object element - which was used for java classes and activex plug-ins embedded in pages - object elements can be nested to support different plug-in implementations. see the mozilla activex project page in the plug-in references section below for more information about embedding activex controls in plug-ins or embe...
... interprets the attributes as follows: when the browser encounters an object element, it goes through the element attributes, ignoring or parsing as appropriate. it analyzes the attributes to determine the object type, then determines whether the browser can handle the type. if the browser can handle the type-that is, if a plug-in exists for that type-then all elements and attributes up to the
closing </object> element, except param elements and other object elements, are filtered. if the browser cannot handle the type, or cannot determine the type, it cannot embed the object. subsequent html is parsed as normal. using the embed element for plug-in display a plug-in runs in an html page in a browser window. the html author uses the html <embed> element to invoke the plug-in and control its...
Debugger.Environment - Firefox Developer Tools
variables. each debugger.frame instance representing a debuggee frame has an associated environment object describing the variables in scope in that frame; and each debugger.object instance representing a debuggee function has an environment object representing the environment the function has closed over. ecmascript environments form a tree, in which each local environment is parented by its en
closing environment (in ecmascript terms, its ‘outer’ environment). we say an environmentbinds an identifier if that environment itself associates the identifier with a variable, independently of its outer environments. we say an identifier isin scope in an environment if the identifier is bound in that environment or any en
closing environment. spidermonkey creates debugger.environment instances as ...
...nction properties of the debugger.environment prototype object the methods described below may only be called with a this value referring to a debugger.environment instance; they may not be used as methods of other kinds of objects. names() return an array of strings giving the names of the identifiers bound by this environment. the result does not include the names of identifiers bound by en
closing environments. getvariable(name) return the value of the variable bound toname in this environment, or undefined if this environment does not bindname.name must be a string that is a valid ecmascript identifier name. the result is a debuggee value. javascript engines often omit variables from environments, to save space and reduce execution time. if the given variable should be in scope, but...
Debugger.Object - Firefox Developer Tools
; false otherwise. name the name of the referent, if it is a named function. if the referent is an anonymous function, or not a function at all, this is undefined. this accessor returns whatever name appeared after the function keyword in the source code, regardless of whether the function is the result of instantiating a function declaration (which binds the function to its name in the en
closing scope) or evaluating a function expression (which binds the function to its name only within the function's body). displayname the referent's display name, if the referent is a function with a display name. if the referent is not a function, or if it has no display name, this is undefined. if a function has a given name, its display name is the same as its given name. in this case, the di...
...have the value: ["a", ["b", "c"], {d:"d", e:"f"}] script if the referent is a function that is debuggee code, this is that function's script, as a debugger.script instance. if the referent is a function proxy or not debuggee code, this is undefined. environment if the referent is a function that is debuggee code, a debugger.environment instance representing the lexical environment en
closing the function when it was created. if the referent is a function proxy or not debuggee code, this is undefined. proxyhandler if the referent is a proxy whose handler object was allocated by debuggee code, this is its handler object—the object whose methods are invoked to implement accesses of the proxy's properties. if the referent is not a proxy whose handler object was allocated by debug...
CSSStyleSheet.insertRule() - Web APIs
guments: (selector, rules) sheet_proto.insertrule = function(selectorandrule){ // first, separate the selector from the rule a: for (var i=0, len=selectorandrule.length, isescaped=0, newcharcode=0; i !== len; ++i) { newcharcode = selectorandrule.charcodeat(i); if (!isescaped && (newcharcode === 123)) { // 123 = "{".charcodeat(0) // secondly, find the last
closing bracket var openbracketpos = i, closebracketpos = -1; for (; i !== len; ++i) { newcharcode = selectorandrule.charcodeat(i); if (!isescaped && (newcharcode === 125)) { // 125 = "}".charcodeat(0) closebracketpos = i; } isescaped ^= newcharcode===92?1:isescaped; // 92 = "\\".charcodeat(0) } if (cl...
... /*else*/ return originalinsertrule.call( this, // the sheet to be changed selectorandrule.substring(0, openbracketpos), // the selector selectorandrule.substring(closebracketpos), // the rule arguments[3] // the insert index ); } // works by if the char code is a backslash, then isescaped ...
CanvasRenderingContext2D.closePath() - Web APIs
eringcontext2d.closepath() method of the canvas 2d api attempts to add a straight line from the current point to the start of the current sub-path. if the shape has already been closed or has only one point, this function does nothing. this method doesn't draw anything to the canvas directly. you can render the path using the stroke() or fill() methods. syntax void ctx.closepath(); examples
closing a triangle this example creates the first two (diagonal) sides of a triangle using the lineto() method. after that, the triangle's base is created with the closepath() method, which automatically connects the shape's first and last points. html <canvas id="canvas"></canvas> javascript the triangle's corners are at (20, 150), (120, 20), and (220, 150). const canvas = document.getelementbyid...
...gle's corners are at (20, 150), (120, 20), and (220, 150). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(20, 140); // move pen to bottom-left corner ctx.lineto(120, 10); // line to top corner ctx.lineto(220, 140); // line to bottom-right corner ctx.closepath(); // line to bottom-left corner ctx.stroke(); result
closing just one sub-path this example draws a smiley face consisting of three disconnected sub-paths. note: although closepath() is called after all the arcs have been created, only the last arc (sub-path) gets closed. html <canvas id="canvas"></canvas> javascript the first two arcs create the face's eyes. the last arc creates the mouth. const canvas = document.getelementbyid('canvas'); const ...
RTCDataChannel.readyState - Web APIs
hannel() (on the peer which started the connection process). "open" the underlying data transport has been established and data can be transferred bidirectionally across it. this is the default state of a new rtcdatachannel created by the webrtc layer when the remote peer created the channel and delivered to the site or app in a datachannel event of type rtcdatachannelevent. "
closing" the process of
closing the underlying data transport has begun. it is no longer possible to queue new messages to be sent, but previously queued messages may still be send or received before entering the "closed" state. "closed" the underlying data transport has closed, or the attempt to make the connection failed. example var datachannel = peerconnection.createdatachannel...
...on failed. example var datachannel = peerconnection.createdatachannel("file transfer"); var sendqueue = []; function sendmessage(msg) { switch(datachannel.readystate) { case "connecting": console.log("connection not open; queueing: " + msg); sendqueue.push(msg); break; case "open": sendqueue.foreach((msg) => datachannel.send(msg)); break; case "
closing": console.log("attempted to send message while
closing: " + msg); break; case "closed": console.log("error! attempt to send while connection closed."); break; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.readystate' in that specification. candida...
ReadableStream.pipeThrough() - Web APIs
ome transformed state by the readable stream. for example, a textdecoder, has bytes written to it and strings read from it, while a video decoder has encoded bytes written to it and uncompressed video frames read from it. options optional the options that should be used when piping to the writable stream. available options are: preventclose: if this is set to true, the source readablestream
closing will no longer cause the destination writablestream to be closed. the method will return a fulfilled promise once this process completes, unless an error is encountered while
closing the destination in which case it will be rejected with that error. preventabort: if this is set to true, errors in the source readablestream will no longer abort the destination writablestream. the method will retu...
...ith any error that occurs during aborting the destination. preventcancel: if this is set to true, errors in the destination writablestream will no longer cancel the source readablestream. in this case the method will return a promise rejected with the source’s error, or with any error that occurs during canceling the source. in addition, if the destination writable stream starts out closed or
closing, the source readable stream will no longer be canceled. in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller. return value the readable side of the...
ReadableStream.pipeTo() - Web APIs
pipe, preventing other readers from locking it. syntax var promise = readablestream.pipeto(destination[, options]); parameters destination a writablestream that acts as the final destination for the readablestream. options optional the options that should be used when piping to the writable stream. available options are: preventclose: if this is set to true, the source readablestream
closing will no longer cause the destination writablestream to be closed. the method will return a fulfilled promise once this process completes, unless an error is encountered while
closing the destination in which case it will be rejected with that error. preventabort: if this is set to true, errors in the source readablestream will no longer abort the destination writablestream. the method will retu...
...ith any error that occurs during aborting the destination. preventcancel: if this is set to true, errors in the destination writablestream will no longer cancel the source readablestream. in this case the method will return a promise rejected with the source’s error, or with any error that occurs during canceling the source. in addition, if the destination writable stream starts out closed or
closing, the source readable stream will no longer be canceled. in this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller. return value a promise that resolves ...
Using writable streams - Web APIs
defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } so here we create a writer to write the chunks to the stream using writablestream.getwriter(). this creates a writablestreamdefaultwriter instance. we also create a new t...
...ently only has one method available on it — writablestreamdefaultcontroller.error(), which when invoked causes future interactions with the stream to error. this is useful when another part of an app goes wrong, and you want to propagate the error to the stream so that the whole system fails cleanly, rather than risking garbage being silently written to the stream (or something similarly bad).
closing and aborting as mentioned above, we call the close() method when the writing is finished, which triggers the close() method specified inside the writablestream() constructor. we could also abort the stream by calling writablestreamdefaultwriter.abort(). the difference is that when close is called, any previously enqueued chunks are written and finished with before the stream is closed. when a...
A simple RTCDataChannel sample - Web APIs
ating the flow of connecting two peers. we'll cover the mechanics of accomplishing the connection and transmitting and receiving data, but we will save the bits about locating and linking to a remote computer for another example. the html first, let's take a quick look at the html that's needed. there's nothing incredibly complicated here. first, we have a couple of buttons for establishing and
closing the connection: <button id="connectbutton" name="connectbutton" class="buttonleft"> connect </button> <button id="disconnectbutton" name="disconnectbutton" class="buttonright" disabled> disconnect </button> then there's a box which contains the text input box into which the user can type a message to transmit, with a button to send the entered text. this <div> will be the first peer in the ...
...then all the saved references to these objects are set to null to avoid accidental reuse, and the user interface is updated to reflect the fact that the connection has been closed. next steps you should try out this example and take a look at the webrtc-simple-datachannel source code, available on github. ...
WebRTC API - Web APIs
ing source (csrc) including the most recent time a packet that the source contributed was played out. events bufferedamountlow the amount of data currently buffered by the data channel—as indicated by its bufferedamount property—has decreased to be at or below the channel's minimum buffered data size, as specified by bufferedamountlowthreshold. close the data channel has completed the
closing process and is now in the closed state. its underlying data transport is completely closed at this point. you can be notified before
closing completes by watching for the
closing event instead.
closing the rtcdatachannel has transitioned to the
closing state, indicating that it will be closed soon. you can detect the completion of the
closing process by watching for the close event. connection...
...ork and how the various protocols and interfaces can be used together to build powerful communication apps. lifetime of a webrtc session webrtc lets you build peer-to-peer communication of arbitrary data, audio, or video—or any combination thereof—into a browser application. in this article, we'll look at the lifetime of a webrtc session, from establishing the connection all the way through
closing the connection when it's no longer needed. establishing a connection: the perfect negotiation pattern perfect negotiation is a design pattern which is recommended for your signaling process to follow, which provides transparency in negotiation while allowing both sides to be either the offerer or the answerer, without significant coding needed to differentiate the two. signaling and two-way vi...
Window.close() - Web APIs
ly be called on windows that were opened by a script using the window.open() method. if the window was not opened by a script, an error similar to this one appears in the console: scripts may not close windows that were not opened by script. note also that close() has no effect when called on window objects returned by htmliframeelement.contentwindow. syntax window.close(); examples
closing a window opened with window.open() this example shows a method which opens a window and a second one which closes the window; this demonstrates how to use window.close() to close a window opened by calling window.open(). //global var to store a reference to the opened window var openedwindow; function openwindow() { openedwindow = window.open('moreinfo.htm'); } function closeopenedwindow() ...
...pen() this example shows a method which opens a window and a second one which closes the window; this demonstrates how to use window.close() to close a window opened by calling window.open(). //global var to store a reference to the opened window var openedwindow; function openwindow() { openedwindow = window.open('moreinfo.htm'); } function closeopenedwindow() { openedwindow.close(); }
closing the current window in the past, when you called the window object's close() method directly, rather than calling close() on a window instance, the browser closed the frontmost window, whether your script created that window or not. this is no longer the case; for security reasons, scripts are no longer allowed to close windows they didn't open. (firefox 46.0.1: scripts can not close windows, the...
ARIA Test Cases - Accessibility
n/a pass pass zoomtext - - - - orca - - - - menu button dojo nightly build expected at behavior: screen readers should indicate that this button has an associated menu. screen magnifiers should give indication (if this is not done visually anyway). when the button is pressed, the menu should be tracked like any other menu. when
closing the menu, this should be indicated, and focus should be repeated for the menu button the menu was opened from, or the new focus location if the activated menu item results in that. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-pc-mode. buttons are indicated as menu buttons. menus are trac...
...menu, this should be indicated, and focus should be repeated for the menu button the menu was opened from, or the new focus location if the activated menu item results in that. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-pc-mode. buttons are indicated as menu buttons. menus are tracked,
closing menus also results in correct focus tracking. partial fail in v-pc-mode. the fact that a button is a menu button is not indicated with the virtual cursor. menus and focus are properly tracked upon activation. - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a ...
Using CSS gradients - CSS: Cascading Style Sheets
nts unlike linear gradients, you can specify the size of radial gradients. possible values include closest-corner, closest-side, farthest-corner, and farthest-side, with farthest-corner being the default. example: closest-side for ellipses this example uses the closest-side size value, which means the size is set by the distance from the starting point (the center) to the closest side of the en
closing box. <div class="radial-ellipse-side"></div> div { width: 240px; height: 100px; } .radial-ellipse-side { background: radial-gradient(ellipse closest-side, red, yellow 10%, #1e90ff 50%, beige); } example: farthest-corner for ellipses this example is similar to the previous one, except that its size is specified as farthest-corner, which sets the size of the gradient by the d...
... <div class="radial-ellipse-far"></div> div { width: 240px; height: 100px; } .radial-ellipse-far { background: radial-gradient(ellipse farthest-corner at 90% 90%, red, yellow 10%, #1e90ff 50%, beige); } example: closest-side for circles this example uses closest-side, which makes the circle's size to be the distance between the starting point (th...
hanging-punctuation - CSS: Cascading Style Sheets
ng: first together with any one of last, allow-end, or force-end last together with any one of first, allow-end, or force-end three-value syntax uses one of the following: first, allow-end, and last first, force-end, and last values none no character hangs. first an opening bracket or quote at the start of the first formatted line of an element hangs. last a
closing bracket or quote at the end of the last formatted line of an element hangs. force-end a stop or comma at the end of a line hangs. allow-end a stop or comma at the end of a line hangs if it does not otherwise fit prior to justification. formal definition initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ first | [ for...
... element hangs. force-end a stop or comma at the end of a line hangs. allow-end a stop or comma at the end of a line hangs if it does not otherwise fit prior to justification. formal definition initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ first | [ force-end | allow-end ] | last ] examples setting opening and
closing quotes to hang html <p>“lorem ipsum dolor sit amet, consectetur adipiscing elit. curabitur dignissim nunc mauris, et sollicitudin est scelerisque sed. praesent laoreet tortor massa, sit amet vulputate nulla pharetra ut.”</p> css p { hanging-punctuation: first last; margin: .5rem; } result specifications specification status comment css text module leve...
Video player styling basics - Developer guides
its position is also specifically set to relative, which is required for its responsiveness (more on that later). as mentioned earlier, a data-state attribute is now used to indicate whether the video controls are visible or not and these also need to be styled: .controls[data-state=hidden] { dis...
... does the same thing as the altervolume() but it also sets the state of the mute button depending on the video's current volume setting. checkvolume() is also called when the volumechange event is raised: video.addeventlistener('volumechange', function() { checkvolume(); }, false); progress bar a small change also needs to be made to the click handler for the <progress> element. since the en
closing <figure> element now has position:relative set on it, the calculations made by this click handler are incorrect. it now also needs to take into account the offset position of the parent element: progress.addeventlistener('click', function(e) { var pos = (e.pagex - (this.offsetleft + this.offsetparent.offsetleft)) / this.offsetwidth; video.currenttime = pos * video.duration; }); fullscree...
The Unicode Bidirectional Text Algorithm - Developer guides
include info about isolating ranges etc. overiding bidi using unicode control characters unicode provides a number of special control characters that make it possible to control directionality of ranges of text. there are two sets of control characters; one set opens the override, and another restores the original directionality. you must always follow each opening character with an appropriate
closing character. initial unicode bidi algorithm control characters character code point html entity markup equivalent description left-to-right isolate (lri) u+2066 ⁦ dir="ltr" sets the base direction to ltr, isolating the embedded content from the surrounding text right-to-left isolate (lri) u+2067 ⁧ dir="rtl" sets the ...
...isking spillover effects left-to-right override (lro) u+202d ‭ <bdo dir="ltr"> overrides the bidi algorithm, displaying the characters in memory order, from left to right right-to-left override (rlo) u+202e ‮ <bdo dir="rtl"> overrides the bidi algorithm and displays the embedded characters in reverse memory order, from right to left
closing unicode bidi algorithm control characters character code point html entity markup equivalent description pop directional formatting (pdf) u+202c ‬
closing whatever opening tag used the dir attribute used for rle or lre </bdo> used for rlo or lro pop directional isolate (pdi) u+2069 ⁩
closing whatever opening ...
<input type="button"> - HTML: Hypertext Markup Language
tored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: while <input> elements of type button are still perfectly valid html, the newer <button> element is now the favored way to create buttons. given that a <button>’s label text is inserted between the opening and
closing tags, you can include html in the label, even images. value a domstring used as the button's label events click supported common attributes type, and value idl attributes value methods none value an <input type="button"> elements' value attribute contains a domstring that is used as the button's label. <input type="button" va...
...', disablebutton); function disablebutton() { button.disabled = true; button.value = 'disabled'; window.settimeout(function() { button.disabled = false; button.value = 'enabled'; }, 2000); } if the disabled attribute isn't specified, the button inherits its disabled state from its parent element. this makes it possible to enable and disable groups of elements all at once by en
closing them in a container such as a <fieldset> element, and then setting disabled on the container. the example below shows this in action. this is very similar to the previous example, except that the disabled attribute is set on the <fieldset> when the first button is pressed — this causes all three buttons to be disabled until the two second timeout has passed. hidden code 2 <fieldset> <lege...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
ion</li> <li>list of greivances</li> <li>conclusion</li> </ol> the above html will output: using the start attribute <p>finishing places of contestants not in the winners’ circle:</p> <ol start="4"> <li>speedwalk stu</li> <li>saunterin’ sam</li> <li>slowpoke rodriguez</li> </ol> the above html will output: nesting lists <ol> <li>first item</li> <li>second item <!--
closing </li> tag not here! --> <ol> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ol> </li> <!-- here's the
closing </li> tag --> <li>third item</li> </ol> the above html will output: unordered list inside ordered list <ol> <li>first item</li> <li>second item <!--
closing </li> tag not here!
... living standard no change since last w3c snapshot, html5. html5the definition of 'htmlolistelement' in that specification. ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
it is commonly used to offer the same media content in multiple file formats in order to provide compatibility with a broad range of browsers given their differing support for image file formats and media file formats. the source for this interactive example is stored in a github repository. ...
...urce> element is checked at once. when used in the context of a <picture> element, the browser will fall back to using the image specified by the <picture> element's <img> child if it is unable to find a suitable image to use after examing every provided <source>. usage notes the <source> element is an empty element (or void element), which means that it not only has no content but also has no
closing tag. that is, you never use "</source>" in your html. for information about image formats supported by web browsers and guidance on selecting appropriate formats to use, see our image file type and format guide on the web. for details on the video and audio media types, you can use, see the guide to media types formats used on the web. examples video example this example demonstrates how to o...
HTML elements reference - HTML: Hypertext Markup Language
mples of navigation sections are menus, tables of contents, and indexes. <section> the html <section> element represents a standalone section — which doesn't have a more specific semantic element to represent it — contained within an html document. text content use html text content elements to organize blocks or sections of content placed between the opening <body> and
closing </body> tags. important for accessibility and seo, these elements identify the purpose or structure of that content. element description <blockquote> the html <blockquote> element (or html block quotation element) indicates that the enclosed text is an extended quotation. usually, this is rendered visually by indentation (see notes for how to change it). a url...
..., among others. <kbd> the html keyboard input element (<kbd>) represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device. <mark> the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation purposes, due to the marked passage's relevance or importance in the en
closing context. <q> the html <q> element indicates that the enclosed text is a short inline quotation. most modern browsers implement this by surrounding the text in quotation marks. <rb> the html ruby base (<rb>) element is used to delimit the base text component of a <ruby> annotation, i.e. the text that is being annotated. <rp> the html ruby fallback paren...
Functions - JavaScript
se one and be consistent. self.age = 0; setinterval(function growup() { // the callback refers to the `self` variable of which // the value is the expected object. self.age++; }, 1000); } alternatively, a bound function could be created so that the proper this value would be passed to the growup() function. ...
... expected object. self.age++; }, 1000); } alternatively, a bound function could be created so that the proper this value would be passed to the growup() function. an arrow function does not have its own this; the this value of the en
closing execution context is used. thus, in the following code, the this within the function that is passed to setinterval has the same value as this in the en
closing function: function person() { this.age = 0; setinterval(() => { this.age++; // |this| properly refers to the person object }, 1000); } var p = new person(); predefined functions javascript has several top-level, built-in functions: eval() the eval() method evaluates javascript code represented as a string. uneval() the uneval() method creates a string representation of ...
Loops and iteration - JavaScript
ot a reserved word. the statement that you identify with a label may be any statement. example in this example, the label markloop identifies a while loop. markloop: while (themark === true) { dosomething(); } break statement use the break statement to terminate a loop, switch, or in conjunction with a labeled statement. when you use break without a label, it terminates the innermost en
closing while, do-while, for, or switch immediately and transfers control to the following statement. when you use break with a label, it terminates the specified labeled statement. the syntax of the break statement looks like this: break; break [label]; the first form of the syntax terminates the innermost en
closing loop or switch. the second form of the syntax terminates the specified enclosin...
... z = 1; while (true) { console.log('inner loops: ' + z); z += 1; if (z === 10 && x === 10) { break labelcancelloops; } else if (z === 10) { break; } } } continue statement the continue statement can be used to restart a while, do-while, for, or label statement. when you use continue without a label, it terminates the current iteration of the innermost en
closing while, do-while, or for statement and continues execution of the loop with the next iteration. in contrast to the break statement, continue does not terminate the execution of the loop entirely. in a while loop, it jumps back to the condition. in a for loop, it jumps to the increment-expression. when you use continue with a label, it applies to the looping statement identified with that label. ...
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
directive is not allowed at the top of such functions per the ecmascript specification. ...
...m([a, b]) { // syntaxerror: "use strict" not allowed in function with destructuring parameter 'use strict'; return a + b; }; this can be converted to the following expression: var sum = (function() { 'use strict'; return function sum([a, b]) { return a + b; }; })(); arrow function if an arrow function needs to access the this variable, you can use the arrow function as the en
closing function: var callback = (...args) => { // syntaxerror: "use strict" not allowed in function with rest parameter 'use strict'; return this.run(args); }; this can be converted to the following expression: var callback = (() => { 'use strict'; return (...args) => { return this.run(args); }; })(); ...
try...catch - JavaScript
l is immediately shifted to the catch-block. if no exception is thrown in the try-block, the catch-block is skipped. the finally-block will always execute after the try-block and catch-block(s) have finished executing. it always executes, regardless of whether an exception was thrown or caught. you can nest one or more try statements. if an inner try statement does not have a catch-block, the en
closing try statement's catch-block is used instead. you can also use the try statement to handle javascript exceptions. see the javascript guide for more information on javascript exceptions. unconditional catch-block when a catch-block is used, the catch-block is executed when any exception is thrown from within the try-block. for example, when the exception occurs in the following code, control tra...
...oops" // "finally" and now, let's rethrow the error. try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); throw ex; } finally { console.log('finally'); } } catch (ex) { console.error('outer', ex.message); } // output: // "inner" "oops" // "finally" // "outer" "oops" any given exception will be caught only once by the nearest en
closing catch-block unless it is rethrown. of course, any new exceptions raised in the "inner" block (because the code in catch-block may do something that throws), will be caught by the "outer" block. returning from a finally-block if the finally-block returns a value, this value becomes the return value of the entire try-catch-finally statement, regardless of any return statements in the try and catc...
MathML attribute reference - MathML
altimg-width altimg-height altimg-valign alttext <math> visual and textual fall-back options. bevelled <mfrac> specifies the style how the fraction should be displayed. deprecated. use u+2044 (fraction slash) instead. unimplemented charalign <mstack> specifies the horizontal alignment of digits. close <mfenced> a string for the
closing delimiter. columnalign <mtable>, <mtd>, <mtr>, <mlabeledtr> specifies the horizontal alignment of table cells. columnlines <mtable> specifies table column borders. columnspacing <mtable> specifies the space between table columns. columnspan <mtd> a non-negative integer value that indicates over how many table columns the cell extends. ...
... specifies the vertical alignment of table cells. rowlines <mtable> specifies table row borders. rowspacing <mtable> specifies the space between table rows. rowspan <mtd> a non-negative integer value that indicates on how many rows does the cell extend. rspace <mo> the amount of space after the operator. rquote <ms> the
closing quote mark (depends on dir) to enclose the content. the default value is """. scriptlevel <mstyle> controls mostly the font-size. the higher the scriptlevel, the smaller the font size. scriptminsize <mstyle> specifies a minimum font size allowed due to changes in scriptlevel. scriptsizemultiplier <mstyle> specifies the multiplier to be used to adj...
<mfenced> - MathML
the default value is ")" and any white space is trimmed. href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. ...
...the default value is ")" and any white space is trimmed. href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. ...
MathML documentation index - MathML
-level element in mathml is <math>. every valid mathml instance must be wrapped in <math> tags. in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it. 12 <menclose> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <menclose> element renders its content inside an en
closing notation specified by the notation attribute. 13 <merror> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <merror> element is used to display contents as error messages. in firefox this error message is rendered similar to the typical xml error message. note that this error is not thrown when your mathml markup is wrong or not well-formed x...
...own when your mathml markup is wrong or not well-formed xml. you will still get an xml parsing error (in case of the xhtml notation of mathml), which has nothing to do with <merror>. 14 <mfenced> deprecated, mathml, mathml reference, mathml:element, mathml:general layout schemata the deprecated mathml <mfenced> element used to provide the possibility to add custom opening and
closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. it has been removed from the latest mathml standard and modern browsers no longer support it. 15 <mfrac> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mfrac> element is used to display fractions. 16 <mglyph> mathml, mathml refere...
tabs - Archive of obsolete content
b properties, several methods for manipulation, as well as per-tab event registration. tabs emit all the events described in the events section. listeners are passed the tab object that triggered the event. methods pin() pins this tab as an app tab. unpin() unpins this tab. close(callback) closes this tab. parameters callback : function a function to be called when the tab finishes its
closing process. this is an optional argument. reload() reloads this tab. activate() makes this tab active, which will bring this tab to the foreground. getthumbnail() returns thumbnail data uri of the page currently loaded in this tab. attach(options) attach one or more scripts to the document loaded in the tab. note that by attaching inside ready event, this becomes tab-centric: if the user nav...
windows - Archive of obsolete content
t window of windows) { console.log(window.title); } // close the active window windows.activewindow.close(function() { console.log("the active window was closed"); }); methods activate() makes window active, which will focus that window and bring it to the foreground. close(callback) close the window. parameters callback : function a function to be called when the window finishes its
closing process. this is an optional argument. properties title the current title of the window. usually the title of the active tab, plus an app identifier. this property is read-only. tabs a live list of tabs in this window. this object has the same interface as the tabs api, except it contains only the tabs in this window, not all tabs in all windows. this property is read-only. ...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
oping extensions efficiently, you want to minimize the number of steps between revising a source file and running an operations check on it. for each type of source file, there’s a different procedure to follow. the following all assumes that you’ve disabled the xul cache as discussed in the section “setting up your development environment”. xul that opens new windows confirm changes by
closing and reopening window. if the xul is displaying as a sidebar, reopen the sidebar. likewise with any javascript, dtds, or style sheets referenced by the xul. xul overlaying other windows you need to force the overlay-target xul to reload. if it’s the browser window that’s the target, you can simply open a new browser window to confirm the changes. properties file if you make changes to a pr...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
examples of xml-based markup languages include xhtml, which is html redefined on an xml base; svg, for expressing vector images; and mathml, for expressing mathematical formulas. xul, which is used in firefox, is also based on xml. listing 1: xml syntax <elementname someattribute="somevalue"> content </elementname> as shown in listing 1, xml uses elements, which consist of an opening tag, a
closing tag, and content. note: elements that take no content can be expressed in compact form as <elementname/>. an element can include other elements as well as text in its content, and all information is structured as a tree. as in all trees, elements can have children (elements contained within them) and parents (elements that contain them). attributes can also be added to opening tags, each with a...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
erfaces.nsiwindowmediator); var browser = windowmediator.getmostrecentwindow('navigator:browser'); alert(browser.gbrowser.mtabs.length); get overview of all windows with a certain type use the nsiwindowmediator.getenumerator() method to get an overview of all windows that have a certain type. listing 5 shows how to get a summary of all browser windows in firefox and then close them. listing 5:
closing all browser windows var browsers = windowmediator.getenumerator('navigator:browser'); var browser; while (browsers.hasmoreelements()) { browser = browsers.getnext().queryinterface(components.interfaces.nsidomwindowinternal); browser.browsertrytoclosewindow(); } this method returns an overview of the specified window type in the form of an iterator pattern object called nsisimpleenumerator. ...
JavaScript Object Management - Archive of obsolete content
initializes this object. */ init : function(aevent) { this._stringbundle = document.getelementbyid("xulschoolhello-string-bundle"); // you can make changes to the window dom here. } // more stuff }; window.addeventlistener( "load", function() { 〈namespace〉.browseroverlay.init(); }, false); there are some things you can't (or shouldn't) do inside load handlers, such as
closing the window being loaded, or opening new windows, alerts or dialogs. the window has to finish loading before it can do any of these things. they are bad ui practices anyway and you should avoid them. if you really need to do something like this anyway, one way to do it is to have a timeout execute the code after a delay: init : function(aevent) { let that = this; this._stringbundle = docum...
Setting Up a Development Environment - Archive of obsolete content
ipt has some guidelines you should follow to avoid them. one of the most common errors developers make is to register a js event listener or observer, and never removing it. the simple practice of always including removal code for everything you add makes a big difference. to make sure your extension doesn't leak, you should use the leak monitor extension when testing it. always test opening and
closing windows. leaks usually surface when doing this. exercise set up a new firefox profile for xul school. make sure you can open and close your xul school firefox without having to close the instance of firefox you use to browse normally. make any modifications you want to the xul school project, run make install and restart firefox to see the extension work with your changes. install dom inspec...
The Essentials of an Extension - Archive of obsolete content
or add-on ids. one is the email-like format in the hello world example, which should be something like <project-name>@<yourdomain>. the other standard practice is to use a generated uuid string, which is extremely unlikely to be duplicated. unix-based systems have a command line tool called uuidgen that generates uuids. there are also downloadable tools for all platforms that generate them. the en
closing brackets are just notation, and they're just common practice. as long as your id has some uniqueness to it, it's ok to use either form. <em:name>xul school hello world</em:name> <em:description>welcome to xul school!</em:description> <em:version>0.1</em:version> <em:creator>appcoast</em:creator> <em:homepageurl>https://developer.mozilla.org/docs/xul_school</em:homepageurl> this is the data ...
Setting up an extension development environment - Archive of obsolete content
eate a unique id using the format "name@yourdomain" (for example chromebug@mydomain.com) - then the proxy filename will be same as that id, with no curly brackets {}. the contents of this file should be the path to the directory that contains your install.rdf file, for example /full/path/to/yourextension/ on mac and linux, and c:\full\path\to\yourextension\ on windows. remember to include the
closing slash and remove any trailing whitespace. note: if you already installed the extension via xpi, you should uninstall it first before creating the pointer file. also note that the use of proxy files requires that the extension's chrome.manifest defines its chrome urls using traditional directories, rather than a jared structure. see below. place the file in the extensions folder of...
Tabbed browser - Archive of obsolete content
var newtab = tabbrowser.addtab(url); newtab.setattribute(attrname, "xyz"); // focus tab tabbrowser.selectedtab = newtab; // focus *this* browser window in case another one is currently focused tabbrowser.ownerdocument.defaultview.focus(); } } the function can be called like so: openandreuseonetabperattribute("myextension-myattribute", "http://developer.mozilla.org/").
closing a tab this example closes the currently selected tab. gbrowser.removecurrenttab(); there is also a more generic removetab method, which accepts a xul tab element as its single parameter. changing active tab this moves one tab forward (to the right). gbrowser.tabcontainer.advanceselectedtab(1, true); this moves one tab to the left. gbrowser.tabcontainer.advanceselectedtab(-1, true); de...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
xhtml conversion, but our ad units and some other third-party content prevent us from doing so. our engineers also faced a huge archive of content that wasn't entered into our cms with xhtml in mind. it's true that our stories exist in a database, separated from page templates and peripheral formatting. but writers, editors, and producers have been inserting stories into vignette for years sans
closing paragraph (</p>) tags. unquoted attributes and uppercase html tags? we've got them in spades, and they're embedded in all past stories of the database. fortunately, our chief engineer was able to write some code that scraped through the database looking for errors like this which would invalidate our markup. we don't make any claims about past archived content, but we've taken many efforts to mak...
MMgc - Archive of obsolete content
stroyed. gcfinalizedobject base class: gcobject a garbage collected object with finalization support. all of the rules from gcobject above apply to gcfinalizedobject. the finalizer (c++ destructor) of a gcfinalizedobject will be invoked when mmgc collects the object. class myfinalizedobject : public mmgc::gcfinalizedobject { public: ~myfinalizedobject() { // do finalization behavior, like
closing network connections, // freeing unmanaged memory owned by this object, etc. } }; rcobject base class: gcfinalizedobject this is a reference-counted, garbage collected object. rcobject is used instead of gcobject when more immediate reclamation of memory is desired. for instance, the avmplus::string class in avm+ is a rcobject. strings are created very frequently, and are often temporary ob...
Locked config settings - Archive of obsolete content
e getting the moz-byteshift.pl script to work locally, there is also an online version available. note: in recent versions of mozilla (tested on windows and linux, with 1.5, 1.6 and 1.7b), the mozilla.cfg file needs to be placed in mozilla's root directory, rather than default\pref where all.js resides. if you suspect syntax errors in your config file, you can display the exact error message by en
closing your code in a try-catch block: try { ... } catch(e) { displayerror("test", e); } clear text configuration if you don't care about encoding the mozilla.cfg file, append this config to all.js instead : pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg"); ...
Code Samples - Archive of obsolete content
const uri = "chrome://chatzilla/content/" calendar const name = "calendarmainwindow" const uri = "chrome://calendar/content/" * at the time of writing, sunbird's passwords window is broken close the current window to close the window containing the button, possibly leaving other windows open: close() exit the application to exit the application, first
closing all its windows: components .classes['@mozilla.org/toolkit/app-startup;1'] .getservice(components.interfaces.nsiappstartup) .quit(components.interfaces.nsiappstartup.eattemptquit) ...
Adding HTML Elements - Archive of obsolete content
would you like to save the following documents? <html:hr/> </html:div> expense report 1 what i did last summer <button id="yes" label="yes"/> <button id="no" label="no"/> as can be seen in the image, the text inside the div tag was displayed but the other text (expense report 1 and what i did last summer) was not. this is because there is no html or xul element capable of displaying text en
closing it. to have this text appear, you would need to put it inside the div tag, or enclose the text in a description tag. note: due to bug 554290, this text actually does render in gecko 1.9.2 and later. invalid html elements <html:po>case 1</html:po> <div>case 2</div> <html:description value="case 3"/> all three of the cases above will not display, each for a different reason. case 1 po i...
Cross Package Overlays - Archive of obsolete content
box</code>" in firefox 3 beta 3. you can support both firefox 2 and earlier and firefox 3 by duplicating the <code><span class="plain">' .. <toolbox> .. '</span></code> section with that id. to add this overlay to the manifest file, we need to add two resources. first, we add one for each window that we are applying an overlay to. the code below should be added into contents.rdf just before the
closing rdf tag. <rdf:seq about="urn:mozilla:overlays"> <rdf:li resource="chrome://navigator/content/navigator.xul"/> </rdf:seq> this declares that we are adding a overlay window, a child of the root overlay node (urn:mozilla:overlays). you can add additional nodes for any other windows that you want to apply overlays to by adding additional li nodes. next, we add a node for each overlay to appl...
XULBrowserWindow - Archive of obsolete content
in order to do so it implements the following interfaces: nsisupports nsixulbrowserwindow nsiwebprogresslistener nsiwebprogresslistener2 nsisupportsweakreference note: this page is not complete at this time. see the linked interfaces for the definition of the implemented methods. you may also wish to refer to the implementation of xulbrowserwindow in browser/base/content/browser.js. ...
XML - Archive of obsolete content
lid. all strings must be double quoted. all of the values for all of the attributes declared in xul are strings. when an attribute is assigned a value (e.g., flex="1" or "onload='dointerestingstartupthing()'") that value must be double-quoted. every xul widget must use close tags to be well-formed. html allows some elements, such as <br> and <hr>, to be neither closed nor matched with a
closing element. in xul, elements must either be of the form <tag></tag> or <tag/> to be valid. for example, <html:img src="box.gif" /> is valid, but <html:img src="box.gif"> is not. all attributes must have a value. xul is made out of xml you don't need to know all about xml in order to use xul, but you may want to read through this article to get a sense of xul's pedigree as a specialized markup ...
menu - Archive of obsolete content
as visible to the user, are read and set using the menulist.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. control type: menu element returns the en
closing menu that the item is inside, if any, or null if there is no en
closing menu. itemcount type: integer read only property holding the number of child items. menupopup type: menupopup element a reference to the menupopup used by the menu or menulist. this property is read-only. open type: boolean this property will be set to true when the menu is open. the men...
menuitem - Archive of obsolete content
ntents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. accesskey type: character gets and sets the value of the accesskey attribute. command type: element id gets and sets the value of the command attribute. control type: menu element returns the en
closing menu that the item is inside, if any, or null if there is no en
closing menu. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image url gets and sets the value of the image attribute. label type: string g...
menuseparator - Archive of obsolete content
ts displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. accesskey type: character gets and sets the value of the accesskey attribute. command type: element id gets and sets the value of the command attribute. control type: menu element returns the en
closing menu that the item is inside, if any, or null if there is no en
closing menu. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image url gets and sets the value of the image attribute. label type: string ...
radio - Archive of obsolete content
alue", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indicating the type of accessibility object for the element. control type: radiogroup element returns the en
closing radiogroup that the radio element is contained within, which may or may not be its direct parent. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image url gets and sets the value of the image attribute. label ...
tab - Archive of obsolete content
om the cache if possible. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integer a value indicating the type of accessibility object for the element. command type: element id gets and sets the value of the command attribute. control type: tabs element returns the en
closing tabs element. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. linked...
tabs - Archive of obsolete content
advanceselectedtab, appenditem, getindexofitem, getitematindex, insertitemat, removeitemat examples (example needed) attributes closebutton obsolete since gecko 1.9.2 type: boolean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends. this feature is used by the tabbrowser to provide the facilities for adding and
closing tabs. you can set an image to the "new tab" and "close" buttons by applying them to the tabs-newbutton and tabs-closebutton classes respectively. disableclose type: boolean if this attribute is true the close button will be disabled. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are u...
2006-11-17 - Archive of obsolete content
bug or was intented. firefox 2.0 javascript popup issue user seeks advice about a line of javascript code that worked in firefox 1.5.0.x, but not in firefox 2.0 balloon help user inquires if anyone can explain how to disable the balloon help in firefox 2.0. two questions: (1) launching a separate intance of firefox.exe, and (2) programmatically
closing a window user has two questions about using adobe flex builder debugger in firefox 2.0. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
Extentsions FAQ - Archive of obsolete content
need to marshalinvokations to a particular thread? if so, how? are there any fundamental rules related to threading in xpcom, and if so, where are these defined? dom can only be accessed from the main thread. also, check out this site to learn how to set up a proxy: http://www.mozilla.org/projects/xpcom/proxies.html how to test a tab has been closed or not? you can capture the even of tab
closing. you can get the tab that is being closed. this should be enough for you. is it possible to fix the size exactly at 16x16 pixels avoiding any resize? simply position the image and it will no longer be stretched to the size of the stack. <image left="0" top="0"> would seem to suffice. could there be more than two images to reflect more than two states?does the rules in the css file have to ...
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.l10n - november 24, 2006 announcements thunderbird 2 release schedule for localizations beta 1 freeze for thunderbird 2 is scheduled on december 4th (en-us only). beta 2 freeze around january 4th. final release date in in early 2007. approval queue for fx 2.0.0.1
closing closing the approval queue for firefox 2.0.0.1 discussions quality of localized builds and process requirements quality of localized builds and process requirements the translate toolkit mdnto po: its current state and how to use it discussion on clarifications on translate toolkit to avoid confusion. feedback on l10n:ownership draft feedback on the l10n:ownership draft at mozilla wiki site detailed here. summary vs. live titles there seems to be a few locales that use "summa...
NPN_GetURLNotify - Archive of obsolete content
her a request with a null target failed, or that a request with a non-null target completed. for requests that complete unsuccessfully, the browser calls npp_urlnotify() as soon as possible. for requests that complete successfully: if the target is non-null, the browser calls npp_urlnotify() after it has finished loading the url. if the target is null, the browser calls npp_urlnotify() after
closing the stream by calling npn_destroystream(). if this function is called with a target parameter value of _self or a parent to _self, this function should return nperr_invalid_param. this is the only way to notify the plug-in once it is deleted. warning: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), npn_geturlnotify() does not notify the plug-in if notifydata is null. see bug 63836...
Building a Theme - Archive of obsolete content
cate your profile folder and beneath it the profile you want to work with (e.g. firefox/profiles/<profile_id>.default/). open the extensions/ folder, creating it if need be. create a new text file and put the full path to your development folder inside (e.g. c:\themes\my_theme\ or ~/themes/my_theme/). windows users should retain the os' slash direction, and everyone should remember to include a
closing slash and remove any trailing spaces. save the file with the id of your theme as its name (e.g. sample@example.net). no file extension. now you should be ready to test your theme! start firefox. firefox will detect the text link to your theme directory and install the theme. your theme will not be active the first time you install, and you will need to click "enable" and restart before you ca...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
r, so the os is oblivious of what is going on and the overlapped io request is still in progress. the os still has a pointer to the overlapped buffer in the thread's <tt>prthread</tt> structure. if the thread subsequently exists and its <tt>prthread</tt> structure gets deleted, the pointer to the overlapped buffer will be pointing to freed memory. this is problematic. canceling overlapped io by
closing the file descriptor therefore, we need to cancel the outstanding overlapped io request before the thread exits. nt's <tt>cancelio()</tt> function would be ideal for this purpose. unfortunately, <tt>cancelio()</tt> is not available on nt 3.51. so we can't go this route as long as we are supporting nt 3.51. the only reliable way to cancel outstanding overlapped io request that works on both nt 3.5...
Processing XML with E4X - Archive of obsolete content
ubstitution, quotation marks are escaped as " while apostrophes are handled normally. var b = 'he said "don\'t go there."'; var el = <foo a={b}/>; alert(el.toxmlstring()); // gives: <foo a="he said "don't go there.""/> less than and ampersand signs are escaped into their entity equivalents. since a greater than sign is not escaped, it is possible to get an xml error if the cdata
closing sequence (]]>) is included. it is not possible to directly interpolate variables amidst other literal (or variable) attribute content, however (e.g., bar="a{var1}{var2}"). one must instead either calculate the variable with a javascript expression (e.g., bar={'a'+var1+var2}), define a new variable before the element literal which includes the full interpolation and then include that variable or ...
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
ation. - xmlguru) inline style and script containing double dashes another problem with using comments to surround javascript in xhtml is related to the problems which can occur if comments contain double dashes (——). <script type="text/javascript"> <!-- var i; var sum = 0; for (i = 10; i > 0; --i) { sum += i; } // --> </script> using cdata instead of comments properly en
closing script contents inside of cdata sections can cause problems in downlevel browsers which do not understand xml. however, it is possible to combine javascript comments with cdata sections to allow for backward compatibility. <script type="text/javascript"> //<![cdata[ var i = 0; while (++i < 10) { // ... } //]]> </script> examples using css rules in inline style within comments ...
Writing JavaScript for XHTML - Archive of obsolete content
//<!-- window.alert("hello world!"); //--> </script> solution: the cdata trick this problem usually arises, when inline scripts are included in comments. this was common practice in html, to hide the scripts from browsers not capable of js. in the age of xml comments are what they were intended: comments. before processing the file, all comments will be stripped from the document, so en
closing your script in them is like throwing your lunch in a piranha pool. moreover, there's really no point to commenting out your scripts -- no browser written in the last ten years will display your code on the page. the easy solution is to do away with the commenting entirely: <script type="text/javascript"> window.alert("hello world!"); </script> this will work so long as your code doesn't c...
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
} in situations where the only instances of the class value nav are applied to hyperlinks, this will work fine. however, rules of this type are usually seen in conjunction with markup like this: <td class="nav"> <a href="one.html" class="nav">one</a> | <a href="two.html" class="nav">two</a> | <a href="thr.html" class="nav">three</a> | <a href="fou.html" class="nav">four</a> </td> because the en
closing table cell has a class of nav, the vertical-bar characters will turn red when the user moves the mouse pointer anywhere within the table cell. the links will also turn red when they are hovered. gecko behavior in browsers based on netscape gecko builds later than 20020410 (netscape 6.1+), :hover styles can be applied to any element in a document. thus authors who have used bare pseudo-classes, ...
Building up a basic demo with A-Frame - Game development
e screen, to allow you to shift to full screen, stereoscopic image viewing if you have the necesary vr hardware set up and ready. specifying a camera a camera entity can be created by adding an <a-camera> element to the scene. we can set the position of the camera explicitly and move it back a little bit from the center of the scene, so we'll be able to see the shapes. ...
Building up a basic demo with Babylon.js - Game development
ne by adding the following lines just below our previous code: var scene = new babylon.scene(engine); scene.clearcolor = new babylon.color3(0.8, 0.8, 0.8); thus, the scene is created and the second line sets the background color to light gray. creating a rendering loop to make the scene actually visible we have to render it. add these lines at the end of the <script> element, just before the
closing </script>. var renderloop = function () { scene.render(); }; engine.runrenderloop(renderloop); we're using the engine's runrenderloop() method to execute the renderloop() function repeatedly on every frame — the loop will continue to render indefinitely until told to stop. creating a camera now the setup code is in place we need to think about implementing the standard scene components...
Unconventional controls - Game development
ples you can look at. to get the leap motion working on your computer you have to first install it by following the steps at leapmotion.com/setup. when everything is installed and the controller is connected to your computer we can proceed with implementing support in our little demo. first, we add a <script> tag with the url pointing at this file, and add <div id="output"></div> just before the
closing </body> tag for outputting diagnostic information. we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for holding the horizontal and vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and one for the state of our hand's grab status. we next add these lines after all th...
Bounce off the walls - Game development
we have the top and bottom edge covered, so let's think about the left and right ones. it is very similar actually, all you have to do is to repeat the statements for x instead of y: if(x + dx > canvas.width || x + dx < 0) { dx = -dx; } if(y + dy > canvas.height || y + dy < 0) { dy = -dy; } at this point you should insert the above code block into the draw() function, just before the
closing curly brace. the ball keeps disappearing into the wall! test your code at this point, and you will be impressed — now we have a ball that bounced off all four edges of the canvas! we have another problem however — when the ball hits each wall it sinks into it slightly before changing direction: this is because we're calculating the collision point of the wall and the center of the ball, ...
Create the Canvas and draw on it - Game development
er. the body contains <canvas> and <script> elements — we will render the game inside the first one and write the javascript code that controls it in the second one. the <canvas> element has an id of mycanvas to allow us to easily grab a reference to it, and it is 480 pixels wide and 320 pixels high. all the javascript code we will write in this tutorial will go between the opening <script> and
closing </script> tags. canvas basics to actually be able to render graphics on the <canvas> element, first we have to grab a reference to it in javascript. add the following below your opening <script> tag. var canvas = document.getelementbyid("mycanvas"); var ctx = canvas.getcontext("2d"); here we're storing a reference to the <canvas> element to the canvas variable. then we're creating the ctx var...
Finishing up - Game development
eing rendered. requestanimationframe helps the browser render the game better than the fixed framerate we currently have implemented using setinterval(). replace the following line: var interval = setinterval(draw, 10); with simply: draw(); and remove each instance of: clearinterval(interval); // needed for chrome to end game then, at the very bottom of the draw() function (just before the
closing curly brace), add in the following line, which causes the draw() function to call itself over and over again: requestanimationframe(draw); the draw() function is now getting executed again and again within a requestanimationframe() loop, but instead of the fixed 10 milliseconds frame rate, we are giving control of the framerate back to the browser. it will sync the framerate accordingly and ren...
Paddle and keyboard controls - Game development
paddlex = canvas.width - paddlewidth; } } else if(leftpressed) { paddlex -= 7; if (paddlex < 0){ paddlex = 0; } } the paddlex position we're using will move between 0 on the left side of the canvas and canvas.width-paddlewidth on the right hand side, which will work exactly as we want it to. add the above code block into the draw() function at the bottom, just above the
closing curly brace. the only thing left to do now is call the drawpaddle() function from within the draw() function, to actually print it on the screen. add the following line inside your draw() function, just below the line that calls drawball(): drawpaddle(); compare your code here's the working code for you to compare yours against: exercise: make the paddle move faster or slower, or change ...
Animations and tweens - Game development
own below: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.input.x || game.world.width*0.5; } then we can create the ballhitpaddle() function (having ball and paddle as default parameters), playing the wobble animation when it is called. add the following function just before your
closing </script> tag: function ballhitpaddle(ball, paddle) { ball.animations.play('wobble'); } the animation is played every time the ball hits the paddle. you can add the animations.play() call inside the ballhitbrick() function too, if you feel it would make the game look better. tweens whereas animations play external sprites sequentially, tweens smoothly animate properties of an object in t...
Build the brick field - Game development
ve it in your /img directory. drawing the bricks we will place all the code for drawing the bricks inside an initbricks function to keep it separated from the rest of the code. add a call to initbricks at the end of the create() function: function create(){ // ... initbricks(); } now onto the function itself. add the initbricks() function at the end of our games code, just before the
closing </script> tag, as shown below. to begin with we've included the brickinfo object, as this will come in handy very soon: function initbricks() { brickinfo = { width: 50, height: 20, count: { row: 3, col: 7 }, offset: { top: 50, left: 60 }, padding: 10 }; } this brickinfo object will ...
Collision detection - Game development
de.collide(ball, paddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.input.x || game.world.width*0.5; } the ball's position is calculated against the positions of all the bricks in the group. the third, optional parameter is the function executed when a collision occurs — ballhitbrick(). create this new function as the bottom of your code, just before the
closing </script> tag, as follows: function ballhitbrick(ball, brick) { brick.kill(); } and that's it! reload your code and you should see the new collision detection working just as required. thanks to phaser there are two parameters passed to the function — the first one is the ball, which we explicitly defined in the collide method, and the second one is the single brick from the bricks grou...
Element - MDN Web Docs Glossary: Definitions of Web-related terms
an element is a part of a webpage. in xml and html, an element may contain a data item or a chunk of text or an image, or perhaps nothing. a typical element includes an opening tag with some attributes, enclosed text content, and a
closing tag. elements and tags are not the same things. tags begin or end an element in source code, whereas elements are part of the dom, the document model for displaying the page in the browser. ...
Empty element - MDN Web Docs Glossary: Definitions of Web-related terms
an empty element is an element from html, svg, or mathml that cannot have any child nodes (i.e., nested elements or text nodes). the html, svg, and mathml specifications define very precisely what each element can contain. many combinations have no semantic meaning, for example an <audio> element nested inside an <hr> element. in html, using a
closing tag on an empty element is usually invalid. for example, <input type="text"></input> is invalid html. the empty elements in html are as follows: <area> <base> <br> <col> <embed> <hr> <img> <input> <keygen>(html 5.2 draft removed) <link> <meta> <param> <source> <track> <wbr> ...
HTML - MDN Web Docs Glossary: Definitions of Web-related terms
at that time, the w3c nearly abandoned html in favor of xhtml, prompting the founding of an independent group called whatwg in 2004. thanks to whatwg, work on html5 continued: the two organizations released the first draft in 2008 and the final standard in 2014. concept and syntax an html document is a plaintext document structured with elements. elements are surrounded by matching opening and
closing tags. each tag begins and ends with angle brackets (<>). there are a few empty or void tags that cannot enclose any text, for instance <img>. you can extend html tags with attributes, which provide additional information affecting how the browser interprets the element: an html file is normally saved with an .htm or .html extension, served by a web server, and can be rendered by any web brows...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
or wifi, based on the time between the browser requesting a page and effective type of the connection. 127 element codingscripting, glossary, html an element is a part of a webpage. in xml and html, an element may contain a data item or a chunk of text or an image, or perhaps nothing. a typical element includes an opening tag with some attributes, enclosed text content, and a
closing tag. 128 empty element codingscripting, glossary, intermediate an empty element is an element from html, svg, or mathml that cannot have any child nodes (i.e., nested elements or text nodes). 129 encapsulation codingscripting, glossary encapsulation is the packing of data and functions into one component (for example, a class) and then controlling access ...
Syntax error - MDN Web Docs Glossary: Definitions of Web-related terms
an exception caused by the incorrect use of a pre-defined syntax. syntax errors are detected while compiling or parsing source code. for example, if you leave off a
closing brace (}) when defining a javascript function, you trigger a syntax error. browser development tools display javascript and css syntax errors in the console. learn more general knowledge syntax error on wikipedia syntaxerror javascript object ...
Attribute selectors - Learn web development
ue which starts with a, so matches the first two list items. li[class$="a"] matches any attribute value that ends with a, so matches the first and third list item. li[class*="a"] matches 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 ...
What are browser developer tools? - Learn web development
erty to show the property's longhand equivalents. click a property name or value to bring up a text box, where you can key in a new value to get a live preview of a style change. next to each rule is the file name and line number the rule is defined in. clicking that rule causes the dev tools to jump to show it in its own view, where it can generally be edited and saved. you can also click the
closing curly brace of any rule to bring up a text box on a new line, where you can write a completely new declaration for your page. you'll notice a number of clickable tabs at the top of the css viewer: computed: this shows the computed styles for the currently selected element (the final, normalized values that the browser applies). layout: in firefox, this area includes two sections: box ...
Basic native form controls - Learn web development
s a reset button"> anonymous <button type="button"> this is an <strong>anonymous button</strong> </button> <input type="button" value="this is an anonymous button"> buttons always behave the same whether you use a <button> element or an <input> element. as you can see from the examples, however, <button> elements let you use html in their content, which is inserted between the opening and
closing <button> tags. <input> elements on the other hand are empty elements; their displayed content is inserted inside the value attribute, and therefore only accepts plain text as content. the following examples show default, focused, and disabled button input types — in firefox 71 and safari 13 on macos and chrome 79 and edge 18 on windows 10. image button the image button control is rendered ...
Other form controls - Learn web development
multi-line text field is specified using a <textarea> element, rather than using the <input> element. <textarea cols="30" rows="8"></textarea> this renders like so: the main difference between a <textarea> and a regular single line text field is that users are allowed to include hard line breaks (i.e. pressing return) that will be included when the data is submitted. <textarea> also takes a
closing tag, and any default text you want it to contain should be put between the opening and
closing tags. in contrast, the <input> is an empty element with no
closing tag — any default value is put inside the value attribute. note that even though you can put anything inside a <textarea> element (including other html elements, css, and javascript), because of its nature, it is all rendered as if it...
JavaScript basics - Learn web development
he standard for introductory programming examples.) important: if you haven't been following along with the rest of our course, download this example code and use it as a starting point. go to your test site and create a new folder named scripts. within the scripts folder, create a new file called main.js, and save it. in your index.html file, enter this code on a new line, just before the
closing </body> tag: <script src="scripts/main.js"></script> this is doing the same job as the <link> element for css. it applies the javascript to the page, so it can have an effect on the html (along with the css, and anything else on the page). add this code to the main.js file: const myheading = document.queryselector('h1'); myheading.textcontent = 'hello world!'; make sure the html and ja...
Define terms with HTML - Learn web development
ociate a term more formally with its definition: <p> <span id="ff"> <dfn aria-describedby="ff">firefox</dfn> is the web browser created by the mozilla foundation. </span> you can download it at <a href="http://www.mozilla.org">mozilla.org</a> </p> assistive technology can often use this attribute to find a text alternative to a given term. you can use aria-describedby on any tag en
closing a keyword to be defined (not just the <dfn> element). aria-describedby references the id of the element containing the description. how to build a description list description lists are just what they claim to be: a list of terms and their matching descriptions (e.g., definition lists, dictionary entries, faqs, and key-value pairs). description lists are not suitable for marking up dialogue, ...
What’s in the head? Metadata in HTML - Learn web development
t trying to access an html element that doesn't exist on the page yet. there are actually a number of ways to handle loading javascript on your page, but this is the most foolproof one to use for modern browsers (for others, read script loading strategies). <script src="my-js-file.js" defer></script> note: the <script> element may look like an empty element, but it's not, and so needs a
closing tag. instead of pointing to an external script file, you can also choose to put your script inside the <script> element. active learning: applying css and javascript to a page to start this active learning, grab a copy of our meta-example.html, script.js and style.css files, and save them on your local computer in the same directory. make sure they are saved with the correct names and f...
Images in HTML - Learn web development
ty with html fundamentals (as covered in getting started with html.) objective: to learn how to embed simple images in html, annotate them with captions, and how html images relate to css background images. how do we put an image on a webpage? in order to put a simple image on a webpage, we use the <img> element. this is an empty element (meaning that it has no text content or
closing tag) that requires a minimum of one attribute to be useful — src (sometimes spoken as its full title, source). the src attribute contains a path pointing to the image you want to embed in the page, which can be a relative or absolute url, in the same way as href attribute values in <a> elements. note: you should read a quick primer on urls and paths to refresh your memory on relative and abso...
From object to iframe — other embedding technologies - Learn web development
effect can be better achieved using border: none; in your css. src this attribute, as with <video>/<img>, contains a path pointing to the url of the document to be embedded. width and height these attributes specify the width and height you want the iframe to be. fallback content in the same way as other similar elements like <video>, you can include fallback content between the opening and
closing <iframe></iframe> tags that will appear if the browser doesn't support the <iframe>. in this case, we have included a link to the page instead. it is unlikely that you'll come across any browser that doesn't support <iframe>s these days. sandbox this attribute, which works in slightly more modern browsers than the rest of the <iframe> features (e.g. ie 10 and above) requests heightened security...
Index - Learn web development
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 en
closing 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 following line of content: 40 how the web works beginner, client, dns, http, ip, infrastructure, learn, server, tcp, l10n:priority this theory is not essential to writing web code in the short term, but before long you'll reall...
Graceful asynchronous programming with Promises - Learn web development
ul. imagine that we’re fetching information to dynamically populate a ui feature on our page with content. in many cases, it makes sense to receive all the data and only then show the complete content, rather than displaying partial information. let's build another example to show this in action. download a fresh copy of our page template, and again put a <script> element just before the
closing </body> tag. download our source files (coffee.jpg, tea.jpg, and description.txt), or feel free to substitute your own. in our script, we'll first define a function that returns the promises we want to send to promise.all(). this would be easy if we just wanted to run the promise.all() block in response to three fetch() operations completing. we could just do something like: let a ...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
y> height to 100% of the <html> height, and centers the <div> inside the <body>, horizontally and vertically. html { background-color: white; height: 100%; } body { height: inherit; background-color: red; margin: 0; display: flex; justify-content: center; align-items: center; } div { display: inline-block; font-size: 10rem; } insert a <script> element just above the
closing </body> tag. insert the following javascript inside your <script> element. here, you're storing a reference to the <div> inside a constant, setting a rotatecount variable to 0, setting an uninitialized variable that will later be used to contain a reference to the requestanimationframe() call, and setting a starttime variable to null, which will later be used to store the start time of the ...
Build your own function - Learn web development
ew changes to make way for the icons. first, update the .msgbox width from: width: 200px; to width: 242px; next, add the following lines inside the .msgbox p { ... } rule: padding-left: 82px; background-position: 25px center; background-repeat: no-repeat; now we need to add code to our displaymessage() function to handle displaying the icons. ...
Manipulating documents - Learn web development
you'll come across make use of them. you may have also come across them if you have studied css (e.g. descendant selector, child selector). active learning: basic dom manipulation to start learning about dom manipulation, let's begin with a practical example. take a local copy of the dom-example.html page and the image that goes along with it. add a <script></script> element just above the
closing </body> tag. to manipulate an element inside the dom, you first need to select it and store a reference to it inside a variable. inside your script element, add the following line: const link = document.queryselector('a'); now we have the element reference stored in a variable, we can start to manipulate it using properties and methods available to it (these are defined on interfaces like h...
Third-party APIs - Learn web development
lds have pattern attributes specified, which means they won't submit unless their values consist of 8 numbers (pattern="[0-9]{8}"). see form data validation for more details on how these work. requesting data from the api now we've constructed our url, let's make a request to it. we'll do this using the fetch api. ...
Silly story generator - Learn web development
ou more of an idea, have a look at the finished example (no peeking at the source code!) steps to complete the following sections describe what you need to do. basic setup: create a new file called main.js, in the same directory as your index.html file. apply the external javascript file to your html by inserting a <script> element into your html referencing main.js. put it just before the
closing </body> tag. initial variables and functions: in the raw text file, copy all of the code underneath the heading "1. complete variable and function definitions" and paste it into the top of the main.js file. this gives you three variables that store references to the "enter custom name" text field (customname), the "generate random story" button (randomize), and the <p> element at the bottom ...
What is JavaScript? - Learn web development
. let's learn how this works. internal javascript first of all, make a local copy of our example file apply-javascript.html. save it in a directory somewhere sensible. open the file in your web browser and in your text editor. you'll see that the html creates a simple web page containing a clickable button. ...
JavaScript object basics - Learn web development
custom value types in their people data, by typing the member name and value into two text inputs. we could get those values like this: let mydataname = nameinput.value; let mydatavalue = namevalue.value; we could then add this new member name and value to the person object like this: person[mydataname] = mydatavalue; to test this, try adding the following lines into your code, just below the
closing curly brace of the person object: let mydataname = 'height'; let mydatavalue = '1.75m'; person[mydataname] = mydatavalue; now try saving and refreshing, and entering the following into your text input: person.height adding a property to an object using the method above isn't possible with dot notation, which can only accept a literal member name, not a variable value pointing to a name. what...
Vue conditional rendering: editing existing todos - Learn web development
-else at the root of your component to display only one block or another, since vue will only render one of these blocks at a time. we'll do this in our app, as it will allow us to replace the code that displays our to-do item with the edit form. first of all add v-if="!isediting" to the root <div> in your todoitem component, <div class="stack-small" v-if="!isediting"> next, below that <div>'s
closing tag add the following line: <to-do-item-edit-form v-else :id="id" :label="label"></to-do-item-edit-form> we also need to import and register the todoitemeditform component, so we can use it inside this template. add this line at the top of your <script> element: import todoitemeditform from "./todoitemeditform"; and add a components property about the props property inside the component objec...
Implementing feature detection - Learn web development
e different effects these two files have by manually changing the css file referred to by the second <link> element, but let's instead implement some javascript to automatically swap them as needed. first, remove the contents of the second <link> element's href attribute. we will fill this in dynamically later on. next, add a <script></script> element at the bottom of your body (just before the
closing </body> tag). give it the following contents: const conditional = document.queryselector('.conditional'); const testelem = document.createelement('div'); if (testelem.style.flex !== undefined && testelem.style.flexflow !== undefined) { conditional.setattribute('href', 'flex-layout.css'); } else { conditional.setattribute('href', 'float-layout.css'); } here we are grabbing a reference t...
Handling common HTML and CSS problems - Learn web development
code as normal, but older ie versions will be able to style these elements too. note: see ie conditional comments for the best way to do this. more complex elements like html <video>, <audio>, and <canvas> (and other features besides) have natural mechanisms for fallbacks to be added, which work on the same principle as described above. you can add fallback content in between the opening and
closing tags, and non-supporting browsers will effectively ignore the outer element and run the nested content. for example: <video id="video" controls preload="metadata" poster="img/poster.jpg"> <source src="video/tears-of-steel-battle-clip-medium.mp4" type="video/mp4"> <source src="video/tears-of-steel-battle-clip-medium.webm" type="video/webm"> <!-- offer download --> <p>your browser does no...
Strategies for carrying out testing - Learn web development
ed filling in everything, press the get tracking id button, then accept the terms of service that appear. the next page provides you with some code snippets and other instructions. for a basic website, what you need to do is copy the website tracking code block and paste it into all the different pages you want to track using google analytics on your site. you could place the snippets below your
closing </body> tag, or somewhere else appropriate that keeps it from getting muddled up with your application code. upload the changes to the development server, or wherever else you need your code. that's it! your site should now be ready to start reporting analytics data. studying analytics data now you should be able to go back to the analytics web homepage, and start looking at the data you've ...
Setting up your own test automation environment - Learn web development
ls by default! let's update our bstack_google_test.js demo, to show how these features work: first, we'll need to import the node request module, so we can use it to send requests to the rest api. add the following line at the very top of your code: const request = require("request"); now we'll update our capabilities object to include a project name — add the following line before the
closing curly brace, remembering to add a comma at the end of the previous line (you can vary the build and project names to organize the tests in different windows in the browserstack automation dashboard): 'project' : 'google test 2' next we need to access the sessionid of the current session, so we know where to send the request (the id is included in the request url, as you'll see later). includ...
Continuous Integration
se individuals are known as sheriffs. the sheriffs' role is to "keep the tree green", or in other words, to keep the code in our respositories in a good state, to the extent that the state is reflected in the output shown on treeherder. when sheriffs see a build or test has been broken, they are empowered to take one of several actions, including backing out a patch which caused the problem and
closing the tree (i.e., preventing any additional commits). results in treeherder are ordered by mercurial pushes. each taskcluster job is represented by a colored label; green means a job has succeeded, while other colors represent different kinds of problems. the label text indicates the job type. for a full list of job types, see the help menu in treeherder's upper-right corner. below is a list o...
HTTP logging
t cd /path/to/firefox ./firefox reproduce the problem you're debugging. when the problem has been reproduced, exit firefox and look for the generated log files, which you can find at /tmp/log.txt. mac os x these instructions show how to log http traffic in firefox on mac os x. quit firefox is if it's currently running, by using the quit option in the file menu. keep in mind that simply
closing all windows does not quit firefox on mac os x (this is standard practice for mac applications). run the terminal application, which is located in the utilities subfolder in your startup disk's applications folder. copy and paste the following commands into the terminal window, hitting the return key after each line. export moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nsh...
Multiple Firefox profiles
ng the profiles windows if you want to have the profile manager to pop up each time you start firefox, so you can choose a profile, you will need to edit the "target" of the launch icon. to do this: right-click the icon and choose "properties". when the properties dialog box pops up, you should see a "target" text field that you can edit, and it should show the current file path. after the
closing quote, add -profilemanager. click ok. now whenever you double click that icon, the profile manager should appear, allowing you to choose which profile you'd like to use. if you want individual icons to launch specific profiles, you will need to edit the "target" of each icon. to do this: right-click the icon and choose "properties". when the properties dialog box pops up, you should see a...
Frame script loading and lifetime
, where the current content page is used as prototype. if you want a frame script to do something when a new document is loaded, you need to listen for an appropriate dom event, generally domwindowcreated, domcontentloaded, or load. unloading frame scripts frame scripts are automatically unloaded when their hosting tab is closed. there is currently no way to unload them when loaded, other than
closing the tab they were loaded into. to listen for an event, when your frame script is unloaded (due to tab close for instance), you must set the third argument of addmessagelistener to true. for example, from bootstrap.js: services.mm.addmessagelistener( 'my-addon-id', { receivemessage: function() { console.log('incoming message from frame script:', amsg.data); } ...
HTML parser threading
s fields that hold objects that aren't safe to release except from the main thread. the runnables use nshtml5refptr<nshtml5streamparser>. nshtml5refptr sends runnables back to the main thread to call release on nshtml5streamparser on the main thread. normal (non-speculative) parsing initially, dodataavailable performs character encoding sniffing on the data if an encoding wasn't declared on the en
closing protocol (http) level. once a unicode decoder has been set up, dodataavailable passes the byte data to the decoder whose output is accumulated into a linked list of nshtml5owningutf16buffer objects. nshtml5owningutf16buffer objects are then passed to the tokenizer in sequence by the parseavailabledata() method. the tokenizer calls into the tree builder which outputs nshtml5treeoperation objects (...
HTTP Cache
the eviction preparation operation - i.e. clearing of the internal io state - is then put to the end of ...
How to investigate Disconnect failures
usually disconnects happens when a modal dialog freezes and we cannot close it sp we close firefox with the modal frozen. we cannot investigate failures via mozmill, because we do not catch the crashes, so the crashes' information is not logged; we have to go to ci machines and investigate directly. ...
OSFile.jsm
ll developers need to remember is that the duration of a file i/o operation is unbounded. depending on the current load of the kernel, the current disk activity, the current load of the bus, the current rotation speed of the disk, the amount of battery power, etc. operations can take an arbitrary amount of time. we are talking about several seconds to execute operations that look trivial, such as
closing a file, or checking when it was last modified. if the operation is called on the main thread, this means that the whole user experience is stuck for several seconds, which is quite bad. why is i/o efficiency important? i/o efficiency is all about minimizing the number of actual i/o calls. this is critical because some platforms have extremely slow storage (e.g. smartphones, tablets) and becaus...
Sqlite.jsm
called, they will be cancelled. callers should not attempt to use the connection after calling this method as the connection will be unusable. it is possible to automatically close the connection when the browser is closed with the shutdown hook: const conn = await sqlite.openconnection({ path: "mydatabase.sqlite", sharedmemorycache: false }); try { sqlite.shutdown.addblocker("my connection
closing", async () => await conn.close()); } catch (e) { // it's too late to block shutdown, just close the connection. await conn.close(); throw e; } clone(readonly) this function returns a clone of the current connection-promise. these functions receive the following arguments: readonly (optional) if true the clone will be read-only, default is false. if the ...
Localization quick start guide
ay, you'll learn about the variety of projects you can contribute to and the tools used to localize them. when we get to specific examples, we'll take them from the firefox project, as it is the most widely localized project within mozilla. as you near the end of this guide, you should be able to make a change to firefox in your local setting and then see that change in the firefox interface. in
closing, when you finish this guide, you will have all the tools necessary to start contributing! remember, this guide will instruct you on the technical aspects of mozilla l10n only. visit the l10n process page to learn about the whole process. initial setup tech prep work before localizing. translation phase l10n tools tutorials for translation. qa phase l10n testing tutorials. release phase s...
Leak-hunting strategies and tips
y most of the leaks, i mean the leaks of large numbers of different types of objects or leaks of objects that are known to entrain many non-logged objects such as js objects. seeing a leaked globalwindowimpl, nsxulpdglobalobject, nsxbldocglobalobject, or nsxpcwrappedjs is a sign that there could be significant numbers of js objects leaked.) for example, start with bringing up the mail window and
closing the window without doing anything. then go on to selecting a folder, then selecting a message, and then other activities one does while reading mail. once you've done this, and it doesn't leak much, then try the action under trace-malloc or lsan or valgrind to find the leaks of smaller graphs of objects. (when i refer to the size of a graph of objects, i'm referring to the number of objects, not...
Patches and pushes
ch attachment will be needed. commit the patch to your aurora repo. only commit the changes you have reviewed. use a commit message that mentions the bug number, describes the change, and mentions the reviewer. for example: hg ci -m "bug 654321, copied the comment from the doc without reading, r=nobody" path-to-changed-files close the bug, copying the url to your change in the
closing comment. write up something like this for your comment: landed this on aurora, http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-cd/rev/adfe1234feac, marking fixed. update your sign-offs on the l10n dashboard to include the change into the next release. and that's it! it can be considered a bit complicated at first, but after you do it the first time, it gets easier and easier after that...
PRLinger
structure used with the pr_sockopt_linger socket option to specify the time interval (in printervaltime units) to linger on
closing a socket if any data remain in the socket send buffer. syntax #include <prio.h> typedef struct prlinger { prbool polarity; printervaltime linger; } prlinger; fields the structure has the following fields: polarity polarity of the option's setting: pr_false means the option is off, in which case the value of linger is ignored. pr_true means the option is on, and the value of linger will be used to determine how long pr_close waits before returning. linger time (in printervaltime units) to linger before
closing if any data remain in the socket send buffer. description by default, pr_close returns immediately, but if there are any data remaining...
NSS 3.14.3 release notes
y producing ascii output as requested. bug 837799 - nss 3.14.2 broke compilation with older versions of sqlite that lacked the sqlite_fcntl_tempfilename file control. nss 3.14.3 now properly compiles when used with older versions of sqlite. acknowledgements the nss development team would like to thank nadhem alfardan and kenny patterson (royal holloway, university of london) for responsibly dis
closing the issue by providing advance copies of their research. in addition, thanks to adam langley (google) for the development of a mitigation for the issues raised in the paper, along with emilia kasper and bodo möller (google) for assisting in the review and improvements to the initial patches. bugs fixed in nss 3.14.3 https://bugzilla.mozilla.org/buglist.cgi?list_id=5689256;resolution=fixed;cla...
NSS 3.16.2.1 release notes
l break in future nss releases. bugs fixed in nss 3.16.2.1 bug 1064636 - (cve-2014-1568) rsa signature forgery in nss acknowledgements the nss development team would like to thank antoine delignat-lavaud, security researcher at inria paris in team prosecco, and the advanced threat research team at intel security, who both independently discovered and reported this issue, for responsibly dis
closing the issue by providing advance copies of their research. compatibility nss 3.16.2.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.16.2.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public...
NSS 3.16.5 release notes
ill break in future nss releases. bugs fixed in nss 3.16.5 bug 1064636 - (cve-2014-1568) rsa signature forgery in nss acknowledgements the nss development team would like to thank antoine delignat-lavaud, security researcher at inria paris in team prosecco, and the advanced threat research team at intel security, who both independently discovered and reported this issue, for responsibly dis
closing the issue by providing advance copies of their research. compatibility nss 3.16.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.16.5 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public fun...
NSS 3.17.1 release notes
compatibility nss 3.17.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.17.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public fun...
NSS 3.19.1 release notes
compatibility nss 3.19.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible w...
NSS 3.19.2.2 release notes
://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_2_2_rtm/src/ security fixes in nss 3.19.2.2 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures. new in nss 3.19.2.2 new functionality no new functionality is introduced in this release. acknowledgements the nss development team would like to thank karthikeyan bhargavan from inria for responsibly dis
closing the issue in bug 1158489. compatibility nss 3.19.2.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19.2.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatib...
NSS 3.19.2.3 release notes
45528 / cve-2016-1950 - fixed a heap-based buffer overflow related to the parsing of certain asn.1 structures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly dis
closing the issue in bug 1245528. compatibility nss 3.19.2.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19.2.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatib...
NSS 3.19 release notes
use certificates with a sha512 signature (bug 1155922). bugs fixed in nss 3.19 this bugzilla query returns all the bugs fixed in nss 3.19: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.19 acknowledgements the nss development team would like to thank karthikeyan bhargavan from inria for responsibly dis
closing the issue in bug 1086145. compatibility nss 3.19 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.19 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with ...
NSS 3.20.2 release notes
https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_20_2_rtm/src/ security fixes in nss 3.20.2 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures. new in nss 3.20.2 new functionality no new functionality is introduced in this release. acknowledgements the nss development team would like to thank karthikeyan bhargavan from inria for responsibly dis
closing the issue in bug 1158489. compatibility nss 3.20.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.20.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible w...
NSS 3.21.1 release notes
45528 / cve-2016-1950 - fixed a heap-based buffer overflow related to the parsing of certain asn.1 structures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly dis
closing the issue in bug 1245528. compatibility nss 3.21.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.21.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible w...
NSS 3.21.4 release notes
/mozilla.org/security/nss/releases/nss_3_21_4_rtm/src/ new in nss 3.21.4 no new functionality is introduced in this release. bugs fixed in nss 3.21.4 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly dis
closing the issues by providing advance copies of their research. compatibility nss 3.21.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.21.4 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public fu...
NSS 3.21 release notes
compatibility nss 3.21 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.21 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with ...
NSS 3.22.2 release notes
ures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. notable changes in nss 3.22.2 bug 1247990 - the root ca changes from nss 3.23 have been backported. acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly dis
closing the issue in bug 1245528. compatibility nss 3.22.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.22.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible w...
NSS 3.23 release notes
n of arbitrary code with the permissions of the user. bugs fixed in nss 3.23 this bugzilla query returns all the bugs fixed in nss 3.23: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.23 acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly dis
closing the issue in bug 1245528. compatibility nss 3.23 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.23 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with ...
NSS 3.24 release notes
ote that tls 1.3 support is experimental and not suitable for production use. bugs fixed in nss 3.24 this bugzilla query returns all the bugs fixed in nss 3.24: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.24 acknowledgements the nss development team would like to thank yuval yarom for responsibly dis
closing the cachebleed attack by providing advance copies of their research. compatibility nss 3.24 shared libraries are backward-compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.24 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss pu...
NSS 3.28.4 release notes
tm/src/ new in nss 3.28.4 no new functionality is introduced in this release. bugs fixed in nss 3.28.4 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) bug 1342358 - crash in tls13_destroykeyshares acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly dis
closing the issues by providing advance copies of their research. compatibility nss 3.28.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.28.4 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public fu...
NSS 3.29.5 release notes
/mozilla.org/security/nss/releases/nss_3_29_5_rtm/src/ new in nss 3.29.5 no new functionality is introduced in this release. bugs fixed in nss 3.29.5 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly dis
closing the issues by providing advance copies of their research. compatibility nss 3.29.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.29.5 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public fu...
NSS 3.30.1 release notes
cure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_30_1_rtm/src/ new in nss 3.30.1 no new functionality is introduced in this release. bugs fixed in nss 3.30.1 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) acknowledgements the nss development team would like to thank ronald crane for responsibly dis
closing the issue by providing advance copies of their research. compatibility nss 3.30.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.30.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public fun...
NSS release notes template
in ___.h macro - description notable changes in nss 3.xx ... bugs fixed in nss 3.xx this bugzilla query returns all the bugs fixed in nss 3.xx: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.xx (make a link) acknowledgements the nss development team would like to thank ... for responsibly dis
closing the issue by providing advance copies of their research. compatibility nss 3.xx.y shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.xx.y shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions listed in nss public funct...
Python binding for NSS
fix return value creation in sslsocket.get_security_status convert licensing to mpl tri-license the following were added: nss.io.socket.new_socket_pair() nss.io.socket.poll() nss.io.socket.import_tcp_socket() nss.nss.certificate.get_subject_common_name() nss.nss.generate_random() nss.ssl.sslsocket.import_...
sslintro.html
after these tasks have been performed, call nss_shutdown to close the certificate and key databases opened by nss_init, and pr_cleanup to coordinate a graceful shutdown of nspr. ...
Rhino scopes and contexts
. string loadme = "regexp; getclass; java; packages; javaadapter;"; cx.evaluatestring(sealedsharedscope , loadme, "lazyload", 0, null); sealedsharedscope .sealobject(); dynamic scopes there's one problem with the setup outlined above. calls to functions in javascript use static scope, which means that variables are first looked up in the function and then, if not found there, in the lexically en
closing scope. this causes problems if functions you define in your shared scope need access to variables you define in your instance scope. with rhino 1.6, it is possible to use dynamic scope. with dynamic scope, functions look at the top-level scope of the currently executed script rather than their lexical scope. so we can store information that varies across scopes in the instance scope yet still sh...
Scripting Java
lementations of java interfaces with more than one method if all the methods have the same signature. when calling the function, rhino passes the method's name as the additional argument. function can use it to distinguish on behalf of which method it was called: js> var frame = new packages.javax.swing.jframe(); js> frame.addwindowlistener(function(event, methodname) { if (methodname == "window
closing") { print("calling system.exit()..."); java.lang.system.exit(0); } }); js> frame.setsize(100, 100); js> frame.visible = true; true js> calling system.exit()... creating java arrays rhino provides no special syntax for creating java arrays. you must use the java.lang.reflect.array class for this purpose. to create an array of five java strings you would make the following call:...
SpiderMonkey Internals
debugger-supplied function that receives the old value and a pointer to the new one, which it can use to modify the new value being set. line number to pc and back mapping functions. the line-to-pc direction "rounds" toward the next bytecode generated from a line greater than or equal to the input line, and may return the pc of a for-loop update part, if given the line number of the loop body's
closing brace. any line after the last one in a script or function maps to a pc one byte beyond the last bytecode in the script. an example, from perfect.js: function perfect(n) { print("the perfect numbers up to " + n + " are:"); // we build sumofdivisors[i] to hold a string expression for // the sum of the divisors of i, excluding i itself. var sumofdivisors = new exprarray(n + 1, 1); for (v...
JS::CloneFunctionObject
ld, the caller must be in a request on this jscontext. funobj js::handleobject the function to clone. scopechain js::autoobjectvector the new function's scope chain. description js::clonefunctionobject creates a new function object from funobj. the new object has the same code and argument list as funobj. if scopechain is supplied, it uses scopechain as its en
closing scope. if scopechain is omitted, it creates a new function object in cx's global. this can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object. the new object's prototype is function.prototype; js_newobject : choosing a default prototype explains exactly how this is computed. js::clonefunctionobject takes care to choose a protot...
JS_CloneFunctionObject
time information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. funobj jsobject * the function to clone. parent jsobject * the new function's parent. description js_clonefunctionobject creates a new function object from funobj. the new object has the same code and argument list as funobj, but uses parent as its en
closing scope. this can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object. the new object's prototype is function.prototype; js_newobject: choosing a default prototype explains exactly how this is computed. js_clonefunctionobject takes care to choose a prototype that shares a global object with the given parent whenever possible. funob...
JS_ConvertArguments
st entirely useless, because the resulting jsfunction is not a real function object and therefore cannot be safely passed to any other jsapi function. that includes js_callfunction() and js_getfunctionobject(). a jsfunction represents only the compiled code and not the environment of the function. unless the function happens to be a native function, this means it isn't attached to any global or en
closing scope, and therefore must not be treated like a real function. instead, use jsval_is_object and js_objectisfunction() to check whether a value is already a function, or use js_convertvalue() to convert a value to jstype_function safely. v jsval argument value (no conversion) * n/a none. if an asterisk (*) is present in format, it tells the conversion routine to ...
JS_GetParent
inarily the global object. an object created by a script via implicit conversion (the ecmascript toobject operator), an object initializer ({a: 1, b: 2}), or an array initializer ([1, 2, 3]), has the global object as its parent. the parent of a function created by evaluating a function declaration or function expression in a script depends on the lexical scope of the function. if there is no en
closing function, with statement, or block scope, then the function's parent is the global object. otherwise, the parent is implementation-defined. it may be a call, with, or block object representing the function's dynamic scope, or it may be the global object. in any case the global object is guaranteed appear on the new function's parent chain. the initial parent of an object created via the jsapi...
JS_GetScopeChain
n the given context, cx. the ecmascript standard, ecma 262-3 §10, describes execution contexts and scope chains. a scope chain is a sequence of objects whose properties are searched whenever a script or function refers to a variable. these objects represent the lexical scope of the currently executing statement or expression, not the call stack, so they include: the variable objects of any en
closing functions or let statements or expressions, and any objects selected by en
closing with statements, in order from the most-nested scope outward; lastly the global object against which the function was created. note that cx's current global object, as set by js_setglobalobject, is not guaranteed to be on the scope chain. if the currently executing function was created in the scope of a different...
JS_LeaveLocalRootScope
js_enterlocalrootscope(). requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. description see js_enterlocalrootscope for an explanation of local root scopes. leaving a nested local root scope causes all objects created since the matching js_enterlocalrootscope call to become subject to garbage collection. that is, they are not transferred to the en
closing local root scope. however, js_leavelocalrootscopewithresult provides a way to transfer one value to the en
closing local root scope. see also bug 519949 bug 803907 ...
JS_ValueToFunction
st entirely useless, because the resulting jsfunction is not a real function object and therefore cannot be safely passed to any other jsapi function. that includes js_callfunction() and js_getfunctionobject(). a jsfunction represents only the compiled code and not the environment of the function. unless the function happens to be a native function, this means it isn't attached to any global or en
closing scope, and therefore must not be treated like a real function. instead, use jsval_is_object and js_objectisfunction() to check whether a value is already a function, or use js_convertvalue() to convert a value to jstype_function safely. if v is a function object, this returns the associated jsfunction. if v is null, undefined, a boolean, a number, or a string, a typeerror is reported and js_...
places.sqlite Database Troubleshooting
ces.sqlite database. how to (try to) recover from a corrupt places.sqlite sometimes after a firefox/aurora/nightly upgrade, history disappears, but bookmarks are at their place. in the profile folder a places.sqlite-corrupt file has been created. in some cases, this procedure may allow you to recover the corrupt file along with all of its contents (history). close firefox and ensure it's done
closing in your task manager. before you proceed, make a backup of the firefox profile folder, in any case. create a folder to use temporarily for this work, such as my_work_folder. copy places.sqlite-corrupt from the firefox profile folder to the work folder. download the latest precompiled binary sqlite command-line shell from: https://www.sqlite.org/download.html extract sqlite3 executable int...
XPCOM Stream Guide
pying an input stream to an output stream (the asynccopy() method), getting an input stream from another source (the asyncfetch() method), and reading an input stream into a string (the readinputstreamtostring() method). fileutils.jsm provides apis for getting output streams for files, with the .openfileoutputstream(file, modeflags) and .opensafefileoutputstream(file, modeflags) methods, and for
closing those output streams with the .closesafefileoutputstream(inputstream) method. as we mentioned earlier, you can use the io service to get any channel, and from there an input stream. the io service is available through the services.jsm module as the .io property. stream listeners a stream listener is an object you build to let you know when there is data in a stream ready for you to consume. mo...
Observer Notifications
related to places (the history and bookmarks database) occur. topic data description places-autocomplete-feedback-updated sent when places updates the location bar's autocompletion display. places-connection-closed sent after places has closed its database connection. once this has been sent, no places features will work. places-connection-
closing sent as the last notification before the places service closes its database connection. warning: this is for internal use only. places-database-locked the places database is currently locked by a third-party process and cannot be opened. places-favicons-expired sent when all favicons have been expired. places-init-complete the p...
IAccessibleText
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this enum defines values which specify a text() boundary type. ia2_text_boundary_sentence is optional. when a method doesn't implement this method it must return s_false. typically this feature would not be implemented by an application. ...
mozIPlacesAutoComplete
er. methods registeropenpage() mark a page as being currently open. note: pages will not be automatically unregistered when private browsing mode is entered or exited. therefore, consumers must unregister or register themselves. void registeropenpage( in nsiuri auri ); parameters auri the uri to register as an open page. unregisteropenpage() mark a page as no longer being open (either by
closing the window or tab, or by navigating away from that page). note: pages will not be automatically unregistered when private browsing mode is entered or exited. therefore, consumers must unregister or register themselves. void unregisteropenpage( in nsiuri auri ); parameters auri the uri to unregister as an open page. ...
mozIStorageConnection
mozistorageconnection clone( in boolean areadonly optional ); parameters areadonly if true, the returned database connection is in read only mode. this is false by default. return value a new mozistorageconnection object representing the cloned connection. exceptions thrown ns_error_unexpected the connection is to a memory database. close() closes a database connection. before
closing the connection, you need to finalize all statements created for the connection. note: you must not call this method if any asynchronous statements have been executed on the connection. instead, you should call asyncclose(). void close(); parameters none. exceptions thrown ns_error_unexpected thrown if any statement has been executed asynchronously on the connection, or if the method was...
nsIBrowserHistory
rame( in long long abegintime, in long long aendtime ); parameters abegintime the time of the first page to remove, in microseconds from epoch. aendtime the time of the last page to remove, in microseconds from epoch. unregisteropenpage() obsolete since gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) mark a page as no longer being open (either by
closing the window or tab, or by navigating away from that page). note: this method was an alias for moziplacesautocomplete.unregisteropenpage(), which still exists and can be used instead. void unregisteropenpage( in nsiuri auri ); parameters auri the page to unregister as an open page. see also places using the places history service nsiglobalhistory2 ...
nsIDirectoryEnumerator
xpcom/io/nsidirectoryenumerator.idlscriptable this interface provides a means for enumerating the contents of a directory. it is similar to nsisimpleenumerator except the retrieved entries are qi'ed to nsifile, and there is a mechanism for
closing the directory when the enumeration is complete. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void close(); attributes attribute type description nextfile nsifile the next file in the sequence. the nextfile attribute is the first element upon the first call. this attribute is null if there is no next element. read only. methods close() closes the directory being enumerated...
nsIDownloadManager
opens an individual progress dialog displaying progress for the download. void openprogressdialogfor( in nsidownload adownload, in nsidomwindow aparent, in boolean acanceldownloadonclose ); parameters adownload the download object to display progress for, as returned by getdownload() or adddownload(). aparent the parent, or opener, of the front end. acanceldownloadonclose whether
closing the dialog should cancel the download. pausedownload() pauses the specified download. void pausedownload( in unsigned long aid ); parameters aid the unique id of the download to pause. exceptions thrown ns_error_failure the download is not in progress. removedownload() removes the download with the specified id if it is not currently in progress. whereas canceldownload() simp...
nsIOutputStream
igned long writesegments(in nsreadsegmentfun areader, in voidptr aclosure, in unsigned long acount); native code only! methods close() close the stream. forces the output stream to flush() any buffered data. note: this method may be called more than once, but subsequent calls are ignored. void close(); parameters none. exceptions thrown ns_base_stream_would_block indicates that
closing the output stream would block the calling thread for an indeterminate amount of time. this exception may only be thrown if isnonblocking() returns true. flush() this method may be called to instruct the output stream to write out the contents of any internal buffers to a low-level data sink, such as a file on disk. however, the flush method may simply do nothing depending on the implementation...
nsIPromptService
entred in the order 0, 2, 1. constant value description button_pos_0 1 this is usually the button used to confirm the prompt. it typically has the label "ok", "yes", or "save". button_pos_1 256 this is the button used to cancel the prompt. it typically has the label "cancel" or "no". it is equivalent to pressing the escape key (or cmd+. on the mac), or
closing the window through the os controls. button_pos_2 65536 this button can be used to give the user a choice of options, but still allowing the user to cancel the prompt. for instance, it might have the label "don't save". button title flags these flags are used along with button position flags to set the labels of buttons in the prompt. constant value description ...
nsIRequest
still considered pending. boolean ispending(); parameters none. return value true if the request has yet to reach completion. resume() resumes the current request. this may have the effect of re-opening any underlying transport and will resume the delivery of data to any open streams. void resume(); parameters none. suspend() suspends the current request. this may have the effect of
closing any underlying transport (in order to free up resources), although any open streams remain logically opened and will continue delivering data when the transport is resumed. calling cancel() on a suspended request must not send any notifications (such as onstoprequest) until the request is resumed. note: some implementations are unable to immediately suspend, and may continue to deliver events a...
nsITransport
itransporteventsink status codes. nsitransport implementations may override these status codes with their own more specific status codes (for example, see nsisockettransport). constant value description status_reading 0x804b0008 status_writing 0x804b0009 methods close() close the transport and any open streams. void close( in nsresult areason ); parameters areason the reason for
closing the stream. openinputstream() open an input stream on this transport. nsiinputstream openinputstream( in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount ); parameters aflags optional transport specific flags. flags have the following meaning: open_blocking if specified, then the resulting stream will have blocking stream semantics. this means that if t...
nsIWebSocketListener
ageavailable(), onbinarymessageavailable()() or onacknowledge()() will be delievered to the listener after onserverclose() is called, but outgoing messages can still be sent through the nsiwebsocketchannel connection. void onserverclose( in nsisupports acontext, in unsigned short acode, in autf8string areason ); parameters acontext user defined context. acode the websocket
closing handshake status code; see status codes for possible values. areason a text string explaining the reason for the closure of the connection. onstart() called to signify the establishment of the message stream. any listener that receives onstart() will also receive onstop(). void onstart( in nsisupports acontext ); parameters acontext user defined context. onstop() called to s...
nsIXULWindow
can not be assured of what object it is. it could be an editor, a docshell, or a browser object. or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. read only. xulbrowserwindow nsixulbrowserwindow provides access to the xulbrowserwindow object offering a way for the browser to update the user interface of the en
closing xul window. zlevel unsigned long one of the z level constants below. on some platforms, windows with a higher zlevel will be kept above windows with a lower zlevel. constants constant value description lowestz 0 loweredz 4 the z level of an independent window opened with the "alwayslowered" chrome flag. normalz 5 ...
Working with Multiple Versions of Interfaces
#pragma warning(pop) so now i have to own up to the ugly hack. i did have to delve into my old versions and change: ns_define_static_iid_accessor(...) to ns_declare_static_iid_accessor(...) this ugliness aside, my plan b routine now looks like: hwnd gethwndb(nsidomnode *node){ hwnd...
Add to iPhoto
illa code. it gets the filename of the file being download by slicing it off the end of the specified image url, then obtains the path to the temporary items folder and appends the image file's name to that path. then we call createunique() to create a unique file by that name (or a derivative thereof if the name is already in use), and download the contents of the image file to that local file.
closing remarks this is a fairly simple example of how to use js-ctypes, but it actually does something useful, and should be a helpful demonstration not just for how to use js-ctypes, but also more specifically for developers that want to interface with mac os x system frameworks. ...
Drawing and Event Handling - Plugins
ansparent plug-in opaque, call npn_setvalue to set nppvplugintransparentbool to false. the plug-in can call this method any time after specifying that it is a windowless plug-in. making a plug-in transparent a windowless plug-in is transparent if it has transparent areas. here are two examples of plug-ins that have transparent areas: a plug-in that is smaller than the area specified by the en
closing object or embed element a plug-in with nonrectangular boundaries the browser is responsible for rendering the background of a transparent windowless plug-in. before generating a paint message for the plug-in, the browser makes sure that the background is already drawn into the area to be updated. the plug-in can then draw the part of the update region that corresponds to its opaque areas. this...
Initialization and Destruction - Plugins
and released. np_shutdown gives you an opportunity to delete data allocated in np_initialize to be shared by all instances of a plug-in. the browser calls the plug-in's np_shutdown function, which informs the plug-in that its library is about to be unloaded, and gives it a chance to cancel any outstanding i/o requests, delete threads it created, free any memory it allocated, and perform any other
closing tasks. the np_shutdown function releases memory or resources shared across all instances of a plug-in. it is called once after the last instance of the plug-in is destroyed, before releasing the plug-in library itself. void np_shutdown(void); for an example that shows both the np_initialize and np_shutdown methods, see initialize and shutdown example. initialize and shutdown example this exa...
Browser Console - Firefox Developer Tools
yboard shortcuts and helper commands. if the result of a command is an object, you can click on the object to see its details. but while the web console executes code in the scope of the content window it's attached to, the browser console executes code in the scope of the chrome window of the browser. you can confirm this by evaluating window: this means you can control the browser: opening,
closing tabs and windows and changing the content that they host, and modify the browser's ui by creating, changing and removing xul elements. controlling the browser the command line interpreter gets access to the tabbrowser object, through the gbrowser global, and that enables you to control the browser through the command line. try running this code in the browser console's command line (remember th...
Debugger - Firefox Developer Tools
source line. if this property is present, the url property must be present as well. column the script must include given column on the line given by the line property. if this property is present, the url and line properties must both be present as well. innermost if this property is present and true, the script must be the innermost script covering the given source location; scripts of en
closing code are omitted. global the script must be in the scope of the given global object. if this property’s value is a debugger.object instance belonging to this debugger instance, then its referent is used. if the object is not a global object, then the global in whose scope it was allocated is used. all properties ofquery are optional. passing an empty object returns all debuggee code scr...
DevTools API - Firefox Developer Tools
ly boolean, optional. if true, the label won't be shown in the tool's tab. default: false inverticonforlighttheme boolean, optional. if true the colors of the icon will be inverted for the light theme. default: false key string, optional. the key used for keyboard shortcut. either key or keycode value. modifiers string, optional. modifiers for the keyboard shortcut. prevent
closingonkey boolean, optional. if true the tool won't close if its keybinding is pressed while it is active. default: false inmenu boolean, optional. if true the tool will be shown in the developer menu. default: false menulabel string, optional. a label for the developer menu item. default: {label} accesskey string, optional. accesskey for the developer menu <xul:menuitem>. examp...
All keyboard shortcuts - Firefox Developer Tools
shortcuts used by the developer tools built into firefox. the first section lists the shortcut for opening each tool and the second section lists shortcuts that are applicable to the toolbox itself. after that there's one section for each tool, which lists the shortcuts that you can use within that tool. because access keys are locale-dependent, they're not documented in this page. opening and
closing tools these shortcuts work in the main browser window to open the specified tool. the same shortcuts will work to close tools hosted in the toolbox, if the tool is active. for tools like the browser console that open in a new window, you have to close the window to close the tool. command windows macos linux open toolbox (with the most recent tool activated) ctrl +...
Examine and edit CSS - Firefox Developer Tools
yped in a filter, you can press esc to remove it again. edit rules if you click on a declaration or a selector in the rules view you can edit it and see the results immediately. you can also tab through the different existing properties and values, and start editing them by pressing enter or space. to add a new declaration to a rule, click on the last line of the rule (the line occupied by the
closing brace). as you start typing a property name, you'll see a list of autocomplete suggestions. press tab to accept the current suggestion or up and down to move through the list. the default choice is the most common property that starts with the letters you've typed. for example, here the user has typed "c" and the default choice is "color": if you enter an invalid value for a property when edi...
Examine and edit HTML - Firefox Developer Tools
hold the alt key while clicking the arrow, it expands the node and all the nodes underneath it. moving the mouse over a node in the tree highlights that element in the page. nodes that are not visible are shown faded/desaturated. this can happen for different reasons such as using display: none or that the element doesn't have any dimensions. there is an ellipsis shown between the opening and
closing tag of an element when the node is collapsed if it has larger contents. now children are indicated in the tree with this icon: at the right side of some nodes there are markers shown indicating different pieces of information related to it: event the element has one or several event listeners attached to it. clicking the marker opens a tooltip listing the event listeners and allows...
Settings - Firefox Developer Tools
new in firefox 53. editor preferences preferences for the codemirror source editor, which is included in firefox and used by several developer tools, including scratchpad and the style editor. detect indentation auto-indent new lines based on the current indentation. autoclose brackets determines whether typing an opening character like [ or { will cause the editor to insert the matching
closing character ] or } for you. indent using spaces when checked, indentation will be performed using spaces, when off, the editor will use tabs instead. tab size the frequency of tab stops in the editor. select 2, 4, or 8. keybindings choose the default codemirror keybindings or keybindings from one of several popular editors: vim emacs sublime text advanced settings show gecko ...
CDATASection - Web APIs
that can be used within xml to include extended portions of unescaped text. the symbols < and & don’t need escaping as they normally do when inside a cdata section. in xml, a cdata section looks like: <![cdata[ ... ]]> for example: <foo>here is a cdata section: <![cdata[ < > & ]]> with all kinds of unescaped text.</foo> the only sequence which is not allowed within a cdata section is the
closing sequence of a cdata section itself, ]]>: <![cdata[ ]]> will cause an error ]]> note that cdata sections should not be used within html; they only work in xml. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewb...
Applying styles and colors - Web APIs
on 0.0) since it wasn't strictly necessary, because it will automatically assume the color of the next color stop. therefore, assigning the black color at position 0.5 automatically makes the gradient, from the start to this stop, black. screenshotlive sample a createradialgradient example in this example, we'll define four different radial gradients. because we have control over the start and
closing points of the gradient, we can achieve more complex effects than we would normally have in the "classic" radial gradients we see in, for instance, photoshop (that is, a gradient with a single center point where the gradient expands outward in a circular shape). function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); // create gradients var radgrad = ctx.createradia...
Basic usage of canvas - Web APIs
width="150" height="150" alt=""/> </canvas> telling the user to use a different browser that supports canvas does not help users who can't read the canvas at all, for example. providing a useful fallback text or sub dom helps to make the canvas more accessible. required </canvas> tag as a consequence of the way fallback is provided, unlike the <img> element, the <canvas> element requires the
closing tag (</canvas>). if this tag is not present, the rest of the document would be considered the fallback content and wouldn't be displayed. if fallback content is not needed, a simple <canvas id="foo" ...></canvas> is fully compatible with all browsers that support canvas at all. the rendering context the <canvas> element creates a fixed-size drawing surface that exposes one or more rendering co...
DedicatedWorkerGlobalScope.close() - Web APIs
syntax self.close(); example if you want to close your worker instance from inside the worker itself, you can call the following: close(); close() and self.close() are effectively equivalent — both represent close() being called from inside the worker's inner scope. note: there is also a way to stop the worker from the main thread: the worker.terminate method. ...
DedicatedWorkerGlobalScope - Web APIs
nthandler representing the code to be called when the messageerror event is raised. methods this interface inherits methods from the workerglobalscope interface, and its parent eventtarget, and therefore implements methods from windowtimers, windowbase64, and windoweventhandlers. dedicatedworkerglobalscope.close() discards any tasks queued in the workerglobalscope's event loop, effectively
closing this particular scope. dedicatedworkerglobalscope.postmessage() sends a message — which can consist of any javascript object — to the parent document that first spawned the worker. inherited from workerglobalscope workerglobalscope.dump() writes a message to the console. workerglobalscope.importscripts() imports one or more scripts into the worker's scope. you can specify as many ...
Document.createCDATASection() - Web APIs
appendchild(cdata); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><![cdata[some <cdata> data & then some]]></xml> notes this will only work with xml, not html documents (as html documents do not support cdata sections); attempting it on an html document will throw not_supported_err. will throw a ns_error_dom_invalid_character_err exception if one tries to submit the
closing cdata sequence ("]]>") as part of the data, so unescaped user-provided data cannot be safely used without with this method getting this exception (createtextnode() can often be used in its place). specifications specification status comment domthe definition of 'document.createcdatasection' in that specification. living standard ...
Document.createProcessingInstruction() - Web APIs
get. the data is up to you, but it can't contain ?>, since that closes the processing instruction. exceptions dom_invalid_character throws if either of the following are true: the processing instruction target is invalid — it should be a valid xml name that doesn't contain "xml", "xml", or any case combination of the two, other than standardized ones such as <?xml-stylesheet ?>. the
closing processing instruction sequence (?>) is part of the data. example var doc = new domparser().parsefromstring('<foo />', 'application/xml'); var pi = doc.createprocessinginstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'); doc.insertbefore(pi, doc.firstchild); console.log(new xmlserializer().serializetostring(doc)); // displays: <?xml-stylesheet href="mycss.css" type="text/cs...
Document.domain - Web APIs
document's effective domain is null the given value is not equal to the document's effective domain (or it is not a registerable domain suffix of it) the document-domain feature-policy is enabled examples getting the domain for the uri http://developer.mozilla.org/docs/web, this example sets currentdomain to the string "developer.mozilla.org". const currentdomain = document.domain;
closing a window if a document, such as www.example.xxx/good.html, has the domain of "www.example.xxx", this example attempts to close the window. const baddomain = "www.example.xxx"; if (document.domain === baddomain) { // just an example: window.close() sometimes has no effect window.close(); } specifications specification status comment html living standardthe def...
Document.open() - Web APIs
: all event listeners currently registered on the document, nodes inside the document, or the document's window are removed. all existing nodes are removed from the document. syntax document.open(); parameters none. return value a document object instance. examples the following simple code opens the document and replaces its content with a number of different html fragments, before
closing it again. document.open(); document.write("<p>hello world!</p>"); document.write("<p>i am a fish</p>"); document.write("<p>the number is 42</p>"); document.close(); notes an automatic document.open() call happens when document.write() is called after the page has loaded. for years firefox and internet explorer additionally erased all javascript variables, etc., in addition to removing all no...
GlobalEventHandlers.onabort - Web APIs
the onabort property of the globaleventhandlers mixin is the eventhandler for processing abort events sent to the window. while the standard for aborting a document load is defined, html issue #3525 suggests that browsers should not currently fire the abort event on a window that would trigger onabort to be called. todo: define what "abort" is.
closing the window via window manager? stopping the load of the page? by which means and reasons (user, network/server)? at which stages would it fire / be caught? for ie, onabort is only available with <img> tags. syntax window.onabort = functionref; value functionref is a function name or a function expression. example window.onabort = function() { alert('load aborted.'); } specification specification status commen...
GlobalEventHandlers.onclose - Web APIs
syntax target.onclose = functionref; value functionref is a function name or a function expression. the function receives an event object as its sole argument. only one onclose handler can be assigned to an object at a time. ...
Using IndexedDB - Web APIs
ect store in one transaction and write the new list in another transaction, there is a danger that the browser will close after the clear but before the write, leaving you with an empty database. to avoid this, you should combine the clear and the write into a single transaction. second, you should never tie database transactions to unload events. if the unload event is triggered by the browser
closing, any transactions created in the unload event handler will never complete. an intuitive approach to maintaining some information across browser sessions is to read it from the database when the browser (or a particular page) is opened, update it as the user interacts with the browser, and then save it to the database when the browser (or page) closes. however, this will not work. the database tra...
MediaKeySession - Web APIs
the mediakeysession interface of the encryptedmediaextensions api represents a context for message exchange with a content decryption module (cdm). properties mediakeysession.closed read only returns a promise signaling when a mediakeysession closes. this promise can only be fulfilled and is never rejected.
closing a session means that licenses and keys associated with it are no longer valid for decrypting media data. mediakeysession.expiration read only the time after which the keys in the current session can no longer be used to decrypt media data, or nan if no such time exists. this value is determined by the cdm and measured in milliseconds since january 1, 1970, utc. this value may change during a session lifetime, such as when an action triggers the start of a window. mediakey...
Node.firstChild - Web APIs
p01 = document.getelementbyid('para-01'); console.log(p01.firstchild.nodename); </script> in the above, the console will show '#text' because a text node is inserted to maintain the whitespace between the end of the opening <p> and <span> tags. any whitespace will create a #text node, from a single space to multiple spaces, returns, tabs, and so on. another #text node is inserted between the
closing </span> and </p>tags. if this whitespace is removed from the source, the #text nodes are not inserted and the span element becomes the paragraph's first child. <p id="para-01"><span>first span</span></p> <script> var p01 = document.getelementbyid('para-01'); console.log(p01.firstchild.nodename); </script> now the console will show 'span'. to avoid the issue with node.firstchild returnin...
Node.nextSibling - Web APIs
= el.nextsibling; i++; } console.groupend(); </script> /************************************************** the console displays the following: siblings of div-1 1. #text 2. div 3. #text 4. script **************************************************/ in the above example, #text nodes are inserted in the dom where whitespace occurs between tags (i.e. after the
closing tag of an element and before the opening tag of the next). the possible inclusion of text nodes must be allowed for when traversing the dom using nextsibling. see the resources in the notes section. specifications specification status comment domthe definition of 'node.nextsibling' in that specification. living standard no change document object model...
Notification.Notification() - Web APIs
ype. vibrate: a vibration pattern for the device's vibration hardware to emit with the notification. renotify: a boolean specifying whether the user should be notified after a new notification replaces an old one. the default is false, which means they won't be notified. requireinteraction: indicates that a notification should remain active until the user clicks or dismisses it, rather than
closing automatically. the default value is false. actions: an array of notificationactions representing the actions available to the user when the notification is presented. these are options the user can choose among in order to act on the action within the context of the notification itself. the action's name is sent to the service worker notification handler to let it know the action was selected b...
Notification.requireInteraction - Web APIs
note: this can be set when the notification is first created by setting the requireinteraction option to true in the options object of the notification.notification() constructor. ...
Notification - Web APIs
url of an image to be displayed as part of the notification, as specified in the constructor's options parameter. notification.renotify read only specifies whether the user should be notified after a new notification replaces an old one. notification.requireinteraction read only a boolean indicating that a notification should remain active until the user clicks or dismisses it, rather than
closing automatically. notification.silent read only specifies whether the notification should be silent — i.e., no sounds or vibrations should be issued, regardless of the device settings. notification.timestamp read only specifies the time at which a notification is created or applicable (past, present, or future). notification.title read only the title of the notification as specified in th...
Using the Notifications API - Web APIs
the notification such as an icon or a text body. for example, in the to-do-list example we use the following snippet to create a notification when required (found inside the createnotification() function): var img = '/to-do-notifications/img/icon-128.png'; var text = 'hey! your task "' + title + '" is now overdue.'; var notification = new notification('to do list', { body: text, icon: img });
closing notifications used close() to remove a notification that is no longer relevant to the user (e.g. the user already read the notification on the webpage, in the case of a messaging app, or the following song is already playing in a music app to notifies upon song changes). most modern browsers dismiss notifications automatically after a few moments (around four seconds) but this isn't something yo...
Page Visibility API - Web APIs
h firefox and chrome. some processes are exempt from this throttling behavior. in these cases, you can use the page visibility api to reduce the tabs' performance impact while they're hidden. tabs which are playing audio are considered foreground and aren’t throttled. tabs running code that's using real-time network connections (websockets and webrtc) go unthrottled in order to avoid
closing these connections timing out and getting unexpectedly closed. indexeddb processes are also left unthrottled in order to avoid timeouts. example view live example (video with sound). the example, which pauses the video when you switch to another tab and plays again when you return to its tab, was created with the following code: // set the name of the hidden property and the change event for...
Pinch zoom gestures - Web APIs
he browser's default touch behavior from overriding this application's pointer handling, the touch-action property is applied to the <body> element. <body onload="init();" style="touch-action:none"> <div id="target">touch and hold with 2 pointers, then pinch in or out.<br/> the background color will change to pink if the pinch is opening (zoom in) or changes to lightblue if the pinch is
closing (zoom out).</div> <!-- ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> </body> miscellaneous functions these functions support the application but aren't directly involved in the event flow. cache management this function helps man...
RTCDataChannel.bufferedAmount - Web APIs
d. this only includes data buffered by the user agent itself; it doesn't include any framing overhead or buffering done by the operating system or network hardware. the user agent may implement the process of actually sending data in any way it chooses; this may be done periodically during the event loop or truly asynchronously. as messages are actually sent, this value is reduced accordingly.
closing the data channel doesn't reset this count, even though the user agent purges the queued messages. however, even after
closing the channel, attempts to send messages continue to add to the bufferedamount value, even though the messages are neither sent nor buffered. whenever this value decreases to fall to or below the value specified in the bufferedamountlowthreshold property, the user agent fi...
RTCDataChannel.close() - Web APIs
the rtcdatachannel.close() method closes the rtcdatachannel. either peer is permitted to call this method to initiate closure of the channel. closure of the data channel is not instantaneous. most of the process of
closing the connection is handled asynchronously; you can detect when the channel has finished
closing by watching for a close event on the data channel. the sequence of events which occurs in response to this method being called: rtcdatachannel.readystate is set to "
closing". a background task is established to handle the remainder of the steps below, and close() returns to the caller. the transport layer deals with any buffered messages; the protocol layer decides whether to send them or discard them. the underlying data transport is closed. the rtcdatachannel.readystate pr...
RTCDataChannel.send() - Web APIs
the send() method of the rtcdatachannel interface sends data across the data channel to the remote peer. this can be done any time except during the initial process of creating the underlying transport channel. data sent before connecting is buffered if possible (or an error occurs if it's not possible), and is also buffered if sent while the connection is
closing or closed. different browsers have different limitations on the size of the message you can send. specifications exist to define how to automatically fragment large messages, but not all browsers implement them, and those that do have various additional restrictions. this will get less complicated over time, but for now, if you have questions, see understanding message size limits in using webrtc data channels. syntax rtcdatachann...
RTCDataChannel - Web APIs
object, is sent when the amount of data buffered to be sent falls to or below the threshold specified by the channel's bufferedamountlowthreshold.onclose the rtcdatachannel.onclose property is an eventhandler which specifies a function to be called by the browser when the close event is received by the rtcdatachannel. this is a simple event which indicates that the data channel has closed down.on
closing the rtcdatachannel.on
closing property is an eventhandler which specifies a function to be called by the browser when the
closing event is received by the rtcdatachannel. this is a simple event which indicates that the data channel is being closed, that is, rtcdatachannel transitions to "
closing" state. for example, after rtcdatachannel.close() was called but the underlying data transport might n...
Range.getBoundingClientRect() - Web APIs
this method is useful for determining the viewport coordinates of the cursor or selection inside a text box. see element.getboundingclientrect() for details on the returned value. syntax boundingrect = range.getboundingclientrect() example html <div id="highlight"></div> <p>this example positions a "highlight" rectangle behind the contents of a range. the range's content <b>starts here</b> and continues on until it <b>ends here</b>. ...
Using server-sent events - Web APIs
e shown in this article on github — see simple sse demo using php. error handling when problems occur (such as a network timeout or issues pertaining to access control), an error event is generated. you can take action on this programmatically by implementing the onerror callback on the eventsource object: evtsource.onerror = function(err) { console.error("eventsource failed:", err); };
closing event streams by default, if the connection between the client and server closes, the connection is restarted. the connection is terminated with the .close() method. evtsource.close(); event stream format the event stream is a simple stream of text data which must be encoded using utf-8. messages in the event stream are separated by a pair of newline characters. a colon as the first character...
Server-sent events - Web APIs
sible for a server to send new data to a web page at any time, by pushing messages to the web page. these incoming messages can be treated as events + data inside the web page. concepts and usage to learn how to use server-sent events, see our article using server-sent events. interfaces eventsource defines all the features that handle connecting to a server, receiving events/data, errors,
closing a connection, etc. examples simple sse demo using php specification specification status comment html living standardthe definition of 'server-sent events' in that specification. living standard see also tools eventsource polyfill for node.js remy sharp’s eventsource polyfill yaffle’s eventsource polyfill rick waldron’s jquery plugin...
SharedWorkerGlobalScope.close() - Web APIs
syntax self.close(); example if you want to close your worker instance from inside the worker itself, you can call the following: close(); close() and self.close() are effectively equivalent — both represent close() being called from inside the worker's inner scope. note: there is also a way to stop the worker from the main thread: the worker.terminate method. ...
SharedWorkerGlobalScope - Web APIs
rt connection is opened between the associated sharedworker and the main thread. methods this interface inherits methods from the workerglobalscope interface, and its parent eventtarget, and therefore implements methods from windowtimers, windowbase64, and windoweventhandlers. sharedworkerglobalscope.close() discards any tasks queued in the sharedworkerglobalscope's event loop, effectively
closing this particular scope. inherited from workerglobalscope workerglobalscope.close() discards any tasks queued in the workerglobalscope's event loop, effectively
closing this particular scope. workerglobalscope.dump() allows you to write a message to stdout — i.e. in your terminal. this is the same as firefox's window.dump, but for workers. workerglobalscope.importscripts() imports o...
SpeechSynthesisErrorEvent.error - Web APIs
o be removed from the queue before it had begun being spoken. interrupted a speechsynthesis.cancel method call caused the speechsynthesisutterance to be interrupted after it had begun being spoken and before it completed. audio-busy the operation couldn't be completed at this time because the user-agent couldn't access the audio output device (for example, the user may need to correct this by
closing another application.) audio-hardware the operation couldn't be completed at this time because the user-agent couldn't identify an audio output device (for example, the user may need to connect a speaker or configure system settings.) network the operation couldn't be completed at this time because some required network communication failed. synthesis-unavailable the operation couldn't be co...
Using readable streams - Web APIs
result; return; } charsreceived += value.length; const chunk = value; let listitem = document.createelement('li'); listitem.textcontent = 'read ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); }
closing and cancelling streams we’ve already shown examples of using readablestreamdefaultcontroller.close() to close a reader. as we said before, any previously enqueued chunks will still be read, but no more can be enqueued because it is closed. if you wanted to completely get rid of the stream and discard any enqueued chunks, you'd use readablestream.cancel() or readablestreamdefaultreader.cancel(...
Lifetime of a WebRTC session - Web APIs
this article doesn't get into details of the actual apis involved in establishing and handling a webrtc connection; it simply reviews the process in general with some information about why each step is required. ...
Signaling and video calling - Web APIs
bute("srcobject"); document.getelementbyid("hangup-button").disabled = true; targetusername = null; } after pulling references to the two <video> elements, we check if a webrtc connection exists; if it does, we proceed to disconnect and close the call: all of the event handlers are removed. this prevents stray event handlers from being triggered while the connection is in the process of
closing, potentially causing errors. for both remote and local video streams, we iterate over each track, calling the mediastreamtrack.stop() method to close each one. close the rtcpeerconnection by calling mypeerconnection.close(). set mypeerconnection to null, ensuring our code learns there's no ongoing call; this is useful when the user clicks a name in the user list. then for both the incoming a...
WebSocket.close() - Web APIs
ready closed, this method does nothing. syntax websocket.close(); parameters code optional a numeric value indicating the status code explaining why the connection is being closed. if this parameter is not specified, a default value of 1005 is assumed. see the list of status codes of closeevent for permitted values. reason optional a human-readable string explaining why the connection is
closing. this string must be no longer than 123 bytes of utf-8 text (not characters). exceptions thrown invalid_access_err an invalid code was specified. syntax_err the reason string is too long or contains unpaired surrogates. note: in gecko, this method didn't support any parameters prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5). specifications specification ...
WebSocket.readyState - Web APIs
ket.readystate read-only property returns the current state of the websocket connection. syntax var readystate = awebsocket.readystate; value one of the following unsigned short values: value state description 0 connecting socket has been created. the connection is not yet open. 1 open the connection is open and ready to communicate. 2
closing the connection is in the process of
closing. 3 closed the connection is closed or couldn't be opened. specifications specification status comment html living standardthe definition of 'websocket: readystate' in that specification. living standard initial definition ...
WebSocket - Web APIs
he api for creating and managing a websocket connection to a server, as well as for sending and receiving data on the connection. to construct a websocket, use the websocket() constructor. constructor websocket(url[, protocols]) returns a newly created websocket object. constants constant value websocket.connecting 0 websocket.open 1 websocket.
closing 2 websocket.closed 3 properties websocket.binarytype the binary data type used by the connection. websocket.bufferedamount read only the number of bytes of queued data. websocket.extensions read only the extensions selected by the server. websocket.onclose an event listener to be called when the connection is closed. websocket.onerror an event listener to be ca...
Writing WebSocket servers - Web APIs
rol frame. pings have an opcode of 0x9, and pongs have an opcode of 0xa. when you get a ping, send back a pong with the exact same payload data as the ping (for pings and pongs, the max payload length is 125). you might also get a pong without ever sending a ping; ignore this if it happens. if you have gotten more than one ping before you get the chance to send a pong, you only send one pong.
closing the connection to close a connection either the client or server can send a control frame with data containing a specified control sequence to begin the
closing handshake (detailed in section 5.5.1). upon receiving such a frame, the other peer sends a close frame in response. the first peer then closes the connection. any further data received after
closing of connection is then discarded. mis...
Web Video Text Tracks Format (WebVTT) - Web APIs
t is future text . this enables karaoke style captions. example 12 - karaoke style text 1 00:16.500 --> 00:18.500 when the moon <00:17.500>hits your eye 1 00:00:18.500 --> 00:00:20.500 like a <00:19.000>big-a <00:19.500>pizza <00:20.000>pie 1 00:00:20.500 --> 00:00:21.500 that's <00:00:21.000>amore the following tags are the html tags allowed in a cue and require opening and
closing tags (e.g., <b>text</b>). class tag (<c></c>) style the contained text using a css class. example 14 - class tag <c.classname>text</c> italics tag (<i></i>) italicize the contained text. example 15 - italics tag <i>text</i> bold tag (<b></b>) bold the contained text. example 16 - bold tag <b>text</b> underline tag (<u></u...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
in the context of the real world (in the case of augmented reality). in order to perceive depth, it's necessary to have two perspectives on the scene. by comparing the two views, it's possible to recognize the depth of objects and, by extension, the distance between the viewer and objects which are seen. this is why we have two eyes, spaced slightly apart. you can remind yourself of this fact by
closing one eye at a time, switching back and forth between the two eyes. notice how your left eye can see the left side of your nose but not the right, while your right eye sees the right side of your nose but not the left. that's just one of many differences that exist between what each of your eyes see. our brain receives two sets of data about light levels and wavelengths throughout our field of vie...
Targeting and hit detection - Web APIs
ly for game development. simplified representative objects one common solution is to overlay simplified, invisible objects atop the objects in your scene. these objects then serve a s. for instance, if you have a more-or-less rectangular object, use a rectangle as a surrogate for the object when performing hit testing. likewise, if an object is essentially round, use the radius of the minimum en
closing circle to establish a colision test object. real-world hit testing the acronym "lidar" has multiple definitions depending on specifics of how it's implemented, but the end result is the same. most commonly, it refers to "laser imaging, detection, and ranging" or "light detection and ranging"). testing for collisions with the real world is a different problem, which may involve not only interpr...
window.dump() - Web APIs
dump output you have to enable it by setting the preference browser.dom.window.dump.enabled to true. you can set the preference in about:config or in a user.js file. note: this preference is not listed in about:config by default, you may need to create it (right-click the content area -> new -> boolean). on windows, you will need a console to actually see anything. if you don't have one already,
closing the application and re-opening it with the command line parameter -console should create the console or use -attach-console to use the existing console. on other operating systems, it's enough to launch the application from a terminal. to redirect the console output to a file, run firefox without the -console option and use the syntax to redirect stderr and stdout to a file, i.e.: firefox > con...
Window.sessionStorage - Web APIs
onstorage is cleared when the page session ends. a page session lasts as long as the browser is open, and survives over page reloads and restores. opening a page in a new tab or window creates a new session with the value of the top-level browsing context, which differs from how session cookies work. opening multiple tabs/windows with the same url creates sessionstorage for each tab/window.
closing a tab/window ends the session and clears objects in sessionstorage. data stored in sessionstorage is specific to the protocol of the page. in particular, data stored by a script on a site accessed with http (e.g., http://example.com) is put in a different sessionstorage object from the same site accessed with https (e.g., https://example.com). the keys and the values are always in the utf-16 d...
WorkerGlobalScope.close() - Web APIs
the close() method of the workerglobalscope interface discards any tasks queued in the workerglobalscope's event loop, effectively
closing this particular scope. syntax self.close(); example if you wanted to close your worker instance from inside the worker itself, you could call the following: close(); close() and self.close() are effectively equivalent — both represent close() being called from inside the worker's inner scope. note: there is also a way to stop the worker from the main thread: the worker.terminate method. ...
WorkerGlobalScope - Web APIs
ocess of fetching a resource from the network. windoworworkerglobalscope.setinterval() schedules a function to execute every time a given number of milliseconds elapses. windoworworkerglobalscope.settimeout() schedules a function to execute in a given amount of time. deprecated methods workerglobalscope.close() discards any tasks queued in the workerglobalscope's event loop, effectively
closing this particular scope. in newer browser versions, close() is available on dedicatedworkerglobalscope and sharedworkerglobalscope instead. this change was made to stop close() being available on service workers, as it isn't supposed to be used there and always throws an exception when called (see bug 1336043). example you won't access workerglobalscope directly in your code; however, its proper...
WritableStream.WritableStream() - Web APIs
defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestrea...
WritableStream.getWriter() - Web APIs
defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestrea...
WritableStream - Web APIs
defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestrea...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestrea...
WritableStreamDefaultWriter.close() - Web APIs
defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestrea...
WritableStreamDefaultWriter.ready - Web APIs
make sure the stream and its writer are able to // receive data. defaultwriter.ready .then(function() { defaultwriter.write(chunk) .then(function() { console.log("chunk written to sink.); }) .catch(function(err) { console.log("chunk error: " + err); }); }); // call ready again to ensure that all chunks are written // before
closing the writer. defaultwriter.ready .then(function() { defaultwriter.close() .then(function() { console.log("all chunks written"); }) .catch(function(err) { console.log("stream error: " + err); }); }); }); } specifications specification status comment streamsthe definition of 'ready' in that specification. living...
WritableStreamDefaultWriter.write() - Web APIs
defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestrea...
WritableStreamDefaultWriter - Web APIs
defaultwriter.ready .then(() => { defaultwriter.close(); }) .then(() => { console.log("all chunks written"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = ne...
XRSession.onsqueezeend - Web APIs
the xrsession interface's onsqueezeend event handler property is a function to be invokedn when the squeezeend event sent to an xrsession when a primary squeeze action ends. this is sent immediately after the squeeze event, which announces the successful completion of the squeeze action. the squeezeend event handler is where you handle
closing out a squeeze action whether it was successfully completed or not. to learn more about how the sequence of squeeze events works, see primary squeeze actions in inputs and input sources. syntax xrsession.onsqueezeend = squeezeendhandlerfunction; value a function to be invoked whenever the xrsession receives a squeezestart event, indicating the ending of a primary squeeze action. examples this snippet of code adds a simple handler for the squeezeend...
Using the aria-describedby attribute - Accessibility
"> ... </div> </div> example 2: a close button in the example below, a link that functions as a 'close' button on a dialog is described elsewhere in the document. the aria-describedby attribute is used to associate the description with the link. <button aria-label="close" aria-describedby="descriptionclose" onclick="mydialog.close()">x</button> ... <div id="descriptionclose">
closing this window will discard any information entered and return you back to the main page</div> working examples: checkbox example uses aria-describedby tooltip example uses aria-describedby notes the aria-describedby attributed is not designed to reference descriptions on an external resource—since it is an id, it must reference an element in the same dom document. used by aria roles...
ARIA: tab role - Accessibility
ipt features while there are ways to build tab-like functionality without javascript, there are no substitute combination of html and css only that will provide the same set of functionality that's required above for accessible tabs with content. example this example combines the role tab with tablist and elements with tabpanel to create an interactive group of tabbed content. here we are en
closing our group of content in a div, with our tablist having an aria-label to label it for assistive technology. each tab is a button with the attributes previously mentioned. the first tab has tabindex=0 on it, which we will later change to whatever tab has aria-selected=true. all of the tabpanel elements have tabindex=0 to make them tabbable, and all but the currently active one have the hidden attri...
Alerts - Accessibility
r will be notified via an alert. instead of using the javascript ‘alert’ function, we’ll use a simple wai-aria widget for notification. this notifies the user of the error, but allows for them continue modifying the form without losing focus (caused by the “onblur” handler in javascript's default ‘alert’ function). ...
Attribute selectors - CSS: Cascading Style Sheets
esents 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 value i] adding an i (or i) before the
closing bracket causes the value to be compared case-insensitively (for characters within the ascii range). [attr operator value s] adding an s (or s) before the
closing bracket causes the value to be compared case-sensitively (for characters within the ascii range). examples links css a { color: blue; } /* internal links, beginning with "#" */ a[href^="#"] { background-color: gold; } /* l...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
grid-auto-flow: dense; } anonymous grid items there is a mention in the specification of anonymous grid items. these are created if you have a string of text inside your grid container, that is not wrapped in any other element. in the example below we have three grid items, assuming you had set the parent with a class of grid to display: grid. the first is an anonymous item as it has no en
closing markup, this item will always be dealt with via the auto-placement rules. the other two are grid items enclosed in a div, they might be auto-placed or you could place these with a positioning method onto your grid. <div class="grid"> i am a string and will become an anonymous item <div>a grid item</div> <div>a grid item</div> </div> anonymous items are always auto-placed because there is...
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
io this image doesn't specify either a width or a height; instead, it specifies an intrinsic ratio of 1:1. think of this like a program icon. it's always square, and is usable at any size, such as 32x32, 128x128, or 512x512, for example. svg source scaling examples now let's see some examples of what happens as we apply different scaling to these images. in each of the examples below, the en
closing rectangles are 300 pixels wide and 200 pixels tall. in addition, the backgrounds have background-repeat set to no-repeat for clarity. note: the screenshots below show the expected rendering. not all browsers currently render these correctly. specifying fixed lengths for both dimensions if you use background-size to specify fixed lengths for both dimensions, those lengths are always used, per r...
Value definition syntax - CSS: Cascading Style Sheets
mark (?) the question mark multiplier indicates that the entity is optional, and must appear zero or one time. bold smaller? this example matches the following values: bold bold smaller but not: bold smaller smaller, as smaller must appear at most one time. smaller, as bold is juxtaposed and must appear before any smaller keyword. curly braces ({ }) the curly braces multiplier, en
closing two integers separated by a comma, a and b, indicates that the entity must appear at least a times and at most b times. bold smaller{1,3} this example matches the following values: bold smaller bold smaller smaller bold smaller smaller smaller but not: bold, as smaller must appear at least one time. bold smaller smaller smaller smaller, as smaller must appear at most three times. sm...
<basic-shape> - CSS: Cascading Style Sheets
these arguments follow the syntax of the margin shorthand, that let you set all four insets with one, two or four values. the optional <border-radius> argument(s) define rounded corners for the inset rectangle using the border-radius shorthand syntax. a pair of insets in either dimension that add up to more than the used dimension (such as left and right insets of 75% apiece) define a shape en
closing no area. for this specification, this results in an empty float area. circle() circle( [<shape-radius>]? [at <position>]? ) the <shape-radius> argument represents r, the radius of the circle. negative values are invalid. a percentage value here is resolved from the used width and height of the reference box as sqrt(width^2+height^2)/sqrt(2). the <position> argument defines the center of...
var() - CSS: Cascading Style Sheets
ifier that starts with two dashes. custom properties are solely for use by authors and users; css will never give them a meaning beyond what is presented here. <declaration-value> the custom property's fallback value, which is used in case the custom property is invalid in the used context. this value may contain any character except some characters with special meaning like newlines, unmatched
closing brackets, i.e. ), ], or }, top-level semicolons, or exclamation marks. examples :root { --main-bg-color: pink; } body { background-color: var(--main-bg-color); } /* fallback */ /* in the component’s style: */ .component .header { color: var(--header-color, blue); /* header-color isn’t set, and so remains blue, the fallback value */ } .component .text { color: var(--text-color, ...
Event reference
alertclose addons specific a notification element is closed. fullscreen addons specific browser fullscreen mode has been toggled. sizemodechange addons specific window has entered/left fullscreen mode, or has been minimized/unminimized. mozentereddomfullscreen addons specific dom fullscreen mode has been entered. sswindow
closing addons specific the session store will stop tracking this window. sstab
closing addons specific the session store will stop tracking this tab. sstabrestoring addons specific a tab is about to be restored. sstabrestored addons specific a tab has been restored. sswindowstateready addons specific a window state has ...
Cross-browser audio basics - Developer guides
used to inform the browser of the file type. if omitted, most browsers will attempt to guess this from the file extension. if the <audio> element is not supported then <audio> and <source> will be ignored. however any supported text or elements that you define within <audio> will be displayed or acted upon. so the ideal place to create a fallback or inform of incompatibility is before the
closing </audio> tag. in this case, we've provided a simple paragraph including a link to download the audio directly. the controls attribute on the <audio> element is specified when we require the browser to provide us with default playback controls. if you don't specify this attribute, no controls will appear — and you will instead have to create your own controls and program their functionality usi...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
he hexadecimal string notation covered above. example: picking a color let's look at a simple example, in which the user can choose a color. as the user adjusts the color, the border around the example changes to reflect the new color. after finishing up and picking the final color, the color picker's value is displayed. on macos, you indicate that you've finalized selection of the color by
closing the color picker window. html the html here creates a box that contains a color picker control (with a label created using the <label> element) and an empty paragraph element (<p>) into which we'll output some text from our javascript code. <div id="box"> <label for="colorpicker">border color:</label> <input type="color" value="#8888ff" id="colorpicker"> <p id="output"></p> </div> css ...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
headings • page structure • wai web accessibility tutorials mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 mdn understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.1 | w3c understanding wcag 2.0 understanding success criterion 2.4.6 | w3c understanding wcag 2.0 understan...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
pull request. the above example shows simple usage of the <audio> element. in a similar manner to the <img> element, we include a path to the media we want to embed inside the src attribute; we can include other attributes to specify information such as whether we want it to autoplay and loop, whether we want to show the browser's default audio controls, etc. the content inside the opening and
closing <audio></audio> tags is shown as a fallback in browsers that don't support the element. attributes this element's attributes include the global attributes. autoplay a boolean attribute: if specified, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading. note: sites that automatically play audio (or videos with ...
<base>: The Document Base URL element - HTML: Hypertext Markup Language
for all relative urls in a document. there can be only one <base> element in a document. a document's used base url can be accessed by scripts with document.baseuri. if the document has no <base> elements, then baseuri defaults to location.href. content categories metadata content. permitted content none, it is an empty element. tag omission there must be no
closing tag. permitted parents a <head> that doesn't contain another <base> element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlbaseelement attributes this element's attributes include the global attributes. if either of the following attributes are specified, this element must come before oth...
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
e notes alternative content you may (and should) provide alternate content inside the <canvas> block. that content will be rendered both on older browsers that don't support canvas and in browsers with javascript disabled. providing a useful fallback text or sub dom helps to make the the canvas more accessible. required </canvas> tag unlike the <img> element, the <canvas> element requires the
closing tag (</canvas>). sizing the canvas using css versus html the displayed size of the canvas can be changed using css, but if you do this the image is scaled during rendering to fit the styled size, which can make the final graphics rendering end up being distorted. it is better to specify your canvas dimensions by setting the width and height attributes directly on the <canvas> elements, either ...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
ntents of the <summary> element are used as the label for the disclosure widget. 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: the common use of a triangle which rotates or twists around to represent opening or
closing the widget is why these are sometimes called "twisties." a <details> widget can be in one of two states. the default closed state displays only the triangle and the label inside <summary> (or a user agent-defined default string if no <summary>). this might look like the following: here we see a standard disclosure widget with the label "system requirements", in its default closed state. when...
<mark>: The Mark Text element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, palpable content. permitted content phrasing content. ...
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use. this element was deprecated in html 4.01 and above in favor of placing fallback content between the opening and
closing tags of an <object> element. while this element currently still works in many browsers, it is obsolete and should not be used. use <object> instead, with fallback content between the opening and
closing tags of the element. examples the message inside <noembed> tag will appear only when your browser does not support <embed> tag. show an alternative content <embed type="vide/webm" src="/media/examples/flower.mp4" width="200" height="200">...
<p>: The Paragraph element - HTML: Hypertext Markup Language
represents a paragraph. paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but html paragraphs can be any structural grouping of related content, such as images or form fields. paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the
closing </p> tag. see “tag omission” below. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, palpable content. permitted content phrasing content. tag omissio...
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
note: do not use this element. <plaintext> is deprecated since html 2, and not all browsers implemented it. browsers that did implement it didn't do so consistently. <plaintext> is obsolete in html5; browsers that accept it may instead treat it as a <pre> element that still interprets html within. if <plaintext> is the first element on the page (other than any non-displayed elements, like <head>), do not use html at all. ...
<rtc>: The Ruby Text Container element - HTML: Hypertext Markup Language
(<rt>) and semantic (<rtc>) annotations. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content phrasing content or <rt> elements. tag omission the
closing tag can be omitted if it is immediately followed by a <rb>, <rtc> or <rt> element opening tag or by its parent
closing tag. permitted parents a <ruby> element. permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes. examples <div class="info"> <ruby> <rbc> <rb>旧</rb><rt>jiù</rt> ...
<textarea> - HTML: Hypertext Markup Language
o be associated with a <label> element for accessibility purposes a name attribute to set the name of the associated data point submitted to the server when the form is submitted. rows and cols attributes to allow you to specify an exact size for the <textarea> to take. setting these is a good idea for consistency, as browser defaults can differ. default content entered between the opening and
closing tags. <textarea> does not support the value attribute. the <textarea> element also accepts several attributes common to form <input>s, such as autocomplete, autofocus, disabled, placeholder, readonly, and required. attributes this element includes the global attributes. autocapitalize this is a non-standard attribute supported by webkit on ios (therefore nearly all browsers running on i...
<title>: The Document Title element - HTML: Hypertext Markup Language
the html title element (<title>) defines the document's title that is shown in a browser's title bar or a page's tab. it only contains text; tags within the element are ignored. <title>grandma's heavy metal festival journal</title> content categories metadata content. permitted content text that is not inter-element whitespace. tag omission both opening and
closing tags are required. note that leaving off </title> should cause the browser to ignore the rest of the page. permitted parents a <head> element that contains no other <title> element. implicit aria role no corresponding role permitted aria roles no role permitted. dom interface htmltitleelement attributes this element only includes the global a...
<video>: The Video Embed element - HTML: Hypertext Markup Language
example shows simple usage of the <video> element. in a similar manner to the <img> element, we include a path to the media we want to display inside the src attribute; we can include other attributes to specify information such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's default video controls, etc. the content inside the opening and
closing <video></video> tags is shown as a fallback in browsers that don't support the element. attributes like all other html elements, this element supports the global attributes. autoplay a boolean attribute; if specified, the video automatically begins to play back as soon as it can do so without stopping to finish loading the data. note: sites that automatically play audio (or videos with an ...
HTML documentation index - HTML: Hypertext Markup Language
to define an image map (a clickable link area). 153 <mark>: the mark text element element, html, html text-level semantics, html5, highlighting, highlighting text, marking text, reference, web, mark the html mark text element (<mark>) represents text which is marked or highlighted for reference or notation purposes, due to the marked passage's relevance or importance in the en
closing context. 154 <marquee>: the marquee element (obsolete) element, html, obsolete, reference, web, marquee the html <marquee> element is used to insert a scrolling area of text. you can control what happens when the text reaches the edges of its content area using its attributes. 155 <menu> element, experimental, html, html interactive elements, navigation, refere...
Link types - HTML: Hypertext Markup Language
itation about the webpage. the protocol used to make such a call is defined in the pingback 1.0 specification. note: if the x-pingback: http header is also present, it supersedes the <link> element with this link type. <link> <a>, <area>, <form> preconnect provides a hint to the browser suggesting that it open a connection to the linked web site in advance, without dis
closing any private information or downloading any content, so that when the link is followed the linked content can be fetched more quickly. <link> <a>, <area>, <form> prefetch suggests that the browser fetch the linked resource in advance, as it is likely to be requested by the user. starting with firefox 44, the value of the crossorigin attribute is taken into consideration, making i...
Forwarded - HTTP
ndent content and by design it exposes privacy sensitive information, such as the ip address of the client. therefore the user's privacy must be kept in mind when deploying this header. header type request header forbidden header name no syntax forwarded: by=<identifier>;for=<identifier>;host=<host>;proto=<http|https> directives <identifier> an identifier dis
closing the information that is altered or lost when using a proxy. this can be either: an ip address (v4 or v6, optionally with a port, and ipv6 quoted and enclosed in square brackets), an obfuscated identifier (such as "_hidden" or "_secret"), or "unknown" when the preceding entity is not known (and you still want to indicate that forwarding of the request was made). by=<identifier> the i...
Keep-Alive - HTTP
alue separated by the equal sign ('='). the following identifiers are possible: timeout: indicating the minimum amount of time an idle connection has to be kept opened (in seconds). note that timeouts longer than the tcp timeout may be ignored if no keep-alive tcp message is set at the transport level. max: indicating the maximum number of requests that can be sent on this connection before
closing it. unless 0, this value is ignored for non-pipelined connections as another request will be sent in the next response. an http pipeline can use it to limit the pipelining. examples a response containing a keep-alive header: http/1.1 200 ok connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: thu, 11 aug 2016 15:23:13 gmt keep-alive: timeout=5, max=10...
Closures - JavaScript
es benefits that are normally associated with object-oriented programming. in particular, data hiding and encapsulation. closure scope chain every closure has three scopes: local scope (own scope) outer functions scope global scope a common mistake is not realizing that, in the case where the outer function is itself a nested function, access to the outer function's scope includes the en
closing scope of the outer function—effectively creating a chain of function scopes. to demonstrate, consider the following example code. // global scope var e = 10; function sum(a){ return function(b){ return function(c){ // outer functions scope return function(d){ // local scope return a + b + c + d + e; } } } } console.log(sum(1)(2)(3)(4)); // log 20 ...
Control flow and error handling - JavaScript
d! // while f() executes, the `finally` block returns false, // which overwrites the `throw` inside the above `catch` console.log('caught outer "bogus"'); } // output // caught inner "bogus" // false nesting try...catch statements you can nest one or more try...catch statements. if an inner try...catch statement does not have a catch block: it must contain a finally block, and the en
closing try...catch statement's catch block is checked for a match. for more information, see nested try-blocks on the try...catch reference page. utilizing error objects depending on the type of error, you may be able to use the name and message properties to get a more refined message. the name property provides the general class of error (such as domexception or error), while message generally pr...
SyntaxError: missing ] after element list - JavaScript
the javascript exception "missing ] after element list" occurs when there is an error with the array initializer syntax somewhere. likely there is a
closing bracket ("]") or a comma (",") missing. message syntaxerror: missing ] after element list error type syntaxerror. what went wrong? there is an error with the array initializer syntax somewhere. likely there is a
closing bracket ("]") or a comma (",") missing. examples incomplete array initializer var list = [1, 2, var instruments = [ 'ukulele', 'guitar', 'piano' }; var data = [{foo: 'bar'} {bar: 'foo'}]; correct would be: var list = [1, 2]; var instruments = [ 'ukulele', 'guitar', 'piano' ]; var data = [{foo: 'bar'}, {bar: 'foo'}]; ...
SyntaxError: missing } after property list - JavaScript
somewhere. might be in fact a missing curly bracket, but could also be a missing comma. message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong? there is a mistake in the object initializer syntax somewhere. might be in fact a missing curly bracket, but could also be a missing comma, for example. also check if any
closing curly brackets or parenthesis are in the correct order. indenting or formatting the code a bit nicer might also help you to see through the jungle. examples forgotten comma oftentimes, there is a missing comma in your object initializer code: var obj = { a: 1, b: { myprop: 2 } c: 3 }; correct would be: var obj = { a: 1, b: { myprop: 2 }, c: 3 }; ...
SyntaxError: missing ) after argument list - JavaScript
missing ) after argument list (firefox) error type syntaxerror. what went wrong? there is an error with how a function is called. this might be a typo, a missing operator, or an unescaped string, for example. examples because there is no "+" operator to concatenate the string, javascript expects the argument for the log function to be just "pi: ". in that case, it should be terminated by a
closing parenthesis. console.log('pi: ' math.pi); // syntaxerror: missing ) after argument list you can correct the log call by adding the "+" operator: console.log('pi: ' + math.pi); // "pi: 3.141592653589793" unterminated strings console.log('"java" + "script" = \"' + 'java' + 'script\"); // syntaxerror: missing ) after argument list here javascript thinks that you meant to have ); inside the st...
SyntaxError: Unexpected token - JavaScript
the javascript exceptions "unexpected token" occur when a specific language construct was expected, but something 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 ')'...
SyntaxError: unterminated string literal - JavaScript
ring literal (firefox) error type syntaxerror what went wrong? there is an unterminated string somewhere. string literals must be enclosed by single (') or double (") quotes. javascript makes no distinction between single-quoted strings and double-quoted strings. escape sequences work in strings created with either single or double quotes. to fix this error, check if: you have opening and
closing quotes (single or double) for your string literal, you have escaped your string literal correctly, your string literal isn't split across multiple lines. examples multiple lines you can't split a string across multiple lines like this in javascript: var longstring = 'this is a very long string which needs to wrap across multiple lines because otherwise m...
FinalizationRegistry - JavaScript
or some time later, or not at all. it's likely that major implementations will call cleanup callbacks at some point during execution, but those calls may be substantially after the related object was reclaimed. there are also situations where even implementations that normally call cleanup callbacks are unlikely to call them: when the javascript program shuts down entirely (for instance,
closing a tab in a browser). when the finalizationregistry instance itself is no longer reachable by javascript code. examples creating a new registry you create the registry passing in the callback: const registry = new finalizationregistry(heldvalue => { // .... }); registering objects for cleanup then you register any objects you want a cleanup callback for by calling the `register` ...
Symbol.prototype.description - JavaScript
xamples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. description symbol objects can be created with an optional description which can be used for debugging but not to access the symbol itself. the symbol.prototype.description property can be used to read that description. it is different to symbol.prototype.tostring() as it does not contain the en
closing "symbol()" string. see the examples. examples using description symbol('desc').tostring(); // "symbol(desc)" symbol('desc').description; // "desc" symbol('').description; // "" symbol().description; // undefined // well-known symbols symbol.iterator.tostring(); // "symbol(symbol.iterator)" symbol.iterator.description; // "symbol.iterator" // global symbols symbol.for('foo').t...
undefined - JavaScript
ariable 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 en
closing 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 defined globally } void operator and undefined the void operator is a third alternative. var x; if ...
Lexical grammar - JavaScript
= 42; var o = {a, b, c}; // instead of var o = { a: a, b: b, c: c }; array literals see also array for more information. [1954, 1974, 1990, 2014] string literals a string literal is zero or more unicode code points enclosed in single or double quotes. unicode code points may also be represented by an escape sequence. all code points may appear literally in a string literal except for these
closing quote code points: u+005c \ (backslash), u+000d <cr>, and u+000a <lf>. prior to the proposal to make all json text valid ecma-262, u+2028 <ls> and u+2029 <ps>, were also disallowed from appearing unescaped in string literals. any code points may appear in the form of an escape sequence. string literals evaluate to ecmascript string values. when generating these string values unicode code ...
for...of - JavaScript
in these cases, the iterator is closed. function* foo(){ yield 1; yield 2; yield 3; }; for (const o of foo()) { console.log(o); break; // closes iterator, execution continues outside of the loop } console.log('done'); iterating over generators you can also iterate over generators, i.
function declaration - JavaScript
function foo(){ return 1; } } // in chrome: // 'foo' name is hoisted. typeof foo is undefined // // in firefox: // 'foo' name is hoisted. typeof foo is undefined // // in edge: // 'foo' name is not hoisted. typeof foo is undefined // // in safari: // 'foo' name is hoisted. typeof foo is function function declaration hoisting function declarations in javascript are hoisted to the top of the en
closing function or global scope. you can use the function before you declared it: hoisted(); // logs "foo" function hoisted() { console.log('foo'); } note that function expressions are not hoisted: nothoisted(); // typeerror: nothoisted is not a function var nothoisted = function() { console.log('bar'); }; examples using function the following code declares a function that returns the tot...
let - JavaScript
the window object when declared globally (in the top-most scope). an explanation of why the name "let" was chosen can be found here. examples scoping rules variables declared by let have their scope in the block for which they are defined, as well as in any contained sub-blocks. in this way, let works very much like var. the main difference is that the scope of a var variable is the entire en
closing function: function vartest() { var x = 1; { var x = 2; // same variable! console.log(x); // 2 } console.log(x); // 2 } function lettest() { let x = 1; { let x = 2; // different variable console.log(x); // 2 } console.log(x); // 1 } at the top level of programs and functions, let, unlike var, does not create a property on the global object. for example: v...
throw - JavaScript
urns -1 c = verifyzipcode('a'); // returns -1 d = verifyzipcode('95060'); // returns 95060 e = verifyzipcode('95060 1234'); // returns 95060 1234 rethrow an exception you can use throw to rethrow an exception after you catch it. the following example catches an exception with a numeric value and rethrows it if the value is over 50. the rethrown exception propagates up to the en
closing function or to the top level so that the user sees it. try { throw n; // throws an exception with a numeric value } catch (e) { if (e <= 50) { // statements to handle exceptions 1-50 } else { // cannot handle this exception, so rethrow throw e; } } specifications specification ecmascript (ecma-262)the definition of 'throw statement' in that ...
var - JavaScript
l identifier. valuen optional initial value of the variable. it can be any legal expression. default value is undefined. description var declarations, wherever they occur, are processed before any code is executed. this is called hoisting, and is discussed further below. the scope of a variable declared with var is its current execution context and closures thereof, which is either the en
closing function and functions declared within it, or, for variables declared outside any function, global. duplicate variable declarations using var will not trigger an error, even in strict mode, and the variable will not lose its value, unless another assignment is performed. 'use strict'; function foo() { var x = 1; function bar() { var y = 2; console.log(x); // 1 (function `bar` closes ...
Strict mode - JavaScript
ents[i] does not track the value of the corresponding named argument, nor does a named argument track the value in the corresponding arguments[i]. function f(a) { 'use strict'; a = 42; return [a, arguments[0]]; } var pair = f(17); console.assert(pair[0] === 42); console.assert(pair[1] === 17); third, arguments.callee is no longer supported. in normal code arguments.callee refers to the en
closing function. this use case is weak: simply name the en
closing function! moreover, arguments.callee substantially hinders optimizations like inlining functions, because it must be made possible to provide a reference to the un-inlined function if arguments.callee is accessed. arguments.callee for strict mode functions is a non-deletable property which throws an error when set or retrieved: 'use stri...
<menclose> - MathML
attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. notation a list of notations, separated by white space, to apply to the child elements. the symbols are each drawn as if the others are not present, and therefore may overlap. ...
<mo> - MathML
efault properties. for ordinary operators (+, -, etc. ) you usually do not need to specify this attribute explicitly. possible values are: prefix, for opening fences. (it is the default value if the operator is the first argument in a <mrow> element with more than one argument.) infix, for separators. (it is the default value if the operator is not included in a <mrow> element.) postfix,
closing fences. (it is the default value if the operator is the last argument in a <mrow> element with more than one argument.) href used to set a hyperlink to a specified uri. largeop specifies whether the operator should be drawn larger than normal when displaystyle="true" is set. allowed values are either true or false. lspace the amount of space before the operator (see length for values an...
<ms> - MathML
the default value is """. examples <math> <ms lquote="„" rquote="“"> abc </ms> </math> specifications specification status comment mathml 3.0the definition of 'ms' in that specification. recommendation current specification mathml 2.0the definition of 'ms' in that specification. re...
Web video codec guide - Web media technologies
a broadly-supported combination—by every major browser, in fact—and the quality is typically good for most use cases. make sure you verify your compliance with the license requirements, however. <video controls> <source type="video/webm" src="filename.webm"> <source type="video/mp4" src="filename.mp4"> </video> keep in mind that the <video> element requires a
closing </video> tag, whether or not you have any <source> elements inside it. recommendations for high-quality video presentation if your mission is to present video at the highest possible quality, you will probably benefit from offering as many formats as possible, as the codecs capable of the best quality tend also to be the newest, and thus the most likely to have gaps in browser compatibility. ...