Search completed in 1.29 seconds.
2642 results for "nsID":
Your results are loading. Please wait...
nsIDOMWindowUtils
dom/interfaces/base/nsidomwindowutils.idlscriptable this interface is a dom utility interface that provides useful dom methods and attributes.
...to get this interface, use: var domwindowutils = window.windowutils; method overview void activatenativemenuitemat(in astring indexstring); void clearmozafterpaintevents(); pruint32 comparecanvases(in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference); double computeanimationdistance(in nsidomelement element, in astring property, in astring value1, in astring value2); nsicompositionstringsynthesizer createcompositionstringsynthesizer(); obsolete since gecko 38.0 void disablenontestmouseevents(in boolean adisable); ...
... boolean dispatchdomeventviapresshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodalstate(); nsidomelement findelementwithviewid(in nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsummary(in long ascri...
...And 32 more matches
nsIDocShell
docshell/base/nsidocshell.idlscriptable ???
...instead, retrieve an nsidocshell from a browser or other document container element.
... note that out-of-process browsers do not have an nsidocshell; instead you can access the nsidocshell object from a frame script.
...And 27 more matches
nsIDOMWindowInternal
dom/interfaces/base/nsidomwindowinternal.idlscriptable this interface is part of a chain of interfaces used to represent a window in the dom.
... 66 introduced gecko 1.0 deprecated gecko 8.0 inherits from: nsidomwindow last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) in gecko 8.0 this interface was merged into the nsidomwindow interface.
...add-ons should be updated to use nsidomwindow instead.
...And 22 more matches
nsIDOMMozNetworkStatsManager
please check dom/network/interfaces/nsidomnetworkstatsmanager.idl to make sure this data is accurate.
... dom/network/interfaces/nsidomnetworkstatsmanager.idlscriptable interface that provides access to network usage statistics.
...to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstatsmanager;1"] .createinstance(components.interfaces.nsidomnetworkstatsmanager); furthermore, the networkstatsmanager is published through a moznetworkstats child object within the navigator object.
...And 17 more matches
nsIDOMWindow
dom/interfaces/base/nsidomwindow.idlscriptable this interface is the primary interface for a window object.
... starting in firefox 3, dom windows are actually based on nsidomwindow2, which is a subclass of nsidomwindow that adds some new features to this interface.
... in gecko 7.0 nsidomwindow2 has been merged into this interface.
...And 17 more matches
nsIDownloadProgressListener
/toolkit/components/downloads/nsidownloadprogresslistener.idlscriptable this interface gives applications and extensions a way to monitor the status of downloads being processed by the download manager.
... inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) to use simply implement this interface in your code, then call nsidownloadmanager.addlistener() to start listening.
... when you no longer need to listen to the download manager's state, call nsidownloadmanager.removelistener() to stop listening.
...And 16 more matches
nsIDownloadManager
toolkit/components/downloads/public/nsidownloadmanager.idlscriptable this interface lets applications and extensions communicate with the download manager, adding and removing files to be downloaded, fetching information about downloads, and being notified when downloads are completed.
...to get the service, use: var downloadmanager = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); method overview nsidownload adddownload(in short adownloadtype, in nsiuri asource, in nsiuri atarget, in astring adisplayname, in nsimimeinfo amimeinfo, in prtime astarttime, in nsilocalfile atempfile, in nsicancelable acancelable, in boolean aisprivate); void addlistener(in nsidownloadprogresslistener alistener); void canceldownload(in unsigned long aid); void cleanup(); void endbatchupdate(); obsolete since gecko...
... 1.9.1 void flush(); obsolete since gecko 1.8 nsidownload getdownload(in unsigned long aid); void onclose(); obsolete since gecko 1.9.1 void open(in nsidomwindow aparent, in nsidownload adownload); obsolete since gecko 1.9.1 void openprogressdialogfor(in nsidownload adownload, in nsidomwindow aparent, in boolean acanceldownloadonclose); obsolete since gecko 1.9.1 void pausedownload(in unsigned long aid); void removedownload(in unsigned long aid); void removedownloadsbytimeframe(in long long abegintime, in long long aendtime); void removelistener(in nsidownloadprogresslistener alistener); void resumedownload(in unsigned long aid); void retrydownload(in unsigned long aid); void savest...
...And 13 more matches
break-inside - CSS: Cascading Style Sheets
the break-inside css property sets how page, column, or region breaks should behave inside a generated box.
... /* keyword values */ break-inside: auto; break-inside: avoid; break-inside: avoid-page; break-inside: avoid-column; break-inside: avoid-region; /* global values */ break-inside: inherit; break-inside: initial; break-inside: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
...thus, the break-before value has precedence over the break-after value, which in turn has precedence over the break-inside value.
...And 10 more matches
nsIDBChangeListener
the nsidbchangelistener interface is used by components wanting to receive notification when the current database changes somehow.
...ction(akeychanged, oldparent, newparent, ainstigator) {}, onannouncergoingaway: function(ainstigator) {}, onreadchanged: function(ainstigator) {}, onjunkscorechanged: function(ainstigator) {}, onhdrpropertychanged: function(ahdrtochange, aprechange, astatus, ainstigator) {}, onevent: function(adb, aevent) {}, queryinterface: function(aiid) { if (!aiid.equals(components.interfaces.nsidbchangelistener) && !aiid.equals(components.interfaces.nsisupports)) throw components.results.ns_error_no_interface; return this; } }; and to attach it in thunderbird, we must call addlistener on a nsidbchangeannouncer, typically through a nsimsgdatabase.
...essage database: if you have a nsimsgfolder, you can do this like so: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access the message database through the nsimsgdbview like so: gfolderdisplay.view.dbview.db.addlistener(mylistener); method overview void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in unsigned long aoldflags, in unsigned long anewflags, in nsidbchangelistener ainstigator); void onhdrdeleted(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onhdradded(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onparentchanged(in nsmsgkey akeychanged, in nsmsgkey oldparent, in nsmsgkey newparent, in nsid...
...And 9 more matches
nsIDOMElement
dom/interfaces/core/nsidomelement.idlscriptable this interface represents an element in an html or xml document.
... inherits from: nsidomnode last changed in gecko 1.7 method overview domstring getattribute(in domstring name); nsidomattr getattributenode(in domstring name); nsidomattr getattributenodens(in domstring namespaceuri, in domstring localname); domstring getattributens(in domstring namespaceuri, in domstring localname); nsidomnodelist getelementsbytagname(in domstring name); nsidomnodelist getelementsbytagnamens(in domstring namespaceuri, in domstring localname); boolean hasattribute(in domstring name); boolean hasattributens(in domstring namespaceuri, in domstring localname); void removeattribute(in domstring name) nsidomattr removeattributenode(in nsidomattr oldattr) void removeattributens(in domstring namespaceuri, in domstring localname) void setattribute(in doms...
...tring name, in domstring value) nsidomattr setattributenode(in nsidomattr newattr) nsidomattr setattributenodens(in nsidomattr newattr) void setattributens(in domstring namespaceuri, in domstring qualifiedname, in domstring value) attributes attribute type description tagname domstring the element tag name.
...And 9 more matches
nsIDOMNode
dom/interfaces/core/nsidomnode.idlscriptable this interface is the primary datatype for the entire document object model.
... inherits from: nsisupports last changed in gecko 0.9.6 method overview nsidomnode appendchild(in nsidomnode newchild) nsidomnode clonenode(in boolean deep); boolean hasattributes(); boolean haschildnodes(); nsidomnode insertbefore(in nsidomnode newchild, in nsidomnode refchild) boolean issupported(in domstring feature, in domstring version); void normalize(); nsidomnode removechild(in nsidomnode oldchild) nsidomnode replacechild(in nsidomnode newchild, in nsidomnode oldchild) attributes attribute type description attributes nsidomnamednodemap read only.
... childnodes nsidomnodelist read only.
...And 9 more matches
nsIDOMGeoGeolocation
summary the nsidomgeogeolocation interface provides access to geolocation information.
... dom/interfaces/geolocation/nsidomgeogeolocation.idlscriptable please add a summary to this article.
...starting in gecko 1.9.2, you can access this service using: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exception when importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsisupports); method overview void clearwatch(in unsigned short watchid); void getcurrentposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorca...
...And 8 more matches
nsIDeviceMotion
xpcom/system/nsidevicemotion.idlscriptable this interface is used to implement accelerometer support.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotion prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3).
... method overview void addlistener(in nsidevicemotionlistener alistener); void addwindowlistener(in nsidomwindow awindow); native code only!
...And 8 more matches
Using nsIDirectoryService
when you have it, queryinterface for the nsidirectoryservice interface.
... apart from this interface there is a function, registerprovider which will allow you to register a nsidirectoryserviceprovider, which implements the getfile callback function: var provider = { getfile : function(prop, persistant) { // return an nsifile }, } components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsidirectoryservice).registerprovider(provider); when the callback is called, it will be passed the string key, and should return an nsifile.
...the new method the new method uses nsidirectoryservice to locate files and directories.
...And 8 more matches
page-break-inside - CSS: Cascading Style Sheets
this property has been replaced by the break-inside property.
... the page-break-inside css property adjusts page breaks inside the current element.
... /* keyword values */ page-break-inside: auto; page-break-inside: avoid; /* global values */ page-break-inside: inherit; page-break-inside: initial; page-break-inside: unset; syntax values auto initial value.
...And 8 more matches
nsIDOMOfflineResourceList
the nsidomofflineresourcelist interface provides access to the application cache that allows web content's resources to be cached locally for use while offline.
... dom/interfaces/offline/nsidomofflineresourcelist.idlscriptable please add a summary to this article.
...6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list.
...And 7 more matches
nsIDOMNSHTMLDocument
dom/interfaces/html/nsidomnshtmldocument.idlscriptable this interface defines methods and properties supported by gecko on the document object that are not part of dom level 2.
...isupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void captureevents(in long eventflags); void clear(); boolean execcommand(in domstring commandid, in boolean doshowui, in domstring value); boolean execcommandshowhelp(in domstring commandid); obsolete since gecko 14.0 domstring getselection(); nsidomdocument open(in acstring acontenttype, in boolean areplace); boolean querycommandenabled(in domstring commandid); boolean querycommandindeterm(in domstring commandid); boolean querycommandstate(in domstring commandid); boolean querycommandsupported(in domstring commandid); domstring querycommandtext(in domstring commandid); obsolete since gecko 14.0 ...
... domstring querycommandvalue(in domstring commandid); void releaseevents(in long eventflags); void routeevent(in nsidomevent evt); void write(); obsolete since gecko 2.0 void writeln(); obsolete since gecko 2.0 attributes attribute type description alinkcolor domstring same as body.alink bgcolor domstring same as body.bgcolor compatmode domstring returns "backcompat" if the document is in quirks mode or "css1compat" if the document is in full standards or almost standards mode.
...And 5 more matches
nsIDOMXPathEvaluator
dom/interfaces/xpath/nsidomxpathevaluator.idlscriptable this interface is used to evaluate xpath expressions against a dom node.
...to create an instance, use: var domxpathevaluator = components.classes["@mozilla.org/dom/xpath-evaluator;1"] .createinstance(components.interfaces.nsidomxpathevaluator); method overview nsidomxpathexpression createexpression(in domstring expression, in nsidomxpathnsresolver resolver) nsidomxpathnsresolver creatensresolver(in nsidomnode noderesolver); nsisupports evaluate(in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result) methods createexpression() creates an nsidomxpathexpression which can then be used for (repeated) evaluations.
... nsidomxpathexpression createexpression( in domstring expression, in nsidomxpathnsresolver resolver ); parameters expression a string representing the xpath to be created.
...And 5 more matches
nsIDragService
widget/nsidragservice.idlscriptable implements the drag service for handling drag and drop operations.
... nsidragsession getcurrentsession( ) ; void invokedragsession( in nsidomnode adomnode, in nsisupportsarray atransferables, in nsiscriptableregion aregion, in unsigned long aactiontype ); void invokedragsessionwithimage(in nsidomnode adomnode, in nsisupportsarray atransferablearray, in nsiscriptableregion aregion, in unsigned long aactiontype, in nsidomnode aimage, in long aimagex, in ...
...long aimagey, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void invokedragsessionwithselection(in nsiselection aselection, in nsisupportsarray atransferablearray, in unsigned long aactiontype, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void startdragsession( ) ; void suppress(); void unsuppress(); constants constant value description dragdrop_action_none 0 no action.
...And 5 more matches
nsIDNSService
netwerk/dns/nsidnsservice.idlscriptable provides domain name resolution service.
...to access the service, use: var dnsservice = components.classes["@mozilla.org/network/dns-service;1"] .createinstance(components.interfaces.nsidnsservice); note: starting in gecko 7.0, the "happy eyeballs" strategy is used to reduce lengthy timeouts when attempting backup connections during attempts to connect from clients that have broken ipv6 connectivity.
... method overview nsicancelable asyncresolve(in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget); void init(); obsolete since gecko 1.8 nsidnsrecord resolve(in autf8string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type description myhostname autf8string read only.
...And 4 more matches
nsIDOMEvent
dom/interfaces/events/nsidomevent.idlscriptable this interface is the primary data type for all events in the document object model.
...n boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface guidelines void settarget(in nsidomeventtarget atarget); native code only!
... currenttarget nsidomeventtarget used to indicate the eventtarget whose eventlisteners are currently being processed.
...And 4 more matches
nsIDOMWindow2
dom/interfaces/base/nsidomwindow2.idlscriptable this interface is the primary interface for a dom window object.
... inherits from: nsidomwindow last changed in gecko 1.9 (firefox 3) because nsidomwindow is frozen, this interface was introduced in firefox 3 (gecko 1.9) to allow dom windows to take on new features.
... dom windows implement nsidomwindow2, which is a subclass of nsidomwindow.
...And 4 more matches
nsIDirectoryService
xpcom/io/nsidirectoryservice.idlscriptable this interface provides methods to initialize and configure a directory service instance.
... inherits from: nsisupports last changed in gecko 1.7 method overview void init(); void registerprovider(in nsidirectoryserviceprovider prov); void unregisterprovider(in nsidirectoryserviceprovider prov); init() initializes the nsidirectoryservice instance.
... this method must be called before an nsidirectoryservice instance can be used.
...And 4 more matches
nsIDroppedLinkHandler
dom/base/nsidroppedlinkhandler.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean candroplink(in nsidomdragevent aevent, in prbool aallowsamedocument); astring droplink(in nsidomdragevent aevent, out astring aname, [optional] in boolean adisallowinherit); void droplinks(in nsidomdragevent aevent, [optional] in boolean adisallowinherit, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidroppedlinkitem alinks); methods candroplink() determines if a link being dragged can be dropped.
... boolean candroplink( in nsidomdragevent aevent, in prbool aallowsamedocument ); parameters aevent a dragenter or dragover event.
...And 4 more matches
nsIDBFolderInfo
nsidbfolderinfo - careful, pulled from the wrong (cvs) repo!
... mailnews/db/msgdb/public/nsidbfolderinfo.idlscriptable ???
...as a service: var dbfolderinfo = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsidbfolderinfo); method overview long andflags(in long flags); void changeexpungedbytes(in long delta); void changenummessages(in long delta); void changenumunreadmessages(in long delta); boolean getbooleanproperty(in string propertyname, in boolean defaultvalue); void getcharacterset(out acstring charset,...
...And 3 more matches
nsIDOMFontFaceList
layout/inspector/public/nsidomfontfacelist.idlscriptable a list of nsidomfontface objects, each representing a single font face.
... 1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview nsidomfontface item(in unsigned long index); attributes attribute type description length unsigned long the number of items in the list.
... methods item() returns the nsidomfontface object at the specified index into the list.
...And 3 more matches
nsIDOMMouseScrollEvent
dom/interfaces/events/nsidommousescrollevent.idlscriptable this interface represents a mouse scroll wheel event.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note prior to gecko 1.9.2, this inherited from nsisupports instead of from nsidommouseevent.
... method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type description axis long indicates which mouse wheel axis changed; this will be either horizontal_axis or vertical_axis.
...And 3 more matches
nsIDOMXPathExpression
dom/interfaces/xpath/nsidomxpathexpression.idlscriptable represents a compiled xpath query returned from nsidomxpathevaluator.createexpression or document.createexpression inherits from: nsisupports last changed in gecko 1.7 method overview nsisupports evaluate(in nsidomnode contextnode, in unsigned short type, in nsisupports result) methods evaluate() evaluate the xpath expression.
... nsisupports evaluate( in nsidomnode contextnode, in unsigned short type, in nsisupports result ); parameters contextnode a dom node to evaluate the xpath expression against.
... type a number that corresponds to one of the type constants of nsidomxpathresult.
...And 3 more matches
nsIDOMGeoPositionCallback
the nsidomgeopositioncallback interface is called when updated position information is available.
... you need to implement this interface to accept callbacks after using nsidomgeolocation.watchposition().
... dom/interfaces/geolocation/nsidomgeopositioncallback.idlscriptable please add a summary to this article.
...And 2 more matches
nsIDOMStorageEventObsolete
dom/interfaces/storage/nsidomstorageeventobsolete.idlscriptable this interface represents an event that occurs to notify interested parties about changes to the contents of a dom storage space; it is used for both session storage and local storage.
... 1.0 66 introduced gecko 1.8 obsolete gecko 2.0 inherits from: nsidomevent last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) when a dom storage event is received, the recipient can check its domain attribute to determine which domain's data store has changed.
...you should use the nsidomstorageevent interface instead.
...And 2 more matches
nsIDOMStorageWindow
dom/interfaces/storage/nsidomstoragewindow.idlscriptable this interface provides access to a dom window's client side storage objects.
... 1.0 66 introduced gecko 1.8.1 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface has been merged into nsidomwindow, and this interface has been removed.
... attributes attribute type description globalstorage nsidomstoragelist global storage, accessible by domain.
...And 2 more matches
nsIDOMXPathResult
dom/interfaces/xpath/nsidomxpathresult.idlscriptable this interface describes an xpath result returned by nsidomxpathevaluator or document.evaluate inherits from: nsisupports last changed in gecko 1.7 method overview nsidomnode iteratenext(); nsidomnode snapshotitem(in unsigned long index); attributes attribute type description booleanvalue boolean if resulttype is boolean_type, the boolean value.
... singlenodevalue nsidomnode if resulttype is any_unordered_node_type or first_ordered_node_type, a single dom node.
...nsidomnode iteratenext(); parameters none.
...And 2 more matches
nsIDOMXULElement
dom/interfaces/xul/nsidomxulelement.idlscriptable represents a xul element within the dom.
... 66 introduced gecko 1.0 inherits from: nsidomelement last changed in gecko 1.9 (firefox 3) method overview void blur(); void click(); void docommand(); void focus(); nsidomnodelist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute.
... style nsidomcssstyledeclaration read only.
...And 2 more matches
nsIDownload
toolkit/components/downloads/public/nsidownload.idlscriptable this interface describes a download object.
... download objects are used by the download manager (see nsidownloadmanager to manage files that are queued to download, being downloaded, and finished being downloaded.) inherits from: nsitransfer last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: once the download is completed, the download manager stops updating the nsidownload object.
... completed states are nsidownloadmanager::download_finished, nsidownloadmanager::download_failed, and nsidownloadmanager::download_canceled.
...And 2 more matches
nsIDragSession
widget/public/nsidragsession.idlscriptable provides support for interacting with an ongoing drag session during a drag and drop operation.
... datatransfer nsidomdatatransfer the data transfer object for the current drag operation.
...(see nsidragservice) numdropitems unsigned long get the number of items that were dropped.
...And 2 more matches
nsIDOMChromeWindow
dom/interfaces/base/nsidomchromewindow.idlscriptable this interface is implemented on the window object in chrome.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script.
...void beginwindowmove( in nsidomevent mousedownevent ); parameters mousedownevent exceptions thrown ns_error_not_implemented if the operating system does not support this method.
...void notifydefaultbuttonloaded( in nsidomelement defaultbutton ); parameters defaultbutton the default button element of the window.
nsIDOMFileReader
the nsidomfilereader interface provides a way to read data from a file specified by an nsidomfile.
... content/base/public/nsidomfilereader.idlscriptable please add a summary to this article.
...to create an instance, use: var filereader = components.classes["@mozilla.org/files/filereader;1"].createinstance(components.interfaces.nsidomfilereader); this interface implements the dom filereader object; see that documentation for details.
... examples os.file for the main thread - example - save canvas to disk see also file api specification working draft nsidomfile nsidomfilelist nsidomfileexception ...
nsIDOMGeoPositionErrorCallback
the nsidomgeopositionerrorcallback interface is used to represent an object that receives callback notifications when geolocation errors occur.
... dom/interfaces/geolocation/nsidomgeopositionerrorcallback.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void handleevent(in nsidomgeopositionerror position); methods handleevent() called to handle a geolocation error.
... void handleevent( in nsidomgeoposition position ); parameters position the error that occurred, as an nsidomgeopositionerror object.
nsIDOMHTMLTimeRanges
the nsidomhtmltimeranges interface represents a set of time ranges in media; it's primarily used by the nsidomhtmlmediaelement interface, and implements the dom timeranges interface.
... each time range represented by an nsidomhtmltimeranges object has an index number; you call the start() and end() methods to obtain the start and end times of each range, specifying the index number of the range to look up.
... dom/interfaces/html/nsidomhtmltimeranges.idlscriptable please add a summary to this article.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long index); float end(in unsigned long index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object.
nsIDOMMozTouchEvent
the nsidommoztouchevent interface describes a raw touch event.
... dom/interfaces/events/nsidommoztouchevent.idlscriptable please add a summary to this article.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidommouseevent method overview void initmoztouchevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in ns...
...void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long streamidarg ); parameters streamidarg the value to assign to the streamid ...
nsIDOMSerializer
content/base/public/nsidomserializer.idlscriptable this interface is really a placeholder till the w3c dom working group defines a mechanism for serializing dom nodes.
...to create an instance, use: var domserializer = components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method overview void serializetostream(in nsidomnode root, in nsioutputstream stream, in autf8string charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the specified element is serialized to a byte stream using the character set specified.
... void serializetostream( in nsidomnode root, in nsioutputstream stream, in autf8string charset ); parameters root the root of the subtree to be serialized.
...astring serializetostring( in nsidomnode root ); parameters root the root of the subtree to be serialized.
nsIDOMSimpleGestureEvent
dom/interfaces/events/nsidomsimplegestureevent.idlscriptable this interface describes a mouse or trackpad gesture event.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomsimplegestureevent interface is the datatype for all mozilla-specific simple gesture events in the document object model.
... method overview void initsimplegestureevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg); attributes attribute type description ...
... void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg ); parameters typearg canbubblea...
nsIDOMStorageList
dom/interfaces/storage/nsidomstoragelist.idlscriptable this interface is used to access the contextual storage areas used by globalstorage by domain.
... 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 nsidomstorage nameditem(in domstring domain); methods nameditem() called when the list of available access points changes.
... nsidomstorage nameditem( in domstring domain ); parameters domain the name of the domain for whom to return the storage object.
... return value the nsidomstorage object representing the data store for the specified domain.see also dom storage structured client-side storage (html 5 specification) nsidomwindow ...
nsIDeviceMotionListener
xpcom/system/nsidevicemotion.idlscriptable this interface can be implemented by clients that want to be notified orientation or acceleration changes on supported devices.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void onmotionchange(in nsidevicemotiondata amotiondata); methods onmotionchange() called when new orientation or acceleration data is available.
... void onmotionchange( in nsidevicemotiondata amotiondata ); parameters aacceleration the nsidevicemotiondata object describing updated motion information.
... see also mozorientation nsidomorientationevent nsidevicemotion nsidevicemotiondata ...
nsIDirectoryServiceProvider
xpcom/io/nsidirectoryservice.idlscriptable this interface is used by the directory service to get file locations.
... inherits from: nsisupports last changed in gecko 1.7 nsidirectoryserviceprovider.
... __definegetter__("currdir", function getcurrdir() { return components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsidirectoryserviceprovider) .getfile("curworkd",{}).path; }); test it with to see the magic happen.
... alert(currdir); see also nsdirectoryservice nsidirectoryservice additionally, see section 16.5.2 of the rapid application development with mozilla book for instructions on how to get the current working directory and the process binary directory, among other things.
nsIDragDropHandler
nsidragdrophandler is an interface for communicating with the built-in drag and drop implementation in the content area.
... content/base/public/nsidragdrophandler.idlscriptable please add a summary to this article.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void detach(); void hookupto(in nsidomeventtarget attachpoint, in nsiwebnavigation navigator); methods detach() unregisters all handlers related to drag and drop.
...void hookupto( in nsidomeventtarget attachpoint, in nsiwebnavigation navigator ); parameters attachpoint the receiver to which to attach drag handlers.
display-inside - Archive of obsolete content
the display-inside css property specifies the inner display type of the box generated by an element, dictating how its contents lay out inside the box.
... /* keyword values */ display-inside: auto; display-inside: block; display-inside: table; display-inside: flex; display-inside: grid; display-inside: ruby; /* global values */ display-inside: inherit; display-inside: initial; display-inside: unset; value not found in db!
... specifications specification status comment css display module level 3the definition of 'display-inside' in that specification.
nsIDNSListener
netwerk/dns/nsidnslistener.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview void onlookupcomplete(in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus); methods onlookupcomplete() called when an asynchronous host lookup completes.
... void onlookupcomplete( in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus ); parameters arequest the value returned from asyncresolve.
nsIDOMEventGroup
dom/interfaces/events/nsidomeventgroup.idlscriptable this interface is the interface implemented by all event targets in the document object model.
... inherits from: nsisupports last changed in gecko 1.7 method overview boolean issameeventgroup(in nsidomeventgroup other); methods issameeventgroup() reports whether or not another event group is the same as this one.
... boolean issameeventgroup( in nsidomeventgroup other ); parameters other instance of nsidomeventgroup object to compare against.
nsIDOMFile
the nsidomfile interface retrieves data from a file submitted to a form using the input type "file".
... content/base/public/nsidomfile.idlscriptable please add a summary to this article.
... see also nsidomfilelist nsidomfileexception datatransfer drag and drop ...
nsIDOMFileException
the nsidomfileexception interface represents exceptions that can be raised by calls to the methods in the nsidomfile interface.
... content/base/public/nsidomfileexception.idlscriptable please add a summary to this article.
... see also nsidomfile nsidomfilelist nsidomfilereader ...
nsIDOMFontFace
layout/inspector/public/nsidomfontface.idlscriptable describes a single font face.
... rule nsidomcssfontfacerule null if no associated @font-face rule.
... see also nsidomfontfacelist ...
nsIDOMGeoPosition
dom/interfaces/geolocation/nsidomgeoposition.idlscriptable this interface describes a geographical location at a specific time.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description address nsidomgeopositionaddress the address of the user's current location, if available.
... coords nsidomgeopositioncoords the user's current position information.
nsIDOMHTMLAudioElement
the nsidomhtmlaudioelement interface is used to implement the html5 <audio> element.
... dom/interfaces/html/nsidomhtmlaudioelement.idlscriptable please add a summary to this article.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidomhtmlmediaelement method overview unsigned long long mozcurrentsampleoffset(); void mozsetup(in pruint32 channels, in pruint32 rate); [implicit_jscontext] unsigned long mozwriteaudio(in jsval data); methods mozcurrentsampleoffset() non-standard this feature is non-standard and is not on a standards track.
nsIDOMHTMLSourceElement
the nsidomhtmlsourceelement interface is the dom interface to the source child of the audio and video media elements in html.
... dom/interfaces/html/nsidomhtmlsourceelement.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.1.2 inherits from: nsidomhtmlelement the source element allows authors to specify multiple media resources for media elements.
nsIDOMMozNetworkStats
dom/network/interfaces/nsidomnetworkstats.idlscriptable interface of the network stats object.
...to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstats;1"] .createinstance(components.interfaces.nsidomnetworkstats); attributes attribute type description connectiontype domstring connection type of the stats.
... data nsidommoznetworkstatsdata array stats samples.
nsIDOMNavigatorDesktopNotification
dom/interfaces/notification/nsidomnavigatordesktopnotification.idlscriptable property that extends the navigator object.
...attributes attribute type description moznotification nsidomdesktopnotificationcenter read only.
... see also nsidomdesktopnotificationcenter ...
nsIDOMOrientationEvent
the nsidomorientationevent interface describes the event that can be delivered to dom windows, providing information from the device's accelerometer, allowing code to determine the orientation of the device.
... dom/interfaces/events/nsidomorientationevent.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsidomevent method overview void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis.
nsIDOMStorage
dom/interfaces/storage/nsidomstorage.idlscriptable this interface represents the storage space used for session storage in the dom.
... return value an nsidomstorageitem object describing the data corresponding to the specified key, or null if no data exists for the given key.
... see also dom storage structured client-side storage (html 5 specification) nsidomstorageitem ...
nsIDOMStorageManager
dom/interfaces/storage/nsidomstoragemanager.idlscriptable this interface provides methods for managing data stored in the offline apps cache.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by @mozilla.org/dom/storagemanager;1 as a service: var domstoragemanager = components.classes["@mozilla.org/dom/storagemanager;1"] .getservice(components.interfaces.nsidomstoragemanager); method overview void clearofflineapps(); nsidomstorage getlocalstorageforprincipal(in nsiprincipal aprincipal, in domstring adocumenturi); long getusage(in astring aownerdomain); methods clearofflineapps() clears keys owned by offline applications.
...nsidomstorage getlocalstorageforprincipal( nsiprincipal aprincipal, domstring adocumenturi ); parameters aprincipal the principal for which to return the local storage object.
nsIDOMUserDataHandler
dom/interfaces/core/nsidomuserdatahandler.idlscriptable the callback function for the setuserdata method.
... 1.0 66 introduced gecko 1.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void handle(in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst); constants constant value description node_cloned 1 the node was cloned.
...void handle( in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst ); parameters operation one of the node_* operation type constants from the above table.
nsIDOMXULSelectControlElement
dom/interfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article.
... inherits from: nsidomxulcontrolelement last changed in gecko 1.9 (firefox 3) method overview nsidomxulselectcontrolitemelement appenditem(in domstring label, in domstring value); long getindexofitem(in nsidomxulselectcontrolitemelement item); nsidomxulselectcontrolitemelement getitematindex(in long index); nsidomxulselectcontrolitemelement insertitemat(in long index, in domstring label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only.
... selectedindex long selecteditem nsidomxulselectcontrolitemelement value domstring methods appenditem() nsidomxulselectcontrolitemelement appenditem( in domstring label, in domstring value ); parameters label value return value getindexofitem() long getindexofitem( in nsidomxulselectcontrolitemelement item ); parameters item return value getitematindex() nsidomxulselectcontrolitemelement getitematindex( in long index ); parameters index return value insertitemat() nsidomxulselectcontrolitemelement insertitemat( in long index, in domstring label, in domstring value ); parameters index label value return value removeitemat() nsidomxulselectcontrolitemelement removeitemat( in long index ); parameters index return value ...
nsIDebug
xpcom/base/nsidebug.idlscriptable provides debugging support for scripted languages, such as javascript, java, python, perl, and so forth.
... inherits from: nsisupports last changed in gecko 1.7 note: c/c++ consumers who are planning to use the nsidebug interface with the @mozilla.org/xpcom;1 contract should use ns_debugbreak() from xpcom glue instead, or alternatively the ns_abort, ns_assertion, ns_break, and ns_warning macros, which also call ns_debugbreak() if used in a debugging build.
... see also nsidebug2 ...
nsIDebug2
xpcom/base/nsidebug2.idlscriptable adds access to additional information in debug builds of mozilla code by expanding upon the features in nsidebug 1.0 66 introduced gecko 1.9.2 inherits from: nsidebug last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description assertioncount long the number of assertions since process start.
... this is normally zero in release builds, but does include calls to nsidebug.assertion().
... see also nsidebug ...
nsIDeviceMotionData
xpcom/system/nsidevicemotion.idlscriptable this interface provides information about device motion.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotiondata prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3).
... see also mozorientation nsidomorientationevent nsidevicemotionlistener nsidevicemotion ...
nsIDirIndex
netwerk/streamconv/public/nsidirindex.idlscriptable a class holding information about a directory index.
...this is encoded with the encoding specified in the nsidirindexparser, and is also escaped.
... see also nsidirindexlistener nsidirindexparser ...
nsIDirIndexListener
netwerk/streamconv/public/nsidirindexlistener.idlscriptable this interface is used to receive contents of directory index listings from a protocol.
... they can then be transformed into an output format (such as rdf, html and so on) inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void onindexavailable(in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex); void oninformationavailable(in nsirequest arequest, in nsisupports actxt, in astring ainfo); methods onindexavailable() called for each directory entry.
... void onindexavailable( in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex ); parameters arequest the request.
nsIDocumentLoader
uriloader/base/nsidocumentloader.idlscriptable this interface responsible for tracking groups of loads that belong together (images, external scripts, and so on.) and subdocuments (iframe, frame, and so on.).
...to create an instance, use: var documentloader = components.classes["@mozilla.org/docloaderservice;1"] .createinstance(components.interfaces.nsidocumentloader); method overview void clearparentdocloader(); obsolete since gecko 1.8 void createdocumentloader(out nsidocumentloader aninstance); obsolete since gecko 1.8 void destroy(); obsolete since gecko 1.8 void fireonlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri auri); obsolete since gecko 1.8 void fireonstatuschange(in ...
... createdocumentloader() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void createdocumentloader( out nsidocumentloader aninstance ); parameters aninstance destroy() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void destroy(); parameters none.
nsIDownloadObserver
netwerk/base/public/nsidownloader.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview void ondownloadcomplete(in nsidownloader downloader, in nsirequest request, in nsisupports ctxt, in nsresult status, in nsifile result); methods ondownloadcomplete() called to signal a download that has completed.
... void ondownloadcomplete( in nsidownloader downloader, in nsirequest request, in nsisupports ctxt, in nsresult status, in nsifile result ); parameters downloader request ctxt status result ...
nsIDownloader
netwerk/base/public/nsidownloader.idlscriptable a special implementation of a nsistreamlistener that will make the contents of the stream available as a file.
... inherits from: nsistreamlistener last changed in gecko 1.7 method overview void init(in nsidownloadobserver observer, in nsifile downloadlocation); methods init() initialize this downloader.
... void init( in nsidownloadobserver observer, in nsifile downloadlocation ); parameters observer the nsidownloadobserver to be notified when the download completes.
<display-inside> - CSS: Cascading Style Sheets
syntax valid <display-inside> values: flow the element lays out its contents using flow layout (block-and-inline layout).
... html <div class="box"> <div class="float">i am a floated box!</div> <p>i am content inside the container.</p> </div> css .box { background-color: rgb(224, 206, 247); border: 5px solid rebeccapurple; display: flow-root; } .float { float: left; width: 200px; height: 150px; background-color: white; border:1px solid black; padding: 10px; } result specifications specification status css display module level 3the definiti...
...on of 'display-inside' in that specification.
Firefox UI considerations for web developers
otherwise, bitmapped icons which are at least 96 pixels wide are considered.
... examples consider again the example top sites box shown at the top of the page, repeated below: let's look at some examples among the icons shown here (note that this discussion is based on the site designs as of early january, 2019).
nsIDOMGeoPositionAddress
dom/interfaces/geolocation/nsidomgeopositionaddress.idlscriptable this interface describes the geographical address of a location, including street, city, and country information, for example.
... 1.0 66 introduced gecko 1.9.2 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8) this object is obtained from an nsidomgeopositionaddress object via its address attribute.
nsIDOMGeoPositionCoords
the nsidomgeopositioncoords interface describes a geographical location.
... dom/interfaces/geolocation/nsidomgeopositioncoords.idlscriptable please add a summary to this article.
nsIDOMGeoPositionError
the nsidomgeopositionerror interface represents an error that occurred while performing geolocation operations.
... dom/interfaces/geolocation/nsidomgeopositionerror.idlscriptable please add a summary to this article.
nsIDOMGeoPositionOptions
the nsidomgeopositionoptions interface is used to specify options for geolocation operations.
... dom/interfaces/geolocation/nsidomgeopositionoptions.idlscriptable please add a summary to this article.
nsIDOMGlobalPropertyInitializer
dom/interfaces/base/nsidomglobalpropertyinitializer.idlscriptable an initializer for global properties that lets them know about the window they're being attached to.
...method overview jsval init(in nsidomwindow window); methods init() jsval init( in nsidomwindow window ); parameters window the window to which the global property is being attached.
nsIDOMHTMLMediaElement
dom/interfaces/html/nsidomhtmlmediaelement.idlscriptable the basis for the nsidomhtmlaudioelement and nsidomhtmlvideoelement interfaces, which in turn implement the <audio> and <video> html5 elements.
... 1.0 67 introduced gecko 1.9.1 inherits from: nsidomhtmlelement last changed in gecko 1.1 the nsidomhtmlmediaelement interface implements the dom htmlmediaelement interface.
nsIDOMParser
to create a domparser when the constructor is not available (e.g., from a js xpcom component, a js module, or an xpcshell test), use: var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); // optionally, call parser.init(principal, documenturi, baseuri); principals, document and base uri note: this section covers changes introduced to domparser in gecko 1.9.
...examples within the context of a window: var parser = new domparser(); var doc = parser.parsefromstring(astr, "application/xml"); outside of a window (e.g., a js xpcom component, a js module, or an xpcshell test): var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); var doc = parser.parsefromstring(astr, "application/xml"); using components.constructor(): const domparser = new components.constructor("@mozilla.org/xmlextras/domparser;1", "nsidomparser"); var parser = new domparser(); parser.init(principal, documenturi, baseuri); var doc = parser.parsefromstring(astr, "application/xml"); ...
nsIDOMProgressEvent
dom/interfaces/events/nsidomprogressevent.idlscriptable this interface represents the events sent with progress information while uploading data using the xmlhttprequest object.
... 1.0 66 introduced gecko 1.9.1 deprecated gecko 22 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomprogressevent is used in the media elements (<video> and <audio>) to inform interested code of the progress of the media download.
nsIDOMStorage2
the nsidomstorage2 interface represents the storage space used for local storage in the dom.
... dom/public/idl/storage/nsidomstorage2.idlscriptable please add a summary to this article.
nsIDOMStorageItem
dom/interfaces/storage/nsidomstorageitem.idlscriptable this interface represents an object in dom storage.
... see also dom storage structured client-side storage (html 5 specification) nsidomstorage nsidomstorage2 ...
nsIDOMXPathException
dom/interfaces/xpath/nsidomxpathexception.idlscriptable describes an exception resulting from xpath operations.
... see also introduction to using xpath in javascript document object model (dom) level 3 xpath specification nsidomxpathevaluator document.evaluate nsidomxpathresult ...
nsIDOMXULControlElement
dom/interfaces/xul/nsidomxulcontrolelement.idlscriptable provides additional attributes specific to control elements.
... 66 introduced gecko 1.0 inherits from: nsidomxulelement last changed in gecko 1.0 attributes attribute type description disabled boolean indicates whether the element is disabled or not.
nsIDOMXULLabeledControlElement
dom/interfaces/xul/nsidomxullabeledcontrolel.idlscriptable this interface is used as a basis for labeled control elements in xul.
... inherits from: nsidomxulcontrolelement last changed in gecko 1.7 attributes attribute type description accesskey domstring this should be set to a character that is used as a shortcut key.
nsIDOMXULSelectControlItemElement
dom/interfaces/xul/nsidomxulselectcntrlitemel.idlscriptable please add a summary to this article.
... inherits from: nsidomxulelement last changed in gecko 1.7 attributes attribute type description accesskey domstring command domstring control nsidomxulselectcontrolelement read only.
nsIDialogCreator
embedding/base/nsidialogcreator.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void opendialog(in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, [optional] in nsidomelement aframeelement); constants constant value description unknown_dialog 0 generic_dialog 1 select_dialog 2 methods opendialog() void opendialog( in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, in nsidomelement aframeelement optional ); parameters atype aname afeatures aarguments aframeelement optional ...
nsIDirIndexParser
netwerk/streamconv/public/nsidirindexlistener.idlscriptable a parser for 'application/http-index-format' directories.
... listener nsidirindexlistener the interface to use as a callback for new entries.
nsIDirectoryServiceProvider2
xpcom/io/nsidirectoryservice.idlscriptable an extension of nsidirectoryserviceprovider which allows multiple files to be returned for the given key.
... inherits from: nsidirectoryserviceprovider last changed in gecko 0.9.6 method overview nsisimpleenumerator getfiles(in string prop); methods getfiles() the directory service calls this when it gets a request for a prop and the requested type is nsisimpleenumerator.
nsIDispatchSupport
js/src/xpconnect/idl/nsidispatchsupport.idlnot scriptable please add a summary to this article.
...boolean isclassmarkedsafeforscripting( in nscidref cid, out boolean classexists ); parameters cid the nsid representation of the clsid to test.
nsIDroppedLinkItem
dom/base/nsidroppedlinkhandler.idlscriptable please add a summary to this article.
... see also nsidroppedlinkhandler ...
nsIDNSRecord
netwerk/dns/nsidnsrecord.idlscriptable this interface represents the result of a dns lookup.
nsIDNSRequest
netwerk/dns/nsidnsrequest.idlscriptable please add a summary to this article.
nsIDOMCanvasRenderingContext2D
the nsidomcanvasrenderingcontext2d interface implements the dom canvasrenderingcontext2d interface.
nsIDOMClientRect
dom/interfaces/base/nsidomclientrect.idlscriptable represents a rectangular box.
nsIDOMDesktopNotification
the nsidomdesktopnotification interface implements the dom notification interface.
nsIDOMDesktopNotificationCenter
the nsidomdesktopnotificationcenter interface implements the dom navigator.moznotification interface.
nsIDOMEventListener
the nsidomeventlistener interface implements the dom eventlistener interface.
nsIDOMEventTarget
dom/interfaces/events/nsidomeventtarget.idlscriptable this interface is the interface implemented by all event targets in the document object model.
nsIDOMFileError
the nsidomfileerror interface describes errors that occur while using the dom file api.
nsIDOMFileList
the nsidomfilelist interface contains a list of nsidomfile objects describing the files selected by the user for a "file" input field on a web form.
nsIDOMHTMLFormElement
the nsidomhtmlformelement interface implements the dom htmlformelement interface.
nsIDOMJSWindow
the interface is defined in dom/interfaces/base/nsidomjswindow.idl.
nsIDOMMozNetworkStatsData
dom/network/interfaces/nsidomnetworkstats.idlscriptable represents a single record in the network statistics database, as reported using the nsidommoznetworkstatsmanager interface.
nsIDataSignatureVerifier
security/manager/ssl/public/nsidatasignatureverifier.idlscriptable an interface for verifying that a given string of data was signed by the private key matching the given public key.
nsIDialogParamBlock
embedding/components/windowwatcher/public/nsidialogparamblock.idlscriptable an interface to pass strings, integers and nsisupports to a dialog.
nsIDictionary
extensions/xml-rpc/idl/nsidictionary.idlscriptable a simple mutable table of objects, maintained as key/value pairs.
nsIDirectoryEnumerator
xpcom/io/nsidirectoryenumerator.idlscriptable this interface provides a means for enumerating the contents of a directory.
nsIDirectoryIterator
the nsidirectoryiterator interface provides a way to iterate over the entries in a directory.
nsIDiskCacheStreamInternal
netwerk/cache/nsidiskcachestreaminternal.idlscriptable please add a summary to this article.
nsIDownloadHistory
docshell/base/nsidownloadhistory.idlscriptable this interface can be used to add a download to history.
nsIDownloadManagerUI
toolkit/components/downloads/public/nsidownloadmanagerui.idlscriptable this interface is used to implement the user interface for the download manager.
nsIDynamicContainer
toolkit/components/places/public/nsidynamiccontainer.idlscriptable this interface provides a base class for services that want to provide containers for temporary contents.
Index
MozillaTechXPCOMIndex
34 components.utils.evalinsandbox add-ons, developing mozilla, extensions, javascript, xpcom:language bindings, xpconnect the evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.
...it lets you get pointers to components inside mozilla, and it lets you talk about their interfaces as well.
... 85 using nsidirectoryservice extensions, guide, xpcom nsdirectoryservice implements the nsiproperties interface.
...And 122 more matches
Index - Archive of obsolete content
while this is generally considered acceptable behavior, considerable care must be taken to avoid violating the mozilla add-on guidelines or creating an adverse user experience.
...in addition, you can augment or replace the download manager's user interface by implementing the new nsidownloadmanagerui interface.
... 429 editor embedding guide embedding mozilla, guide, midas, needshelp given an nsiwebbrowser instance, get an nsidomwindow from the getcontentdomwindow call.
...And 59 more matches
Index - Web APIs
WebAPIIndex
308 bluetoothdevice api, bluetooth, bluetoothdevice, experimental, interface, reference, web bluetooth api the bluetoothdevice interface of the web bluetooth api represents a bluetooth device inside a particular script execution environment.
...the symbols < and & don’t need escaping as they normally do when inside a cdata section.
... 526 drawing text canvas, graphics, intermediate, tutorial the canvas rendering context provides two methods to render text: 527 finale canvas, graphics, tutorial there are a variety of demos and further explanations about canvas on these sites: 528 hit regions and accessibility canvas, graphics, tutorial the content inside the <canvas> ...
...And 47 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
30 browser.type xul attributes, xul reference type: one of the values below.the type of browser, which can be used to set access of the document loaded inside the browser.
... 595 node this is a scriptable interface corresponding to the nsidomnode xpcom interface.
... 611 special per-platform menu considerations beginner, guide, xul, xul popup guide for many menu commands, convention dictates where these items will be placed.
...And 45 more matches
nsISessionStore
method overview void deletetabvalue(in nsidomnode atab, in astring akey); void deletewindowvalue(in nsidomwindow awindow, in astring akey); nsidomnode duplicatetab(in nsidomwindow awindow, in nsidomnode atab); nsidomnode forgetclosedtab(in nsidomwindow awindow, in unsigned long aindex); nsidomnode forgetclosedwindow(in unsigned long aindex); astring getbrowserstate(); unsigned long g...
...etclosedtabcount(in nsidomwindow awindow); astring getclosedtabdata(in nsidomwindow awindow); unsigned long getclosedwindowcount(); astring getclosedwindowdata(); astring gettabstate(in nsidomnode atab); astring gettabvalue(in nsidomnode atab, in astring akey); astring getwindowstate(in nsidomwindow awindow); astring getwindowvalue(in nsidomwindow awindow, in astring akey); void init(in nsidomwindow awindow); void persisttabattribute(in astring aname); void restorelastsession(); void setbrowserstate(in astring astate); void settabstate(in nsidomnode atab, in astring astate); void settabvalue(in nsidomnode atab, in astring akey, in astring astringvalue); void setwin...
...dowstate(in nsidomwindow awindow, in astring astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session.
...And 28 more matches
Introduction to XPCOM for the DOM
let's consider what happens when the class nsfoo implements an interface nsifoo.
... queryinterface() consider again the class nsfoo that implements two interfaces, nsifoo and nsifoo2: class nsfoo : public nsifoo, public nsifoo2 let's assume an instance of nsfoo was somehow created (this assertion is true most of the time).
...and finally, we will look at the implementation of our new interface through the creation of an nsidomfabian interface (fabian is my first name ;-).
...And 25 more matches
Mozilla DOM Hacking Guide
for example, when we ask for |document.getelementbyid("myid");|, xpconnect will find that |document| is a property of the window object, so it will look on the interface nsidomwindow, and it will find the getdocument() method.
... the return value of getdocument() is a nsidomdocument.
... so xpconnect will then try to find a method named getelementbyid() on the nsidomdocument interface.
...And 22 more matches
Client-side storage - Learn web development
for example, you could download a batch of music files (perhaps used by a web game or music player application), store them inside a client-side database, and play them as needed.
... all of your web storage data is contained within two object-like structures inside the browser: sessionstorage and localstorage.
... next, add the following to the bottom of your code: window.onload = function() { }; we will write all of our subsequent code inside this window.onload event handler function, called when the window's load event fires, to make sure we don't try to use indexeddb functionality before the app has completely finished loading (it could fail if we don't).
...And 20 more matches
nsIFocusManager
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) implemented by: @mozilla.org/focus-manager;1 as a service: var focusmanager = components.classes["@mozilla.org/focus-manager;1"] .getservice(components.interfaces.nsifocusmanager); method overview void clearfocus(in nsidomwindow awindow); void contentremoved(in nsidocument adocument, in nsicontent aelement); native code only!
... obsolete since gecko 2.0 void firedelayedevents(in nsidocument adocument); native code only!
... nsidomelement getfocusedelementforwindow(in nsidomwindow awindow, in prbool adeep, out nsidomwindow afocusedwindow); pruint32 getlastfocusmethod(in nsidomwindow window); void movecarettofocus(in nsidomwindow awindow); void elementisfocusable(in nsidomelement aelement, in unsigned long aflags); nsidomelement movefocus(in nsidomwindow awindow, in nsidomelement astartelement, in unsigned long atype, in unsigned long aflags); void setfocus(in nsidomelement aelement, in unsigned long aflags); void windowhidden(in nsidomwindow awindow); native code only!
...And 19 more matches
Creating our first Vue component - Learn web development
along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props, and saving data state.
... objective: to learn how to create a vue component, render it inside another component, pass data into it using props, and save its state.
...inside the <script> tags, add a default exported object export default {}, which is your component object.
...And 18 more matches
nsIHTMLEditor
inherits from: nsisupports last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) method overview void adddefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void addinsertionlistener(in nsicontentfilter infilter); void align(in astring aalign); boolean breakisvisible(in nsidomnode anode); boolean candrag(in nsidomevent aevent); void checkselectionstateforanonymousbuttons(in nsiselection aselection); nsidomelement createanonymouselement(in astring atag, in nsidomnode aparentnode, in astring aanonclass, in boolean aiscreatedhidden); nsidomelement createelementwithdefaults(in astring atagname); void decreasefontsize(); ...
... void dodrag(in nsidomevent aevent); void getalignment(out boolean amixed, out short aalign); astring getbackgroundcolorstate(out boolean amixed); nsidomelement getelementorparentbytagname(in astring atagname, in nsidomnode anode); astring getfontcolorstate(out boolean amixed); astring getfontfacestate(out boolean amixed); astring getheadcontentsashtml(); astring gethighlightcolorstate(out boolean amixed); void getindentstate(out boolean acanindent, out boolean acanoutdent); void getinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); astring getinlinepropertywithattrvalue(in nsiatom aproperty, in astring aattribute, in ...
...astring avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray getlinkedobjects(); void getlistitemstate(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void getliststate(out boolean amixed, out boolean aol, out boolean aul, out boolean adl); astring getparagraphstate(out boolean amixed); nsidomelement getselectedelement(in astring atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean aignorespuriousdragevent); void increasefontsize(); void indent(in astring aindent); void insertelementatselection(in nsidomelement aelement, in boolean adeleteselection); void insertfromdrop(in nsidomevent aevent); void ...
...And 18 more matches
window/utils - Archive of obsolete content
globals functions getmostrecentbrowserwindow() get the topmost browser window, as an nsidomwindow instance.
... returns nsidomwindow: the topmost browser window.
...this function wraps nsidomwindowutils.currentinnerwindowid.
...And 17 more matches
Vue conditional rendering: editing existing todos - Learn web development
to do that, we'll need to first define it inside our data() property.
... add isediting below your existing isdone data point: data() { return { isdone: this.done, isediting: false }; } now add your methods inside a methods property, right below your data() property: methods: { deletetodo() { this.$emit('item-deleted'); }, toggletoitemeditform() { this.isediting = true; } } conditionally displaying components via v:if and v:else now we have an isediting flag that we can use to signify that the item is being edited (or not).
...v-if also has corresponding v-else-if and v-else directives to provide the equivalent of javascript else if and else logic inside vue templates.
...And 17 more matches
inIDOMUtils
inherits from: nsisupports last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/inspector/dom-utils;1 as a service: var inidomutils = components.classes["@mozilla.org/inspector/dom-utils;1"] .getservice(components.interfaces.inidomutils); method overview void addpseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); void clearpseudoclasslocks(in nsidomelement aelement); [implicit_jscontext] jsval colornametorgb(in domstring acolorname); nsiarray getbindingurls(in nsidomelement aelement); nsidomnodelist getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long long getcontentstate(in ...
...nsidomelement aelement); void getcsspropertynames([optional] in unsigned long aflags, [optional] out unsigned long acount, [retval, array, size_is(acount)] out wstring aprops); nsisupportsarray getcssstylerules(in nsidomelement aelement, [optional] in domstring apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(in nsidomcssstylerule arule); unsigned long getrulecolumn(in nsidomcssstylerule arule); unsigned long getselectorcount(in nsidomcssstylerule arule); astring getselectortext(in nsidomcssstylerule arule, in unsigned long aselectorindex); unsigned long long getspecificity(in nsidomcssstylerule arule, in unsigned long aselectorindex); nsid...
...omfontfacelist getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname); void parsestylesheet(in nsidomcssstylesheet asheet, in domstring ainput); void removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselectorindex, [optional] in domstring apseudo); void setcontentstate(in nsidomelement aelement, in unsigned long long astate); constants co...
...And 17 more matches
Fetching data from the server - Learn web development
just inside the <script> element, add the following code.
...the value of the <select> element at any time is the same as the text inside the selected <option> (unless you specify a different value in a value attribute) — so for example "verse 1".
...add the following lines inside your updatedisplay() function: verse = verse.replace(" ", ""); verse = verse.tolowercase(); let url = verse + '.txt'; to begin creating an xhr request, you need to create a new request object using the xmlhttprequest() constructor.
...And 16 more matches
Handling common accessibility problems - Learn web development
each label needs to be included inside a <label> to link it unambiguously to its partner form input (each <label> for attribute value needs to match the form element id value), and it will make sense even if the source order is not completely logical (which to be fair it should be).
... there are a few other considerations you should take into account.
... note: webaim's accessible javascript provides some useful further details about considerations for accessible javascript.
...And 16 more matches
Setting up your own test automation environment - Learn web development
next, we need to install a framework to allow us to work with selenium from inside node.
...to install selenium-webdriver, run the following command, making sure you are inside your project folder: npm install selenium-webdriver note: it is still a good idea to follow these steps even if you previously installed selenium-webdriver and downloaded the browser drivers.
... create a new file inside your project directory called google_test.js: give it the following contents, then save it: const webdriver = require('selenium-webdriver'), by = webdriver.by, until = webdriver.until; const driver = new webdriver.builder() .forbrowser('firefox') .build(); driver.get('http://www.google.com'); driver.findelement(by.name('q')).sendkeys('webdriver'); driver.sleep(1000).then(f...
...And 16 more matches
Functions — reusable blocks of code - Learn web development
previous overview: building blocks next another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
... you've also seen a lot of custom functions in the course so far — functions defined in your code, not inside the browser.
...see also the full source code) from our loops article, we included a custom draw() function that looked like this: function draw() { ctx.clearrect(0,0,width,height); for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } this function draws 100 random circles inside a <canvas> element.
...And 15 more matches
Elements - Archive of obsolete content
content <!element content any> <!attlist content id id #implied > a binding can specify new content that is placed inside the bound element.
...the only xbl element that can appear inside the content tag is the children tag.
... constructor the code inside the constructor is called when a binding has just been attached to an element.
...And 14 more matches
Graceful asynchronous programming with Promises - Learn web development
let's consider a hypothetical video chat application.
... in the first example, we'll use the fetch() method to fetch an image from the web, the blob() method to transform the fetch response's raw body contents into a blob object, and then display that blob inside an <img> element.
... inside your <script> element, add the following line: let promise = fetch('coffee.jpg'); this calls the fetch() method, passing it the url of the image to fetch from the network as a parameter.
...And 14 more matches
Manipulating documents - Learn web development
there are a few really obvious bits you'll reference regularly in your code — consider the following diagram, which represents the main parts of a browser directly involved in viewing web pages: the window is the browser tab that a web page is loaded into; this is represented in javascript by the window object.
...try opening this up in your browser — it is a very simple page containing a <section> element inside which you can find an image, and a paragraph with a link inside.
... child node: a node directly inside another node.
...And 13 more matches
nsISelection
as a service: var selection = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiselection); method overview void addrange(in nsidomrange range); void collapse(in nsidomnode parentnode, in long offset); [noscript,notxpcom,nostdcall] boolean collapsed(); void collapsenative(in nsidomnode parentnode, in long offset); native code only!
... void collapsetoend(); void collapsetostart(); boolean containsnode(in nsidomnode node, in boolean partlycontained); void deletefromdocument(); void extend(in nsidomnode parentnode, in long offset); void extendnative(in nsidomnode parentnode, in long offset); native code only!
... nsidomrange getrangeat(in long index); void modify(in domstring alter, in domstring direction, in domstring granularity); void removeallranges(); void removerange(in nsidomrange range); void selectallchildren(in nsidomnode parentnode); void selectionlanguagechange(in boolean langrtl); domstring tostring(); attributes attribute type description anchornode nsidomnode returns the node in which the selection begins.
...And 13 more matches
How to structure a web form - Learn web development
each time you want to create an html form, you must start it by using this element, nesting all the contents inside.
... warning: it's strictly forbidden to nest a form inside another form.
...this was introduced to let you explicitly bind a control with a form even if it is not nested inside it.
...And 12 more matches
Build your own function - Learn web development
next, add the following inside the <script> element: function displaymessage() { } we start off with the keyword function, which means we are defining a function.
...any parameters we want to give to our function go inside the parentheses, and the code that runs when we call the function goes inside the curly braces.
... finally, add the following code inside the curly braces: const html = document.queryselector('html'); const panel = document.createelement('div'); panel.setattribute('class', 'msgbox'); html.appendchild(panel); const msg = document.createelement('p'); msg.textcontent = 'this is a message box'; panel.appendchild(msg); const closebtn = document.createelement('button'); closebtn.textcontent = 'x'; panel.appendchild(closebtn); closebtn.onclick = function() { panel.parentnode.removechild(panel); } this is quite a lot of code to go through, so we'll walk you through it bit by bit.
...And 12 more matches
A first splash into JavaScript - Learn web development
the place where we'll be adding all our code is inside the <script> element at the bottom of the html: <script> // your javascript goes here </script> adding variables to store our data let's get started.
... first of all, add the following lines inside your <script> element: let randomnumber = math.floor(math.random() * 100) + 1; const guesses = document.queryselector('.guesses'); const lastresult = document.queryselector('.lastresult'); const loworhi = document.queryselector('.loworhi'); const guesssubmit = document.queryselector('.guesssubmit'); const guessfield = document.queryselector('.guessfield'); let guesscount = 1; let resetbutton; this section of the code sets up the variables and constants we need to store the data our program will use.
...in this case, we are using constants to store references to parts of our user interface; the text inside some of them might change, but the html elements referenced stay the same.
...And 12 more matches
nsIMsgDatabase
last changed in gecko 1.9 (firefox 3) inherits from: nsidbchangeannouncer method overview void open(in nsilocalfile afoldername, in boolean acreate, in boolean aleaveinvaliddb); void forcefolderdbclosed(in nsimsgfolder afolder); void close(in boolean aforcecommit); void commit(in nsmsgdbcommit committype); void forceclosed(); void clearcachedhdrs; void resethdrcachesize(in unsigned long size); nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey ke...
... nsisimpleenumerator enumeratemessages(); nsisimpleenumerator enumeratethreads(); void synccounts; nsimsgthread getthreadcontainingmsghdr(in nsimsgdbhdr msghdr); void markhdrread(in nsimsgdbhdr msghdr, in boolean bread, in nsidbchangelistener instigator); void markhdrreplied(in nsimsgdbhdr msghdr, in boolean breplied, in nsidbchangelistener instigator); void markhdrmarked(in nsimsgdbhdr msghdr, in boolean mark,in nsidbchangelistener instigator); void markmdnneeded(in nsmsgkey key, in boolean bneeded,in nsidbchangelistener instigator); boolean ismdnneeded(in nsmsgkey key); void markmdnsent(in nsmsgkey key, in b...
...oolean bneeded, in nsidbchangelistener instigator); boolean ismdnsent(in nsmsgkey key); void markread(in nsmsgkey key, in boolean bread, in nsidbchangelistener instigator); void markreplied(in nsmsgkey key, in boolean breplied, in nsidbchangelistener instigator); void markforwarded(in nsmsgkey key, in boolean bforwarded, in nsidbchangelistener instigator); void markhasattachments(in nsmsgkey key, in boolean bhasattachments, in nsidbchangelistener instigator); void markthreadread(in nsimsgthread thread, in nsidbchangelistener instigator, in nsmsgkeyarrayptr thosemarked); native code only!
...And 12 more matches
Grids - Archive of obsolete content
ArchiveMozillaXULTutorialGrids
inside a grid, you declare two things, the columns that are used and the rows that are used.
... just like html tables, you put content such as labels and buttons inside the rows.
...alternatively, you can put content inside the columns, and use the rows to specify the appearance.
...And 11 more matches
The Implementation of the Application Object Model - Archive of obsolete content
examples of these interfaces include nsidomelement, nsidomnode, nsixmlcontent, and nsicontent.
...in html or xul, when you put one tag inside another tag, a relationship of containment can safely be assumed.
...since an aom tree cannot be placed inside a dom tree, xul applications don't ever occur inside web pages.
...And 11 more matches
Getting started with HTML - Learn web development
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 enclosing it in a paragraph (<p>) element: <p>my cat is very grumpy</p> note: tags in html are case-insensitive.
... the following is an example of the wrong way to do nesting: <p>my cat is <strong>very grumpy.</p></strong> the tags have to open and close in a way that they are inside or outside one another.
...a block-level element wouldn't be nested inside an inline element, but it might be nested inside another block-level element.
...And 11 more matches
Index - Learn web development
accessibility, beginner, design, example, intro, mobile, needsactivelearning when you're building a website, one top issue to consider is universal design: accommodating all users regardless of disability, technical constraints, culture, location, and so on.
... beginner, browser, css, codingscripting, dev tools, html, javascript, learn the devtools live inside your browser in a subwindow that looks roughly like this, depending on what browser you are using: 26 what are hyperlinks?
...a set number of times per second), discusses what they are useful for, and considers their inherent issues.
...And 11 more matches
nsITextInputProcessor
dom/interfaces/base/nsitextinputprocessor.idlscriptable this interface is a text input events synthesizer and manages its composition and modifier state 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) the motivation of this interface is to provide better api than nsidomwindowutils to dispatch key events and create, modify, and commit composition in higher level.
... nsidomwindowutils has provided the methods which dispatched keyboard events and composition events almost directly.
... method overview void appendclausetopendingcomposition(in unsigned long alength, in unsigned long aattribute); boolean begininputtransaction(in nsidomwindow awindow, in nsitextinputprocessorcallback acallback); boolean begininputtransactionfortests(in nsidomwindow awindow, [optional] in nsitextinputprocessorcallback acallback); void cancelcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean commitcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in un...
...And 11 more matches
nsIWindowWatcher
method overview nsiwebbrowserchrome getchromeforwindow(in nsidomwindow awindow); nsiauthprompt getnewauthprompter(in nsidomwindow aparent); nsiprompt getnewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string aurl, in string aname, in string afeat...
...ures, in nsisupports aarguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(in nsiobserver aobserver); attributes attribute type description activewindow nsidomwindow the watcher serves as a global storage facility for the current active (front most non-floating-palette-type) window, storing and returning it on demand.
...this attribute will be null if the active window is not an nsidomwindow; for example, if the active window is an alert.
...And 11 more matches
Functions - JavaScript
function scope variables defined inside a function cannot be accessed from anywhere outside the function, because the variable is defined only in the scope of the function.
... however, a function can access all variables and functions defined inside the scope in which it is defined.
...a function defined inside another function can also access all variables defined in its parent function, and any other variables to which the parent function has access.
...And 11 more matches
JavaScript modules - JavaScript
the modules directory's two modules are described below: canvas.js — contains functions related to setting up the canvas: create() — creates a canvas with a specified width and height inside a wrapper <div> with a specified id, which is itself appended inside a specified parent element.
... createreportlist() — creates an unordered list appended inside a specified wrapper element, which can be used to output report data into.
...they need to be top-level items; you can't use export inside a function, for example.
...And 11 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
extensions also can be considered xul applications with chrome.
...the dtd file is located inside the locale package, and the correct file is picked automatically to match the user’s language preferences.
...the clock.dtd file inside the fr-fr folder must be encoded as utf-8.
...And 10 more matches
Fundamental text and font styling - Learn web development
as you'll have already experienced in your work with html and css, text inside an element is laid out inside the element's content box.
... note: bear in mind that the text inside an element is all affected as one single entity.
... the list of actual web safe fonts will change as operating systems evolve, but it's reasonable to consider the following fonts web safe, at least for now (many of them have been popularized thanks to the microsoft core fonts for the web initiative in the late 90s and early 2000s): name generic type notes arial sans-serif it's often considered best practice to also add helvetica as a preferred alternative to arial as, although their font faces are almost identical, ...
...And 10 more matches
Making decisions in your code — conditionals - Learn web development
a condition to test, placed inside the parentheses (typically "is this value bigger than this other value?", or "does this value exist?").
... a set of curly braces, inside which we have some code — this can be any code we like, and it only runs if the condition returns true.
... another set of curly braces, inside which we have some more code — this can be any code we like, and it only runs if the condition is not true — or in other words, the condition is false.
...And 10 more matches
Working with JSON - Learn web development
you can include the same basic data types inside json as you can in a standard javascript object — strings, numbers, arrays, booleans, and other object literals.
... }, { "name": "eternal flame", "age": 1000000, "secretidentity": "unknown", "powers": [ "immortality", "heat immunity", "inferno", "teleportation", "interdimensional travel" ] } ] } if we loaded this object into a javascript program, parsed in a variable called superheroes for example, we could then access the data inside it using the same dot/bracket notation we looked at in the javascript object basics article.
... inside that we want to access the members property, so we use ["members"].
...And 10 more matches
React interactivity: Events and state - Learn web development
once we have our callback prop, we can call it inside <form /> to send the right data to <app />.
... handling form submission via callbacks inside the top of our app() component function, create a function named addtask() which has a single parameter of name: function addtask(name) { alert(name); } next, we'll pass addtask() into <form /> as a prop.
...your <form /> component call should be updated as follows: <form addtask={addtask} /> finally, you can use this prop inside the handlesubmit() function in your <form /> component!
...And 10 more matches
Introduction to automated testing - Learn web development
automation makes things easy throughout this module we have detailed loads of different ways in which you can test your websites and apps, and explained the sort of scope your cross-browser testing efforts should have in terms of what browsers to test, accessibility considerations, and more.
...inside this section we'll look at how to automate task running with node and gulp, a beginner-friendly option.
... create a new directory somewhere sensible using your file manager ui, or, on a command line, by navigating to the location you want and running the following command: mkdir node-test to make this directory an npm project, you just need to go inside your test directory and initialize it, with the following: cd node-test npm init this second command will ask you many questions to find out the information required to set up the project; you can just select the defaults for now.
...And 10 more matches
Command line crash course - Learn web development
better programs exist for providing a terminal experience on windows, such as powershell (see here to find installers), and gitbash (which comes as part of the git for windows toolset) however, the best option for windows in the modern day is the windows subsystem for linux (wsl) — a compatibility layer for running linux operating systems directly from inside windows 10, allowing you to run a “true terminal” directly on windows, without needing a virtual machine.
...ach case: navigate your computer’s file system along with base level tasks such as create, copy, rename and delete: move around your directory structure: cd create directories: mkdir create files (and modify their metadata): touch copy files: cp move files: mv delete files or directories: rm download files found at specific urls: curl search for fragments of text inside larger bodies of text: grep view a file's contents page by page: less, cat manipulate and transform streams of text (for example changing all the instances of <div>s in an html file to <article>): awk, tr, sed note: there are a number of good tutorials on the web that go much deeper into the command line on the web — this is only a brief introduction!
...assuming the directory is inside your home directory, you can use cd desktop (see the screenshots below).
...And 10 more matches
Performance best practices for Firefox front-end engineers
you might want to consider using a worker if you need to do some computation that can be done off of the main thread.
... if you need more elevated privileges than a standard worker allows, consider using a chromeworker, which is a firefox-only api which lets you create workers with more elevated privileges.
...normally, the changes to the dom just result in the standard style calculation occurring immediately after the javascript has finished running during the 16ms window, inside the "style" step.
...And 10 more matches
nsIWindowMediator
nsisimpleenumerator getenumerator(in wstring awindowtype); nsidomwindow getmostrecentwindow(in wstring awindowtype); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); nsisimpleenumerator getxulwindowenumerator(in wstring awindowtype); pruint32 getzlevel(in nsixulwindow awindow); native code only!
... var {cc: classes, ci: interfaces} = components; var windowlistener = { onopenwindow: function (awindow) { // wait for the window to finish loading let domwindow = awindow.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidomwindowinternal || ci.nsidomwindow); domwindow.addeventlistener("load", function () { domwindow.removeeventlistener("load", arguments.callee, false); //this removes this load function from the window //window has now loaded now do stuff to it //as example this will add a function to listen to tab select and will fire alert in that window if ...
... return value an enumerator of nsidomwindows.
...And 10 more matches
Using Service Workers - Web APIs
in order to facilitate local development, localhost is considered a secure origin by browsers as well.
... when the oninstall handler completes, the service worker is considered installed.
... promises can do a variety of things, but all you need to know for now is that if something returns a promise, you can attach .then() to the end and include callbacks inside it for success cases, or you can insert .catch() on the end if you want to include a failure callback.
...And 10 more matches
JXON - Archive of obsolete content
the algorithms proposed here (see: #1, #2, #3, #4) will consider only the following types of nodes and their attributes: document (only as function argument), documentfragment (only as function argument), element, text (never as function argument), cdatasection (never as function argument), attr (never as function argument).
...this type of algorithm is still considered lossless, since what is lost is meta-information and not information.
... we consider the third algorithm as the most representative and practical jxon parsing algorithm.
...And 9 more matches
Templates - Archive of obsolete content
inside it, you can place the elements that you want to use for each constructed element.
... the template element should be placed inside the container that will contain the constructed elements.
... for example, if you are using a tree, you should place the template element inside a tree element.
...And 9 more matches
Client-side form validation - Learn web development
however, client-side validation should not be considered an exhaustive security measure!
... "please enter your phone number in the format xxx-xxxx" (a specific data format is required for it to be considered valid).
... if the data entered in a form field follows all of the rules specified by the above attributes, it is considered valid.
...And 9 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
a set number of times per second), discusses what they are useful for, and considers their inherent issues.
... passing parameters to a settimeout() function any parameters that you want to pass to the function being run inside the settimeout() must be passed to it as additional parameters at the end of the list.
... if, however, you are doing something more complex and involving objects that are not directly accessible inside the dom (such as 2d canvas api or webgl objects), requestanimationframe() is the better option in most cases.
...And 9 more matches
Looping code - Learn web development
let's consider the case of a farmer that is making sure he has enough food to feed his family for the week.
... inside the parentheses we have three items, separated by semi-colons: an initializer — this is usually a variable set to a number, which is incremented to count the number of times the loop has run.
... inside the loop, we concatenate the current loop item (cats[i] , which is cats[whatever i is at the time]) along with a comma and space, onto the end of the info variable.
...And 9 more matches
Drawing graphics - Learn web development
webgl allows you to create real 3d graphics inside your web browser; the below example shows a simple rotating webgl cube: this article will focus mainly on 2d canvas, as raw webgl code is very complex.
... inside the canvas tags, you can put some fallback content, which is shown if the user's browser doesn't support canvas.
... now add the following lines of javascript inside the <script> element: const canvas = document.queryselector('.mycanvas'); const width = canvas.width = window.innerwidth; const height = canvas.height = window.innerheight; here we have stored a reference to the canvas in the canvas constant.
...And 9 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
in our checkalltodos() function, when we run: todos.foreach(t => t.completed = completed) svelte will not mark todos as changed because it does not know that when we update our t variable inside the foreach() method, we are also modifying the todos array.
... don't forget to pass the prop into moreactions from inside todos.svelte, where the component is called: <moreactions {todos} on:checkall={e => checkalltodos(e.detail)} on:removecompleted={removecompletedtodos} /> working with the dom: focusing on the details now that we have completed all of the app's required functionality, we'll concentrate on some accessibility features that will improve the usability of our app for both keyboard-on...
... put the following contents inside it: <script> import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() let name = '' const addtodo = () => { dispatch('addtodo', name) name = '' } const oncancel = () => name = '' </script> <form on:submit|preventdefault={addtodo} on:keydown={e => e.key === 'escape' && oncancel()}> <h2 class="label-wrapper"> <label for="todo-0" clas...
...And 9 more matches
Creating localizable web applications
for example, if not all the pages of your website are going to be localized, you may consider removing links to the english-only pages from the navigation (headers, footers, sidebars) in the localized versions.
...use the dir attribute on the <html/> element and consider using a rtl class on <html/> or <body/> as well, in order to easily change css rules like in the example below.
...consider the following example: a filmreel-like slideshow showcasing highlighted features of the product or featured designs.
...And 9 more matches
nsIPromptService
to get an instance, use: var promptservice = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); method overview void alert(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); void alertcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheckstate); boolean confirm(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); boolean confirmcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in ...
...wstring acheckmsg, inout boolean acheckstate); print32 confirmex(in nsidomwindow aparent,in wstring adialogtitle,in wstring atext, in unsigned long abuttonflags,in wstring abutton0title, in wstring abutton1title,in wstring abutton2title,in wstring acheckmsg, inout boolean acheckstate); boolean prompt(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring avalue, in wstring acheckmsg, inout boolean acheckstate); boolean promptusernameandpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring ausername, inout wstring apassword, in wstring acheckmsg, inout boolean acheckstate); boolean promptpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring apassword, in wstri...
...ng acheckmsg, inout boolean acheckstate); boolean select(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in pruint32 acount, [array, size_is(acount)] in wstring aselectlist, out long aoutselection); constants the following flags are combined to form the abuttonflags parameter passed to confirmex.
...And 9 more matches
Element Positioning - Archive of obsolete content
box element positioning so far, we know how to position elements either horizontally or vertically inside a box.
...for example, a button's width is determined by the amount of text inside the button.
...a box will be large enough to hold the elements inside the box.
...And 8 more matches
Creating hyperlinks - Learn web development
anatomy of a link a basic link is created by wrapping the text or other content, see block level links, inside an <a> element and using the href attribute, also known as a hypertext reference, or target, that contains the web address.
... inside the html body, add one or more paragraphs or other types of content you already know about.
...inside the root, we have an index.html file and a contacts.html.
...And 8 more matches
Making asynchronous programming easier with async and await - Learn web development
the await keyword the real advantage of async functions becomes apparent when you combine it with the await keyword — in fact, await only works inside async functions.
... you'll note that we've wrapped the code inside a function, and we've included the async keyword before the function keyword.
... this is necessary — you have to create an async function to define a block of code in which you'll run your async code; as we said earlier, await only works inside of async functions.
...And 8 more matches
Introduction to events - Learn web development
in the case of the web, events are fired inside the browser window, and tend to be attached to a specific item that resides in it — this might be a single element, set of elements, the html document loaded in the current tab, or the entire browser window.
...> button { margin: 10px }; the javascript looks like so: const btn = document.queryselector('button'); function random(number) { return math.floor(math.random() * (number+1)); } btn.onclick = function() { const rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundcolor = rndcol; } in this code, we store a reference to the button inside a constant called btn, using the document.queryselector() function.
...the above example invokes a function defined inside a <script> element on the same page, but you could also insert javascript directly inside the attribute, for example: <button onclick="alert('hello, this is my old-fashioned event handler!');">press me</button> you can find html attribute equivalents for many of the event handler properties; however, you shouldn't use these — they are considered bad practice.
...And 8 more matches
Silly story generator - Learn web development
if the online editor you are using doesn't have a separate javascript panel, feel free to put it inline in a <script> element inside the html page.
...in addition you've got a function called randomvaluefromarray() that takes an array, and returns one of the items stored inside the array at random.
...we'd like you to contain these inside variables inside main.js: store the first, big long, string of text inside a variable called storytext.
...And 8 more matches
Observer Notifications
profile-before-change-qm called to shut down the quotamanager; this is separated from profile-before-change to allow everything inside profile-before-change to continue using it.
... web-workers-shutdown called inside xpcom-shutdown.
... topic subject data description chrome-document-global-created nsidomwindow null sent immediately after a chrome document window has been set up, but before any script code has been executed.
...And 8 more matches
nsIAccessibleRetrieval
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiaccessible getaccessiblefor(in nsidomnode anode); nsiaccessible getaccessibleinshell(in nsidomnode anode, in nsipresshell apresshell); nsiaccessible getaccessibleinweakshell(in nsidomnode anode, in nsiweakreference apresshell); obsolete since gecko 2.0 nsiaccessible getaccessibleinwindow(in nsidomnode anode, in nsidomwindow adomwin); obsolete since gecko 2.0 nsiaccessible getapplicationaccessible(); nsiaccessible getattachedaccessiblefo...
...r(in nsidomnode anode); nsiaccessible getcachedaccessible(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsiaccessnode getcachedaccessnode(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsidomnode getrelevantcontentnodefor(in nsidomnode anode); astring getstringeventtype(in unsigned long aeventtype); astring getstringrelationtype(in unsigned long arelationtype); astring getstringrole(in unsigned long arole); nsidomdomstringlist getstringstates(in unsigned long astates, in unsigned long aextrastates); methods getaccessiblefor() return an nsiaccessible for a dom node in pres shell 0.
...nsiaccessible getaccessiblefor( in nsidomnode anode ); parameters anode the dom node to get an accessible for.
...And 8 more matches
nsIXULTemplateQueryProcessor
a template query is the contents inside a <query> element within the template.
...method overview void addbinding(in nsidomnode arulenode, in nsiatom avar, in nsiatom aref, in astring aexpr); print32 compareresults(in nsixultemplateresult aleft, in nsixultemplateresult aright, in nsiatom avar, in unsigned long asorthints); nsisupports compilequery(in nsixultemplatebuilder abuilder, in nsidomnode aquery, in nsiatom arefvariable, in nsiatom amembervariable); void done(); nsisimpleenumerator generateresults(in ...
...nsisupports adatasource, in nsixultemplateresult aref, in nsisupports aquery); nsisupports getdatasource(in nsiarray adatasources, in nsidomnode arootnode, in boolean aistrusted, in nsixultemplatebuilder abuilder, out boolean ashoulddelaybuilding); void initializeforbuilding(in nsisupports adatasource, in nsixultemplatebuilder abuilder, in nsidomnode arootnode); nsixultemplateresult translateref(in nsisupports adatasource, in astring arefstring); methods addbinding() add a variable binding for a particular rule.
...And 8 more matches
Reference Manual
the problem is that inside the getter there is no knowledge of nscomptrs.
...consider, however, what would happen if you were trying to do this with a raw xpcom interface pointer.
... nsidomnode* p = ...; while ( p ) { // ...
...And 8 more matches
Tabbed browser - Archive of obsolete content
within the firefox browser are tabs and inside each tab is a browser, both in the common sense of a web page browser and the xul sense of a browser element.
... from a sidebar basically, if your extension code is a sidebar you can use: var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.gbrowser.addtab(...); from a dialog if your code is running in a dialog opened directly by a browser window, you can use: window.opener.gbrowser.addtab(...); if window.op...
...note that the code above does not work inside of the electrolysis (e10s) enabled tabs.
...And 7 more matches
Drag and Drop - Archive of obsolete content
the first is a drag service, nsidragservice and the second is the drag session, nsidragsession.
... the nsidragservice is responsible for creating drag sessions when a drag starts, and removing the drag session when the drag is complete.
... the function invokedragsession should be called to start a drag inside an ondraggesture event handler.
...And 7 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
5 api codingscripting, glossary, infrastructure an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface.
...for example, you can put a block of statements after an if (condition) block, indicating that the interpreter should run the code inside the block if the condition is true, or skip the whole block if the condition is false.
... 49 cors-safelisted request header cors, fetch a cors-safelisted request header is one of the following http headers: 50 cors-safelisted response header cors, fetch, glossary, http a cors-safelisted response header is an http header which has been safelisted so that it will not be filtered when responses are processed by cors, since they're considered safe (as the headers listed in access-control-expose-headers).
...And 7 more matches
Cascade and inheritance - Learn web development
for example, if you set a color and font-family on an element, every element inside it will also be styled with that color and font, unless you've applied different color and font values directly to them.
...in the example below we have a <ul>, with two levels of unordered lists nested inside it.
... the color has applied to the direct children, but also the indirect children — the immediate child <li>s, and those inside the first nested list.
...And 7 more matches
How to build custom form controls - Learn web development
for example, if you need to perform advanced styling on some controls such as the <select> element or if you want to provide custom behaviors, you may consider building your own controls.
...we will also discuss how, when, and whether building your own control makes sense, and what to consider when building a control is a requirement.
...if you consider that the active state and the open state are completely different, the answer is again "nothing will happen" because we did not define any keyboard interactions for the opened state.
...And 7 more matches
Useful string methods - Learn web development
retrieving a specific string character on a related note, you can return any character inside a string by using square bracket notation — this means you include square brackets ([]) on the end of your variable name.
... inside the square brackets you include the number of the character you want to return, so for example to retrieve the first letter you'd do this: browsertype[0]; remember: computers count from 0, not 1!
... finding a substring inside a string and extracting it sometimes you'll want to find if a smaller string is present inside a larger one (we generally say if a substring is present inside a string).
...And 7 more matches
Ember interactivity: Events, classes and state - Learn web development
add the new line shown below to your header.hbs file: <input class='new-todo' aria-label='what needs to be done?' placeholder='what needs to be done?' autofocus {{on 'keydown' this.onkeydown}} > this new attribute is inside double curly braces, which tells you it is part of ember's dynamic templating syntax.
... we can define what is available inside this by generating a component class to go along with your component.
... to create a header class to go with your header component, type this in to your terminal: ember generate component-class header this will create the following empty class file — todomvc/app/components/header.js: import component from '@glimmer/component'; export default class headercomponent extends component { } inside this file we will implement the event handler code.
...And 7 more matches
Introduction to client-side frameworks - Learn web development
there are many frameworks out there, but currently the "big four" are considered to be the following.
... consider a common kind of application: a to-do list creator, which we'll look at implementing using a variety of frameworks in future chapters.
...we want to represent each task as a list item – an html <li> element inside of an unordered list element (a <ul>).
...And 7 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
previous overview: client-side javascript frameworks next we now have sample data in place, and a loop that takes each bit of data and renders it inside a todoitem in our app.
...go back to app.vue and add the following import statement just below the previous one, inside your <script> element: import todoform from './components/todoform'; you also need to register the new component in your app component — update the components property of the component object so that it looks like this: components: { todoitem, todoform } finally for this section, render your todoform component inside your app by adding the <to-do-form /> element inside yo...
...what we actually want to do is run a method on the submit event that will add the new todo to the todoitem data list defined inside app.
...And 7 more matches
nsIContentViewer
[noscript,notxpcom] nsidocumentptr getdocument(); void hide(); void init(in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds); native code only!
... void setdocumentinternal(in nsidocumentptr adocument, in boolean aforcereuseinnerwindow); native code only!
... [noscript,notxpcom,nostdcall] void setnavigationtiming(in nsdomnavigationtimingptr atiming); void setpagemode(in boolean apagemode, in nsiprintsettings aprintsettings); void show(); void stop(); void unload(); obsolete since gecko 1.8 attributes attribute type description container nsisupports domdocument nsidomdocument enablerendering boolean obsolete since gecko 2.0 historyentry nsishentry get the history entry that this viewer will save itself into when destroyed.
...And 7 more matches
nsIMessenger
method overview void setdisplaycharset(in acstring acharset); void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); void undo(in nsimsgwindow msgwindow); ...
...vice messageservicefromuri(in acstring auri); nsimsgdbhdr msghdrfromuri(in acstring auri); acstring getmsguriatnavigatepos(in long apos); acstring getfolderuriatnavigatepos(in long apos); void getnavigatehistory(out unsigned long acurpos, out unsigned long acount, [array, size_is(acount)] out string ahistory); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
... void setwindow(in nsidomwindow awin, in nsimsgwindow amsgwindow); parameters awin the window to set as the window for the messaging session.
...And 7 more matches
Introduction to formatting contexts - CSS: Cascading Style Sheets
this means that every element inside the <html> element's block is laid out according to normal flow following the rules for block and inline layout.
...display: table-caption block elements where overflow has a value other than visible elements with display: flow-root or display: flow-root list-item elements with contain: layout, content, or strict flex items grid items multicol containers elements with column-span set to all this is useful because a new bfc will behave much like the outermost document in that it becomes a mini-layout inside the main layout.
... a bfc contains everything inside it, float and clear only apply to items inside the same formatting context, and margins only collapse between elements in the same formatting context.
...And 7 more matches
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
the two-value syntax as you can see from the above explanation, the display property has gained considerable new powers.
... in addition to indicating whether something is block-level or inline-level in relationship to other boxes on the page, it now also indicates the formatting context inside the box it is applied to.
...a bfc ensures that everything inside your box stays inside it, and things from outside the box cannot intrude into it.
...And 7 more matches
Mobile first - Progressive web apps (PWAs)
this guide looks at a few useful techniques inside the mobile first umbrella.
... first things first — mobile as a default you may think that concentrating on the mobile experience first sounds pointless, as we are more used to dealing with desktop sites, and we surely need to consider the full gamut of features for the overall experience across desktop, mobile, etc., before then paring it down to a mobile experience that is simpler, more streamlined, or whatever.
... we consider the overall experience during the planning stage, look at what subset of features will be available on mobile, desktop, etc.
...And 7 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
for a start, let's have a look at what happens when we include the <video> and <img> elements inside our first two columns, naked and unstyled.
...this is pretty horrible, but generally this kind of problem is easily fixed with some simple css: img, video { max-width: 100%; } this tells the replaced elements to remain constrained inside their container's widths, no matter what.
...this is created by all of the css inside the first media query: @media all and (max-width: 1024px) { x-card:nth-child(1), x-card:nth-child(2) { width: 50%; } x-card:nth-child(3) { width: 100%; clear: left; } x-card:nth-child(3) img { width: 20%; } } so here we're altering the widths of the columns and removing the float of the third column (and adding clearing to guard against any float funny business).
...And 7 more matches
Understanding WebAssembly text format - WebAssembly
each node in the tree goes inside a pair of parentheses — ( ...
... the first label inside the parenthesis tells you what type of node it is, and after that there is a space-separated list of either attributes or child nodes.
... there are a lot more things that can be put inside function bodies, but we will start off simple for now, and you’ll see a lot more examples as you go along.
...And 7 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
pros and cons i consider the mpl to be an extremely well balanced oss license.
... the gpl does not state whether linked files and the like are considered “derivative works under copyright law.” the lgpl does make the declaration below.
... the following tasks can be considered modifications revision: rewriting the source code; addition: adding new code, or adding parts of it to other code; linkage: creating static or dynamic links.
...And 6 more matches
browser - Archive of obsolete content
ontentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogresslistener, goback, goforward, gohome, gotoindex, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </groupbox> attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
... droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface homepage type: url this attribute allows you to set a homepage for the browser element.
... the type of browser, which can be used to set access of the document loaded inside the browser.
...And 6 more matches
Getting started with CSS - Learn web development
to link styles.css to index.html add the following line somewhere inside the <head> of the html document: <link rel="stylesheet" href="styles.css"> this <link> element tells the browser that we have a stylesheet, using the rel attribute, and the location of that stylesheet as the value of the href attribute.
...in our document are two <em> elements — one inside a paragraph and the other inside a list item.
... to select only an <em> that is nested inside an <li> element i can use a selector called the descendant combinator, which simply takes the form of a space between two other selectors.
...And 6 more matches
Other form controls - Learn web development
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 was plain text content.
... the <option> elements can be nested inside <optgroup> elements to create visually associated groups of values: <select id="groups" name="groups"> <optgroup label="fruits"> <option>banana</option> <option selected>cherry</option> <option>lemon</option> </optgroup> <optgroup label="vegetables"> <option>carrot</option> <option>eggplant</option> <option>potato</option> </optgroup> </select> on the <optgr...
...And 6 more matches
Mozilla splash page - Learn web development
you don't need to touch the css, just the html inside the <body> element — as long as you insert the correct markup, the styling will make it look correct.
... along with mdn.svg, these images will be your icons to link to further resources, inside the further-info area.
...save copies of all these inside the same directory as index.html.
...And 6 more matches
What is JavaScript? - Learn web development
the core client-side javascript language consists of some common programming features that allow you to do things like: store useful values inside variables.
...you will need to consider cross browser testing in more detail when you get closer to delivering production code (i.e.
...when you load a web page in your browser, you are running your code (the html, css, and javascript) inside an execution environment (the browser tab).
...And 6 more matches
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.
...create-react-app uses this name to make a new directory, then creates the necessary files inside it.
... make sure you cd to the place you'd like your app to live on your hard drive, then run the following in your terminal: npx create-react-app moz-todo-react this creates a moz-todo-react directory, and does several things inside it: installs some npm packages essential to the functionality of the app.
...And 6 more matches
Strategies for carrying out testing - Learn web development
you may also consider using open source and privacy focussed analytics platforms like open web analytics and matomo.
... other considerations there are other considerations that you should probably include as well.
... you should definitely include accessibility as a grade a testing requirement (we'll cover exactly what you should test in our handling common accessibility problems article) plus you might have other considerations.
...And 6 more matches
Introducing a complete toolchain - Learn web development
tools used in our toolchain in this article we're going to use the following tools and features: jsx, a react-related set of syntax extensions that allow you to do things like defining component structures inside javascript.
... all web projects will be different, and you need to consider what parts of your toolchain are necessary and consider each part carefully.
...you will probably want to review this part of the toolchain semi-regularly and consider if there's any upgrades or changes you should introduce, but this shouldn't be required too often.
...And 6 more matches
Starting WebLock
this works for most cases, but consider the case when you have this notification create a component.
...in c++, this is considered a public variable and "compiled" into a get method (e.g., getsites).
...this service, available as nsidirectoryservice, stores the location of various common system locations, such as the the directory containing the running process, the user's home directory, and others.
...And 6 more matches
nsIEventListenerService
method overview void geteventtargetchainfor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray); void getlistenerinfofor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsieventlistenerinfo aoutarray); boolean haslistenersfor(in nsidomeventtarget aeventtarget, in domstrin...
...g atype); void addsystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); void removesystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); attributes attribute type description systemeventgroup nsidomeventgroup returns system event group.
...void geteventtargetchainfor( in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray ); parameters aeventtarget the nsidomeventtarget for which to return the event target chain.
...And 6 more matches
nsISelectionController
void charactermove(in boolean forward, in boolean extend); boolean checkvisibility(in nsidomnode node, in short startoffset, in short endoffset); void completemove(in boolean forward, in boolean extend); void completescroll(in boolean forward); boolean getcaretenabled(); short getdisplayselection(); nsiselection getselection(in short type); void intralinemove(in boolean forward, in boolean e...
...this will also have the effect of collapsing the selection if the extend = pr_false the "point" of selection that is extended is considered the "focus" point, or the last point adjusted by the selection.
...boolean checkvisibility( in nsidomnode node, in short startoffset, in short endoffset ); parameters node nsidomnode to test.
...And 6 more matches
nsISelectionPrivate
void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalarray(in nsinode beginnode, in print32 beginoffset, in nsinode endnode, in print32 endoffset, in boolean allowadjacent, in rangearray results); native code only!
... void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results); native code only!
... obsolete since gecko 12.0 long gettableselectiontype(in nsidomrange range); void removeselectionlistener(in nsiselectionlistener listenertoremove); void scrollintoview(in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent); void setancestorlimiter(in nsicontent acontent); native code only!
...And 6 more matches
nsIXULTemplateBuilder
if a result passes a rule's conditions, this is considered a match, and the content within the rule's <action> body is inserted as a sibling of the <template>, assuming the template builder creates real dom content.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void rebuild(); void refresh(); void addresult(in nsixultemplateresult aresult, in nsidomnode aquerynode); void removeresult(in nsixultemplateresult aresult); void replaceresult(in nsixultemplateresult aoldresult, in nsixultemplateresult anewresult, in nsidomnode aquerynode); void resultbindingchanged(in nsixultemplateresult aresult); nsixultemplateresult getresultforid(in astring aid); nsixultemplateresult getresultforcontent(in nsidomelement aelement); boolean hasgener...
...atedcontent(in nsirdfresource anode, in nsiatom atag); void addrulefilter(in nsidomnode arule, in nsixultemplaterulefilter afilter); [noscript] void init(in nsicontent aelement); [noscript] void createcontents(in nsicontent aelement, in boolean aforcecreation); void addlistener(in nsixulbuilderlistener alistener); void removelistener(in nsixulbuilderlistener alistener); attributes attribute type description root nsidomelement readonly: the root node in the dom to which this builder is attached.
...And 6 more matches
Accessibility documentation index - Accessibility
5 aria annotations aria, accessibility, wai-aria, annotations, comments, details, suggestions wai-aria version 1.3 sees the addition of a set of new features, collectively known as aria annotations, which allow the creation of accessible annotations inside web documents.
... 11 multipart labels: using aria for labels with embedded fields inside them aria, accessibility, ben millard, firefox, guide, help, html, html 4, jaws, needscontent, aria-labelledby, label, solution, trouble shoot, troubleshoot the solution is in an aria attribute called aria-labelledby.
...it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list.
...And 6 more matches
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
you can set a default value for the input by including a number inside the value attribute, like so: <input id="number" type="number" value="42"> additional attributes in addition to the attributes commonly supported by all <input> types, inputs of type number support these attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the maximum ...
...value to accept for this input min the minimum value to accept for this input placeholder an example value to display inside the field when it's empty readonly a boolean attribute indicating whether the value is read-only step a stepping interval to use when using up and down arrows to adjust the value, as well as for validation list the values of the list attribute is the id of a <datalist> element located in the same document.
... important: bear in mind that, logically, you should not be able to enter characters inside a number input other than numbers.
...And 6 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
so if a variable is defined using var in a compound statement (for example inside an if control structure), it will be visible to the entire function.
...consider the following: var a = ['dog', 'cat', 'hen']; a[100] = 'fox'; a.length; // 101 remember — the length of the array is one more than the highest index.
... add(); // nan // you can't perform addition on undefined you can also pass in more arguments than the function is expecting: add(2, 3, 4); // 5 // added the first two; 4 was ignored that may seem a little silly, but functions have access to an additional variable inside their body called arguments, which is an array-like object holding all of the values passed to the function.
...And 6 more matches
Patterns - SVG: Scalable Vector Graphics
WebSVGTutorialPatterns
rn id="pattern" x="0" y="0" width=".25" height=".25"> <rect x="0" y="0" width="50" height="50" fill="skyblue"/> <rect x="0" y="0" width="25" height="25" fill="url(#gradient2)"/> <circle cx="25" cy="25" r="20" fill="url(#gradient1)" fill-opacity="0.5"/> </pattern> </defs> <rect fill="url(#pattern)" stroke="black" width="200" height="200"/> </svg> screenshotlive sample inside the <pattern> element, you can include any of the other basic shapes you've included before, and each of them can be styled using any of the styles you've learned before, including gradients and opacity.
... here, we've just drawn two rectangle elements inside the pattern (which overlap, and one of which is twice the size of the other and is used to fill in the entire pattern), and one circle.
... unlike gradients, patterns have a second attribute, patterncontentunits, which describes the units system used inside the pattern element, on the basic shapes themselves.
...And 6 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
mtp1"); lockpref("mail.startup.enabledmailcheckonce", true); lockpref("mailnews.quotingprefs.version", 1); lockpref("mailnews.ui.threadpane.version", 5); /* 3) define here (because if set after "4)" below it doesn't work!) processldapvalues which is eventually called by getldapattributes() just below, check getldapattributes() code from $mozilla_home/defaults/autoconfig/prefcalls.js to see the inside call to "user defined" processldapvalues */ function processldapvalues(values) { if(values) { // set the global var with the values returned from the ldap query ldap_values = values; var uid = getldapvalue(values, "uid"); var cn = getldapvalue(values, "cn"); var mail = getldapvalue(values, "mail"); var url = getldapvalue(values, "labeleduri"); // those ldap variables a...
... // windows settings var env_user = getenv("username"); var env_home = getenv("homepath"); } var env_mozdebug= getenv("mozilla_debug"); // 2) define here (because if set after "3)" below it doesn't work !) processldapvalues which is eventually called by getldapattributes() just below, // check getldapattributes() code from $mozilla_home/defaults/autoconfig/prefcalls.js to see the inside call to "user defined" processldapvalues /* commented all this section about ldap calls, not supported in ff5 packages :-( function processldapvalues (values) { if(values) { // set the global var with the values returned from the ldap query ldap_values = values; var uid = getldapvalue ( values ,"uid" ); var cn = getldapvalue ( values ,"cn" ); var mail = get...
...); } else { // windows settings var env_user = getenv("username"); var env_home = getenv("homepath"); } var env_mozdebug = getenv("mozilla_debug"); /* 2) define here (because if set after "3)" below it doesn't work!) processldapvalues which is eventually called by getldapattributes() just below, check getldapattributes() code from $mozilla_home/defaults/autoconfig/prefcalls.js to see the inside call to "user defined" processldapvalues */ function processldapvalues(values) { if(values) { // set the global var with the values returned from the ldap query ldap_values = values; var uid = getldapvalue(values, "uid"); var cn = getldapvalue(values, "cn"); var mail = getldapvalue(values, "mail"); var url = getldapvalue(values, "labeleduri"); //debug with popup error m...
...And 5 more matches
Monitoring downloads - Archive of obsolete content
in particular, it needs to get an instance of the download manager's nsidownloadmanager interface and create the database into which its data will be stored.
... onload: function() { // initialization code this.initialized = true; this.strings = document.getelementbyid("downloadlogger-strings"); this.dlmgr = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); this.dlmgr.addlistener(downloadlogger); // open the database, placing its file in the profile directory this.dbfile = components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsiproperties) .get("profd", components.interfaces.nsifile); this.dbfile.append("downloadlogger.sqlite"); // get access to the storage service and open the database this.storageservice = components.classes["@mozilla.org/storage/se...
...this is part of the nsidownloadprogresslistener interface.
...And 5 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
<body> <-- method script goes here --> </body> </method> </implementation> a method declaration goes inside the implementation element, like the fields and properties do.
... elements with an xbl behavior attached to them have a special property which holds an array of the anonymous child elements inside it.
...note that it is possible for an xbl-bound element to be placed inside another one, in which case you will have to use the getanonymousnodes() function again.
...And 5 more matches
Building up a basic demo with A-Frame - Game development
the webxr and webgl apis already enable us to start creating virtual reality (vr) experiences inside web browsers, but the community is still waiting for tools and libraries to appear, to make this easier.
... save a copy of the latest a-frame javascript library file inside your directory (check the github repository for latest stable a dev builds).
... html structure the first step is to create an html document — inside your project directory, create a new index.html file, and save the follow html inside it: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: a-frame demo</title> <script src="aframe.min.js"></script> </head> <body> <!-- html goes here --> </body> </html> this contains some basic information like the document charset and <title>.
...And 5 more matches
Dealing with files - Learn web development
inside your chosen place, create a new folder called web-projects (or similar).
... inside this first folder, create another folder to store your first website in.
...using your text editor, create a new file called index.html and save it just inside your test-site folder.
...And 5 more matches
Images in HTML - Learn web development
fortunately, it wasn't too long before the ability to embed images (and other more interesting types of content) inside web pages was added.
... there are other types of multimedia to consider, but it is logical to start with the humble <img> element, used to embed a simple image in a webpage.
... so for example, if your image is called dinosaur.jpg, and it sits in the same directory as your html page, you could embed the image like so: <img src="dinosaur.jpg"> if the image was in an images subdirectory, which was inside the same directory as the html page (which google recommends for seo/indexing purposes), then you'd embed it like this: <img src="images/dinosaur.jpg"> and so on.
...And 5 more matches
From object to iframe — other embedding technologies - Learn web development
these were considered the height of coolness in the mid to late 90s, and there was evidence that having a webpage split up into smaller chunks like this was better for download speeds — especially noticeable with network connections being so slow back then.
... finally, the <iframe> element appeared (along with other ways of embedding content, such as <canvas>, <video>, etc.) this provides a way to embed an entire web document inside another one, as if it were an <img> or other such element, and is used regularly today.
... there are some serious security concerns to consider with <iframe>s, as we'll discuss below, but this doesn't mean that you shouldn't use them in your websites — it just requires some knowledge and careful thinking.
...And 5 more matches
Image gallery - Learn web development
if the online editor you are using doesn't have separate javascript/css panels, feel free to put them inline <script>/<style> elements inside the html page.
...the html body looks like this: <h1>image gallery example</h1> <div class="full-img"> <img class="displayed-img" src="images/pic1.jpg"> <div class="overlay"></div> <button class="dark">darken</button> </div> <div class="thumb-bar"> </div> the example looks like this: the most interesting parts of the example's css file: it absolutely positions the three elements inside the full-img <div> — the <img> in which the full-sized image is displayed, an empty <div> that is sized to be the same size as the <img> and put right over the top of it (this is used to apply a darkening effect to the image via a semi-transparent background color), and a <button> that is used to control the darkening effect.
... it sets the width of any images inside the thumb-bar <div> (so-called "thumbnail" images) to 20%, and floats them to the left so they sit next to one another on a line.
...And 5 more matches
Framework main features - Learn web development
the following shows a simple jsx example: const subject = "world"; const header = ( <header> <h1>hello, {subject}!</h1> </header> ); this expression represents an html <header> element with a <h1> element inside.
...for instance, consider a function add(), which takes integers a and b and returns their sum.
...to render this component, we would write code like this in the place where we want it rendered (which will probably be inside another component): <authorcredit src="./assets/zelda.png" alt="portrait of zelda schiff" byline="zelda schiff is editor-in-chief of the library times." /> this will ultimately render the following <figure> element in the browser, with its structure as defined in the authorcredit component, and its content as defined in the props included on the authorcredit component call: <figure> <...
...And 5 more matches
Deploying our app - Learn web development
here's just a few things to consider for this particular project: generating a production build: ensuring files are minimised, chunked, have tree-shaking applied, and that versions are "cache busted".
... netlify, amongst other things, also allows you to run pre-deployment tasks, which in our case means that all the production code build processes can be performed inside of netlify and if the build is successful, the website changes will be deployed.
... "build": "parcel build src/index.html" } note: if the scripts property already has a command inside it, put a comma at the end of it.
...And 5 more matches
mach
if the current working directory mach is invoked with is inside an object directory, the mozconfig used when creating that object directory is used.
...if you don't use mach, you have to find another solution for the following problems: discovering what commands or make targets are available (mach exposes everything through mach help while inside "mozilla-central" , else you'll just get a cryptic error message) making more sense out of command output (mach offers terminal colorization and structured logging) getting productive tools in the hands of others (mach "advertises" tools to people through mach help (unless it actually just gives you a cryptic error message) - in the former case, people don't need to discover your tool from a b...
...generally speaking, if you have some piece of functionality or action that is useful to multiple people (especially if it results in productivity wins), then you should consider implementing a mach command for it.
...And 5 more matches
Localization content best practices
it's important to consider this when adding strings, and especially localization comments for strings that contain references, or obscure technical details.
... create localizable strings don't assume grammar structures you need to consider the need for different grammar structures in different locales, and add switching mechanisms to present them appropriately.
... unless there are significant savings of translation volume involved, it is usually easier and quicker for translators to handle these as fixed strings rather than composed strings, especially considering the time needed for locating, checking and potentially fixing composed strings.
...And 5 more matches
nsIJSID
method overview boolean equals(in nsijsid other); const nsid* getid(); violates the xpcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only.
...obsolete since gecko 1.9 the internal nsid.
...the string representation of the internal nsid.
...And 5 more matches
nsISmsRequestManager
to create an instance, use: var smsrequestmanager = components.classes["@mozilla.org/sms/smsrequestmanager;1"] .createinstance(components.interfaces.nsismsrequestmanager); method overview long addrequest(in nsidommozsmsrequest arequest); long createrequest(in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest); void notifycreatemessagelist(in long arequestid, in long alistid, in nsidommozsmsmessage amessage); void notifygetsmsfailed(in long arequestid, in long aerror); void notifygotnextmessage(in long arequestid, in nsidommozsmsmessage amessage); void notifygotsms(in long arequesti...
...d, in nsidommozsmsmessage amessage); void notifymarkedmessageread(in long arequestid, in bool aread); void notifymarkmessagereadfailed(in long arequestid, in long aerror); void notifynomessageinlist(in long arequestid); void notifyreadmessagelistfailed(in long arequestid, in long aerror); void notifysmsdeleted(in long arequestid, in bool adeleted); void notifysmsdeletefailed(in long arequestid, in long aerror); void notifysmssendfailed(in long arequestid, in long aerror); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related errors that could apply to smsrequest objects.
...long addrequest( in nsidommozsmsrequest arequest ); parameters arequest an smsrequest.
...And 5 more matches
nsIWinTaskbar
to create an instance, use: var wintaskbar = components.classes["@mozilla.org/windows-taskbar;1"] .getservice(components.interfaces.nsiwintaskbar); method overview nsijumplistbuilder createjumplistbuilder(); nsitaskbartabpreview createtaskbartabpreview(in nsidocshell shell, in nsitaskbarpreviewcontroller controller); nsitaskbarprogress gettaskbarprogress(in nsidocshell shell); nsitaskbarwindowpreview gettaskbarwindowpreview(in nsidocshell shell); void setgroupidforwindow(in nsidomwindow aparent, in astring aidentifier); attributes attribute type description available boolean returns true if the operating system supports windows 7 or late...
...createtaskbartabpreview() creates a taskbar tab preview, given an nsidocshell reference to a top-level window.
... nsitaskbartabpreview createtaskbartabpreview( in nsidocshell shell, in nsitaskbarpreviewcontroller controller ); parameters shell an nsidocshell object representing the top-level window from which to create the preview.
...And 5 more matches
nsIXMLHttpRequestEventTarget
1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) attributes attribute type description onabort nsidomeventlistener a javascript function object that gets invoked if the operation is canceled by the user.
... onerror nsidomeventlistener a javascript function object that gets invoked if the operation fails to complete due to an error.
... onload nsidomeventlistener a javascript function object that gets invoked when the operation is successfully completed.
...And 5 more matches
XPIDL
nsresult (xpidl unsigned long typedef, 32 bits) number nsrefcnt (xpidl unsigned long typedef, 32 bits) number size_t (xpidl unsigned long typedef, 32 bits) number voidptr void* void* not allowed charptr char* char** not allowed unicharptr char16_t* char16_t** not allowed nsidref const nsid& nsid* ?
... nsidptr const nsid* nsid** ?
... nsid const nsid nsid* ?
...And 5 more matches
Working with windows in chrome code
technically speaking, it implements a number of interfaces, including nsidomjswindow and nsidomwindow, but it also contains the user-defined properties for global variables and functions of the window.
... the same holds for chrome windows opened inside a tab of <tabbrowser>.
... accessing content documents assume you have a document loaded in a <tabbrowser>, <browser>, or <iframe> element inside your document.
...And 5 more matches
Using Web Workers - Web APIs
you can run whatever code you like inside the worker thread, with some exceptions.
... for example, you can't directly manipulate the dom from inside a worker, or use some default methods and properties of the window object.
...first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } so here we have two <input> elements represented by the variables first and second; when the value of either is changed, myworker.postmessage([first.value,second.value]) is used to send the value inside both to the worker, as an array.
...And 5 more matches
ARIA Test Cases - Accessibility
expected at behavior: when any control is focused inside the groupbox, where focus was previously outside of the groupbox, the description for the entire groupbox should be read by a screen reader.
.../a jaws 10 - - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - group (no examples yet) expected at behavior: (mz) when focus first lands on a control inside the group, the name should be spoken.
... voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - menubar and menu yui menubar menubar 1 dojo nightly build - popup menu expected at behavior: (mz) as focus is placed inside a menu or menubar, a screen reader should announce the name (if any) of the menu, the role of the menu, and then read the current menu item.
...And 5 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
that said, hsl colors incorporate lightness, not luminance, and this is a significant consideration.
... another important point to consider is the ambience of light surrounding the color.
... color combinations contrast alone is not enough when it comes to accessibility considerations.
...And 5 more matches
Using HTML sections and outlines - Developer guides
you can have primary and secondary menus, but you cannot nest a <nav> element inside another <nav> element.
...the header can also be used inside other semantic elements such as <article> or <section>.
... </p> </article> nesting elements inside an article the <article> element can have other semantic elements such as headers, asides, and footers.
...And 5 more matches
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
it takes few attributes, the most notable of which are form, which can contain the id of a <form> on the same page, allowing you to make the <fieldset> part of that <form> even if it is not nested inside it, and disabled, which allows you to disable the <fieldset> and all its contents in one go.
...note that form elements inside the <legend> element won't be disabled.
... form this attribute takes the value of the id attribute of a <form> element you want the <fieldset> to be part of, even if it is not inside the form.
...And 5 more matches
Closures - JavaScript
lexical scoping consider the following example code: function init() { var name = 'mozilla'; // name is a local variable created by init function displayname() { // displayname() is the inner function, a closure alert(name); // use variable declared in the parent function } displayname(); } init(); init() creates a local variable called name and a function called displayname().
... the displayname() function is an inner function that is defined inside init() and is available only within the body of the init() function.
... closure consider the following code example: function makefunc() { var name = 'mozilla'; function displayname() { alert(name); } return displayname; } var myfunc = makefunc(); myfunc(); running this code has exactly the same effect as the previous example of the init() function above.
...And 5 more matches
Media container formats (file types) - Web media technologies
audio codecs supported by webm codec browser support chrome edge firefox safari opus yes yes yes yes vorbis yes yes yes yes choosing the right container there are a few factors to consider when selecting the best container or containers to use for your media.
... if your target audience is likely to include users on mobile, especially on lower-end devices or on slow networks, consider providing a version of your media in a 3gp container with appropriate compression.
... if you want your media to be in a non-proprietary, open format, consider using one of the open container formats such as flac (for audio) or webm (for video).
...And 5 more matches
Web Performance
this article starts the module off with a good look at what performance actually is — this includes the tools, metrics, apis, networks, and groups of people we need to consider when thinking about performance, and how we can make performance part of our web development workflow.
...this article outlines some javascript best practices that should be considered to ensure even complex content is as performant as possible.
... mobile performance with web access on mobile devices being so popular, and all mobile platforms having fully-fledged web browsers, but possibly limited bandwidth, cpu and battery life, it is important to consider the performance of your web content on these platforms.
...And 5 more matches
fill-rule - SVG: Scalable Vector Graphics
the fill-rule attribute is a presentation attribute defining the algorithm to use to determine the inside part of a shape.
...it is therefore considered outside the shape, and not filled.
... --> <polygon fill-rule="evenodd" stroke="red" points="150,0 121,90 198,35 102,35 179,90"/> </svg> usage notes value nonzero | evenodd default value nonzero animatable yes the fill-rule attribute provides two options for how the inside (that is, the area to be filled) of a shape is determined: nonzero the value nonzero determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction, and then examining the places where a segment of the shape crosses the ray.
...And 5 more matches
Secure contexts - Web security
when is a context considered secure?
... a context is considered secure when it meets certain minimum standards of authentication and confidentiality defined in the secure contexts specification.
... a particular document is considered to be in a secure context when it is the active document of a top-level browsing context (basically, a containing window or tab) that is a secure context.
...And 5 more matches
Using shadow DOM - Web Components
as an example, consider the following html fragment: <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple dom example</title> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https:/...
... shadow tree: the dom tree inside the shadow dom.
... you can affect the nodes in the shadow dom in exactly the same way as non-shadow nodes — for example appending children or setting attributes, styling individual nodes using element.style.foo, or adding style to the entire shadow dom tree inside a <style> element.
...And 5 more matches
content/mod - Archive of obsolete content
window : nsidomwindow the window to be modified.
...detachfrom(style, window); parameters modification : object the modification we want to remove from the target window : nsidomwindow the window to be modified.
... gettargetwindow(target) function takes target, value representing content (page) and returns nsidomwindow for that content.
...And 4 more matches
Actions - Archive of obsolete content
the content to generate goes directly inside the action element.
...instead, the action element is placed directly inside the <xul:template> element after the query is defined.
...for result b, the builder would have generated the following content: <button id="http://www.xulplanet.com/rdf/b" label="http://www.xulplanet.com/rdf/b"/> naturally, you wouldn't use an id attribute inside a template action since the id would be replaced anyway.
...And 4 more matches
Content Panels - Archive of obsolete content
the web pages would appear inside the iframe.
...there are three classes of browser, depending on the kind of content that you want to display inside.
...in this case, the content loaded inside the browser is treated as if it was part of the same application and has access to the outer window.
...And 4 more matches
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
all of the columns should be placed directly inside a treecols element.
... treerow a single row in the tree, which should be placed inside a treeitem tag.
...this element would go inside a treerow element.
...And 4 more matches
Using Spacers - Archive of obsolete content
as we've seen, the find files window has appeared in a size that will fit the elements inside it.
...if you place a spacer directly inside a window, the spacer will grow in size when the size of the window is changed.
...you'll notice that the cancel button in the dialogs has always set its width so that it fits the text inside it.
...And 4 more matches
3D collision detection - Game development
the box constantly changes dimensions to snugly fit the entity contained inside.
...aabb checking if a point is inside an aabb is pretty simple — we just need to check whether the point's coordinates fall inside the aabb; considering each axis separately.
...re the ranges of each axis of the aabb, we can calculate whether a collision has occurred between the two using the following formula: f(p,b)=(px>=bminx∧px<=bmaxx)∧(py>=bminy∧py<=bmaxy)∧(pz>=bminz∧pz<=bmaxz)f(p,b)= (p_x >= b_{minx} \wedge p_x <= b_{maxx}) \wedge (p_y >= b_{miny} \wedge p_y <= b_{maxy}) \wedge (p_z >= b_{minz} \wedge p_z <= b_{maxz}) or in javascript: function ispointinsideaabb(point, box) { return (point.x >= box.minx && point.x <= box.maxx) && (point.y >= box.miny && point.y <= box.maxy) && (point.z >= box.minz && point.z <= box.maxz); } aabb vs.
...And 4 more matches
Styling tables - Learn web development
link the css to the html by placing the following line of html inside your <head>: <link href="style.css" rel="stylesheet" type="text/css"> spacing and layout the first thing we need to do is sort out the spacing/layout — default table styling is so cramped!
...this is why we've selected the four different headings with the thead th:nth-child(n) (:nth-child) selector ("select the nth child that is a <th> element in a sequence, inside a <thead> element") and given them set percentage widths.
...we've also set our custom font on the headings inside the <thead> and <tfoot> elements, for a nice grungy, punky look.
...And 4 more matches
Introduction to CSS layout - Learn web development
we also have entire layout methods that are switched on via specific display values, for example css grid and flexbox, which alter how elements inside the element they are set on are laid out.
... the position property — allows you to precisely control the placement of boxes inside other boxes.
...if you create a link around some text inside a paragraph, that link remains inline with the rest of the text, and doesn’t break onto a new line.
...And 4 more matches
Styling lists - Learn web development
previous overview: styling text next lists behave like any other text for the most part, but there are some css properties specific to lists that you need to know about, and some best practices to consider.
... list-style-position: sets whether the bullets appear inside the list items, or outside them before the start of each item.
... bullet position the list-style-position property sets whether the bullets appear inside the list items, or outside them before the start of each item.
...And 4 more matches
JavaScript basics - Learn web development
for example: let icecream = 'chocolate'; if(icecream === 'chocolate') { alert('yay, i love chocolate ice cream!'); } else { alert('awwww, but chocolate is my favorite...'); } the expression inside the if( ...
...arguments go inside the parentheses, separated by commas if there is more than one argument.
... for example, the alert() function makes a pop-up box appear inside the browser window, but we need to give it a string as an argument to tell the function what message to display.
...And 4 more matches
HTML text fundamentals - Learn web development
search engines indexing your page consider the contents of headings as important keywords for influencing the page's search rankings.
...consider the following: <span style="font-size: 32px; margin: 21px 0; display: block;">is this a top level heading?</span> this is a <span> element.
... nesting lists it is perfectly ok to nest one list inside another one.
...And 4 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
to get started, open the local copy inside your favorite text editor, and your browser.
...what's even more useful is that the console gives you error messages whenever a syntax error exists inside the javascript being fed into the browser's javascript engine.
... note: this error didn't come up as soon as the page was loaded because this error occurred inside a function (inside the checkguess() { ...
...And 4 more matches
Inheritance in JavaScript - Learn web development
inside here you'll find the same person() constructor example that we've been using all the way through the module, with a slight difference — we've defined only the properties inside the constructor: function person(first, last, age, gender, interests) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; }; the methods are all defined o...
... the last line inside the constructor simply defines the new subject property that teachers are going to have, which generic people don't have.
...so, for example, if you had something really simple like this: function brick() { this.width = 10; this.height = 20; } you could inherit the width and height properties by doing this (as well as the other steps described below, of course): function blueglassbrick() { brick.call(this); this.opacity = 0.5; this.color = 'blue'; } note that we've only specified this inside call() — no other parameters are required as we are not inheriting any properties from the parent that are set via parameters.
...And 4 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
add the edittask() function inside your app component, in the same place as the other functions: function edittask(id, newname) { const editedtasklist = tasks.map(task => { // if this task has the same id as the edited task if (id === task.id) { // return {...task, name: newname} } return task; }); settasks(editedtasklist); } pass edittask into our <todo /> components as a prop in the same way we...
...add the following line just inside the top of your todo(props) { … } component definition: const [isediting, setediting] = usestate(false); next, we're going to rethink the <todo /> component — from now on, we want it to display one of two possible “templates", rather than the single template it's used so far: the "view" template, when we are just viewing a todo; this is what we’ve used in rest of the tutorial so far...
...="visually-hidden">{props.name}</span> </button> <button type="button" classname="btn btn__danger" onclick={() => props.deletetask(props.id)} > delete <span classname="visually-hidden">{props.name}</span> </button> </div> </div> ); we've now got the two different template structures — "edit" and "view" — defined inside two separate constants.
...And 4 more matches
TypeScript support in Svelte - Learn web development
steep learning curve: even though typescript is a superset of javascript and not a completely new language, there is a considerable learning curve, especially if you have no experience at all with static languages like java or c#.
...alternatively, you can download the setuptypescript.js file to a scripts folder inside your project's root folder, and then run node scripts/setuptypescript.js.
... note: if you find any trouble working with typescript inside a svelte application, have a look at this troubleshooting/faq section about typescript support.
...And 4 more matches
Focus management with Vue refs - Learn web development
inside it, assign your ref to a variable, and then call the focus() method on the ref.
... since the focusoneditbutton() method needs to be invoked after the dom has updated, we can wrap the existing function body inside a $nexttick() call.
...however, because our edit form is in a different component to our "edit" button, we can't just set focus inside the "edit" button’s click event handler.
...And 4 more matches
Handling common JavaScript problems - Learn web development
incorrectly using functions inside loops — for example, in bad-for-loop.html (see source code), we loop through 10 iterations, each time creating a paragraph and adding an onclick event handler to it.
...each scope can be expanded to show the values of variables inside the scope when execution of the code was stopped.
...as an example, the fetch api (a modern equivalent to xmlhttprequest) uses promises to fetch resources across the network and make sure that the response has been returned before they are used (for example, displaying an image inside an <img> element).
...And 4 more matches
Creating Custom Events That Can Pass Data
as of gecko 1.8, if your event names do not start with "nsdom" and their interfaces do not start with "nsidom" then you can forget about passing data.
... you need to make the following two modifications: around line 1000: ns_define_classinfo_data({truncated name}, nsdomgenericsh, dom_default_scriptable_flags) around line 2900: dom_classinfo_map_begin({truncated name}, nsidom{truncatedname}) dom_classinfo_map_entry(nsidom{truncated name}) dom_classinfo_event_map_entries dom_classinfo_map_end remember, {truncated name} is the same as above.
...your event in order for your event to work you must do the following: create a scriptable interface called nsidom{youreventname} inheriting from nsidomevent.
...And 4 more matches
Eclipse CDT
when eclipse's indexer tries to process the mozilla source, eclipse will need considerably more memory than the limits imposed by its default configuration.
...(if you're thinking of adding tips, please first consider how widely useful they'll be before adding to this already lengthy page.) for further documentation see the official eclipse user guide and eclipse cdt user guide.
... the benefit of building from inside eclipse is that build errors will appear in the problems tab at the bottom of the window, and from there you can double click on the build error and it will take you straight to the source file and line where the problem occurred.
...And 4 more matches
Listening to events on all tabs
void onlocationchange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, nsiuri alocation [optional] in unsigned long aflags ); parameters abrowser the browser representing the tab whose location changed.
...void onprogresschange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, print32 acurselfprogress, print32 amaxselfprogress, print32 acurtotalprogress, print32 amaxtotalprogress ); parameters abrowser the browser representing the tab for which updated progress information is being provided.
...void onsecuritychange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, unsigned long astate ); parameters abrowser the browser that fired the notification.
...And 4 more matches
Midas
it also has a property called contentwindow that refers to the window object inside the inline frame.
...if the caret is inside a list, that item becomes a sub-item one level deeper.
... insertbronreturn true/false selects whether pressing return inside a paragraph creates another paragraph or just inserts a <br> tag.
...And 4 more matches
A Web PKI x509 certificate primer
in order for a certificate to be valid these three requirements must be met: there is a verification path from the site certificate to a trusted certificate of the user agent (ie if you follow the issuer path you will end on a self-signed certificate that is considered trusted by the browser).
... the attributes of the certificates in the verification path have valid parameters for that verification (for example the validity period of all the certificates are valid for the time the verification is being done) revocation checks are considered ok for that particular validation.
... extensions while rfc 5280 defines 16 extensions for webpki in this document we will be describing the six extensions we considered critical for understanding.
...And 4 more matches
Avoiding leaks in JavaScript XPCOM components
with this strategy, a single pointer to the object is considered the "owner" of the object and the object is deleted through that pointer.
...consider the example where j is implemented in javascript and n is implemented in c++.
... to understand closures a little better before examining how they can cause leaks, consider the following example, in which there are two pairs of function objects, and each pair has an instance of the private_data variable: // this function returns an array containing two functions.
...And 4 more matches
nsIAppShellService
oid doprofilestartup(in nsicmdlineservice acmdlineservice, in boolean caninteract); obsolete since gecko 1.8 void ensure1window(in nsicmdlineservice acmdlineservice); obsolete since gecko 1.8 void enterlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow, out jscontext ajscontext); native code only!
... void quit(in pruint32 aferocity); obsolete since gecko 1.8 void registertoplevelwindow(in nsixulwindow awindow); void run(); obsolete since gecko 1.8 void toplevelwindowismodal(in nsixulwindow awindow, in boolean amodal); obsolete since gecko 1.9.1 void unregistertoplevelwindow(in nsixulwindow awindow); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
... hiddendomwindow nsidomwindow return the (singleton) application hidden window, automatically created and maintained by this appshellservice.
...And 4 more matches
nsIEditor
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes);...
...; clipboard methods void cut(); boolean cancut(); void copy(); boolean cancopy(); void paste(in long aselectiontype); boolean canpaste(in long aselectiontype); selection methods void selectall(); void beginningofdocument(); void endofdocument(); drag/drop methods boolean candrag(in nsidomevent aevent); void dodrag(in nsidomevent aevent); void insertfromdrop(in nsidomevent aevent); node manipulation methods void setattribute(in nsidomelement aelement, in astring attributestr,in astring attvalue); boolean getattributevalue(in nsidomelement aelement, in astring attributestr, out astring resultvalue); void removeattribute(in nsid...
...omelement aelement, in astring aattribute); void cloneattribute(in astring aattribute, in nsidomnode asourcenode); void cloneattributes(in nsidomnode destnode, in nsidomnode sourcenode); nsidomnode createnode(in astring tag, in nsidomnode parent, in long position); void insertnode(in nsidomnode node, in nsidomnode parent, in long aposition); void splitnode(in nsidomnode existingrightnode, in long offset, out nsidomnode newleftnode); void joinnodes(in nsidomnode leftnode, in nsidomnode rightnode, in nsidomnode parent); void deletenode(in nsidomnode child); void marknodedirty(in nsidomnode node); direction controller void switchtextdirection(); output methods astring outputtostring(in...
...And 4 more matches
nsIUUIDGenerator
xpcom/base/nsiuuidgenerator.idlscriptable this interface can be used to generate an id that can be considered globally unique, often referred to as a uuid or guid.
... 1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by @mozilla.org/uuid-generator; as a service: var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getservice(components.interfaces.nsiuuidgenerator); method overview nsidptr generateuuid(); void generateuuidinplace(in nsnonconstidptr id); native code only!
... methods generateuuid() obtains a new uuid using appropriate platform-specific methods to obtain a nsid that can be considered to be globally unique.
...And 4 more matches
XPCOM Interface Reference by grouping
browser autocomplete nsiautocompletecontroller nsiautocompleteinput nsiautocompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleservice document nsidocshell dom device nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement n...
...sidomhtmlformelement nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsidomwindowinternal nsidomwindowutils nsidynamiccontainer nsieditor event nsidomevent nsidomeventgroup nsidomeventlistener nsidomeventtarget nsidommousescrollevent nsidommoztouchevent nsidomorientationevent nsidomprogressevent nsidomsimplegestureevent nsidragdrophandler nsidragservice nsidragsession html nsiaccessibilityservice nsiaccessiblecoordinatetype nsiaccessibledocument nsiaccessibleeditabletext nsiaccessibleevent nsiaccessiblehyperlink nsiac...
... nsiaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsiworkermessageport nsiworkerscope tree ...
...And 4 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
</h1> this source code contains a couple of line feeds after the doctype and a bunch of space characters before, after, and inside the <h1> element, but the browser doesn’t seem to care at all and just shows the words "hello world!" as if these characters didn’t exist at all: this is so that whitespace characters don't impact the layout of your page.
... creating space around and inside elements is the job of css.
... inside this context, whitespace character processing can be summarized as follows: first, all spaces and tabs immediately before and after a line break are ignored so, if we take our example markup from before and apply this first rule, we get: <h1>◦◦◦hello⏎ <span>◦world!</span>⇥◦◦</h1> next, all tab characters are handled as space characters, so the example becomes: <...
...And 4 more matches
Pointer events - Web APIs
a pointer is considered active if it can still produce further events.
... for example, a pen that is a down state is considered active because it can produce additional events when the pen is lifted or moved.
...typically, this is determined by considering the pointer's location and also the visual layout of elements in a document on screen media.
...And 4 more matches
WebGL best practices - Web APIs
take advantage of universally supported webgl 1 extensions these webgl 1 extensions are universally supported: angle_instanced_arrays ext_blend_minmax oes_element_index_uint oes_standard_derivatives oes_vertex_array_object webgl_debug_renderer_info webgl_lose_context (see also: https://jdashg.github.io/misc/webgl/webgl-feature-levels.html) consider polyfilling these into webglrenderingcontext, like: https://github.com/jdashg/misc/blob/master/webgl/webgl-v1.1.js universally supported limits the minimum requirements for webgl are quite low.
... consider rendering to a smaller backbuffer size a common (and easy) way to trade off quality for speed is rendering into a smaller backbuffer, and upscaling the result.
... consider reducing canvas.width and height and keeping canvas.style.width and height at a constant size.
...And 4 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
third party assistive technology, such as screen readers, screen magnifiers and voice input software, want to track what's happening inside mozilla.
...one downside to this solution is that means that you cannot use "client data" for the list items, because windows won't allow owner drawn list items to use client data.
... solution: when an object is about to get focused in a different window, make sure you focus a window before you fire your own focus events for objects inside it.
...And 4 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
by default block elements will consume all of the space in the inline direction, so our paragraphs spread out and get as big as they can inside their containing block.
... in the following example, we have three inline boxes created by a paragraph with a <strong> element inside it.
... the line box size in the block direction (so the height when working in english) is defined by the tallest box inside it.
...And 4 more matches
display - CSS: Cascading Style Sheets
WebCSSdisplay
keyword values are grouped into six value categories: .container { display: [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy> ; } outside <display-outside> these keywords specify the element’s outer display type, which is essentially its role in flow layout.
... inside <display-inside> these keywords specify the element’s inner display type, which defines the type of formatting context that its contents are laid out in (assuming it is a non-replaced element).
... valid <display-inside> values: flow the element lays out its contents using flow layout (block-and-inline layout).
...And 4 more matches
Block formatting context - Developer guides
there's no floating children avaliable inside a flex/grid container, but exclude external floats and suppress margin collapsing still works.
... in the following example, we have a floated element inside a <div> with a border applied.
...our <div> now becomes a mini-layout inside our layout.
...And 4 more matches
Web audio codec guide - Web media technologies
however, if your target is primarily macos and ios users, it may be worth considering, as the operating systems have integrated support for alac.
... when mp3-format audio is stored inside an mpeg container, the resulting file is also referred to as just an "mp3 file" or simply "mp3." files with the ubiquitous .mp3 extension are stored in what is perhaps the most widely distributed audio file format in the world, which is in large part responsible for the digital audio revolution of the late 1990s and early 2000s.
... when choosing a codec to use for your audio, you should first consider the following questions: will the encoded audio be getting remixed or recompressed?
...And 4 more matches
Web video codec guide - Web media technologies
this guide introduces the video codecs you're most likely to encounter or consider using on the web, summaries of their capabilities and any compatibility and utility concerns, and advice to help you choose the right codec for your project's video.
... h.263 has been superseded by h.264 and is therefore considered a legacy media format which you generally should avoid using if you can.
...otherwise, you should probably consider a different codec.
...And 4 more matches
Codecs used by WebRTC - Web media technologies
for details on webrtc-related considerations for each codec, see the sub-sections below by following the links on each codec's name.
... mandatory audio codecs codec name browser compatibility opus chrome, edge, firefox, safari g.711 pcm (a-law) chrome, firefox, safari g.711 pcm (µ-law) chrome, firefox, safari see below for more details about any webrtc-specific considerations that exist for each codec listed above.
... due to its low sample rate and sample size, g.711 audio quality is generally considered poor by modern standards, even though it's roughly equivalent to what a landline telephone sounds like.
...And 4 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
the attribute does not specify any processing restrictions; it can be considered metadata.
... 73 fill-rule svg, svg attribute the fill-rule attribute is a presentation attribute defining the algorithm to use to determine the inside part of a shape.
... 263 xml:space svg, svg attribute svg supports the built-in xml xml:space attribute to handle whitespace characters inside elements.
...And 4 more matches
Using custom elements - Web Components
it is possible to define specific lifecycle callbacks inside the class, which run at specific points in the element's lifecycle.
... inside the constructor, we define all the functionality the element will have when an instance of it is instantiated.
...this.getattribute('img') : 'img/default.png'; const info = wrapper.appendchild(document.createelement('span')); info.setattribute('class','info'); // take attribute content and put it inside the info span info.textcontent = this.getattribute('data-text'); // create some css to apply to the shadow dom const style = document.createelement('style'); style.textcontent = '.wrapper {' + // css truncated for brevity // attach the created elements to the shadow dom this.shadowroot.append(style,wrapper); finally, we register our custom element on the customelementregistry using the defi...
...And 4 more matches
Finding window handles - Archive of obsolete content
var basewindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .treeowner .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsibasewindow); then in c++ part, a function take nsibasewindow as param hwnd getparentwindowhwnd(nsibasewindow *window) { nativewindow hwnd; nsresult rv = window->getparentnativewindow(&hwnd); if ...
...s components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.
...c components.utils.import('resource://gre/modules/services.jsm'); var browserwindow = services.wm.getmostrecentwindow('navigator:browser'); if (!browserwindow) { throw new error('no browser window found'); } var basewindow = browserwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var nswindowstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var objc = ctypes.open(ctypes.libraryname('objc')); // types let id = ctypes.voidptr_t; let sel...
...And 3 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
please consider all of your options carefully before deciding to use native code (c++) in your extension.
...on the other hand, if you are an experienced developer or team, and you know that you are going to build a large, complex extension, you would do well to consider the approach described in this article.
... one final note: i've only tried these techniques inside firefox, but they'll probably work more or less unchanged on other gecko-based platforms like thunderbird or seamonkey.
...And 3 more matches
Updating addons broken by private browsing changes - Archive of obsolete content
if your code refers to any of the following interfaces: ff 15: nsidomstoragemanager ff 16: nsitransferable ff 18: imgicache moziasyncfavicons nsifaviconservice nsiwebbrowserpersist ff 19: nsicontentprefservice nsidownloadmanager nsidownload nsihttpauthmanager nsistricttransportsecurityservice ff 20: nsiprivatebrowsingservice nsirecentbadcertservice furthermore, if your code uses any of these common chrome apis: ff 19: saveurl saveinternal openlinkin ff 20: openbrowserwindow gprivatebrowsingui finally, if y...
... nsidownloadmanager/nsidownload: integer download ids (and specifically the id property of nsidownload) are deprecated, and don't allow access to private downloads.
... nsidownload now has retry, cancel, remove, pause, and resume methods which should be used instead of deprecated similarly-named nsidownloadmanager methods.
...And 3 more matches
Layout System Overview - Archive of obsolete content
the in-flow case is considered the 'normal' case, and corresponds to normal html formatting.
...consider a text entry field: the user types text into a form on the web.
...thus the html editor and text controls put considerable performance requirements on the layout system's handling of dynamic content manipulation.
...And 3 more matches
Adding HTML Elements - Archive of obsolete content
you can also add labels to controls either by using the html label element, or you can simply put the text inside another html block element (such as p or div) as in the example below.
...notice that the xul button can appear inside the html elements, as it does here.
... plain text will only be displayed when placed inside an html element that would normally allow you to display text (such as a p tag).
...And 3 more matches
More Menu Features - Archive of obsolete content
« previousnext » in this section, we'll look at creating submenus and checked menus creating submenus you can create submenus inside other menus (nested menus) using the existing elements.
... remember that you can put any element inside a menupopup.
...however, you can create submenus by simply placing the menu element inside the menupopup element.
...And 3 more matches
The Box Model - Archive of obsolete content
elements inside of a box will orient themselves horizontally or vertically.
...login prompt example you can add as many elements as you want inside a box, including other boxes.
...the labels and textboxes are inside the inner hbox elements, so they are oriented according to those boxes, which are horizontal.
...And 3 more matches
Toolbars - Archive of obsolete content
a simple toolbar inside a toolbox source view <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton label="back"/> <toolbarbutton label="forward"/> </toolbar> </toolbox> this has created a toolbar containing two buttons, a back button and a forward button.
... the one toolbar has been placed inside the toolbox.
...inside it are placed the individual toolbar items, usually buttons, but they can be other elements.
...And 3 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
although this approach was considered reasonable at the time, this approach caused problems for browser vendors right from the beginning.
...consider the following example: // wrong approach - do not use!
...netscape navigator 4 and internet explorer 4 should both be considered downlevel browsers for most pages due to their limited support for css and the more recent dom based standards.
...And 3 more matches
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
in particular: raw < and & characters are not allowed except inside of cdata sections (<![cdata[ ...
... use of comments inside inline style and script authors who are familiar with html commonly enclose the contents of inline style and script tags in comments in order to hide the contents of the tags from browsers which do not understand them.
... <style type="text/css"> <!-- body {background-color: blue; color: yellow;} --> </style> <script type="text/javascript"> <!-- var i = 0; var sum = 0; for (i = 0; i < 10; ++i) { sum += i; } alert('sum = ' + sum); // --> </script> this example illustrates that a conformant browser can ignore content inside of comments.
...And 3 more matches
WAI-ARIA basics - Learn web development
as an example, you could use aria-labelledby to specify that a key description contained in a <div> is the label for multiple table cells, or you could use it as an alternative to image alt text — specify existing information on the page as an image's alt text, rather than having to repeat it inside the alt attribute.
... there are many combinations of operating system, browser, and screenreader to consider.
...if you are looking for a 3rd party javascript solution for rapid ui development, you should definitely consider the accessibility of its ui widgets as an important factor when making your choice.
...And 3 more matches
What is accessibility? - Learn web development
overview: accessibility next this article starts the module off with a good look at what accessibility is — this overview includes what groups of people we need to consider and why, what tools different people use to interact with the web, and how we can make accessibility part of our web development workflow.
...the main types of disability to consider are explained below, along with any special tools they use to access web content (known as assistive technologies, or ats).
... you have only started to consider accessibility and uncovered related issues in the late stages of a project.
...And 3 more matches
Backgrounds and borders - Learn web development
in this case we could use the background-size property, which can take length or percentage values, to size the image to fit inside the background.
... contain — the browser will make the image the right size to fit inside the box.
... in the example below i have used the larger image from the example above and used length units to size it inside the box.
...And 3 more matches
The box model - Learn web development
boxes also have an inner display type, however, which dictates how elements inside that box are laid out.
... by default, the elements inside a box are laid out in normal flow, which means that they behave just like any other block and inline elements (as explained above).
...this establishes flex layout for the items inside the container, however, the list itself is a block box and — like the paragraph — expands to the full container width and breaks onto a new line.
...And 3 more matches
CSS values and units - Learn web development
absolute length units the following are all absolute length units — they are not relative to anything else and are generally considered to always be the same size.
...the <li> elements inside the <ul> with a class of ems take their sizing from their parent.
...(rem stands for "root em".) the <li> elements inside the <ul> with a class of rems take their sizing from the root element (<html>).
...And 3 more matches
Multiple-column layout - Learn web development
our starting point contains some very simple html; a wrapper with a class of container inside which is a heading and some paragraphs.
...in the live example below, i have used multicol to lay out a series of boxes, each of which have a heading and some text inside.
...for example, add the property break-inside with a value of avoid to the rules for .card.
...And 3 more matches
Positioning - Learn web development
previous overview: css layout next positioning allows you to take elements out of the normal document layout flow, and make them behave differently; for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
...what if you want to slightly alter the position of some boxes inside a layout from their default layout flow position, to give a slightly quirky, distressed feel?
...or if you want to create a ui element that floats over the top of other parts of the page, and/or always sits in the same place inside the browser window no matter how much the page is scrolled?
...And 3 more matches
How CSS is structured - Learn web development
here are three examples: <!-- inside a subdirectory called styles inside the current directory --> <link rel="stylesheet" href="styles/style.css"> <!-- inside a subdirectory called general, which is in a subdirectory called styles, inside the current directory --> <link rel="stylesheet" href="styles/general/style.css"> <!-- go up one directory level, then inside a subdirectory called styles --> <link rel="stylesheet" href="../sty...
...to create an internal stylesheet, you place css inside a <style> element contained inside the html <head>.
...inside the folder, copy the text below to create two files: index.html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>my css experiments</title> <link rel="stylesheet" href="styles.css"> </head> <body> <p>create your test html here</p> </body> </html> styles.css: /* create your test css here */ p { color: red; } when you find css that you want t...
...And 3 more matches
Basic native form controls - Learn web development
they can have a placeholder; this is text that appears inside the text input box that should be used to briefly describe the purpose of the box.
... due to the on-off nature of checkboxes, the checkbox is considered a toggle button, with many developers and designers expanding on the default checkbox styling to create buttons that look like toggle switches you can see an example in action here (also see the source code).
...if they share the same value for their name attribute, they will be considered to be in the same group of buttons.
...And 3 more matches
Third-party APIs - Learn web development
you can expand the controls available using the map.addcontrol() method; add this to your code, inside the window.onload handler: map.addcontrol(l.mapquest.control()); the mapquest.control() method just creates a simple full-featured control set, and it is placed in the top-right hand corner by default.
...add the following code to your example, again inside window.onload: l.marker([53.480759, -2.242631], { icon: l.mapquest.icons.marker({ primarycolor: '#22407f', secondarycolor: '#3b5998', shadow: true, size: 'md', symbol: 'a' }) }) .bindpopup('this is manchester!') .addto(map); as you can see, this at its simplest takes two parameters, an array containing the coordinates at which to display the marker, and an options objec...
... add the following code block inside the fetchresults() function, just above the closing curly brace: // use fetch() to make the request to the api fetch(url).then(function(result) { return result.json(); }).then(function(json) { displayresults(json); }); here we run the request by passing our url variable to fetch(), convert the response body to json using the json() function, then pass the resulting json to the displayresul...
...And 3 more matches
Video and Audio APIs - Learn web development
here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> this creates a video player inside the browser like so: you can review what all the html features do in the article linked above; for our purposes here, the most interesting attribute is controls, which enables the default set of playback controls.
... each <button> has a class name, a data-icon attribute for defining what icon should be shown on each button (we'll show how this works in the below section), and an aria-label attribute to provide an understandable description of each button, since we're not providing a human-readable label inside the tags.
... exploring the css now open the css file and have a look inside.
...And 3 more matches
Componentizing our Svelte app - Learn web development
inside this file we will declare a filter prop, and then copy the relevant markup over to it from todos.svelte.
... the <script> section of our filterbutton component should end up looking like this — update it now: <script> export let filter = 'all' export let onclick = (clicked) => {} $: onclick(filter) </script> now when we call filterbutton inside todos.svelte we'll need to specify the handler.
... put the following contents inside this file: <script> export let todo </script> <div class="stack-small"> <div class="c-cb"> <input type="checkbox" id="todo-{todo.id}" on:click={() => todo.completed = !todo.completed} checked={todo.completed} /> <label for="todo-{todo.id}" class="todo-label">{todo.name}</label> </div> <div class="btn-group"> <button type="button" class="btn"> edit <s...
...And 3 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
{/each} </ul> go back to the app; you'll see something like this: now we've seen that this is working, let's generate a complete todo item with each loop of the {#each} directive, and inside embed the information from the todos array: id, name, and completed.
... update the <input type="checkbox"> element inside src/components/todos.svelte as follows: <input type="checkbox" id="todo-{todo.id}" on:click={() => todo.completed = !todo.completed} checked={todo.completed} /> next we'll add a function to remove a todo from our todos array.
... update your totaltodos and completedtodos variable definitions inside src/components/todos.svelte to look like so: $: totaltodos = todos.length $: completedtodos = todos.filter(todo => todo.completed).length if you check your app now, you'll see that the heading's numbers are updated when todos are completed or deleted.
...And 3 more matches
Getting started with Vue - Learn web development
this will check for errors when we save a file inside the project.
...in fact, if you look inside the src folder in the project we created with the cli, you'll see your first .vue file: app.vue.
...locally registered components can only be used inside the components that register them, so you need to import and register them in every component file that uses them.
...And 3 more matches
Rendering a list of Vue components - Learn web development
in this artcle we'll look at adding a set of todo item data to our app.vue component, which we'll then loop through and display inside todoitem components using the v-for directive.
...this is a built-in vue directive that lets us include a loop inside of our template, repeating the rendering of a template feature for each item in an array.
...in this case, we want to display an <li> element for every to-do item inside our todoitems array.
...And 3 more matches
Eclipse CDT Manual Setup
this page contains the content that used to live on the eclipse cdt page that most people will likely just consider noise.
...if you're interested in future improvements to eclipse that would allow parallel builds to be run from inside eclipse while still allowing it to obtain the compiler options, see the faq isn't there a better method of build option discovery?
...(this directory doesn't show in the project explorer tab, but eclipse still indexes it without this filter!) if you have secondary object directories (object directories that are not your only/the primary object directory) for the source tree and those directories are inside the source tree (or if you might have such object directories in future), then add an "exclude all", regular expression filter for folders with a project relative path matching "obj(?!-debug(?:$|/)).+".
...And 3 more matches
Inner and outer windows
consider that when the user is looking at a document in a browser window, not only can the document the user is currently viewing change, but the document's contents can change.
...in order to represent these levels of complexity, two "types" of window need to be considered.
...consider this view of a window and the browser history: as the user navigates, documents are added to the backward-forward cache (often referred to as the bfcache).
...And 3 more matches
Fonts for Mozilla's MathML engine
open the zip archive, move inside the latinmodern-math-1959 directory and then inside the otf directory.
... open the zip archive, move inside the /stixv2.0.0/fonts/otf/ directory.
... extract the zip archive, move inside the latinmodern-math-1959 directory and then inside the otf directory.
...And 3 more matches
Index
a trust anchor is just another x.509 certificate that is already known and has been deliberately marked as trusted by a software vendor, administrators inside an organizational infrastructure, or the software user.
...for example: certificates were valid at the time the signature was made, name in certificates matches the expected signer (check subject name, common name, email, based on application), the trust restrictions recorded inside the certificate (extensions) permit the use (e.g., encryption might be allowed, but not signing), and based on environment/application policy it might be required to perform a revocation check (ocsp or crl), that asks the issuer(s) of the certificates whether there have been events that made it necessary to revoke the trust (revoke the validity of the cert).
...a complex string must not include newlines or carriage returns.outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens.
...And 3 more matches
Places utilities for JavaScript
string atype); nsitransaction maketransaction(string data, string type, nsinavhistoryresultnode container, int index, boolean copy); nsinavhistoryresult getfoldercontents(int afolderid, boolean aexcludeitems, boolean aexpandqueries); boolean showaddbookmarkui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showminimaladdbookmarkui(nsiuri auri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker, boolean aloadinsidebar, string akeyword, string apostdata); boolean showaddlivemarkui(nsiuri afeeduri, nsiuri asiteuri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker); ...
...ean showfolderproperties(int aid); boolean showaddfolderui(string atitle, int adefaultinsertionpoint, boolean ashowpicker); array object getannotationsforuri(nsiuri auri); array object getannotationsforitem(int aitemid); void setannotationsforuri(nsiuri auri, object aannos); void setannotationsforuri(int aitemid, object aannos); getviewfornode(nsidomnode anode); void markpageastyped(string aurl); void markpageasfollowedbookmark(string aurl); boolean checkurlsecurity(nsinavhistoryresultnode aurinode); string getquerystringforfolder(int afolderid); string getdescriptionfromdocument(nsidomdocument doc); string setpostdataforbookmark(int aboomarkid, string apostdata); string getpost...
...landpostdataforkeyword(string akeyword); string getitemdescription(int aitemid); nsinavhistoryresultnode getmostrecentbookmarkforuri(nsiuri auri); nsinavhistoryresultnode getmostrecentfolderforfeeduri(nsiuri auri); nsinavhistoryresultnode geturlsforcontainernode(nsinavhistoryresultnode anode); void opencontainernodeintabs(nsinavhistoryresultnode anode, nsidomevent aevent); void openurinodesintabs(array nsinavhistoryresultnode anodes, nsidomevent aevent); void createmenuitemfornode(nsinavhistoryresultnode anode, acontainersmap); constants mimetypes type_x_moz_place_container type_x_moz_place_separator: "text/x-moz-place-separator", type_x_moz_place: "text/x-moz-place", type_x_moz_url: "text/x-moz-url", type_html: "tex...
...And 3 more matches
An Overview of XPCOM
consider, for example, a class that isn't well encapsulated.
...when a component gets created, an integer inside the component tracks the number of clients who have an interface to the components -- also known as the reference count.
... xpcom identifier classes the nsiid class is actually a typedef for the nsid class.
...And 3 more matches
Detailed XPCOM hashtable guide
key type: integer string/cstring nsid nsisupports* complex data type: none (hash set) nsthashtable<...> simple (pruint32) nsdatahashtable nsthashtable<...> <nsuint32hashkey, pruint32> <ns(c)stringhashkey, pruint32> <nsidhashkey, pruint32> <nsisupportshashkey, pruint32> interface (nsisupports) nsinterfacehashtable <nsuint32hashkey, nsisuppor...
...ts> <ns(c)stringhashkey, nsisupports> <nsidhashkey, nsisupports> <nsisupportshashkey, nsisupports> class (nsstring*) nsclasshashtable <nsuint32hashkey, nsstring> <ns(c)stringhashkey, nsstring> <nsidhashkey, nsstring> <nsisupportshashkey, nsstring> complex (structures, etc.) nsthashtable<...> pldhash the pldhash implementation is a fairly low-level implementation, written in c.
...if you need entry pointers to remain constant, you may want to consider using plhashtable instead.
...And 3 more matches
nsIBoxObject
propertyname); obsolete since gecko 1.9 wstring getproperty(in wstring propertyname); nsisupports getpropertyassupports(in wstring propertyname); void removeproperty(in wstring propertyname); void setproperty(in wstring propertyname, in wstring propertyvalue); void setpropertyassupports(in wstring propertyname, in nsisupports value); attributes attribute type description element nsidomelement read only.
... firstchild nsidomelement the first child of the box, in box-ordinal-group order.
... lastchild nsidomelement the last child of the box, in box-ordinal-group order.
...And 3 more matches
nsIIOService
ring extractscheme(in autf8string urlstring); unsigned long getprotocolflags(in string ascheme); nsiprotocolhandler getprotocolhandler(in string ascheme); nsichannel newchannel(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); obsolete since gecko 48 nsichannel newchannel2(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsichannel newchannelfromuri(in nsiuri auri); obsolete since gecko 48 nsichannel newchannelfromuri2(in nsiuri auri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in unsign...
...ed long asecurityflags, in unsigned long acontentpolicytype); nsichannel newchannelfromuriwithloadinfo(in nsiuri auri, in nsiloadinfo aloadinfo); nsichannel newchannelfromuriwithproxyflags2(in nsiuri auri, in nsiuri aproxyuri, in uint32_t aproxyflags,in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsiuri newfileuri(in nsifile afile); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description offline boolean returns true if networking is in "offline" mode.
...if the given port is considered unsafe, then the protocol handler (corresponding to ascheme) will be asked whether it wishes to override the io service's decision to block the port.
...And 3 more matches
nsINavBookmarkObserver
index the folder's index inside its parent.
... oldindex the folder's old index inside oldparent.
... newindex the folder's index inside newparent.
...And 3 more matches
nsIScriptableUnescapeHTML
implemented by: @mozilla.org/feed-unescapehtml;1 as a service: var scriptableunescapehtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml); method overview nsidomdocumentfragment parsefragment(in astring fragment, in prbool isxml, in nsiuri baseuri, in nsidomelement element); astring unescape(in astring src); methods parsefragment() parses a string of html or xml source into a sanitized documentfragment.
... nsidomdocumentfragment parsefragment( in astring fragment, in prbool isxml, in nsiuri baseuri, in nsidomelement element ); parameters fragment a string of html or xml source to parse as a fragment.
... element the nsidomelement to be used as the context node for the purposes of the fragment parsing algorithm.
...And 3 more matches
WebIDL bindings
the return value is guaranteed to not be affected by any code running inside gecko itself, but we might get a new value every time the method or getter is called even if no gecko code ran between the calls.
... [securecontext] we implement the standard extended attribute with a few details specific to gecko: system principals are considered secure.
...if the xpcom component implements nsidomglobalpropertyinitializer, then the object's init method will be invoked with a single argument: the content window the constructor came from.
...And 3 more matches
Applying styles and colors - Web APIs
if you consider a path from (3,1) to (3,5) with a line thickness of 1.0, you end up with the situation in the second image.
...for lines which are at large angles with each other, this point is not far from the inside connection point.
... the miterlimit property determines how far the outside connection point can be placed from the inside connection point.
...And 3 more matches
ServiceWorkerState - Web APIs
values installing the service worker in this state is considered an installing worker.
... during this state, extendableevent.waituntil() can be called inside the install event handler to extend the life of the installing worker until the passed promise resolves successfully.
... installed the service worker in this state is considered a waiting worker.
...And 3 more matches
Using writable streams - Web APIs
inside this method, you should include code that sets up the stream functionality, e.g.
...inside this block we use writablestreamdefaultwriter.ready to check whether the writer is ready to have another chunk written to it.
... ready returns a promise that fulfills when this is the case, inside of which we call writablestreamdefaultwriter.write() to actually write the chunk to the stream.
...And 3 more matches
ARIA: dialog role - Accessibility
the label given to the dialog will provide contextual information for the interactive controls inside the dialog.
... in other words, the dialog's label acts like a grouping label for the controls inside it (similar to how a <legend> element provides a grouping label for the controls inside a <fieldset> element).
... if a dialog already has a visible title bar, the text inside that bar can be used to label the dialog itself.
...And 3 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
if you initially learned flexbox then you may consider these properties to be part of the flexbox specification, and some of the properties are indeed listed in level 1 of flexbox.
...on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items.
... relationship to writing modes alignment is linked to writing modes in that when we align an item we do not consider whether we are aligning it to the physical dimensions of top, right, bottom and left.
...And 3 more matches
Specificity - CSS: Cascading Style Sheets
(the selectors declared inside :not() do, however.) for more information, visit: "specificity" in "cascade and inheritance", you can also visit: https://specifishity.com inline styles added to an element (e.g., style="font-weight: bold;") always overwrite any styles in external stylesheets, and thus can be thought of as having the highest specificity.
... some rules of thumb: always look for a way to use specificity before even considering !important only use !important on page-specific css that overrides foreign css (from external libraries, like bootstrap or normalize.css).
... instead of using !important, consider: make better use of the css cascade use more specific rules.
...And 3 more matches
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
the css syntax reflects this goal and its basic building blocks are: the property which is an identifier, that is a human-readable name, that defines which feature is considered.
...the pair is separated by a colon, ':' (u+003a colon), and white spaces before, between, and after properties and values, but not necessarily inside, are ignored.
... such blocks are naturally called declaration blocks and declarations inside them are separated by a semi-colon, ';' (u+003b semicolon).
...And 3 more matches
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
ements regardless of their type, email inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid multiple whether or not to allow multiple, comma-separated, e-mail addresses to be entered pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should...
... note: normally, if you specify the required attribute, the user must enter a valid e-mail address for the field to be considered valid.
...in its most basic form, an email input can be implemented like this: <input id="emailaddress" type="email"> notice that it's considered valid when empty and when a single validly-formatted e-mail address is entered, but is otherwise not considered valid.
...And 3 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
<input> types how an <input> works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages.
... use careful consideration for accessibility when applying the autofocus attribute.
... what's in a name consider the name a required attribute (even though it's not).
...And 3 more matches
Grammar and types - JavaScript
(for more information, see the detailed reference about javascript's lexical grammar.) it is considered best practice, however, to always write a semicolon after a statement, even when it is not strictly needed.
...(spaces, tabs, and newline characters are considered whitespace.) comments the syntax of comments is the same as in c++ and in many other languages: // a one line comment /* this is a longer, * multi-line comment */ /* you can't, however, /* nest comments */ syntaxerror */ comments behave like whitespace, and are discarded during script execution.
...for example, consider the following statements: x = 'the answer is ' + 42 // "the answer is 42" y = 42 + ' is the answer' // "42 is the answer" with all other operators, javascript does not convert numeric values to strings.
...And 3 more matches
this - JavaScript
function context inside a function, the value of this depends on how the function is called.
...the same applies to arrow functions created inside other functions: their this remains that of the enclosing lexical context.
...ll bar as a method of obj, setting its this to obj // assign a reference to the returned function to fn var fn = obj.bar(); // call fn without setting this, would normally default // to the global object or undefined in strict mode console.log(fn() === obj); // true // but caution if you reference the method of obj without calling it var fn2 = obj.bar; // calling the arrow function's this from inside the bar method() // will now return window, because it follows the this from fn2.
...And 3 more matches
let - JavaScript
break; } however, it's important to point out that a block nested inside a case clause will create a new block scoped lexical environment, which will not produce the redeclaration errors shown above.
... value of undefined, using the typeof operator to check for the type of a variable in that variable's temporal dead zone will throw a referenceerror: // prints out 'undefined' console.log(typeof undeclaredvariable); // results in a 'referenceerror' console.log(typeof i); let i = 10; another example of temporal dead zone combined with lexical scoping due to lexical scoping, the identifier foo inside the expression (foo + 55) evaluates to the if block's foo, and not the overlying variable foo with the value of 33.
...the instruction let n of n.a is already inside the private scope of the for loop's block.
...And 3 more matches
Strict mode - JavaScript
consider concatenating a strict mode script with a non-strict mode script: the entire concatenation looks strict!
...obviously, concatenation of scripts is never ideal, but if you must, consider enabling strict on a function-by-function basis.
...the problem with with is that any name inside the block might map either to a property of the object passed to it, or to a variable in surrounding (or even global) scope, at runtime: it's impossible to know which beforehand.
...And 3 more matches
Graphic design for responsive sites - Progressive web apps (PWAs)
css media queries allow us to serve different css rules dependant on viewport dimensions, and you should consider using mobile first media queries where possible.
...most hi res devices apply a default zoom factor to the whole web page so that the content is a bit more legible, but the downside of this is that the images in question start to look pixellated and ugly because they have been zoomed in.
...you could use css3 properties for generating effects like drop shadows, gradients and rounded corners, and you could also consider using svg for other ui elements, instead of raster graphics formats.
...And 3 more matches
Web Components
using templates and slots a guide showing how to define a reusable html structure using <template> and <slot> elements, and then use that structure inside your web components.
... life cycle callbacks special callback functions defined inside the custom element's class definition, which affect its behavior: connectedcallback: invoked when the custom element is first connected to the document's dom.
... :host: selects the shadow host of the shadow dom containing the css it is used inside.
...And 3 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
there are earlier experiments going back a long way in developing user interfaces using a combination of html and scripting languages, and xul could be considered an evolutionary step from that.
... note: these values are stored in localstore.rdf, inside the user profile.
... earlier we placed the menupopup child element inside a menu element; here, we use it outside the menu element.
...And 2 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
if you put the toolbarpalette element inside the window element in your overlay, some weird errors will begin to happen.
... setting the image for a toolbar button is done with css: #xulschoolhello-hello-world-button { list-style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button states, but we'll get into that further ahead.
...the way icons are handled in firefox changed considerably after firefox 4, so supporting older versions is not mentioned here (you can check this document's change history for older revisions, though).
...And 2 more matches
Download Manager improvements in Firefox 3 - Archive of obsolete content
in addition, you can augment or replace the download manager's user interface by implementing the new nsidownloadmanagerui interface.
... download manager interfaces nsidownloadmanager gives applications and extensions access to the download manager, allowing them to add and remove files to the download list, retrieve information about past and present downloads, and request notifications as to the progress of downloads.
... nsidownload describes a file in the download queue; these files may currently be queued for download, actively being downloaded, or finished being downloaded.
...And 2 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
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 enclosing <script>.
... mimetypes (when css files are not applied) the most common css-related issue is that css definitions inside referenced css files are not applied.
...And 2 more matches
Anonymous Content - Archive of obsolete content
[actually, only tag names may be specified; see the includes attribute description in <children> element reference, bug 174614 and bug 51527.] if no attribute is specified, an insertion point is considered generic and will match on all content.
... as an example, consider the html file upload control.
...it then generates a focus event on the textfield inside the file control.
...And 2 more matches
Manipulating Lists - Archive of obsolete content
in fact, these methods are part of the nsidomxulselectcontrolelement interface so any xul elements which implement this interface have these methods.
... list selection the nsidomxulselectcontrolelement interface provides two additonal properties, selectedindex and selecteditem.
...getelementbyid('level').selectedindex = val - 1; } </script> <hbox align="center"> <label value="enter a number from 1 to 3:"/> <textbox id="number"/> <button label="select" oncommand="doselect();"/> </hbox> <radiogroup id="level"> <radio label="excellent"/> <radio label="good"/> <radio label="poor"/> </radiogroup> listboxes also support multiple selection and the functions of the nsidomxulmultiselectcontrolelement interface.
...And 2 more matches
More Button Features - Archive of obsolete content
buttons with extra content buttons may have arbitrary markup contained inside them, and it will be rendered inside the button.
...for example, the following will create a button where two of the words are red: example 4 : source view <button> <description value="this is a"/> <description value="rather strange" style="color: red;"/> <description value="button"/> </button> any xul element may be placed inside the button.
... html elements will be ignored, so you need to wrap them inside a description element.
...And 2 more matches
XBL Example - Archive of obsolete content
the content of the pages will be specified in the xul file, not in xbl, but we'll need to add it inside the deck.
...the children of the element that the xbl is bound to will be placed inside the deck.
...the body of the method has been enclosed inside <![cdata[ and ]]>.
...And 2 more matches
Using the Editor from XUL - Archive of obsolete content
nseditorshell is able to observe the document load on the <iframe>, because it implements nsidocumentloaderobserver, and registered itself as a doc loader when it was assigned the content window.
...for text widgets and composer): nstexteditorkeylistener (as a nsidomkeylistener) nstexteditormouselistener (as a nsidommouselistener) nstexteditorfocuslistener (as a nsidomfocuslistener) nstexteditortextlistener (as a nsidomtextlistener) nstexteditorcompositionlistener (as a nsidomcompositionlistener) nstexteditordraglistener (as a nsidomdraglistener) in nseditorshell::preparedocumentforediting(), we install a mouse listener.
...not for text widgets): nseditorshellmouselistener (as a nsidommouselistener) note: starting in gecko 12, the editor refuses any events sent by unprivileged content.
...And 2 more matches
Accessibility/XUL Accessibility Reference - Archive of obsolete content
therefore, with jaws 7.10, to use xul inside of a browser, the type attribute cannot not be used.
... groupbox <groupbox> <caption label="<!--group label-->" /> <hbox> <button label="<!--button text-->" /> </hbox> </groupbox> iframe jaws 7.10 issues testing with jaws 7.10, use of an iframe element causes many, unpredictable issues with xul inside of the iframe.
... okay to use html inside of iframe.
...And 2 more matches
button - Archive of obsolete content
you can specify the label of the button using the label attribute or by placing content inside the button.
...constants for the possible values for this attribute are in the nsidomxulbuttonelement interface.
...place a menupopup element inside the button in this case.
...And 2 more matches
iframe - Archive of obsolete content
the type of browser, which can be used to set access of the document loaded inside the browser.
...the content that is loaded inside the browser is not allowed to access the chrome above it.
...the content that is loaded inside the browser is not allowed to access the chrome above it.
...And 2 more matches
promptBox - Archive of obsolete content
method overview nsidomelement appendprompt(args, onclosecallback); void removeprompt(nsidomelement aprompt); nodelist listprompts(nsidomelement aprompt); methods appendprompt() creates a new prompt, adding it to the tab.
... nsidomelement appendprompt( args, onclosecallback ); parameters args arguments for the prompt.
... return value an nsidomelement object representing the new prompt.
...And 2 more matches
Table Reflow Internals - Archive of obsolete content
incremental - has a reflow path (tree) where each node has a command with a target frame, reflow command types are: dirty - something changed inside a target (e.g.
...the table figures out the column widths (balances) given the style width constraints on the table, col groups, cols, cells the preferred and max element sizes of the cells (from the pass 1 reflow), and considers colspans pass 2 - cell widths are constrained by the column widths (heights are only constrained in paginated mode).
...when a target is the cell or below and the cell changes size, the row tells the table so it can decide if it needs to rebalance when a target is inside the cell's block, the cell requests max element, preferred sizes of its block in case they change after the table reflows the row group(s) containing the targets, if it rebalances, it then does a pass 2 reflow.
...And 2 more matches
XForms Custom Controls - Archive of obsolete content
for example, you might want to render images that are held inside an instance document or you would like to show a disabled trigger when its bound node becomes irrelevant rather than having it not display (the current default behavior).
...you can put the xforms controls inside your xbl binding.
...interface nsixformsuiwidget : nsidomelement { /** * is called when control should be updated to reflect the value of the bound node.
...And 2 more matches
Implementation Status - Archive of obsolete content
7.4 expression categories supported 7.4.2 model binding expressions and computed expressions supported 7.4.3 expressions in actions and submissions partial 7.4.4 ui expressions partial scenarios exist where controls contained inside other controls inside a repeat won't be bound correctly 333638; 7.4.5 ui binding in other xml vocabularies unsupported not a compliance requirement for an xforms processor 7.4.6 binding examples supported 7.5 xforms core function library supported ...
... supported 8.1.6 upload supported 8.1.7 range partial 316355; 343523; 8.1.8 trigger supported 8.1.9 submit supported 8.1.10 select partial @selection does not work, select inside repeat may not work correctly, select that mixes itemsets with items may show them in the wrong order 282840; 371595; 372127; 8.1.11 select1 partial there are some resize issues, select/deselect/valuechange firing in wrong order.
... 8.2.1 choices supported 8.2.2 item supported 8.2.3 value supported 8.3.1 filename supported 8.3.2 mediatype supported 8.3.3 label partial labels for items inside a choices element has bind problems.
...And 2 more matches
Anatomy of a video game - Game development
that is not by accident and it is considered best practice.
...it is known as a domhighrestimestamp but, for all intents and purposes, consider it a floating point number.
...you will also need to consider how gracefully your game will fail if the user's system cannot keep up with the workload.
...And 2 more matches
Building up a basic demo with Three.js - Game development
save a copy of the latest minimized three.js library inside your directory.
...the first <script> element includes the three.js library in the page, and we will write our example code inside the second.
...when creating new objects in the demo, we add them all inside the scene to become visible on the screen.
...And 2 more matches
HTML: A good basis for accessibility - Learn web development
good for seo — search engines give more importance to keywords inside headings, links, etc.
... another consideration when creating layouts is using html5 semantic elements as seen in the above example (see content sectioning) — you can create a layout using only nested <div> elements, but it is better to use appropriate sectioning elements to wrap your main navigation (<nav>), footer (<footer>), repeating content units (<article>), etc.
... note: this is why you should never include text content inside an image — screen readers simply can't access it.
...And 2 more matches
HTML: A good basis for accessibility - Learn web development
good for seo — search engines give more importance to keywords inside headings, links, etc.
... another consideration when creating layouts is using html5 semantic elements as seen in the above example (see content sectioning) — you can create a layout using only nested <div> elements, but it is better to use appropriate sectioning elements to wrap your main navigation (<nav>), footer (<footer>), repeating content units (<article>), etc.
... note: this is why you should never include text content inside an image — screen readers simply can't access it.
...And 2 more matches
Mobile accessibility - Learn web development
previous overview: accessibility next with web access on mobile devices being so popular and renowned platforms such as ios and android having full-fledged accessibility tools, it is important to consider the accessibility of your web content on these platforms.
... this article looks at mobile-specific accessibility considerations.
... there are some exceptions that need special consideration for mobile; the main ones are: control mechanisms — make sure interface controls such as buttons are accessible on mobiles (i.e., mainly touchscreen), as well as desktops/laptops (mainly mouse/keyboard).
...And 2 more matches
Flexbox - Learn web development
the following simple layout requirements are either difficult or impossible to achieve with such tools, in any kind of convenient, flexible way: vertically centering a block of content inside its parent.
... you'll see that we have a <header> element with a top level heading inside it, and a <section> element containing three <article>s.
... the items being laid out as flexible boxes inside the flex container are called flex items (the <article> elements in our example).
...And 2 more matches
Legacy layout methods - Learn web development
4, 6, or 12), and then fit your content columns inside these imaginary columns.
...replace whatever is inside the body currently with the following: <h1>2 column layout example</h1> <div> <h2>first column</h2> <p> lorem ipsum dolor sit amet, consectetur adipiscing elit.
... easier calculations using the calc() function you could use the calc() function to do the math right inside your css — this allows you to insert simple mathematical equations into your css values, to calculate what a value should be.
...And 2 more matches
Styling web forms - Learn web development
to position it somewhere else, for example inside the fieldset somewhere, or near the bottom left corner, you need to rely on positioning.
...et { position: relative; } legend { position: absolute; bottom: 0; right: 0; } the <fieldset> needs to be positioned too, so that the <legend> is positioned relative to it (otherwise the <legend> would be positioned relative to the <body>.) the <legend> element is very important for accessibility — it will be spoken by assistive technologies as part of the label of each form element inside the fieldset — but using a technique like the one above is fine.
... inside the unzipped contents you will find some font files (at the time of writing, two .woff files and two .woff2 files; they might vary in the future.) copy these files into a directory called fonts, in the same directory as before.
...And 2 more matches
UI pseudo-classes - Learn web development
in-range and out-of-range data as we hinted at above, there are two other related pseudo-classes to consider — :in-range and :out-of-range.
... these match numeric inputs where range limits are specified by the min and max, when their data is inside or outside the specified range, respectvely.
...but there are a couple of other states to consider too: :default: matches radios/checkboxes that are checked by default, on page load (i.e.
...And 2 more matches
HTML basics - Learn web development
nesting elements you can put elements inside other elements too — this is called nesting.
...the following is incorrect: <p>my cat is <strong>very grumpy.</p></strong> the elements have to open and close correctly so that they are clearly inside or outside one another.
...in the mists of time, when html was young (around 1991/92), doctypes were meant to act as links to a set of rules that the html page had to follow to be considered good html, which could mean automatic error checking and other useful things.
...And 2 more matches
The web and web standards - Learn web development
this can be considered a forerunner of the web, as it worked on packet switching, and featured the first implementation of the tcp/ip protocol suite.
... browsers you are probably reading these words inside a web browser in this very moment (unless you've printed it out, or are using assistive technology, such as a screenreader to read it out to you).
...the following simple javascript will store a reference to our paragraph in memory and change the text inside it: let pelem = document.queryselector('p'); pelem.textcontent = 'we changed the text!'; in the house analogy, javascript is like the cooker, tv, microwave, or hairdryer — the things that give your house useful functionality tooling once you've learned the "raw" technologies that can be used to build web pages (such as html, css, and javascript), you'll soon start to come across vari...
...And 2 more matches
Add a hitmap on top of an image - Learn web development
here we go over how to set up an image map, and some downsides to consider first.
... image maps, and their drawbacks when you nest an image inside <a>, the entire image links to one webpage.
... formerly, image maps were a popular navigation device, but it’s important to thoroughly consider their performance and accessibility ramifications.
...And 2 more matches
Advanced text formatting - Learn web development
blockquotes if a section of block level content (be it a paragraph, multiple paragraphs, a list, etc.) is quoted from somewhere else, you should wrap it inside a <blockquote> element to signify this, and include a url pointing to the source of the quote inside a cite attribute.
...there is no reason however why you couldn't link the text inside <cite> to the quote source in some way: <p>according to the <a href="/docs/web/html/element/blockquote"> <cite>mdn blockquote page</cite></a>: </p> <blockquote cite="/docs/web/html/element/blockquote"> <p>the <strong>html <code>&lt;blockquote&gt;</code> element</strong> (or <em>html block quotation element</em>) indicates that the enclosed text is an extended quotation.</p> </blockquote> ...
...t solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; abbreviations another fairly common element you'll meet when looking around the web is <abbr> — this is used to wrap around an abbreviation or acronym, and provide a full expansion of the term (included inside a title attribute.) let's look at a couple of examples: <p>we use <abbr title="hypertext markup language">html</abbr> to structure our web documents.</p> <p>i think <abbr title="reverend">rev.</abbr> green did it in the kitchen with the chainsaw.</p> these will come out looking something like this (the expansion will appear in a tooltip when the term is hovered over): note: there is ano...
...And 2 more matches
Document and website structure - Learn web development
many web designers consider the navigation bar to be part of the header rather than an individual component, but that's not a requirement; in fact, some also argue that having the two separate is better for accessibility, as screen readers can read the two features better if they are separate.
... sidebar: <aside>; often placed inside <main>.
...all rights reversed.</p> </footer> </body> </html> take some time to look over the code and understand it — the comments inside the code should also help you to understand it.
...And 2 more matches
HTML table advanced features and accessibility - Learn web development
adding a caption to your table with <caption> you can give your table a caption by putting it inside a <caption> element and nesting that inside the <table> element.
... put the obvious headers row inside a <thead> element, the "sum" row inside a <tfoot> element, and the rest of the content inside a <tbody> element.
...inside the head of your html document, you'll see an empty <style> element.
...And 2 more matches
HTML table basics - Learn web development
LearnHTMLTablesBasics
add these inside the body of your html.
... the smallest container inside a table is a table cell, which is created by a <td> element ('td' stands for 'table data').
... add the following inside your table tags: <td>hi, i'm your first cell.</td> if we want a row of four cells, we need to copy these tags three times.
...And 2 more matches
Introduction to web APIs - Learn web development
the most obvious ones are: audiocontext, which represents an audio graph that can be used to manipulate audio playing inside the browser, and has a number of methods and properties available to manipulate that audio.
... mediaelementaudiosourcenode, which represents an <audio> element containing sound you want to play and manipulate inside the audio context.
... we start by creating an audiocontext instance inside which to manipulate our track: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); next, we create constants that store references to our <audio>, <button>, and <input> elements, and use the audiocontext.createmediaelementsource() method to create a mediaelementaudiosourcenode representing the source of our audio — the <audio> element w...
...And 2 more matches
Arrays - Learn web development
array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value.
... note that an array inside an array is called a multidimensional array.
... you can access an item inside an array that is itself inside another array by chaining two sets of square brackets together.
...And 2 more matches
Handling text — strings in JavaScript - Learn web development
for example, both of these are okay: let sgldbl = 'would you eat a "fish supper"?'; let dblsgl = "i'm feeling blue."; sgldbl; dblsgl; however, you can't include the same quote mark inside the string if it's being used to contain them.
...e's an example from earlier in the course: <button>press me</button> const button = document.queryselector('button'); button.onclick = function() { let name = prompt('what is your name?'); alert('hello ' + name + ', nice to see you!'); } here we're using a window.prompt() function in line 4, which asks the user to answer a question via a popup dialog box then stores the text they enter inside a given variable — in this case name.
...so, taking a simple example: let song = 'fight the youth'; would be turned into a template literal like so: song = `fight the youth`; if we want to concatenate strings, or include expression results inside them, traditional strings can be fiddly to write: let score = 9; let highestscore = 10; let output = 'i like the song "' + song + '".
...And 2 more matches
JavaScript object basics - Learn web development
object basics an object is a collection of related data and/or functionality (which usually consists of several variables and functions — which are called properties and methods when they are inside objects.) let's work through an example to understand what they look like.
...i\'m ' + this.name[0] + '.'); } }; after saving and refreshing, try entering some of the following into the javascript console on your browser devtools: person.name person.name[0] person.age person.interests[1] person.bio() person.greeting() you have now got some data and functionality inside your object, and are now able to access them with some nice simple syntax!
...the object name (person) acts as the namespace — it must be entered first to access anything encapsulated inside the object.
...And 2 more matches
Object-oriented JavaScript for beginners - Learn web development
the basic idea of oop is that we use objects to model real world things that we want to represent inside our programs, and/or provide a simple way to access functionality that would otherwise be hard or impossible to make use of.
...object data (and often, functions too) can be stored neatly (the official word is encapsulated) inside an object package (which can be given a specific name to refer to, which is sometimes called a namespace), making it easy to structure and access; objects are also commonly used as data stores that can be easily sent across the network.
... defining an object template let's consider a simple program that displays information about the students and teachers at a school.
...And 2 more matches
Object prototypes - Learn web development
object.is(), object.keys(), and other members not defined inside the prototype bucket are not inherited by object instances or object types that inherit from object.prototype.
...bye for now!'); }; save the code and load the page in the browser, and try entering the following into the text input: person1.farewell(); you should get an alert message displayed, featuring the person's name as defined inside the constructor.
...this worked fine on the method we defined earlier in the prototype because it is sitting inside a function scope, which will be transferred successfully to the object instance scope.
...And 2 more matches
Getting started with Svelte - Learn web development
the markup section in the markup section you can insert any html you like, and in addition you can insert valid javascript expression inside single curly brackets ({}).
... in svelte, css inside a component's <style> block will be scoped only to that component.
...then in line 3 it instantiates it, passing an option object with the following properties: target: the dom element inside which we want the component to be rendered, in this case the <body> element.
...And 2 more matches
Package management basics - Learn web development
type the following command, making sure you are inside the parcel-experiment directory: npm init you will now be asked some questions; npm will then create a default package.json file based on the answers: name: a name to identify the app.
... one disadvantage is that parcel is only available inside our parcel-experiment app; you won't be able to run it in a different directory.
... this is determined using a system called semver, which might look a bit complicated from the documentation but can be simplified by considering only the summary information and that a version is represented by major.minor.patch, such as 2.0.1 being major version 2 with patch version 1.
...And 2 more matches
Gecko info for Windows accessibility vendors
microsoft active accessibility (msaa) an api devised by microsoft so that accessibility aids can track what's going on inside the user interface of any software package that supports it.
...inside the gecko process, code has full access to dom apis.
... the accname is an accumulation of the descendents' accnames, so may be considered redundant with them.
...And 2 more matches
Configuring Build Options
be aware that changing your mozconfig will require the configure process to be rerun and therefore the build will take considerably longer, so if you find yourself changing the same options regularly, it may be worth having a separate mozconfig for each.
... the main downside of this is that each objdir will take up a significant amount of space on disk.
...many of these extensions are now considered an integral part of the browsing experience.
...And 2 more matches
The Firefox codebase: CSS Guidelines
this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers.
... using css variables adding new variables before adding new css variables, please consider the following questions: is the variable value changed at runtime?
... (either from javascript or overriden by another css file) if the answer is no, consider using a preprocessor variable or simply inlining the value.
...And 2 more matches
Overview of Mozilla embedding APIs
contract-id: ns_document_loader_service_contractid implemented interfaces: nsiwebprogress nsidocumentloader related interfaces: nsiwebprogresslistener public components nswebbrowser the nswebbrowser is the main embedding component which gecko exposes.
...contract-id: ns_webbrowser_contractid implemented interfaces: nsiwebbrowser nsiwebnavigation nsiwebbrowsersetup nsiwebbrowserpersist nsiwebbrowserfind nsiwebbrowserprint nsiwebbrowserfocus nsibasewindow requestor interfaces: nsidomwindow nsidomdocument nsiwebprogress nsiclipboardcommands nsiprompt related interfaces: nsiprompt nsiwebbrowserchrome nsiwebbrowsersitewindow nsiwebprogresslistener nsicontextmenulistener nsiprintoptions overview: most of gecko's functionality is exposed through the nswebbrowser component.
...being reviewed interface definition: nsimemory.idl nsidomwindow this interface is used to represent the window containing a specific document.
...And 2 more matches
Bytecode Descriptions
if the function call is not inside a with statement, use jsop::gimplicitthis instead.
...we could implement switch statements using jsop::ifne and jsop::pop, but that would also be awkward--putting the jsop::pop inside the switch body would complicate fallthrough.
...jsop::gosub is considered to have two "successors": the target of offset, which is the actual next instruction to run; and the instruction immediately following jsop::gosub, even though it won't run until later.
...And 2 more matches
JIT Optimization Strategies
consider the following constructor: function point(x, y) { this.x = x; this.y = y; } if only integers are ever stored in the x and y properties, then the instances of point will be represented in an "unboxed" mode - with the property values stored as raw 4-byte values within the object.
... consider the following example: function base() {} base.prototype = { get x() { return 3; } }; function derived1() {} derived1.prototype = object.create(base.prototype); function derived2() {} derived1.prototype = object.create(base.prototype); if a property access for d.x sees only instances of both derived1 and derived2 for d, it can optimize the access to x to a call to the getter function define...
... consider the following example: function base() {} base.prototype = { set x(val) { ...
...And 2 more matches
amIWebInstallListener
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview boolean onwebinstallblocked(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); void onwebinstalldisabled(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); boolean onwebinstallrequested(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstal...
...ls, [optional] in pruint32 acount); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
...boolean onwebinstallblocked( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pruint32 acount optional ); parameters awindow the window that triggered the installs.
...And 2 more matches
nsIAccessNode
method overview nsiaccessnode getchildnodeat(in long childnum); obsolete since gecko 2.0 nsidomcssprimitivevalue getcomputedstylecssvalue(in domstring pseudoelt, in domstring propertyname); domstring getcomputedstylevalue(in domstring pseudoelt, in domstring propertyname); void scrollto(in unsigned long ascrolltype); void scrolltopoint(in unsigned long acoordinatetype, in long ax, in long ay); attributes note: attempting to access the attributes of a ...
...obsolete since gecko 2.0 innerhtml domstring the innerhtml for the dom node this is a text string of all the markup inside the dom node, not including the start and end tag for the node.
... getcomputedstylecssvalue() retrieve the computed style value as nsidomcssprimitivevalue for the dom node this access node is associated with.
...And 2 more matches
nsIClipboardDragDropHooks
method overview boolean allowdrop(in nsidomevent event, in nsidragsession session); boolean allowstartdrag(in nsidomevent event); boolean oncopyordrag(in nsidomevent aevent, in nsitransferable trans); boolean onpasteordrop(in nsidomevent event, in nsitransferable trans); methods allowdrop() tells gecko whether a drop is allowed on this content area.
... boolean allowdrop( in nsidomevent event, in nsidragsession session ); parameters event the dom event (drag gesture).
...boolean allowstartdrag( in nsidomevent event ); parameters event the dom event (drag gesture).
...And 2 more matches
nsIContentFrameMessageManager
attributes content nsidomwindow: the current top level window in the frame or null.
... docshell nsidocshell: the top level docshell or null.
... examples once you obtain the conten frame messge manager, you can send messages to listeners who registered with services.mm.addmessagelistener get content message manager from browser this could would run in a nsidomwindow scope.
...And 2 more matches
nsIEditorMailSupport
inherits from: nsisupports last changed in gecko 1.7 method overview nsisupportsarray getembeddedobjects(); nsidomnode insertascitedquotation(in astring aquotedtext, in astring acitation, in boolean ainserthtml); nsidomnode insertasquotation(in astring aquotedtext); void inserttextwithquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document.
...nsidomnode insertascitedquotation( in astring aquotedtext, in astring acitation, in boolean ainserthtml ); parameters aquotedtext the actual text to be quoted.
...(vs plaintext) return value the nsidomnode which was inserted.
...And 2 more matches
nsIFrameLoader
docshell nsidocshell get the docshell from the frame loader.
... destroy() destroys the frame loader and everything inside it.
...see nsidomwindowutils.sendkeyevent() for details; this method is its equivalent for cross-process event handling.
...And 2 more matches
Working with Multiple Versions of Interfaces
to do this i used the accessibility framework: hwnd gethwnd(nsidomnode *node){ hwnd self = null; nsresult rv; nscomptr<nsiaccessibleretrieval> refp; refp = do_createinstance( "@mozilla.org/accessibleretrieval;1", &rv); if (ns_failed(rv)){ return self; } //line 6.
...unfortunately we compiled this in the latest sdk, and so this magic number happens to be: "244e4c67-a1d3-44f2-9cab-cdaa31b68046" whereas, inside firefox 2, the iid it happens to know about is: "663ca4a8-d219-4000-925d-d8f66406b626".
... hwnd gethwndb(nsidomnode *node){ hwnd self = null; nsresult rv; nscomptr<nsicomponentmanager> compmgr; rv = ns_getcomponentmanager(getter_addrefs(compmgr)); if (ns_failed(rv)){ return self; } nscomptr<nsiaccessibleretrieval> refp; rv = compmgr->createinstancebycontractid(accretcid, 0, iar_iid_old, getter_addrefs(refp)); if (ns_failed(rv)){ return self; } nscomptr<nsiaccessible> accnode; rv = re...
...And 2 more matches
Migrating from Firebug - Firefox Developer Tools
the developer tools console offers similar functionality via the filter buttons inside its toolbar — centralized at one place.
...the difference is that they show the properties and methods within a side panel inside the web console.
... inspect cookies all cookies related to a website are listed inside the cookies panel in firebug.
...And 2 more matches
Basic usage of canvas - Web APIs
providing fallback content is very straightforward: just insert the alternate content inside the <canvas> element.
... browsers that don't support <canvas> will ignore the container and render the fallback content inside it.
... browsers that do support <canvas> will ignore the content inside the container, and just render the canvas normally.
...And 2 more matches
Intersection Observer API - Web APIs
consider a web page that uses infinite scrolling.
...a value of 1.0 means that the threshold isn't considered passed until every pixel is visible.
... how intersection is calculated all areas considered by the intersection observer api are rectangles; elements which are irregularly shaped are considered as occupying the smallest rectangle which encloses all of the element's parts.
...And 2 more matches
PointerEvent.isPrimary - Web APIs
a pointer is considered primary if the pointer represents a mouse device.
... a pointer representing pen input is considered the primary pen input if its pointerdown event was dispatched when no other active pointers representing pen input existed.
... a pointer representing touch input is considered the primary touch input if its pointerdown event was dispatched when no other active pointers representing touch input existed.
...And 2 more matches
RTCConfiguration - Web APIs
if the policy isn't specified, all is assumed by default, allowing all candidates to be considered.
... rtcicetransportpolicy enum the rtcicetransportpolicy enum defines string constants which can be used to limit the transport policies of the ice candidates to be considered during the connection process.
... constant description "all" all ice candidates will be considered.
...And 2 more matches
Using bounded reference spaces - Web APIs
the space inside the boundary is then the user's safe movement area, within which they are tracked and their movements replicated into the virtual world.
... although the user's xr system may provide automated detection and protection against exiting the safe area, it is always good practice to handle this yourself, watching for collisions between the user's position and the boundary of the world, and providing guidance to move back toward the origin point, or at least to stay inside the safe zone.
... the interior of the bounded area is always considered to be on the right side of the boundary.
...And 2 more matches
Web Audio API - Web APIs
web audio concepts and usage the web audio api involves handling audio operations inside an audio context, and has been designed to allow modular routing.
... a simple, typical workflow for web audio would look something like this: create audio context inside the context, create sources — such as <audio>, oscillator, stream create effects nodes, such as reverb, biquad filter, panner, compressor choose final destination of audio, for example your system speakers connect the sources up to the effects, and the effects to the destination.
...you need to create an audiocontext before you do anything else, as everything happens inside a context.
...And 2 more matches
Using XMLHttpRequest - Web APIs
for example, consider this snippet, which uses the responsetype of "arraybuffer" to fetch the remote content into a arraybuffer object, which stores the raw binary data.
... now, consider the submission of a form containing only two fields, named foo and baz.
...for this reason, the ajax-only upload is considered an experimental technique.
...And 2 more matches
WAI-ARIA Roles - Accessibility
a feed enables screen readers to use the browse mode reading cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads.aria: figure rolethe aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist.
... a figure is generally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text.aria: form rolethe form landmark role can be used to identify a group of elements on a page that provide equivalent functionality to an html form.aria: grid rolethe grid role is for a widget that contains one or more rows of cells.
...to give the page more structure, a level should also be provided to indicate relationships between sections.aria: img rolethe aria img role can be used to identify multiple elements inside page content that should be considered as a single image.
...And 2 more matches
Cognitive accessibility - Accessibility
cognitive accessibility covers accessibility considerations for people with cognition and learning disabilities.
... additional timing criteria to consider are: people who have cognitive or language limitations may need more time to read and to understand.
...if you have added content to links for screen readers, and that content is verbose and potentially confusing to sighted readers, consider clipping the added text to visually hide it from those not using assistive technologies.
...And 2 more matches
:host-context() - CSS: Cascading Style Sheets
the :host-context() css pseudo-class function selects the shadow host of the shadow dom containing the css it is used inside (so you can select a custom element from inside its shadow dom) — but only if the selector given as the function's parameter matches the shadow host's ancestor(s) in the place it sits inside the dom hierarchy.
... one typical use of this is with a descendant selector expression — for example h1 — to select only instances of the custom element that are inside an <h1>.
... in this example we have a simple custom element — <context-span> — that you can wrap around text: <h1>host selectors <a href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild...
...And 2 more matches
@supports - CSS: Cascading Style Sheets
WebCSS@supports
the rule may be placed at the top level of your code or nested inside any other conditional group at-rule.
...the following example returns true if the browser's transform-origin property considers 5% 5% valid: @supports (transform-origin: 5% 5%) {} function syntax the second basic supports condition is a supports function, the syntax for these is supported by all browsers, but the functions themselves are still being standardized.
...the following example returns true if the browser's transform-origin property doesn't consider 10em 10em 10em valid: @supports not (transform-origin: 10em 10em 10em) {} as with any operator, the not operator can be applied to a declaration of any complexity.
...And 2 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
we are able to align the content inside grid areas, and the grid tracks themselves on these two axes.
... center an item in the area by combining the align and justify properties we can easily center an item inside a grid area.
...a a ."; } .item1 { grid-area: a; align-self: center; justify-self: center; } <div class="wrapper"> <div class="item1">item 1</div> </div> aligning the grid tracks on the block axis if you have a situation where your grid tracks use an area that is smaller than the grid container, then you can align the grid tracks themselves, inside that container.
...And 2 more matches
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
those of us who have been doing web development for more years than we care to remember might consider that css grid is a little bit like using “tables for layout”.
...the biggest downside however was that it tied our design to the mark-up, often creating accessibility issues as it did so.
...we can also position items using line-based placement of grid template areas, without considering their location in the source.
...And 2 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
in the first example, which uses flexbox, i have a container with three items inside.
...in the case of a grid layout, we are aligning the items inside their grid area.
... grid and absolutely positioned elements grid interacts with absolutely positioned elements, which can be useful if you want to position an item inside a grid or grid area.
...And 2 more matches
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } note that the selector given to the ruleset defines the scope that the custom property can be used in.
... as mentioned earlier, you use the custom property value by specifying your custom property name inside the var() function, in place of a regular property value: element { background-color: var(--main-bg-color); } first steps with custom properties let's start with this simple css that applies the same color to elements of different classes: .one { color: white; background-color: brown; margin: 10px; width: 50px; height: 50px; display: inline-block; } .two { color: white; ...
...for example, var(--foo, red, blue) defines a fallback of red, blue — anything between the first comma and the end of the function is considered a fallback value.
...And 2 more matches
Visual formatting model - CSS: Cascading Style Sheets
this situation happens when, for example, you declare display: flex on a parent element, and directly inside there is a run of text not contained in another element.
...in the next example i have a string inside a <div>; in the middle of my string is a <p> element containing part of the text.
... something to consider about these anonymous boxes is that they inherit styles from their direct parent, but you cannot change how they look by targeting the anonymous box.
...And 2 more matches
list-style-position - CSS: Cascading Style Sheets
note that there is variance among browsers regarding behavior when a block element is placed first within a list element declared as list-style-position: inside.
... syntax /* keyword values */ list-style-position: inside; list-style-position: outside; /* global values */ list-style-position: inherit; list-style-position: initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below.
... values inside the ::marker is the first element among the list item's contents.
...And 2 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
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.
... waiting playback has stopped because of a temporary lack of data usage notes browsers don't all support the same file types and audio codecs; you can provide multiple sources inside nested <source> elements, and the browser will then use the first one it understands: <audio controls> <source src="myaudio.mp3" type="audio/mpeg"> <source src="myaudio.ogg" type="audio/ogg"> <p>your browser doesn't support html5 audio.
...And 2 more matches
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
this attribute is considered a legacy attribute and redefined as allow="fullscreen".
... this attribute is considered a legacy attribute and redefined as allow="payment".
...the contentdocument property refers to the document inside the <iframe>, same as contentwindow.document.
...And 2 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
you can set a default value for the input by including a date and time inside the value attribute, like so: <label for="party">enter a date and time for your party booking:</label> <input id="party" type="datetime-local" name="partydate" value="2017-06-01t08:30"> one thing to note is that the displayed date and time formats differ from the actual value; the displayed date and time are formatted according to the user's locale as reported by their operating system, wher...
...we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively.
...if you are stuck with other hardware, you can try to emulate 64-bit hardware inside a 32-bit virtual machine, but most vms don't support this kind of virtualization, stability may suffer, and performance will definately suffer greatly.
...And 2 more matches
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
regardless of their type, search field inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be ...
... setting placeholders you can provide a useful placeholder inside your search input that could give a hint on what to do using the placeholder attribute.
...in many cases, users should just be allowed to search for anything, but there are a few cases to consider, such as searches against data of a known format.
...And 2 more matches
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
lements regardless of their type, text inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be ...
...it can be used on any editable content, but here we consider specifics related to the use of spellcheck on <input> elements.
... setting placeholders you can provide a useful placeholder inside your text input that can provide a hint as to what to enter by including using the placeholder attribute.
...And 2 more matches
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
elements regardless of their type, url inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum number of characters the input should accept minlength the minimum number of characters long the input can be and still be considered valid pattern a regular expression the input's contents must match in order to be valid placeholder an exemplar value to display in the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be ...
...it can be used on any editable content, but here we consider specifics related to the use of spellcheck on <input> elements.
...in its most basic form, a url input can be implemented like this: <input id="myurl" name="myurl" type="url"> notice that it's considered valid when empty and when a single validly-formatted url address is entered, but is otherwise not considered valid.
...And 2 more matches
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
nesting a <kbd> element inside a <samp> element represents input that has been echoed back to the user by the system.
... nesting a <samp> element inside a <kbd> element, on the other hand, represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen.
... echoed input nesting a <kbd> element inside a <samp> element represents input that has been echoed back to the user by the system.
...And 2 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
to link an external stylesheet, you'd include a <link> element inside your <head> like this: <link href="main.css" rel="stylesheet"> this simple example provides the path to the stylesheet inside an href attribute, and a rel attribute with a value of stylesheet.
... you can also provide a media type or query inside a media attribute; this resource will then only be loaded if the media condition is true.
... note: this attribute is considered obsolete by the whatwg html living standard (which is the specification mdn treats as canonical).
...And 2 more matches
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
each menu option is defined by an <option> element nested inside the <select>.
...if no value attribute is included, the value defaults to the text contained inside the element.
... you can further nest <option> elements inside <optgroup> elements to create separate groups of options inside the dropdown.
...And 2 more matches
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
values higher than 1000 will be considered as incorrect and will be set to the default value (1).
...alternatively, you can put the abbreviated description inside the cell and place the long content in the title attribute.
... justify (with text only): the content is stretched out inside the cell so that it covers its entire width.
...And 2 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
84 <content>: the shadow dom content placeholder element (obsolete) content, dom, deprecated, element, html, html web components, placeholder, reference, web, web components, shadow dom the html <content> element—an obsolete part of the web components suite of technologies—was used inside of shadow dom as an insertion point, and wasn't meant to be used in ordinary html.
... 95 <dt>: the description term element definition, definition list, definition term, element, html, html grouping content, reference, term, dt, lists the html <dt> element specifies a term in a description or definition list, and as such must be used inside a <dl> element.
...the precise value, however, is not considered important.
...And 2 more matches
MIME types (IANA media types) - HTTP
note that text/plain does not mean "any kind of textual data." if they expect a specific kind of textual data, they will likely not consider it a match.
...no other values are considered valid, and using any of those may result in scripts that do not load or run.
...only a few image types are used commonly enough to be considered safe for use on web pages: abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safari gif graphics interchange format ...
...And 2 more matches
Authoring MathML - MathML
using mathml mathml in html pages you can use presentation mathml inside html5 documents: <!doctype html> <html> <head> <title>mathml in html5</title> </head> <body> <h1>mathml in html5</h1> <p> square root of two: <math> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> content mathml is not supported by browsers.
...to use it, just insert one line in your document header: <script src="https://fred-wang.github.io/mathml.css/mspace.js"></script> if you need more complex constructions, you might instead consider using the heavier mathjax library as a mathml polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages).
...even if your browser supports mathml, your webmail may prevent you to send or receive mails with mathml inside.
...And 2 more matches
Digital audio concepts - Web media technologies
consider the wave above, and how much different the blue, digital wave would look if you took samples twice as often.
... there is a reason why 44.1 khz is considered the minimum "high fidelity" sampling rate.
... for example, consider a stereo audio clip (that is, two audio channels) with a sample size of 16 bits (2 bytes), recorded at 48 khz: 2×2bytessample×48000samplessecond=192000bytessecond=192kbps2 \times 2\frac { bytes }{ sample } \times 48000\frac { samples }{ second } = 192000\frac { bytes }{ second } = 192 kbps at 192 kbps, lower-end networks are already going to be strained just by a single audio stream playing...
...And 2 more matches
Using templates and slots - Web Components
and because we are appending its contents to a shadow dom, we can include some styling information inside the template in a <style> element, which is then encapsulated inside the custom element.
...we can only display one bit of text inside it, meaning that at the moment it is even less useful than a regular paragraph!
... to define the slot's content, we include an html structure inside the <my-paragraph> element with a slot attribute whose value is equal to the name of the slot we want it to fill.
...And 2 more matches
util/uuid - Archive of obsolete content
generate uuid to generate a new uuid, call uuid() with no arguments: let uuid = require('sdk/util/uuid').uuid(); parsing uuid to convert a string representation of a uuid to an nsid, pass the string representation to uuid(): let { uuid } = require('sdk/util/uuid'); let firefoxuuid = uuid('{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'); globals functions uuid(stringid) generate a new uuid, or convert a string representation of a uuid to an nsid.
...if this argument is supplied, it will be converted to an nsid and returned.
... otherwise a new nsid will be generated and returned.
... returns nsid : a uuid, represented as an nsid object.
StringView - Archive of obsolete content
awhole.subarray(nstartidx, nendidx) : awhole; } this.buffer = awhole.buffer; this.bufferview = awhole; this.rawdata = araw; object.freeze(this); } /* constructor's methods */ stringview.loadutf8charcode = function (achars, nidx) { /* the iso 10646 view of utf-8 considers valid codepoints encoded by 1-6 bytes, * while the unicode view of utf-8 in 2003 has limited them to 1-4 bytes in order to * match utf-16's codepoints.
...if not specified (or specified as null) it will be considered as 0.
...if omitted it will be considered as 0.
... **/ }; if you want to create a stringview inside a bigger empty buffer, like in the following c line /* mybuffer: 12 character followed by 1012 nulls...
Custom XUL Elements with XBL - Archive of obsolete content
it's very similar to a js object variable, and we generally use a field for private variables inside of the element.
... <field name="fieldname">defaultvalue</field> from inside your binding methods, you can access fields with: this.fieldname you can also access them from outside of the element, if you have a reference to it: elementref.fieldname just like with js objects, all fields are publicly accessible, and we use a "_" to indicate a field is "private".
...this suggests that you should keep everything inside your binding.
...in those cases you just add regular event attributes to the nodes inside the content tag.
Local Storage - Archive of obsolete content
it is strongly recommended that you keep your local files inside the firefox profile directory.
...the common practice is to create a directory with the name of your project at the root of the profile folder, and keep your files inside.
...don't log inside functions that are called too often, such as mouseover event handlers, or certain http activity listeners.
...this approach has the downside of being less stable.
The Box Model - Archive of obsolete content
this is similarly the case for xul, except there are two flexibility directions to consider.
... unlike most style attributes, the flex attribute is considered acceptable to use in xul code.
... margins, paddings and spacers margins and paddings are frequently used in both html and xul to define spacing between elements and inside of elements.
...in order to have wrapping descriptions, you need to set the text as a child node instead of using the value attribute: <description>&xulschoolhello.description.label;</description> even then, the text will extend as much as it can in a single line, so you need to add some css limits in order to make it wrap inside a xul dialog or window.
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
until this redesign, wired news wasn't even using css to style the content inside tables.
... the sheer amount [sic] of redundant <font> tags inside every cell was probably enough to double file size.
... what would you say to a site developer considering a similar conversion to standards-based layout, either with simple tables or no tables at all?
... i think the conversion is a matter of taking into account several considerations.
MMgc - Archive of obsolete content
normally, a pointer to the object is considered a hard reference -- any such reference will prevent the object from being destroyed.
...pointers must be marked for the gc to consider the objects "live"; otherwise, the objects will be considered unreachable and will be destroyed.
...they are considered stack memory.
...another point to consider is whether marking should always be on or should be turned on and off at some point based on memory allocation patterns.
Same-origin policy for file: URIs - Archive of obsolete content
in gecko 1.8 or earlier, any two file: uris are considered to be same-origin.
...for cross-window dom access, each file is treated as a separate origin, with one exception: if a file is loaded from another file that would otherwise be able to load it following this same-origin policy, they are considered to have the same origin.
...for example, if the file /home/user/foo.html is a frameset and one of the frames is /home/user/subdir/bar.html, the frame and frameset are considered to share the same origin.
... on the other hand, if the file /home/user/subdir/foo.html is a frameset and the frame is /home/user/bar.html, the frame and frameset are considered to have different origins.
In-Depth - Archive of obsolete content
this will flip it around so items inside of this box will be displayed bottom to top and right to left.
...to style that image, we first need to get a handle to the toolbar, then the box inside of it, and then to the image that we added with the xml.
...inside of the xml file there is an image which has its class set to toolbar-primary-icon.
...put these 3 together and you get: #navigation-toolbar > .toolbar-holder > .toolbar-primary-icon inside this section of the css is where you add an image.
Creating a Help Content Pack - Archive of obsolete content
next, you'll need to insert a rdf:description element into the file, inside the rdf:rdf element just created: <rdf:description rdf:about="urn:root" nc:title="" nc:defaulttopic="" nc:base=""> </rdf:description> fill in the attributes as follows: rdf:about must be urn:root or your pack won't work.
...(we're still not actually to the point where we're describing the actual data in each of these, so we'll just use some filler data for now.) add the following code inside the rdf:description element you just created: <nc:panellist> <rdf:seq> </rdf:seq> </nc:panellist> you'll create the relevant information descriptions within the rdf:seq element.
... nc:platform="win os2" nc:datasources="win-toc.rdf"/> </rdf:li> <rdf:li> <rdf:description nc:panelid="toc" nc:platform="unix mac" nc:datasources="unix-toc.rdf"/> </rdf:li> there's one final element to add inside rdf:seq to complete the content pack descriptor file: an element to describe the help viewer's search function.
...if you're coming anywhere close to this limit, however, you probably should be considering exactly why you need so much nesting.
Mozilla Application Framework in Detail - Archive of obsolete content
javascript, considered by many to be the best scripting language ever designed is ideal for specifying the behavior of your interface widgets.
... where speed is the foremost consideration, we provide c++ libraries with multi-language interfaces for comprehensive, performant access to networking, filesystem, content, rendering, and much more.
...there is no charge for using the gecko browser engine or gecko technologies, including distributing gecko inside another product.
...mozilla engineers have written and are in the process of refining a new security model for web services that will ease the deployment of applications using web services while maintaining the security of sites inside the user's firewall.
Supporting private browsing mode - Archive of obsolete content
other considerations for extensions in some extensions, it's hard to decide whether the data retained by the extension should be written to disk in private browsing mode or not.
... in such a case, it is considered good practice for the extension to enable respecting the private browsing mode based on a preference specific to that extension, and set that preference to true by default.
... for example, the fire.fm extension has a preference called "disable station history and scrobble when firefox is in private mode", and disabling publishing of that information inside the private browsing mode by default.
...the following categories define what's considered "sensitive" data: the urls of pages the user has visited.
browser.type - Archive of obsolete content
the type of browser, which can be used to set access of the document loaded inside the browser.
...the content that is loaded inside the browser is not allowed to access the chrome above it.
...the content that is loaded inside the browser is not allowed to access the chrome above it.
...the content that is loaded inside the browser is not allowed to access the chrome above it.
Menus - Archive of obsolete content
submenus may be created by nesting one menu inside of another.
...a submenu is created by nesting a menu element inside another menupopup.
... you could further add a third level of menus by using another menu element as one of the items inside the 'sort' menupopup.
... accessing and setting the active item in a menu, there will usually be an item that is considered "active".
Tooltips - Archive of obsolete content
elements that use the tooltiptext attribute display the tooltip in a default tooltip element, which typically looks like a small yellow box large enough to fit the text inside it.
... the tooltip can be created using the tooltip element, the contents of which appear inside the tooltip.
... if you don't place any elements inside a tooltip element, it behaves and appears just like a standard tooltip.
... note that when using a specialized tooltip element, any labels used inside it are not populated based on what the tooltip applies to, so you may need to set the content in a tooltip if you wish to use the same tooltip for several elements.
Rule Compilation - Archive of obsolete content
a query is declared with the query tag (new to ff3; ff2 only worked with rdf datasources and had no query tag), which you would place directly inside the <template>.
...for instance, consider the example below: <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a" hidden="true"> <template> ...
...does this mean that templates cannot be used inside hidden areas of the ui?
...content inside a menu is not generated until the menu is opened.
Special Condition Tests - Archive of obsolete content
templates have a means of allowing a rule to match only if the generated content would be inserted inside an element with a particular tag name.
...if the node has one of the predicates listed in the containment attribute pointing out of it, it will also be considered to be a container.
... for instance, we might add the following to the previous example: <button label="houses in my neighbourhood" type="menu" datasources="template-guide-streets.rdf" containment="http://www.xulplanet.com/rdf/address" ref="http://www.xulplanet.com/rdf/myneighbourhood"> the houses do have a value for the 'http://www.xulplanet.com/rdf/address' predicate, so they will also be considered to be containers as well, resulting in another level of menus.
...considering the case of bookmarks, the first two rules would match folders, while the third rule would match bookmarks.
Static Content - Archive of obsolete content
one interesting thing about this example is that only one menupopup will be created, even though there are two in the code, one outside the template and another one inside the action body.
...remember that only the content at the uri attribute or below inside the action are copied for each result.
... when processing the action body, the builder looks at the first element inside the action, in this case, the menupopup.
...the builder then switches where generated content would be generated to inside to existing menupopup and moves onto the next part of the action, the menuitem.
Advanced Rules - Archive of obsolete content
in the simple syntax, the content is placed directly inside the rule.
...ontent uri="?list"/> <member container="?list" child="?city"/> <triple subject="?city" predicate="http://www.xulplanet.com/rdf/weather#name" object="?name"/> <triple subject="?city" predicate="http://www.xulplanet.com/rdf/weather#prediction" object="?pred"/> </conditions> generating content the content to generate for a rule is specified inside the action element.
... adding additional bindings the final element you can add inside a rule is the bindings element.
... inside it, you place one or more binding elements.
Anonymous Content - Archive of obsolete content
xbl content xbl can be used to automatically add a set of elements inside another element.
...all of the elements inside the content tag will be added inside the element that the binding is bound to.
...if you look at a scroll bar in a mozilla window, you will see that it is made up of an arrow button, a slider, a thumb inside it and a second arrow button at the end, which are the elements that appear in the xbl above.
...if you place child elements inside the xul, they will override the elements provided by the binding.
Box Model Details - Archive of obsolete content
if a box has a maximum height, the elements inside it are constrained by this.
... you can put boxes anywhere in a xul file, including inside an html element such as a table.
...remember that flexibility only has meaning for elements that are directly inside a box or an element that is a type of box.
...centering buttons example 4 : source view <hbox pack="center" align="center" flex="1"> <button label="look at me!"/> <button label="push me!"/> </hbox> this example contains a horizontal box with two buttons in it, contained inside a flexible box.
Commands - Archive of obsolete content
it is normal to put a group of commands inside a commandset element, together near the top of the xul file, as in the following: <commandset> <command id="cmd_open" oncommand="alert('open!');"/> <command id="cmd_help" oncommand="alert('help!');"/> </commandset> a command is invoked when the user activates the button or other element attached to the command.
...if the focus is inside a frame, each frame leading to the top-level window is checked as as well.
... this means that commands will work even if the focus is inside a frame.
... this works well for a browser, since editing commands invoked from the main menu will work inside the content area.
Popup Menus - Archive of obsolete content
when invoked, it will display a window containing whatever you put inside the menupopup.
...as the name popupset implies, you can put multiple popup declarations inside it.
...whenever you context-click (right-click) anywhere inside the box, the popup menu will appear.
...note that the tooltip element is still placed inside a popupset element like other popup types.
Splitters - Archive of obsolete content
when a splitter is placed inside a horizontal box, it will allow resizing horizontally.
... when a splitter is placed inside a vertical box, it will allow resizing vertically.
... if you set the collapse attribute, you should also add a grippy element inside the splitter which the user can use to collapse the element.
...the splitter grippy is drawn centered inside the splitter.
Styling a Tree - Archive of obsolete content
all of the content inside the tree's body is rendered by the treechildren element.
... however, css has a concept to access parts of elements considering them to be pseudo-elements.
... this selector matches some tree rows inside the treechildren element as pseudo-elements.
...this style rule means, inside a treechildren element, set the background color to blue for all tree rows that have the 'makeitblue' property.
Using Remote XUL - Archive of obsolete content
xul is often used by desktop applications like mozilla but can also be loaded from a web server and rendered inside the content pane of a compatible browser.
... note: the downside to using xul is that it only works with browsers that understand it.
... this isn't a problem inside an organization that uses mozilla-based browsers exclusively, but for other sites you may need to provide another form of navigation as well.
...because we added it to the menubar item, and events "bubble up" from child element to parent element, it'll fire any time the user manipulates an element inside the menu bar, so we don't have to add it to each menu item and button.
menupopup - Archive of obsolete content
there are several ways in which a menupopup may be used: it may be placed inside a menu, menulist, toolbarbutton, or a button with the type attribute set to "menu" to create a popup that will open when the menu or button is pressed.
... anchornode type: nsidomelement this read-only property holds the dom node that was specified as the anchor when opening the popup.
... triggernode type: nsidomnode this read-only property holds the dom node that generated the event triggering the opening of the popup.
... related elements menu, menubar, menuitem, menulist, menuseparator interfaces nsiaccessibleprovider, nsidomxulpopupelement ...
radiogroup - Archive of obsolete content
only one radio button inside the group can be selected at a time.
...place the radiogroup inside a groupbox if you would like a border or caption for the group.
...this attribute only has any effect when used inside a prefwindow.
... related interfaces nsiaccessibleprovider, nsidomxulselectcontrolelement ...
tabbrowser - Archive of obsolete content
properties browsers type: nodelist of browser elements holds a list of the browser elements inside the tabbrowser.
... docshell type: nsidocshell this read-only property contains the nsidocshell object for the document.
... documentcharsetinfo obsolete since gecko 12.0 type: nsidocumentcharsetinfo this read-only property contains the nsidocumentcharsetinfo object for the document which is used to handle which character set should be used to display the document.
... the properties of the nsidocumentcharsetinfo object were merged into the docshell in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9).
textbox - Archive of obsolete content
prior to gecko 1.9 (firefox 3), the script code would execute in the context of the anonymous html <input> element inside the textbox binding.
...prior to gecko 1.9 (firefox 3), the script code would execute in the context of the anonymous html <input> element inside the textbox binding.
...this attribute only has any effect when used inside a prefwindow.
...tiline="true" rows="2" cols="70" onkeypress="return pncountnotechars(event);"/> the javascript: function pncountnotechars(evt) { //allow non character keys (delete, backspace and and etc.) if ((evt.charcode == 0) && (evt.keycode != 13)) return true; if (evt.target.value.length < 10) { return true; } else { return false; } } related interfaces nsiaccessibleprovider, nsidomxultextboxelement ...
toolbar - Archive of obsolete content
it can be collapsed with a grippy when the toolbar is placed inside a toolbox.
...items that are placed directly inside the toolbar without being in the toolbarpalette are permanent.
...items that are placed directly inside the toolbar without being in the toolbarpalette are permanent.
...this will either be the toolbox's parent (if it's in a toolbox), or, if the toolbar is an external toolbar (that is, one not contained in a toolbox), the id of the toolbox it should be considered to be part of.
Browser Feature Detection - Archive of obsolete content
borderrightcolor true true true borderbottomcolor true true true borderleftcolor true true true bordertopstyle true true true borderrightstyle true true true borderbottomstyle true true true borderleftstyle true true true bottom true true true captionside true false true clear true true true clip true true true content true false true counterincrement true false true counterreset true false true cue true false false cueafter true false false cuebefore true false false cursor true t...
...ue false true outline true false true outlinecolor true false true outlinestyle true false true outlinewidth true false true overflow true true true page true false true pagebreakafter true true true pagebreakbefore true true true pagebreakinside true false true pause true false true pauseafter true false true pausebefore true false true pitch true false false pitchrange true false true playduring false false false position true true true quotes true false true richness true ...
...ame: 'borderrightcolor', 'supported': false}, {name: 'borderbottomcolor', 'supported': false}, {name: 'borderleftcolor', 'supported': false}, {name: 'bordertopstyle', 'supported': false}, {name: 'borderrightstyle', 'supported': false}, {name: 'borderbottomstyle', 'supported': false}, {name: 'borderleftstyle', 'supported': false}, {name: 'bottom', 'supported': false}, {name: 'captionside', 'supported': false}, {name: 'clear', 'supported': false}, {name: 'clip', 'supported': false}, {name: 'content', 'supported': false}, {name: 'counterincrement', 'supported': false}, {name: 'counterreset', 'supported': false}, {name: 'cue', 'supported': false}, {name: 'cueafter', 'supported': false}, {name: 'cuebefore', 'supported': false}, {name: 'cursor', 'supported': false},...
...', 'supported': false}, {name: 'outline', 'supported': false}, {name: 'outlinecolor', 'supported': false}, {name: 'outlinestyle', 'supported': false}, {name: 'outlinewidth', 'supported': false}, {name: 'overflow', 'supported': false}, {name: 'page', 'supported': false}, {name: 'pagebreakafter', 'supported': false}, {name: 'pagebreakbefore', 'supported': false}, {name: 'pagebreakinside', 'supported': false}, {name: 'pause', 'supported': false}, {name: 'pauseafter', 'supported': false}, {name: 'pausebefore', 'supported': false}, {name: 'pitch', 'supported': false}, {name: 'pitchrange', 'supported': false}, {name: 'playduring', 'supported': false}, {name: 'position', 'supported': false}, {name: 'quotes', 'supported': false}, {name: 'richness', 'supported': fals...
GLSL Shaders - Game development
everything inside void main() will be executed by the vertex shader.
... save a copy of the latest minimized three.js library inside your directory.
... go to the cube.html file on github, copy all the javascript code from inside the second <script> element, and paste it into the third <script> element of the current example.
... the vertex shader code let's continue by writing a simple vertex shader — add the code below inside the body's first <script> tag: void main() { gl_position = projectionmatrix * modelviewmatrix * vec4(position.x+10.0, position.y, position.z+5.0, 1.0); } the resulting gl_position is calculated by multiplying the model-view and the projection matrices by each vector to get the final vertex position, in each case.
2D maze game with device orientation - Game development
src: the javascript files with all the source code of the game defined inside.
...without the framework, to add the canvas element to the page, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'></canvas> the important thing to remember is that the framework is setting up helpful methods to speed up a lot of things like image manipulation or assets management, which would be a lot harder to do manually.
... the best way to use it in our case is to vibrate the phone every time the ball hits the walls — inside the wallcollision function: if("vibrate" in window.navigator) { window.navigator.vibrate(100); } if the vibrate method is supported by the browser and available in the window.navigator object, vibrate the phone for 100 miliseconds.
...in this tutorial we used phaser, but there are a number of other frameworks worth considering too like impactjs, construct 2 or playcanvas — it depends on your preferences, coding skills (or lack thereof), project scale, requirements and other aspects.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
in programming, semantics refers to the meaning of a piece of code — for example "what effect does running that line of javascript have?", or "what purpose or role does that html element have" (rather than "what does it look like?".) semantics in javascript in javascript, consider a function that takes a string parameter, and returns an <li> element with that string as its textcontent.
... semantics in css in css, consider styling a list with li elements representing different types of fruits.
...consider the following: <span style="font-size: 32px; margin: 21px 0;">is this a top level heading?</span> this will render it to look like a top level heading, but it has no semantic value, so it will not get any extra benefits as described above.
... some of the benefits from writing semantic markup are as follows: search engines will consider its contents as important keywords to influence the page's search rankings (see seo) screen readers can use it as a signpost to help visually impaired users navigate a page finding blocks of meaningful code is significantly easier than searching though endless divs with or without semantic or namespaced classes suggests to the developer the type of data that will be populated semantic naming mirrors proper custom element/component ...
CSS and JavaScript accessibility best practices - Learn web development
this article outlines some css and javascript best practices that should be considered to ensure even complex content is as accessible as possible.
...to put it another way, it is important that you consider some best practice advice to make sure that your use of css and javascript doesn't ruin the accessibility of your documents.
...the following sections summarize the main html features to consider.
...as we looked at in our html: a good basis for accessibility article, the key considerations are: good semantics: using the right element for the right job.
Accessibility - Learn web development
this article starts off the module with a good look at what accessibility is — this includes what groups of people we need to consider and why, what tools different people use to interact with the web, and how we can make accessibility part of our web development workflow.
...this article outlines some css and javascript best practices that should be considered to ensure that even complex content is as accessible as possible.
... mobile accessibility with web access on mobile devices being so popular, and popular platforms such as ios and android having fully-fledged accessibility tools, it is important to consider the accessibility of your web content on these platforms.
... this article looks at mobile-specific accessibility considerations.
Floats - Learn web development
previous overview: css layout next originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layouts on webpages.
... the background of floats the float property was introduced to allow web developers to implement simple layouts involving an image floating inside a column of text, with the text wrapping around the left or right of it.
... first, we'll start off with some simple html — add the following to your html body, removing anything that was inside there before: <h1>simple float example</h1> <div class="box">float</div> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.
...this is like a mini layout inside your page, inside which everything is contained, therefore our floated element is contained inside the bfc and the background runs behind both items.
Beginner's guide to media queries - Learn web development
@media screen and (min-width: 40em) { article { display: grid; grid-template-columns: 3fr 1fr; column-gap: 20px; } nav ul { display: flex; } nav li { flex: 1; } } this css gives us a two-column layout inside the article, of the article content and related information in the aside element.
...inside a media query we'll make the main element into a two column grid.
... there are a number of other options you can put inside the content attribute of the viewport meta tag — see using the viewport meta tag to control layout on mobile browsers for more details.
...it's always worth considering whether these layout methods can achieve what you want without adding media queries.
Supporting older browsers - Learn web development
you should also consider the type of devices and the way people use your site, for example, you may expect a higher than an average number of mobile devices.
... accessibility and people using assistive technology should always be considered, but for some sites that may be even more critical.
... in my experience, developers are often very worried about the experience of 1% of users in an old version of internet explorer, while not considering at all the far greater number who have accessibility needs.
...the browsers that support the feature query also support css grid and so will run the grid code and the code inside the feature query.
CSS layout - Learn web development
at this point we've already looked at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside.
... floats originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layouts on webpages.
... positioning positioning allows you to take elements out of the normal document layout flow, and make them behave differently, for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
...4, 6, or 12), and then fit your content columns inside these imaginary columns.
Web fonts - Learn web development
the syntax required looks something like this: first of all, you have a @font-face block at the start of the css, which specifies the font file(s) to download: @font-face { font-family: "myfont"; src: url("myfont.woff"); } below this you can then use the font family name specified inside @font-face to apply your custom font to anything you like, as normal: html { font-family: "myfont", "bitstream vera serif", serif; } the syntax does get a bit more complex than this; we'll go into more detail below.
...when you find each font, press on the download button, and save the file inside the same directory as the html and css files you saved earlier.
...inside the unzipped directory you'll see three useful items: multiple versions of each font: (for example .ttf, .woff, .woff2, etc.; the exact fonts provided will be updated over time as browser support requirements change).
... open up the stylesheet.css file and copy both the @font-face blocks contained inside into your web-font-start.css file — you need to put them at the very top, before any of your css, as the fonts need to be imported before you can use them on your site.
What is a URL? - Learn web development
an anchor represents a sort of "bookmark" inside the resource, giving the browser the directions to show the content located at that "bookmarked" spot.
... how to use urls any url can be typed right inside the browser's address bar to get to the resource behind it.
...because the browser already has the document's own url, it can use this information to fill in the missing parts of any url available inside that document.
...people are at the core of the web, and so it is considered best practice to build what is called semantic urls.
The HTML5 input types - Learn web development
but it should not be considered an exhaustive security measure!
...you could display an input value or the output of a calculation inside any element, but <output> is special — like <label>, it can take a for attribute that allows you to associate it with the element or elements that the output value came from.
...note that the usage of these types is quite complex, especially considering browser support (see below); to find out the full details, follow the links below to the reference pages for each type, including detailed examples.
... the reference pages linked to above provide suggestions on how to program fallbacks for non-supporting browsers; another option is to consider using a javascript library to provide a date picker.
Sending form data - Learn web development
consider the following form: <form action="http://www.foo.com" method="get"> <div> <label for="say">what greeting do you want to say?</label> <input name="say" id="say" value="hi"> </div> <div> <label for="to">who do you want to say it to?</label> <input name="to" id="to" value="mom"> </div> <div> <button>send my greetings</button> </div> </form> since the get method ha...
...files are binary data — or considered as such — whereas all other data is text data.
...in human terms, this means: "this is form data that has been encoded into url parameters." if you want to send files, you need to take three extra steps: set the method attribute to post because file content can't be put inside url parameters.
... security issues each time you send data to a server, you need to consider security.
CSS basics - Learn web development
add the <link> element somewhere inside your index.html's head (anywhere between the <head> and </head> tags).
...since <html> is the parent element of the whole page, all elements inside it inherit the same font-size and font-family.
... now let's set font sizes for elements that will have text inside the html body (<h1>, <li>, and <p>).
... text-shadow sets a drop shadow on the text inside an element.
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no no yes see promise.all(), below code example the following code fetches an image from the server and displays it inside an <img> element; see it live also, and see also the source code: fetch('coffee.jpg') .then(response => response.blob()) .then(myblob => { let objecturl = url.createobjecturl(myblob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }) .catch(e => { console.log('there has been a problem with your fetch operation: ' + e.message); }); ...
....createelement('img'); image1.src = objecturl1; image2.src = objecturl2; document.body.appendchild(image1); document.body.appendchild(image2); // display the text in a paragraph let para = document.createelement('p'); para.textcontent = desctext; document.body.appendchild(para); }); pitfalls if a promise.all() rejects, then one or more of the promises you are feeding into it inside its array parameter must be rejecting, or might not be returning promises at all.
...n image, written using async/await (see it live, and see the source code): async function myfetch() { let response = await fetch('coffee.jpg'); let myblob = await response.blob(); let objecturl = url.createobjecturl(myblob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } myfetch(); pitfalls you can't use the await operator inside a non-async function, or in the top level context of your code.
...if you want to use async/await but are concerned about older browser support, you could consider using the babeljs library — this allows you to write your applications using the latest javascript and let babel figure out what changes if any are needed for your user’s browsers.
Introducing asynchronous JavaScript - Learn web development
it is “called back” (hence the name) asynchronously somewhere inside the containing function’s body.
... the catch() block at the end runs if any of the .then() blocks fail — in a similar way to synchronous try...catch blocks, an error object is made available inside the catch(), which can be used to report the kind of error that has occurred.
... it worked :) if this confuses you, then consider the following smaller example: console.log("registering click handler"); button.addeventlistener('click', () => { console.log("get click"); }); console.log("all done"); this is very similar in behavior — the first and third console.log() messages will be shown immediately, but the second one is blocked from running until someone clicks the mouse button.
...this can be done by moving it inside another .then() block chained onto the end of the second one, or by simply moving it inside the second then() block.
Solve common problems in your JavaScript code - Learn web development
for example: function myfunction() { alert('this is my function.'); }; this code won't do anything unless you call it with the following statement: myfunction(); function scope remember that functions have their own scope — you can't access a variable value set inside a function from outside the function, unless you declared the variable globally (i.e.
... not inside any functions), or return the value from the function.
... how do you nest one decision block inside another?
... how do you iterate over the members of an object nested inside an array?
Web performance - Learn web development
this article introduces the components of performance, from web page loading and rendering, including how your content makes it into your users browser to be viewed, to what groups of people we need to consider when thinking about performance, how do users perceive performance?
...this article outlines some javascript best practices that should be considered to ensure even complex content is as performant as possible.
... mobile performance with web access on mobile devices being so popular, and all mobile platforms having fully-fledged web browsers, but possibly limited bandwidth, cpu and battery life, it is important to consider the performance of your web content on these platforms.
... this article looks at mobile-specific performance considerations.
Introduction to the server side - Learn web development
they run inside different operating system environments.
... client-side code is written using html, css, and javascript — it is run inside a web browser and has little or no access to the underlying operating system (including limited access to the file system).
... in contrast, you would almost never consider writing the server-side component of a web app without a framework — implementing a vital feature like an http server is really hard to do from scratch in say python, but python web frameworks like django provide one out of the box, along with other very useful tools.
... note: consider other real examples where access to content is controlled.
Server-side web frameworks - Learn web development
inside the html skeleton we have an expression that first checks if the youngest_teams variable exists, and then iterates it in a for loop.
...if you're starting from absolutely no programming experience then consider django (it is one of the easiest to learn based on the above criteria).
...at this point you may consider adding support for caching.
... for the next article in this module we'll change direction slightly and consider web security.
Accessibility in React - Learn web development
useeffect() is so named because it runs after react renders a given component, and will run any side-effects that we'd like to add to the render process, which we can't run inside the main function body.
...let's see this in action; put the following useeffect() call just above the return statement in the body of todo(), and pass into it a function that logs the words "side effect" to your console: useeffect(() => { console.log("side effect"); }); to illustrate the difference between the main render process and code run inside useeffect(), add another log – put this one below the previous addition: console.log("main render"); now, open the app in your browser.
... creating our ref import the useref() and useeffect() hooks into app.js — you'll need them both below: import react, { usestate, useref, useeffect } from "react"; then declare a new ref inside the app() function.
...add it to the top of your app.js file, just below the imports: function useprevious(value) { const ref = useref(); useeffect(() => { ref.current = value; }); return ref.current; } now add the following, above the return statement inside the app() function: const prevtasklength = useprevious(tasks.length); here we are invoking useprevious() to track the length of the tasks state, like so: note: since we're now utilizing useprevious() in two files, a good efficiency refactor would be to move the useprevious() function into its own file, export it from that file, and import it where you need it.
Starting our Svelte Todo list app - Learn web development
objective: to learn how to create a svelte component, render it inside another component, pass data into it using props, and save its state.
... note: you can put your components anywhere inside the src folder, but the components folder is a recognized convention to follow, allowing you to find your components easily.
...te to-do list</title> open src/app.svelte and replace its contents with the following: <script> import todos from './components/todos.svelte' </script> <todos /> in development mode, svelte will issue a warning in the browser console when specifying a prop that doesn't exist in the component; in this case we have a name prop being specified when we instantiate the app component inside src/main.js, which isn't used inside app.
... if you want to globally disable this warning you can add this onwarn handler to your rollup.config.js file inside the configuration for the svelte plugin, like this: plugins: [ svelte({ dev: !production, css: css => { css.write('public/build/bundle.css'); }, // warnings are normally passed straight to rollup.
Creating JavaScript callbacks in components
remember (or discover) that addeventlistener is a method of the nsidomeventtarget interface and is defined as such: void addeventlistener(in domstring type, in nsidomeventlistener listener, in boolean usecapture); however, it is extremely common to see developers pass a normal javascript function for the listener instead of an nsidomeventlistener implementation: function doload(event) { // do something here } window.
...is nsidomeventlistener magical?
...the nsidomeventlistener interface is "marked" with the function attribute.
...note, that since the javascript function is a single method, this magic only works for callback interfaces with a single method, like nsidomeventlistener.
Storage access policy: Block cookies from trackers
consider the following examples: hostname on the list hostname of resource matched example.com example.com yes example.com a.b.example.com yes blah.example.com example.com no a.b.example.com c.d.example.com no blah.example.com foo.blah.example.com yes what does the storage access policy block?
... consider the following embedding scenarios on a top-level page loaded from example.com on which tracker.example has been granted storage access.
...these providers should consider switching to explicitly request storage access through the storage access api as soon as possible.
...consider the following examples: you run an ad on a social media website that is seen several times by a user, but never clicked.
Embedding Tips
nscomptr<nsiwindowwatcher> wwatch(do_getservice(ns_windowwatcher_contractid)); if (wwatch) { wwatch->setwindowcreator(mywindowcreator); } i need the javascript inside the browser window to talk to my embedding client.
... specify a profile directory in your implementation of nsidirectoryserviceprovider passed to xre_initembedding.
... nscomptr<nsidomdocument> doc; nscomptr<nsidomwindow> window; webbrowser->getcontentdomwindow(getter_addrefs(window)); if (window) { window->getdocument(getter_addrefs(doc)); } what is the docshell?
... nscomptr<nsicommandmanager> commandmanager = do_getinterface(iwebbrowser); if (commandmanager) { nscomptr<nsidomwindow> thedomwindow = do_getinterface(iwebbrowser); nscomptr<nsicommandparams> cmdparamsobj = do_createinstance(ns_command_params_contractid,&rv); cmdparamsobj->setisupportsvalue("addhook", reinterpret_cast<nsisupports*>(ichromeimplementation)); commandmanager->docommand("cmd_clipboarddragdrophook", cmdparamsobj, thedomwindow); } ...
FileUtils.jsm
perms_directory 0755 default permissions when creating directories methods getfile() gets a file at the specified hierarchy under a nsidirectoryservice key.
... nsifile getfile( string key, array patharray, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory specified by key.
... getdir() gets a directory at the specified hierarchy under a nsidirectoryservice key.
... nsifile getdir( string key, array patharray, bool shouldcreate, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory specified by key.
Task.jsm
you can use the yield operator inside the generator function to wait on a promise, spawn another task, or propagate a value: let resolutionvalue = yield (promise/generator/iterator/value); if you specify a promise, the yield operator returns its resolution value as soon as the promise is resolved.
... method overview function async(atask); promise spawn(atask); properties attribute type description result read only constructor constructs a special exception that, when thrown inside a legacy generator function, allows the associated task to be resolved with a specific value.
... try { let info = yield os.file.stat(path); console.log("the .mozconfig file is " + info.size + " bytes long."); } catch (ex if ex instanceof os.file.error && ex.becausenosuchfile) { console.log("you don't have .mozconfig in " + currentdir); } }).then(null, components.utils.reporterror); in this example, if the promise returned by os.file.stat is rejected, an exception is thrown inside the task.
... any other unhandled exception that is thrown inside the task is reported by components.utils.reporterror.
Localizing without a specialized tool
assuming that you have installed mercurial, issue the following command: $ hg clone http://hg.mozilla.org/releases/mozilla-1.9.2 this will pull the mozilla 1.9.2 sources from the remote repository and create a mercurial clone in mozilla-1.9.2 inside your working directory.
... next, again in your working dir, create a directory that will serve as localization base: $ mkdir l10n-mozilla-1.9.2 $ cd l10n-mozilla-1.9.2 inside this directory you will put all the localization files in a folder named after your locale, e.g.
... you can always check the path by typing pwd once you are in the root working directory with both en-us source and the l10n base, copy the searchbar.dtd file by typing cp mozilla-1.9.2/browser/locales/chrome/browser/searchbar.dtd l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/ open the file in your x-testing directory and translate the words inside the quotation marks.
... each time you see a directory or set of sub-directories, you will need to run the mkdir command inside your locale directory and then copy the .dtd or .properties files into that directory.
GCIntegration - SpiderMonkey Redirect 1
if there is a choice between storing a gc thing inside a c++ object or its js corresponding representation, prefer to store it in the js representation.
...consider the following example.
... to understand the problem more, let's consider some reasons why barriers are not needed in common areas of firefox: if a pointer is never changed after it's initialized, then there's no need for a write barrier.
...to see how weak pointers can cause trouble, consider the following situation: {{ svg{source: "http://people.mozilla.org/~wmccloskey/incremental2.svg", embedding: "iframe", height:"130"} }} in the left frame, a has a weak pointer to c.
Exact Stack Rooting
storing a gcpointer in a gcthing storing your gcpointer inside of a gcthing that is already in the liveset is the easiest way to keep a gcthing to the liveset.
...instead, every pointer on the cstack should be considered part of the rootset.
...the downside of this efficiency is that gcpointers must be added to and removed from this rootedset tracking structure in lifo order.
...this is not a terribly safe option for embedder code, so only consider this as a very last resort.
TPS Bookmark Lists
loadinsidebar: true or false.
...the properties for this object include the uri, title, loadinsidebar, description, tags, keyword properties above, plus two additional properties: location: the full path of the folder that the bookmark should be moved to position: the title of the existing bookmark item, in the current folder, where this bookmark should be moved to (i.e., this bookmark would be inserted into the bookmark list at the position of the named bookmark, causing that bookmark to be...
... positioned below the current one) example: { uri: "http://www.google.com", title: "google", loadinsidebar: false, tags: [ "google", "computers", "misc" ] } livemark objects valid properties are: livemark: the livemark name.
...if a location property exists inside the changes object, it is applied before the position property.
mozIThirdPartyUtil
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean isthirdpartychannel(in nsichannel achannel, [optional] in nsiuri auri); boolean isthirdpartyuri(in nsiuri afirsturi, in nsiuri aseconduri); boolean isthirdpartywindow(in nsidomwindow awindow, [optional] in nsiuri auri); methods isthirdpartychannel() determine whether the given channel and its content window hierarchy is third party.
...obtain the bottommost nsidomwindow, and its same-type parent if it exists, from the channel's notification callbacks.
...(this means that nested iframes with different base domains, even though the bottommost and topmost uris might be equal, will be considered third party.) for example, if auri is "http://mail.google.com/", 'awindow' has a uri of "http://google.com/", and its parent is the topmost content window with a uri of "http://mozilla.com", the result will be true.
... boolean isthirdpartywindow( in nsidomwindow awindow, in nsiuri auri optional ); parameters awindow the bottommost window in the hierarchy.
nsIAccessibleDocument
you can also get one from nsiaccessnode.getaccessibledocument() or nsiaccessibleevent.getaccessibledocument() method overview nsiaccessible getaccessibleinparentchain(in nsidomnode adomnode, in boolean acancreate); obsolete since gecko 2.0 nsiaccessnode getcachedaccessnode(in voidptr auniqueid); native code only!
... domdocument nsidomdocument the nsidomdocument interface associated with this document.
... window nsidomwindow the nsidomwindow that the document resides in.
... nsiaccessible getaccessibleinparentchain( in nsidomnode adomnode, in boolean acancreate ); parameters adomnode the dom node we need an accessible for.
nsIFeedTextConstruct
method overview nsidomdocumentfragment createdocumentfragment(in nsidomelement element); astring plaintext(); attributes attribute type description base nsiuri if the text construct contains html or xhtml, relative references in the content should be resolved against this base uri.
... nsidomdocumentfragment createdocumentfragment( in nsidomelement element ); parameters element the element in which to create the new document fragment.
... return value an nsidocumentfragment containing the text and markup.
... see also nsidomelement nsidocumentfragment interwiki link ...
nsIMicrosummaryGenerator
1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosummarygenerator aother); astring generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded.
...long calculateupdateinterval( in nsidomnode apagecontent ); parameters apagecontent the content of the page being summarized.
...generators are considered equal if their canonical locations (uri attribute) are equal.
...astring generatemicrosummary( in nsidomnode apagecontent ); parameters apagecontent the content of the page being summarized.
nsIParserUtils
implemented by: @mozilla.org/parserutils;1 as a service: var parserutils = components.classes["@mozilla.org/parserutils;1"] .getservice(components.interfaces.nsiparserutils); method overview astring converttoplaintext(in astring src, in unsigned long flags, in unsigned long wrapcol); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned long flags); constants constant value description sanitizerallowcomments (1 << 0) flag for sanitizer: allow comment nodes.
... astring converttoplaintext( in astring src, in unsigned long flags, in unsigned long wrapcol ); parameters src the html source to parse (c++ callers are allowed but not required to use the same string for the return value.) flags conversion option flags defined in nsidocumentencoder.
... nsidomdocumentfragment parsefragment( in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element ); parameters fragment the input markup.
... return value an nsidomdocumentfragment object for the resulting sanitized document fragment.
nsISelection2
method overview void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results); native code ...
... void getrangesforinterval( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection.
... native code only!getrangesforintervalcomarray void getrangesforintervalcomarray( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection.
... void scrollintoview( in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent ); parameters aregion the region inside the selection to scroll into view (see selection region constants defined in nsiselectioncontroller).
nsITreeView
method overview boolean candrop(in long index, in long orientation, in nsidomdatatransfer datatransfer); boolean candropbeforeafter(in long index, in boolean before); obsolete since gecko 1.8 boolean candropon(in long index); obsolete since gecko 1.8 void cyclecell(in long row, in nsitreecolumn col); void cycleheader(in nsitreecolumn col); void drop(in long row, in long orientation, in nsidomdatatransfer datatransfer); ...
... boolean candrop( in long index, in long orientation, in nsidomdatatransfer datatransfer ); parameters index the index of the row.
... void drop( in long row, in long orientation, in nsidomdatatransfer datatransfer ); parameters row the index of the row.
...for very simple tree views, such as those without multi-level data, you might want to consider using something simpler than a tree view, such as a listbox.
nsIWebBrowserPersist
to create an instance, use: var webbrowserpersist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void ...
...implies wrap (except inside <pre>), since html wraps.
... void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument document to save to file.
... saveprivacyawareuri() save the specified uri to file, explicitly dictating whether the operation should be considered private for the purposes of network requests, caching, etc.
nsIXSLTProcessor
to create an instance, use: var xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() removes all set pa...
...void importstylesheet( in nsidomnode style ); parameters style the root-node of a xslt stylesheet.
...nsidomdocument transformtodocument( in nsidomnode source ); parameters source the node to be transformed.
...nsidomdocumentfragment transformtofragment( in nsidomnode source, in nsidomdocument output ); parameters source the node to be transformed.
nsIXULBrowserWindow
method overview astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); void setjsdefaultstatus(in astring status); void setjsstatus(in astring status); void setoverlink(in astring link, in nsidomelement element); methods onbeforelinktraversal() called before traversing a link to determine the appropriate target into which to load the link.
...astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the specified target for the link.
...linknode the nsidomnode representing the dom node in which the link is located.
...void setoverlink( in astring link, in nsidomelement element ); parameters link the link string.
nsIXULWindow
void assumechromeflagsarefrozen(); void center(in nsixulwindow arelative, in boolean ascreen, in boolean aalert); nsixulwindow createnewwindow(in print32 achromeflags, in nsiappshell aappshell); nsidocshelltreeitem getcontentshellbyid(in wstring id); void removechildwindow(in nsixulwindow achild); void showmodal(); attributes attribute type description chromeflags pruint32 chromeflags are from nsiwebbrowserchrome.
... docshell nsidocshell the docshell owning the xul for this window.
... primarycontentshell nsidocshelltreeitem the primary content shell.
... nsidocshelltreeitem getcontentshellbyid( in wstring id ); parameters id the id of the content shell, which is the same as the "type" attribute on the containing frame element.
XPCOM Interface Reference
licynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeoloca...
...tionnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbacknsidomgeopositioncoordsnsidomgeopositionerrornsidomgeopositionerrorcallbacknsidomgeopositionoptionsnsidomglobalpropertyinitializernsidomhtmlaudioelementnsidomhtmlformelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimerangesnsidomjswindownsidommousescrolleventnsidommoznetworkstatsnsidommoznetworkstatsdatansidommoznetworkstatsmanagernsidommoztoucheventnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensidomstorage2nsidomstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsidomstoragewindownsidomuserdatahandlernsidomwindownsidomwindow2nsidomwindowi...
...nternalnsidomwindowutilsnsidomxpathevaluatornsidomxpathexceptionnsidomxpathexpressionnsidomxpathresultnsidomxulcontrolelementnsidomxulelementnsidomxullabeledcontrolelementnsidomxulselectcontrolelementnsidomxulselectcontrolitemelementnsidatasignatureverifiernsidebugnsidebug2nsidevicemotionnsidevicemotiondatansidevicemotionlistenernsidialogcreatornsidialogparamblocknsidictionarynsidirindexnsidirindexlistenernsidirindexparsernsidirectoryenumeratornsidirectoryiteratornsidirectoryservicensidirectoryserviceprovidernsidirectoryserviceprovider2nsidiskcachestreaminternalnsidispatchsupportnsidocshellnsidocumentloadernsidownloadnsidownloadhistorynsidownloadmanagernsidownloadmanageruinsidownloadobservernsidownloadprogresslistenernsidownloadernsidragdrophandlernsidragservicensidragsessionnsidroppedlinkhand...
...lernsidroppedlinkitemnsidynamiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsieffectivetldservicensienumeratornsienvironmentnsierrorservicensieventlistenerinfonsieventlistenerservicensieventsourcensieventtargetnsiexceptionnsiextensionmanagernsiexternalhelperappservicensiexternalprotocolservicensiexternalurlhandlerservicensiftpchannelnsiftpeventsinknsifactorynsifavicondatacallbacknsifaviconservicensifeednsifeedcontainernsifeedelementbasensifeedentrynsifeedgeneratornsifeedpersonnsifeedprocessornsifeedprogresslistenernsifeedresultnsifeedresultlistenernsifeedtextconstructnsifilensifileinputstreamnsifileoutputstreamnsifilepickernsifileprotocolhandlernsifilespecnsifilestreamsnsifileurlnsifileutilities...
Storage Inspector - Firefox Developer Tools
cookies — all the cookies created by the page or any iframes inside of the page.
... indexeddb — all indexeddb databases created by the page or any iframes inside the page, their object stores and the items stored in these object stores.
... local storage — all local storage items created by the page or any iframes inside the page.
... session storage — all session storage items created by the page or any iframes inside the page.
AbstractRange - Web APIs
contents of elements when trying to access the contents of an element, keep in mind that the element itself is a node, but so is any text inside it.
... in order to set a range endpoint within the text of an element, be sure to find the text node inside the element: let startelem = document.queryselector("p"); let endelem = startelem.queryselector("span"); let range = document.createrange(); range.setstart(startelem, 0); range.setend(endelem, endelem.childnodes[0].length/2); let contents = range.clonecontents(); document.body.appendchild(contents); this example creates a new range, rng, and sets its starting point to the third child node of the first element whose class is elementclass.
... to illustrate this, consider the html below: <div class="container"> <div class="header"> <img src="" class="sitelogo"> <h1>the ultimate website</h1> </div> <article> <section class="entry" id="entry1"> <h2>section 1: an interesting thing...</h2> <p>a <em>very</em> interesting thing happened on the way to the forum...</p> <aside class="callout"> <h2>aside</h2> <p>an inte...
... example consider this simple html fragment of html.
CanvasRenderingContext2D - Web APIs
fill and stroke styles fill styling is used for colors and styles inside shapes and stroke styling is used for the lines around shapes.
... canvasrenderingcontext2d.fillstyle color or style to use inside shapes.
...everything drawn after clip() is called appears inside the clipping path only.
... canvasrenderingcontext2d.ispointinstroke() reports whether or not the specified point is inside the area contained by the stroking of a path.
Element.insertAdjacentHTML() - Web APIs
it does not reparse the element it is being used on, and thus it does not corrupt the existing elements inside that element.
... 'afterbegin': just inside the element, before its first child.
... 'beforeend': just inside the element, after its last child.
... example // <div id="one">one</div> var d1 = document.getelementbyid('one'); d1.insertadjacenthtml('afterend', '<div id="two">two</div>'); // at this point, the new structure is: // <div id="one">one</div><div id="two">two</div> notes security considerations when inserting html into a page by using insertadjacenthtml(), be careful not to use user input that hasn't been escaped.
Element.querySelector() - Web APIs
the entire hierarchy of elements is considered when matching, including those outside the set of elements including baseelement and its descendants; in other words, selectors is first applied to the whole document, not the baseelement, to generate an initial list of potential elements.
... examples let's consider a few examples.
... find a specific element with specific values of an attribute in this first example, the first <style> element which either has no type or has type "text/css" in the html document body is returned: var el = document.body.queryselector("style[type='text/css'], style:not([type])"); the entire hierarchy counts this example demonstrates that the hierarchy of the entire document is considered when applying selectors, so that levels outside the specified baseelement are still considered when locating matches.
... html <div> <h5>original content</h5> <p> inside paragraph <span>inside span</span> inside paragraph </p> </div> <div> <h5>output</h5> <div id="output"></div> </div> javascript var baseelement = document.queryselector("p"); document.getelementbyid("output").innerhtml = (baseelement.queryselector("div span").innerhtml); result the result looks like this: notice how the "div span" selector still successfully matches the <span> element, even though the baseelement's child nodes do not include the div element (it is still part of the specified selector).
EventTarget.addEventListener() - Web APIs
handler, nonepassive); function oncehandler(event) { alert('outer, once'); } function noneoncehandler(event) { alert('outer, none-once, default'); } function capturehandler(event) { //event.stopimmediatepropagation(); alert('middle, capture'); } function nonecapturehandler(event) { alert('middle, none-capture, default'); } function passivehandler(event) { // unable to preventdefault inside passive event listener invocation.
... if attaching a handler function to an element using addeventlistener(), the value of this inside the handler is a reference to the element.
...</table> note that the value of this inside a function, called by the code in the attribute value, behaves as per standard rules.
...consider this example.
Capabilities, constraints, and settings - Web APIs
however, if you use simple values for properties when calling mediastreamtrack.applyconstraints(), the request will always succeed, because these values will be considered a request, not a requirement.
... advanced constraints so-called advanced constraints are created by adding an advanced property to the constraint set; this property's value is an array of additional constraint sets which are considered optional.
...the browser should do its best to match these settings but will settle for anything it considers a close match.
... when that happens, we know the video has started playing, so we call our getcurrentsettings() function (described above) to display the actual settings that the browser decided upon after considering our constraints and the capabilities of the hardware.
RTCPeerConnection - Web APIs
rtcicetransportpolicy enum the rtcicetransportpolicy enum defines string constants which can be used to limit the transport policies of the ice candidates to be considered during the connection process.
... constant description "all" all ice candidates will be considered.
... "public" only ice candidates with public ip addresses will be considered.
... "relay" only ice candidates whose ip addresses are being relayed, such as those being passed through a turn server, will be considered.
Reporting API - Web APIs
reporting observers reports can also be obtained via reportingobserver objects created via javascript inside the website you are aiming to get reports on.
... a reportingobserver object is created using the reportingobserver() constructor, which is passed two parameters: a callback function that has available as parameters the reports available in the observer's report queue, and a copy of the same reportingobserver object, so observation can be controlled directly from inside the callback.
...web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); later on in the example we deliberately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, success, failure); } else { navigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the event h...
...andler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
SVGSVGElement - Web APIs
each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in pointer-events processing.
...each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in pointer-events processing.
...each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in pointer-events processing.
...each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in pointer-events processing.
Screen.lockOrientation() - Web APIs
a screen is considered in its primary portrait mode if the device is held in its normal position and that position is in portrait, or if the normal position of the device is in landscape and the device held turned by 90° clockwise.
...a screen is considered in its secondary portrait mode if the device is held 180° from its normal position and that position is in portrait, or if the normal position of the device is in landscape and the device held is turned by 90° anticlockwise.
...a screen is considered in its primary landscape mode if the device is held in its normal position and that position is in landscape, or if the normal position of the device is in portrait and the device held is turned by 90° clockwise.
...a screen is considered in its secondary landscape mode if the device held is 180° from its normal position and that position is in landscape, or if the normal position of the device is in portrait and the device held is turned by 90° anticlockwise.
SourceBuffer - Web APIs
sourcebuffer.audiotracks read only a list of the audio tracks currently contained inside the sourcebuffer.
... sourcebuffer.texttracks read only a list of the text tracks currently contained inside the sourcebuffer.
... sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer.
... sourcebuffer.videotracks read only a list of the video tracks currently contained inside the sourcebuffer.
WebGL model view projection - Web APIs
consider our camera, which is viewing an area that starts immediately in front of its lens and extends off into the distance.
...finally it's very helpful to have a fine-tuned control over what points get placed inside and outside of clip space.
... consider a box sitting on a table and a camera resting on the table one meter away, pointed at the box, the front of which is pointed toward the camera.
... then consider moving the camera away from the box until it's two meters away (by adding a meter to the camera's z position), then sliding it 10 centimeters to the its left.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
the first and most important thing to understand when considering the code to manage point-of-view and cameras in your application is this: webxr does not have cameras.
... there's another aspect of the spatial relationship of an object to the origin in space left to be considered: perspective.
...you should strongly consider using one instead of directly using webgl.
... for example, consider a device which uses a 2560x1440 pixel frame buffer.
Web Audio API best practices - Web APIs
as long as you consider security, performance, and accessibility, you can adapt to your own style.
... autoplay policy browsers have started to implement an autoplay policy, which in general can be summed up as: "create or resume context from inside a user gesture".
... when working with an audiocontext, if you create the audio context from inside a click event the state should automatically be set to running.
... here is a simple example of creating the context from inside a click event: const button = document.queryselector('button'); button.addeventlistener('click', function() { const audioctx = new audiocontext(); }, false); if however, you create the context outside of a user gesture, its state will be set to suspended and it will need to be started after user interaction.
Window.prompt() - Web APIs
WebAPIWindowprompt
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpromptchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 4notes full support 4notes notes this function has no effect in the modern ui/metro version...
...desktop versions of ie do implement this function.opera full support 3notes full support 3notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari full support 1webview android full support 1notes full support 1notes notes starting with webview 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value ...
...allow-modals.chrome android full support 18notes full support 18notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.firefox android full support 4opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android full support 1.0note...
...s full support 1.0notes notes starting with samsung internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.legend full support full supportsee implementation notes.see implementation notes.
ARIA: application role - Accessibility
associated wai-aria roles, states, and properties document, article used to indicate parts of the application that should be treated as normal web content aria-activedescendant used to manage focus inside the application.
...the one exception is if focus is set to a standard widget inside the application that supports keyboard navigation from the browser, for example an input element.
... required javascript features keypress used to handle keyboard input and control the focus click, touch handle as appropriate for your widget as well changing attribute values aria-activedescendant is used to manage the focus inside the application container.
...the author of the application must take full responsibility for not letting users get stuck in a focus limbo or trap focus inside something the user cannot exit of.
ARIA: figure role - Accessibility
the aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist.
... a figure is generally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text.
... instead of using aria to create a figure, consider using the native, semantic html <figure> element.
...you could add an id to an element containing content that describes the figure, and then reference that id inside an appropriate attribute on the figure to associate the figure with the label: <div role="figure" aria-labelledby="figure-1"> ...
Accessibility
this article starts off the module with a good look at what accessibility actually is — this includes what groups of people we need to consider and why, what tools different people use to interact with the web, and how we can make accessibility part of our web development workflow.
...this article outlines some css and javascript best practices that should be considered to ensure even complex content is as accessible as possible.
... mobile accessibility with web access on mobile devices being so popular, and popular platforms such as ios and android having fully-fledged accessibility tools, it is important to consider the accessibility of your web content on these platforms.
... this article looks at mobile-specific accessibility considerations.
:host() - CSS: Cascading Style Sheets
WebCSS:host()
the :host() css pseudo-class function selects the shadow host of the shadow dom containing the css it is used inside (so you can select a custom element from inside its shadow dom) — but only if the selector given as the function's parameter matches the shadow host.
...you can't use this with a descendant selector expression to select only instances of the custom element that are inside a particular ancestor.
... in this example we have a simple custom element — <context-span> — that you can wrap around text: <h1>host selectors <a href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild...
..., aside) { color: gray; }' + ':host(.footer) { color : red; }' + ':host { background: rgba(0,0,0,0.1); padding: 2px 5px; }'; the :host(.footer) { color : red; } rule styles all instances of the <context-span> element (the shadow host in this instance) in the document that have the footer class set on them — we've used it to give instances of the element inside the <footer> a special color.
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
justify-self the justify-self property is used to align an item inside its containing block on the inline axis.
... aligning in these layout methods today as we do not currently have browser support for box alignment in block layout, your options for alignment are either to use one of the existing alignment methods or, to make even a single item inside a container a flex item in order to use the alignment properties as specified in flexbox.
...a margin of auto will absorb all available space in that dimension, therefore setting a left and right margin of auto, you can push a block into the center: .container { width: 20em; margin-left: auto; margin-right: auto; } in table layout, you have access to the vertical-align property to align the contents of a cell inside that cell.
...in the example below, a container with a single item inside has been turned into a flex container for the purpose of being able to use the alignment properties.
Handling content breaks in multicol - CSS: Cascading Style Sheets
there are various places we might want to control our breaks: breaks inside boxes, for example inside a figure element.
... breaks inside boxes to control breaks inside boxes use the break-inside property.
... this property takes values of: auto avoid avoid-page avoid-column avoid-region in the example below, we have applied break-inside to the figure element to prevent the caption from becoming separated from the image.
...note that these properties only work inside a block container, such as a paragraph.
Spanning and Balancing Columns - CSS: Cascading Style Sheets
in this guide we look at how to make elements span across columns inside the multicol container and how to control how the columns are filled.
...for example, a heading nested directly inside the container could become a spanner, as could a heading nested inside a section nested inside the multicol container.
... in this second example, the heading is inside an <article> element, yet still spans the content as expected.
... things to watch out for if the spanning element is inside another element which has margins, padding and a border or a background color, it is possible to end up with the top of the box appearing above the spanner and the rest displaying below, as shown in the next example.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
when a flex container has positive free space, it has more space than is required to display the flex items inside the container.
...let's consider the case of three flex items of differing content lengths and the following flex rules applied to them: flex: 1 1 auto; in this case the flex-basis value is auto and the items don’t have a width set, and so are auto-sized.
...consider the following aspects, which we have already discussed in these guides: what sets the base size of the item?
...if so then the item size is not taken into consideration for the space-sharing calculation.
Typical use cases of Flexbox - CSS: Cascading Style Sheets
it forms the most simple of flexbox examples, and could be considered the ideal flexbox use case.
...we either display the space outside of the items — therefore spacing them out with white space between or around them — or we absorb the extra space inside the items and therefore need a method of allowing the items to grow and take up this space.
...for now however, if you need to properly centre one thing inside another, flexbox is the way to do it.
...any content inside uses regular block layout, meaning that on a card with less content the footer will rise up to the bottom of the content rather than stick to the bottom of the card.
Overview of CSS Shapes - CSS: Cascading Style Sheets
there are a number of ways to create these shapes and in these guides we will find out how css shapes work, and consider some ways you might like to use them.
...this means we can keep things used for styling inside the css.
... future css shapes features the initial shapes specification included a property shape-inside for creating shapes inside an element.
...as the shape-inside property was initially in level 1 of the specification, you may find tutorials on the web detailing both properties.
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
ft-colorborder-left-styleborder-left-widthborder-radiusborder-rightborder-right-colorborder-right-styleborder-right-widthborder-spacingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearclipclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cros...
...s-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><display-inside><display-internal><display-legacy><display-listitem><display-outside>dpcmdpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settingsfont-feature-settings (@font-face)@font-feature-valuesfont-kerningfont-language-overridefont-optical-sizingfont-sizefont-size-adjustfont-stretchfont-stretch (@font-face)font-stylefont-style (@font-face)font-synthesi...
...rflow-blockoverflow-inlineoverflow-wrapoverflow-xoverflow-yoverscroll-behavioroverscroll-behavior-blockoverscroll-behavior-inlineoverscroll-behavior-xoverscroll-behavior-yppad (@counter-style)paddingpadding-blockpadding-block-endpadding-block-startpadding-bottompadding-inlinepadding-inline-endpadding-inline-startpadding-leftpadding-rightpadding-top@pagepage-break-afterpage-break-beforepage-break-insidepaint()paint-orderpath()pc<percentage>perspectiveperspective()perspective-originplace-contentplace-itemsplace-self::placeholderpointer-eventspolygon()<position>positionprefix (@counter-style)ptpxqqquotesrradradial-gradient()range (@counter-style)<ratio>:read-only:read-writerect()remrepeat()repeating-linear-gradient()repeating-radial-gradient():requiredresize<resolution>revertrgb()rgba():rightrigh...
...elements which span multiple columns are considered to be a member of all of those columns.
Viewport concepts - CSS: Cascading Style Sheets
the area within the innerheight and innerwidth is generally considered the layout viewport.
... the browser chrome is not considered part of the viewport.
...any sub-viewport that is fully or partially displayed within the layout viewport is considered a visual viewport.
... <iframe> inside an iframe, the visual viewport is the size of the inner width and height of the iframe, rather than the parent document.
break-after - CSS: Cascading Style Sheets
oid-column; break-after: column; /* region break values */ break-after: avoid-region; break-after: region; /* global values */ break-after: inherit; break-after: initial; break-after: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
...if more than one of them are such a break, the one of the element that appears the latest in the flow is taken (i.e., the break-before value has precedence over the break-after value, which itself has precedence over the break-inside value).
...if we are inside a multicol container then it would force a column break, inside paged media (but not inside a multicol container) a page break.
...so a break inside a multicol container, which was inside a page container would force a column and page break.
break-before - CSS: Cascading Style Sheets
lumn; break-before: column; /* region break values */ break-before: avoid-region; break-before: region; /* global values */ break-before: inherit; break-before: initial; break-before: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
...if more than one of them are such a break, the one of the element that appears the latest in the flow is taken (i.e., the break-before value has precedence over the break-after value, which itself has precedence over the break-inside value).
...if we are inside a multicol container then it would force a column break, inside paged media (but not inside a multicol container) a page break.
...so a break inside a multicol container, which was inside a page container would force a column and page break.
justify-items - CSS: Cascading Style Sheets
the effect of this property is dependent of the layout mode we are in: in block-level layouts, it aligns the items inside their containing block on the inline axis.
... for absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
... in table cell layouts, this property is ignored (more about alignment in block, absolute positioned and table layout) in flexbox layouts, this property is ignored (more about alignment in flexbox) in grid layouts, it aligns the items inside their grid areas on the inline axis (more about alignment in grid layouts) syntax /* basic keywords */ justify-items: auto; justify-items: normal; justify-items: stretch; /* positional alignment */ justify-items: center; /* pack items around the center */ justify-items: start; /* pack items from the start */ justify-items: end; /* pack items from the end */ justify-items: flex-start; /* equivalent to 'start'.
...note that if a descendant has a justify-self: auto value, the legacy keyword is not considered by the descend, only the left, right, or center value associated to it.
justify-self - CSS: Cascading Style Sheets
the css justify-self property sets the way a box is justified inside its alignment container along the appropriate axis.
... the effect of this property is dependent of the layout mode we are in: in block-level layouts, it aligns an item inside its containing block on the inline axis.
... for absolutely-positioned elements, it aligns an item inside its containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
... in table cell layouts, this property is ignored (more about alignment in block, absolute positioned and table layout) in flexbox layouts, this property is ignored (more about alignment in flexbox) in grid layouts, it aligns an item inside its grid area on the inline axis (more about alignment in grid layouts) syntax /* basic keywords */ justify-self: auto; justify-self: normal; justify-self: stretch; /* positional alignment */ justify-self: center; /* pack item around the center */ justify-self: start; /* pack item from the start */ justify-self: end; /* pack item from the end */ justify-self: flex-start; /* equivalent to 'start'.
Event reference
pointerenter pointerevent pointer events pointing device is moved inside the hit-testing boundary.
... mozbrowsercaretstatechanged firefox os browser api-specific sent when the text selected inside the browser <iframe> content changes.
... mozbrowserselectionstatechanged firefox os browser api-specific sent when the text selected inside the browser <iframe> content changes.
... domlinkremoved addons specific a link has been removed inside from a document.
A hybrid approach - Developer guides
of course, this technique suffers from all the downsides associated with user-agent detection.
... the bad one downside of mixing approaches is that it can lead to an increase in the number of code paths, both on the client and server side.
...another downside is that because this approach relies on responsive design, it typically works best on a new project or one that has an existing flexible layout, not as a retrofit.
... when it is right to choose this option combining server-side and client-side techniques is something that is always worth considering; there are so many options that one must just weigh the pros and cons of each individual technique employed.
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
you can set a default value for the input with a date inside the value attribute, like so: <input type="date" value="2017-06-01"> the displayed date format will differ from the actual value — the displayed date is formatted based on the locale of the user's browser, but the parsed value is always formatted yyyy-mm-dd.
...we had to put the icon on a <span> next to the input, not on the input itself, because in chrome at least the input's generated content is placed inside the form control, and can't be styled or shown effectively.
...ment.queryselector('#month'); var dayselect = document.queryselector('#day'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'date'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the days and years dynamically // (the months are always the same, therefore hardcoded) populatedays(monthselect.value); populateyears(); } function populateda...
...you'll need to take this into consideration when developing production apps.
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
you can set a default value for the input control by including a month and year inside the value attribute, like so: <label for="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> one thing to note is that the displayed date format differs from the actual value; most user agents display the month and year in a locale-appropriate form, based on the set locale of the user's operating system, whereas the date ...
...we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively.
....queryselector('#year'); var monthselect = document.queryselector('#month'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'month'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the years dynamically // (the months are always the same, therefore hardcoded) populateyears(); } function populateyears() { // get the current year as a numbe...
...you'll need to take this into consideration when developing production apps.
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
on all <input> elements regardless of their type, telephone number inputs support the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options maxlength the maximum length, in utf-16 characters, to accept as a valid input minlength the minimum length that is considered valid for the field's contents pattern a regular expression the entered value must match to pass constraint validation placeholder an example value to display inside the field when it has no value readonly a boolean attribute which, if present, indicates that the field's contents should not be user-editable size the number of characters wide the...
... fortunately, you can consider the requirements of your own site and implement an appropriate level of validation yourself.
...a placeholder is a value that demonstrates the form the value should take by presenting an example of a valid value, which is displayed inside the edit box when the element's value is "".
...let's consider some options.
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
you can set a default value for the input by including a value inside the value attribute, like so: <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" value="2017-w01"> one thing to note is that the displayed format may differ from the actual value, which is always formatted yyyy-www.
...we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively.
...yselector('#year'); var weekselect = document.queryselector('#fallbackweek'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'week'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the weeks dynamically populateweeks(); } function populateweeks() { // populate the week select with 52 weeks for(var i = 1; i <= 52; i++) { var option = d...
...you'll need to take this into consideration when developing production apps.
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
alternatively, you can nest the <input> directly inside the <label>, in which case the for and id attributes are not needed because the association is implicit: <label>do you like peas?
...if there are other elements which also match the id value, later in the document, they are not considered.
... styling with css there are no special styling considerations for <label> elements — structurally they are simple inline elements, and so can be styled in much the same way as a <span> or <a> element.
... examples simple label example <label>click me <input type="text"></label> using the "for" attribute <label for="username">click me</label> <input type="text" id="username"> accessibility concerns interactive content don't place interactive elements such as anchors or buttons inside a label.
<th> - HTML: Hypertext Markup Language
WebHTMLElementth
values higher than 1000 will be considered as incorrect and will be set to the default value (1).
... justify (with text only): the content is stretched out inside the cell so that it covers its entire width.
... char (with text only): the content is aligned to a character inside the <th> element with minimal offset.
... valign obsolete since html5 this attribute specifies how a text is vertically aligned inside a cell.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
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.
... waiting playback has stopped because of a temporary lack of data usage notes browsers don't all support the same video formats; you can provide multiple sources inside nested <source> elements, and the browser will then use the first one it understands.
... there are no special considerations for styling <video>; a common strategy is to give it a display value of block to make it easier to position, size, etc., and then provide styling and layout information as required.
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
<dt> the html <dt> element specifies a term in a description or definition list, and as such must be used inside a <dl> element.
... <rtc> the html ruby text container (<rtc>) element embraces semantic annotations of characters presented in a ruby of <rb> elements used inside of <ruby> element.
... element description <slot> the html <slot> element—part of the web components technology suite—is a placeholder inside a web component that you can fill with your own markup, which lets you create separate dom trees and present them together.
... <content> the html <content> element—an obsolete part of the web components suite of technologies—was used inside of shadow dom as an insertion point, and wasn't meant to be used in ordinary html.
HTTP caching - HTTP
WebHTTPCaching
cache-control: private cache-control: public expiration the most important directive here is "max-age=<seconds>" which is the maximum amount of time a resource will be considered fresh.
...that way each new revision of this resource is considered as a resource on its own that never changes and that can have an expiration time very far in the future, usually one year or even more.
...it is considered weak because it only has 1-second resolution.
...when using the vary: user-agent header, caching servers should consider the user agent when deciding whether to serve the page from cache.
Equality comparisons and sameness - JavaScript
if the values have different types, the values are considered unequal.
... if the values have the same type, are not numbers, and have the same value, they're considered equal.
... finally, if both values are numbers, they're considered equal if they're both not nan and are the same value, or if one is +0 and one is -0.
... same-value-zero equality similar to same-value equality, but +0 and -0 are considered equal.
Control flow and error handling - JavaScript
if break is omitted, the program continues execution inside the switch statement (and will evaluate the next case, and so on).
... try { throw 'myexception'; // generates an exception } catch (err) { // statements to handle any exceptions logmyerrors(err); // pass exception object to error handler } best practice: when logging errors to the console inside a catch block, using console.error() rather than console.log() is advised for debugging.
... block has completed console.log(2); // not reachable } finally { console.log(3); return false; // overwrites the previous "return" console.log(4); // not reachable } // "return false" is executed now console.log(5); // not reachable } console.log(f()); // 0, 1, 3, false overwriting of return values by the finally block also applies to exceptions thrown or re-thrown inside of the catch block: function f() { try { throw 'bogus'; } catch(e) { console.log('caught inner "bogus"'); throw e; // this throw statement is suspended until // finally block has completed } finally { return false; // overwrites the previous "throw" } // "return false" is executed now } try { console.log(f()); } catch(e) { // this is never reached!
... // 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.
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
the javascript warning "javascript 1.6's for-each-in loops are deprecated; consider using es6 for-of instead" occurs when a for each (variable in obj) statement is used.
... message warning: javascript 1.6's for-each-in loops are deprecated; consider using es6 for-of instead error type warning what went wrong?
... deprecated syntax var object = { a: 10, b: 20 }; for each (var x in object) { console.log(x); // 10 // 20 } alternative standard syntax you can now use the standard for...in loop to iterate over specified object keys, and get each value inside the loop: var object = { a: 10, b: 20 }; for (var key in object) { var x = object[key]; console.log(x); // 10 // 20 } or, using for...of (es2015) and object.values (es2017), you can get an array of the specified object values and iterate over the array like this: var object = { a: 10, b: 20 }; for (var x of object.values(object)) { console.log(x); ...
... var object = { a: 10, b: 20 }; for each (var [key, value] in iterator(object)) { console.log(key, value); // "a", 10 // "b", 20 } alternative standard syntax you can now use the standard for...in loop to iterate over specified object keys, and get each value inside the loop: var object = { a: 10, b: 20 }; for (var key in object) { var value = object[key]; console.log(key, value); // "a", 10 // "b", 20 } or, using for...of (es2015) and object.entries (es2017), you can get an array of the specified object values and iterate over the array like this: var object = { a: 10, b: 20 }; for (var [key, value] of object.entries(...
Functions - JavaScript
here is an example of an anonymous function expression (the name is not used): var myfunction = function() { statements } it is also possible to provide a name inside the definition in order to create a named function expression: var myfunction = function namedfunction(){ statements } one of the benefits of creating a named function expression is that in case we encountered an error, the stack trace will contain the name of the function, making it easier to find the origin of the error.
... /* * declare and initialize a variable 'p' (global) * and a function 'myfunc' (to change the scope) inside which * declare a varible with same name 'p' (current) and * define three functions using three different ways:- * 1.
...ction foo() {} // function expression (function bar() {}) // function expression x = function hello() {} if (x) { // function expression function world() {} } // function declaration function a() { // function declaration function b() {} if (0) { // function expression function c() {} } } block-level functions in strict mode, starting with es2015, functions inside blocks are now scoped to that block.
... in non-strict code, function declarations inside blocks behave strangely.
eval() - JavaScript
in a related circumstance, what if you actually wanted your date() function to be able to be called from the code inside function().
...consider the following example where the property of the object to be accessed is not known until the code is executed.
... parsing json (converting strings to javascript objects) if the string you're calling eval() on contains data (for example, an array: "[1, 2, 3]"), as opposed to code, you should consider switching to json, which allows the string to use a subset of javascript syntax to represent data.
... run code with limited privileges if you must run the code, consider running it with reduced privileges.
async function - JavaScript
the await keyword is only valid inside async functions.
...if there is an await expression inside the function body, however, the async function will always complete asynchronously.
...consider the following code: function getprocesseddata(url) { return downloaddata(url) // returns a promise .catch(e => { return downloadfallbackdata(url) // returns a promise }) .then(v => { return processdatainworker(v) // returns a promise }) } it can be rewritten with a single async function as follows: async function getprocesseddata(url) { let v try { v ...
... consider the following rewrite of the above code.
JavaScript typed arrays - JavaScript
multiple views on the same data things start to get really interesting when you consider that you can create multiple views onto the same data.
...consider this: int16view[0] = 32; console.log('entry 0 in the 32-bit array is now ' + int32view[0]); the output from this is "entry 0 in the 32-bit array is now 32".
... consider this c structure: struct somestruct { unsigned long id; char username[16]; float amountdue; }; you can access a buffer containing data in this format like this: let buffer = new arraybuffer(24); // ...
...take precautions and considerations for these padding differences.
Image file type and format guide - Web media technologies
typically, modern content should use png for lossless and indexed still images, and should consider using apng for lossless animation sequences.
...if you use ico files, you should use the bmp format, as support for png inside ico files wasn't added until windows vista and may not be well supported.
...to maximize quality and minimize download time, consider providing both using a fallback with webp as the first choice and jpeg as the second.
... if the icon can be represented using vector graphics, consider svg, since it scales across various resolutions and sizes, so it's perfect for responsive design.
color-profile - SVG: Scalable Vector Graphics
this differs from auto in that it overrides an embedded profile inside an image.
...if a match is found, the corresponding profile overrides an embedded profile inside an image.
... if no match is found, then the embedded profile inside the image is used.
...the referenced color profile overrides an embedded profile inside the image.
Referer header: privacy and security concerns - Web security
for example, consider a "reset password" page with a social media link in a footer.
...this is becoming less useful in this context now that most of the web is using https, but it is still a worthy consideration.
... in addition, you should consider removing any third party content (e.g.
...you should enlist the help of a web security expert to write these requirements, and consider both user needs and welfare, as well as other issues like policy and regulation enforced by legislation such as the eu general data protection regulation (gdpr).
Using the WebAssembly JavaScript API - WebAssembly
add the following to your script, below the first block: webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(obj => obj.instance.exports.exported_func()); the net result of this is that we call our exported webassembly function exported_func, which in turn calls our imported javascript function imported_func, which logs the value provided inside the webassembly instance (42) to the console.
... memory in the low-level memory model of webassembly, memory is represented as a contiguous range of untyped bytes called linear memory that are read and written by load and store instructions inside the module.
... just like functions, linear memories can be defined inside a module or imported.
... to create a webassembly global instance from inside your javascript, you use the webassembly.global() constructor, which looks like this: const global = new webassembly.global({value:'i32', mutable:true}, 0); you can see that this takes two parameters: an object that contains two properties describing the global variable: value: its data type, which can be any data type accepted within webassembly modules — i32, i64, f32, or f64.
panel - Archive of obsolete content
for example, here's an add-on whose content script intercepts mouse clicks on links inside the panel, and sends the target url to the main add-on code.
...addon.port.on("show", function onshow() { textarea.focus(); }); finally, the html file now references "get-text.js" inside a <script> tag: <html> <head> <style type="text/css" media="all"> textarea { margin: 10px; } body { background-color: gray; } </style> </head> <body> <textarea rows="13" cols="33" id="edit-box"></textarea> <script src="get-text.js"></script> </body> </html> styling panel content the panel's default style is different for each oper...
... panel limitations although panels can host html documents, they are not implemented as browser tabs, so many things that work in normal web pages do not work inside panels: prior to firefox 33, you don't get a context menu.
core/promise - Archive of obsolete content
promises consider another approach, instead of continuation via callbacks, a function returns an object that represents a eventual result, either successful or failed.
...you can chain them using either inside or outside handlers.
...}); to see why this is, consider the parallel between promises and try/catch.
stylesheet/utils - Archive of obsolete content
parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet.
... parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet.
...the values considered valid are: "agent", "user" and "author".
Bootstrapped extensions - Archive of obsolete content
shutdown called when the extensidisableon needs to shut itself down, such as when the application is quitting or when the extension is about to be upgraded or disabled.
...inside this folder must be a property file.
... inside the chrome.manifest file these locale must be defined.
Downloading Files - Archive of obsolete content
var privacy = privatebrowsingutils.privacycontextfromwindow(urlsourcewindow); persist.persistflags = persist.persist_flags_from_cache | persist.persist_flags_replace_existing_files; persist.saveuri(uritosave, null, null, null, "", targetfile, privacy); if you don't need detailed progress information, you might be happier with nsidownloader.
...vepassword, pwd) { pwd.value = hardcodedpassword; return true; }, promptusernameandpassword: function(dialogtitle, text, passwordrealm, savepassword, user, pwd) { user.value = hardcodedusername; pwd.value = hardcodedpassword; return true; } }; persist.saveuri(urltosave, null, null, null, "", nsfileinstance, privacy); the above is going to give you errors about missing nsidownloadprogresslistener methods, so you should implement that as well.
...l && channel.responsestatus != 200) { return ""; } var bstream = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bstream.setinputstream(stream); var size = 0; var file_data = ""; while(size = bstream.available()) { file_data += bstream.readbytes(size); } return file_data; } see also nsidownloadprogresslistener saving an arbitrary url to a local file customizing the download progress bar appearance ...
Windows - Archive of obsolete content
you can get a dom window's id using the nsidomwindowutils attribute outerwindowid.
...this can be used in cases in which you need to uniquely identify a dom window during the duration of the application's lifespan: var util = win.queryinterface(components.interfaces.nsiinterfacerequestor).getinterface(components.interfaces.nsidomwindowutils); var windowid = util.outerwindowid; after running that code, windowid contains the outer window's unique id.
... similarly, you can get the current inner window id using the nsidomwindowutils attribute currentinnerwindowid: var util = win.queryinterface(components.interfaces.nsiinterfacerequestor).getinterface(components.interfaces.nsidomwindowutils); var windowid = util.currentinnerwindowid; programatically modifying html when attempting to modify html elements, it is important to specify the namespace.
Default Preferences - Archive of obsolete content
default preferences are set similarly but inside an extension and use the pref() function.
...you may not set variables inside of it, nor may do any kind of program flow control (ifs, loops etc.) nor even calculated values (i.e.
...inside your file you set preferences using the pref() function: pref("name", "value") example: pref('extensions.defaultprefs.example.int', 1); pref('extensions.defaultprefs.example.float', 0.1); pref('extensions.defaultprefs.example.string', 'fadf'); pref('extensions.defaultprefs.example.bool', true); notice that unlike when you're reading preferences, writing default preferences uses the same function no matter the data type of the preference.
How to convert an overlay extension to restartless - Archive of obsolete content
well, you should probably consider switching to be extractionless when you go restartless.
...see here for the list of stuff you can't have in addition to no resource:// uris or file:// uris to files inside your xpi.
...w) { /* call/move your ui construction function here */ } function unloadfromwindow(window) { /* call/move your ui tear down function here */ } function foreachopenwindow(todo) // apply a function to all open browser windows { var windows = services.wm.getenumerator("navigator:browser"); while (windows.hasmoreelements()) todo(windows.getnext().queryinterface(components.interfaces.nsidomwindow)); } var windowlistener = { onopenwindow: function(xulwindow) { var window = xulwindow.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); function onwindowload() { window.removeeventlistener("load",onwindowload); if (window.document.documentelem...
Chapter 1: Introduction to Extensions - Archive of obsolete content
what features are considered standard for web browsers these days?
...d for installing add-ons helps troubleshoot add-ons by disabling them and offering a safe mode confirms and runs updates provides access to add-ons' settings dialogs provides access to add-ons' support sites development environment amenities initially, there wasn't adequate documentation available, and extension developers were largely left to fend for themselves1; however, now there's a considerable store of knowledge.
... these are sophisticated extensions that can be considered full-scale applications in their own right, essentially using firefox as the development platform.
Intercepting Page Loads - Archive of obsolete content
few modern sites use framesets, but it is common for ads to appear inside iframe elements.
...make sure you access it from inside the state validation if condition.
... document loader service nsidocumentloader is nothing but a global web progress listener.
JavaScript Object Management - Archive of obsolete content
} // 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.
...if you have to use a reference to this inside the function, declare a variable called that that equals this, and use that in the anonymous function.
...all of the objects inside of it are exported as well, since they are members of the 〈modulenamespace〉 object.
Mozilla Documentation Roadmap - Archive of obsolete content
if you find it lacking or missing some piece of information, please consider adding it once you've found it.
...one way to do this is to look into your firefox installation directory, maybe unpack a few jars and see what's inside.
...here are some important feeds you should consider following: planet mozilla.
CSS3 - Archive of obsolete content
it consists mainly in allowing nested at-rules inside @media and the adding of a new css at-rule, @supports, and a new dom method css.supports().
... css multi-column layout module working draft adds support for easy multi-column layouts using the css columns, column-count, column-fill, column-gap, column-rule, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, break-after, break-before, and break-inside.
... the image-orientation property by adding the keyword from-image, allowing to follow exif data stored into images to be considered.
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
the first one looks like a traditional dhtml ticker application and uses hidden iframes and javascript to provide updates inside the webpage's ticker headlines section.
...another approach is to request an html page in the iframe and inside this page (requested data), set the onload event to callback a function notifying the parent document (originator).
...here, iframecallback is considered the data binder, so it is responsible for getting the content from the iframe and putting it in the proper repository in the page's context.
Working with BFCache - Archive of obsolete content
q: when a user clicks a link that replaces the view in the current tab with a new page, what is the fate of the nsidomwindow supporting the view they click on?
...a: the outer nsidomwindow (the |window| object in content js, aka the <browser>'s contentwindow object in the parent document) stays right where it is.
...the inner nsidomwindow (the global scope object in content js) is either thrown away when gc happens, or frozen and placed in the bfcache.
Autodial for Windows NT - Archive of obsolete content
essentially, if some address at domain.com is in the database, then any address at domain.com is considered to be in the database.
... also, if any address that starts with www is in the database, then any other address that begins with www is considered to be in the database.
...if an address can't be reached, we trigger the autodial features from inside mozilla.
Editor Embedding Guide - Archive of obsolete content
in the beginning there is makeeditable given an nsiwebbrowser instance, get an nsidomwindow from the getcontentdomwindow call.
...the first parameter is the nsidomwindow you just retrieved, the second is the editor type you want to create, and the third is whether you want the window editable immediately or when the document is done loading.
...the above strings should be considered examples of base functionality and in no way imply that this command won't handle other fonts.
Embedding FAQ - Archive of obsolete content
you can find more information on adding new protocols here how to embedding mozilla inside of java there hasn't been any good code examples found.
...here is the code : import org.eclipse.swt.swt; import org.eclipse.swt.browser.mozillabrowser; import org.eclipse.swt.browser.progressevent; import org.eclipse.swt.browser.progresslistener; import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.shell; import org.mozilla.xpcom.nsidomdocument; public class test { public static void main(string args[]) { display display = new display(); shell shell = new shell(display); final mozillabrowser browser = new mozillabrowser(shell,wt.border); browser.seturl("http://www.google.com"); browser.addprogresslistener(new progresslistener() { ...
... public void changed(progressevent event) { } public void completed(progressevent event) { nsidomdocument doc = browser.getdocument(); system.out.println(doc); } }); while (!shell.isdisposed()) { if (!display.readanddispatch()) { display.sleep(); } } } how to map a javascript function to a c++ function define an xpcom class defining the function you'll be doing in javascript.
Modularization techniques - Archive of obsolete content
this mechanism can be used both inside an executable at run-time and externally using the apersist flag to tell the repository to store the class id/library relationship in its permenant store.
...for those who like gory details, their structure is this: struct nsid { pruint32 m0; pruint16 m1, m2; pruint8 m3[8]; }; frequently you see them represented as strings, like this: {221ffe10-ae3c-11d1-b66c-00805f8a2676} to initialize an id struct you declare them like this: id = {0x221ffe10, 0xae3c, 0x11d1, {0xb6, 0x6c, 0x00, 0x80, 0x5f, 0x8a, 0x26, 0x76}}; why the b66c couplet gets broken up and grouped with the last set of bytes is probably a footnote somewhere.
...the implementation takes into consideration two things when deciding whether or not a dll can be unloaded: whether any of its factories are currently in use, and whether anyone has locked the server.
Prism - Archive of obsolete content
javascript api: an api that can be used by scripts inside the bundle to customize the application.
... firefox extension: a firefox extension, code-named "refractor", can be used to spin out new prism apps from inside the web browser.
... refractor adds a new menu item to call up the shortcut creation dialog for inside firefox.
The Download Manager schema - Archive of obsolete content
this information is available using nsidownloadmanager methods to retrieve nsidownload objects for each download entry; however, if you feel like poking directly into the table, you can do so using the storage api.
...see the constants list in the nsidownloadmanager documentation.
... see also nsidownloadmanager nsidownloadmanagerui nsidownloadprogresslistener ...
The life of an HTML HTTP request - Archive of obsolete content
now the channel knows the content type of the incoming data, so the documentloader can find an nsidocumentloaderfactory for the "text/html" content type (in this case an nslayoutdlf).
...in most cases (including this) it also creates a nsidocument (nshtmldocument) and binds it to the contentviewer.
... (7) since the presentation shell (nspresshell) has registred as an documentobserver with the nsidocument it also gets notified of changes in the document/content tree.
DOM Interfaces - Archive of obsolete content
the nsidomdocumentxbl interface the nsidomdocumentxbl interface contains methods for manipulating xbl bindings.
... idl definition interface nsidomdocumentxbl { nodelist getanonymousnodes(in element elt); element getanonymouselementbyattribute(in element elt, in domstring attrname, in domstring attrvalue); element getbindingparent(in node node); void loadbindingdocument(in domstring documenturl); }; methods getanonymousnodes the getanonymousnodes method retrieves the anonymous children of the specified element.
... if (element.ownerdocument instanceof ci.nsidomdocumentxbl) { var anonchildren = element.ownerdocument.getanonymousnodes(element); if (anonchildren) { for (var i = 0; i < anonchildren.length; i++) { if (anonchildren[i].nodetype == 1) return false; } } } return true; ...
tag - Archive of obsolete content
ArchiveMozillaXULPropertytag
if set, the conditions will only match if the template builder is parsing content for an element directly inside this tag.
... for example, by using a value of treechildren, the condition will only match when placing elements directly inside a treechildren tag.
... thus, nested elements will not match because they are directly inside a treeitem.
Additional Template Attributes - Archive of obsolete content
« previousnext » referencing templates all the templates used so far have had the template placed inside the root element with the datasources attribute.
...the generated content is always inserted into the root node, in this example the listbox, not inside the template.
...the container or starting node variable is specified in the <content> tag inside a query, while the member variable is determined by the value of the uri attribute inside the action body.
Building Hierarchical Trees - Archive of obsolete content
the tree builder creates rows lazily, so a closed container will not have any data generated inside in it until the row is opened.
...similarly, when the user closes a tree row, the rows inside it are removed, such that they will have to be generated again the next time the row is opened.
... if you want to put rows inside the photo rows, you will either need to make each photo resource a container (for this rdf datasource, this will usually be an rdf seq), or use the containment attribute to specify additional properties that indicate containership.
The Joy of XUL - Archive of obsolete content
considering the broad range of platforms that currently support mozilla, this may be one of the most compelling features of xul as a technology for building applications.
... porting xul applications to other platforms is trivial.the calendar originated as a linux application with no consideration given to porting it to other platforms.
... whether you need to migrate an existing web application to the desktop, are looking for a technology that will enable you to easily port your applications to multiple platforms, or want to integrate your own cool features into the browser, xul warrants serious consideration.
Complete - Archive of obsolete content
install.js installation script for seamonkey chrome directory containing the extension code chrome/allcustom.jar the extension jar defaults/preferences directory containing a preferences file inside the jar there are three directories: content xul, javascript and other content that does not depend on the locale or theme locale files for each locale skin files for each theme version checks firefox etc.
...this is how it happens: for example, if your locale is fr-fr, it loads: locale/fr-fr/allcustom/allcustom.dtd from inside the jar file.
...for example, if you are using modern, it loads: skin/modern/allcustom/seamonkey/allcustom.css from inside the jar.
Adding Properties to XBL-defined Elements - Archive of obsolete content
in this example, no content has been placed inside either the xul box or its definition in xbl, which is perfectly valid.
...actually, you can instead place a script inside the field tag that evaluates to the default value.
...this is done in the code inside the setter element.
Document Object Model - Archive of obsolete content
the window object isn't defined by any dom specification, but in mozilla is sometimes considered part of dom level 0, a name used by some developers to refer to the dom-like functions before they were added to specifications.
...the script tag does allow code to be contained directly inside of it.
... the children are the child tags of the element and will be nested inside the element in the source.
Groupboxes - Archive of obsolete content
more complex captions you can also add child elements inside the caption element to create a more complex caption.
...you can put any element you want inside it, and apart from its special handling of radio buttons, it works like any other box.
... any radio buttons placed inside the radio group will be grouped together, even if they are inside nested boxes.
More Tree Features - Archive of obsolete content
to create a set of nested rows, all we need to do is add a second treechildren element inside the parent treeitem.
... you can then add items inside that to specify the child rows of an item.
... don't put the inner treechildren element inside the treerow as this won't work.
Simple Menu Bars - Archive of obsolete content
the menu bar can optionally be placed inside a toolbox and the menu would work just like any other toolbar.
...the size of the popup will be large enough to fit the commands inside it.
...note that it has been placed inside a flexible toolbox.
Stacks and Decks - Archive of obsolete content
however, the specialized types of boxes work just like regular boxes in the way they orient the elements inside them, but they have additional features.
...the third page is a box with two elements inside it.
... both the box and the elements inside it make up the page.
Tabboxes - Archive of obsolete content
shown below is the general syntax of a tabbox: <tabbox id="tablist"> <tabs> <!-- tab elements go here --> </tabs> <tabpanels> <!-- tabpanel elements go here --> </tabpanels> </tabbox> the tab elements are placed inside a tabs element, which is much like a regular box.
... the tabs element itself has been placed inside a tabbox.
... the contents of the individual tab pages should go inside each tabpanel element.
XUL FAQ - Archive of obsolete content
are there any elements inside the <prefwindow>, before the <prefpane>s?
...(the animation effect when you open the preference window will not stop, if a script outside <prefpane> refers any element inside <prefpane>, while initializing the window.
... if you want to access elements inside <prefpane>, you should put script in the <prefpane> or write script into "onpaneload" of the <prefpane>.) note, that prefwindow only works in chrome xul.
XUL Questions and Answers - Archive of obsolete content
how to add and remove values to/from, set up inside a <prefwindow> container to handle the preference?
... see also http://developer.mozilla.org/en/docs...in_chrome_code how can i include a .js document from inside a javascript document?
... with mozilla trunk --------------------------------------------------------- nsidomcanvasrenderingcontext2d* c2d = //coming from <canvas> nsidomwindow* window = //coming from <iframe> c2d->drawwindow( window, ..., "rgba(0,0,0,0)"); --------------------------------------------------------- this makes canvas background transparent if background is transparent but when "window" is coming from top level content window, background is not transparent.
XUL element attributes - Archive of obsolete content
if this attribute is not specified, there should be a template element directly inside the node.
...if this attribute is set to '_child', the first tooltip child element inside the element is used.
... elements that appear inside the element with the attribute will be repeated for each node in the rdf datasource.
XUL accessibility guidelines - Archive of obsolete content
consider using context menu items or other xul elements along with keyboard shortcuts.
...describe keyboard shortcuts and any other accessibility considerations.
...these include language-neutral guidelines and also refer to techniques for xhtml, which is relevant for xul, as html can also be included inside of xul by use of the xhtml namespace.
colorpicker - Archive of obsolete content
this attribute only has any effect when used inside a prefwindow.
... type type: string if this attribute is not present, the colorpicker is displayed inside the window.
...s(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement bugs the onchange event only fires if attribute type is set to "button".
content - Archive of obsolete content
if set, the conditions will only match if the template builder is parsing content for an element directly inside this tag.
... for example, by using a value of treechildren, the condition will only match when placing elements directly inside a treechildren tag.
... thus, nested elements will not match because they are directly inside a treeitem.
menulist - Archive of obsolete content
to create the drop-down, put a menupopup inside the menulist containing the choices as menuitem elements.
...this attribute only has any effect when used inside a prefwindow.
... related elements menu, menubar, menuitem, menupopup, menuseparator interfaces nsiaccessibleprovider, nsidomxulmenulistelement ...
splitter - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element which should appear before or after an element inside a container.
...if a grippy is placed inside the splitter, one sibling element of the splitter is collapsed when the grippy is clicked.
...you should put a grippy element inside the splitter when it is used for collapsing.
toolbarbutton - Archive of obsolete content
constants for the possible values for this attribute are in the nsidomxulbuttonelement interface.
...place a menupopup element inside the button in this case.
...removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider, nsidomxulbuttonelement ...
toolbox - Archive of obsolete content
if a toolbar is placed inside a toolbox, a grippy is displayed on its left or upper edge.
...ymaster/gatekeeper/there.is.only.xul" title="toolbox example" width="300"> <toolbox> <toolbar> <toolbarbutton label="back"/> <toolbarbutton label="forward"/> <toolbarbutton label="home"/> </toolbar> <toolbar> <toolbarbutton label="stop"/> <toolbarbutton label="reload"/> </toolbar> </toolbox> <textbox multiline="true" value="we have two toolbars inside of one toolbox above." width="20"/> </window> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, o...
... externaltoolbars type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
Deploying XULRunner - Archive of obsolete content
copy xulrunner/ to this directory when deploying with xulrunner 2.0 and above do the following: move chrome.manifest to the root directory, and adjust resource paths inside chrome.manifest accordingly with xulrunner 9.0 or 10.0 you may need to copy "mozutils.dll" and/or "mozcrt19.dll" from the xulrunner directory to the root directory.
... xulrunner 39 and later due to mac os x code signing rules and how they interact with the design of xulrunner (see bug 1105044 for the inside scoop), starting with xulrunner 39 the xulrunner library files are no longer able to reside in a xulrunner framework directory.
...you should copy this file from /library/frameworks/xul.framework/versions/1.8/xulrunner.) when deploying with xulrunner 2.0, move chrome.manifest to the root directory, and adjust resource paths inside chrome.manifest accordingly.
Archived Mozilla and build documentation - Archive of obsolete content
in addition, you can augment or replace the download manager's user interface by implementing the new nsidownloadmanagerui interface.
... help viewer help viewer: allows information to be shown to the user inside mozilla.
...the only downside is you can't specify how much of the resource to use, only which one to consume.
Mozilla release FAQ - Archive of obsolete content
take this into consideration when posting things) ftp see the mozilla ftp mirror section for ftp sites under which license terms was mozilla released?
...for these reasons, this is generally considered a bad idea.
...i would suggest that before you devote much time and effort to your port, you consider: how many users the os has that are likely to use mozilla does the os support multitasking well enough for mozilla does the os have a sufficiently evolved gui for mozilla to work does the os have sufficient networking support for mozilla is the os typically run on systems that have the resources to run mozilla does gcc or some other easily available compiler exist for the target platform if many of these answers are no, then there will be large issues that will hamper the port.
Building a Theme - Archive of obsolete content
inside your new theme folder, create two new empty text files, one called chrome.manifest and the other called install.rdf.
... create the install manifest open the file called install.rdf that you created at the top of your extension's folder hierarchy and put this inside: <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>sample@example.net</em:id> <em:version>1.0</em:version> <em:type>4</em:type> <!-- target application this theme can install into, with minimum and maximum supported versions.
... create a new text file and put the full path to your development folder inside (e.g.
LiveConnect Overview - Archive of obsolete content
(although this functionality (along with some others) had been broken in gecko 1.9 (see bug 391642) as the mozilla-specific liveconnect code had not been maintained inside mozilla, with java 6 update 11 and 12 building support for reliance on mozilla's implementation of the generic (and cross-browser) npapi plugin code, this has again been fixed.) for example, suppose you are using the java forname method to assign the name of a java class to a variable called theclass.
...also, any time you use javascript objects in your java code, you should put the call to the javascript object inside a try...catch statement which handles exceptions of type netscape.javascript.jsexception.
...note: a more realistic example would place the call to getmember inside a try...catch statement to handle errors of type jsexception.
Index - Game development
16 building up a basic demo with a-frame 3d, a-frame, vr, virtual reality, web, webgl the webxr and webgl apis already enable us to start creating virtual reality (vr) experiences inside web browsers, but the community is still waiting for tools and libraries to appear, to make this easier.
... 50 initialize the framework 2d, beginner, canvas, games, html, javascript, phaser, tutorial before we can start writing the game's functionality, we need to create a basic structure to render the game inside.
... 63 create the canvas and draw on it 2d, beginner, canvas, games, html, javascript, tutorial before we can start writing the game's functionality, we need to create a basic structure to render the game inside.
Building up a basic demo with Babylon.js - Game development
saving a copy of the latest babylon.js engine inside your directory.
...to show actual animation, we need to make changes to these values inside the rendering loop at the end of our code, so they are updated on every frame.
... define a helper variable — t — that we will use for animations, just before the renderloop, and decrement it on every frame inside the loop, like this: var t = 0; var renderloop = function () { scene.render(); t -= 0.01; // animation code goes here }; engine.runrenderloop(renderloop); the t variable will be incremented on every rendered frame.
Building up a basic demo with the PlayCanvas engine - Game development
saving a copy of the latest playcanvas engine inside your directory.
...to show actual animation, we need to make changes to these values inside the rendering loop, so they are updated on every frame.
...add this line of code inside the app.on("update") callback function, right after the addition of the deltatime to the timer variable: box.rotate(deltatime*10, deltatime*20, deltatime*30); it will rotate the box by deltatime*10 on the x axis, deltatime*20 on the y axis and deltatime*30 on the z axis, on very frame — giving us a smooth animation.
Implementing controls using the Gamepad API - Game development
the gamepad api achieves this by providing an interface exposing button presses and axis changes that can be used inside javascript code to handle the input.
...update() is executed on every frame inside the game loop, to update the actual status of the gamepad object regularly: update: function() { // clear the buttons cache gamepadapi.buttonscache = []; // move the buttons status from the previous frame to the cache for(var k=0; k<gamepadapi.buttonsstatus.length; k++) { gamepadapi.buttonscache[k] = gamepadapi.buttonsstatus[k]; } // clear the buttons status gamepadapi.buttons...
...ess if(!hold) { // loop through the cached states from the previous frame for(var j=0,p=gamepadapi.buttonscache.length; j<p; j++) { // if the button was already pressed, ignore new press if(gamepadapi.buttonscache[j] == button) { newpress = false; } } } } } return newpress; }, there are two types of action to consider for a button: a single press and a hold.
Animations and tweens - Game development
applying the animation when the ball hits the paddle in the arcade.collide() method call that handles the collision between the ball and the paddle (the first line inside update(), see below) we can add an extra parameter that specifies a function to be executed every time the collision happens, in the same fashion as the ballhitbrick() function.
... update the first line inside update() as shown 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.
...you can add the animations.play() call inside the ballhitbrick() function too, if you feel it would make the game look better.
Load the assets and print them on screen - Game development
add the following new line just inside the preload() function, at the bottom: function preload() { // ...
...grab the ball image from github, and save it inside an /img directory in the same place as your index.html file.
... now, to show it on the screen we will use another phaser method called add.sprite(); add the following new code line inside the create() function as shown: function create() { ball = game.add.sprite(50, 50, 'ball'); } this will add the ball to the game and render it on the screen.
Call stack - MDN Web Docs Glossary: Definitions of Web-related terms
call stack list: - greeting execute all lines of code inside the greeting() function.
... call stack list: - sayhi - greeting execute all lines of code inside the sayhi() function, until reaches its end.
... call stack list: - greeting when everything inside the greeting() function has been executed, return to its invoking line to continue executing the rest of the js code.
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
it correctly finds our variable instantiated with our first statement after finding it, the expression is evaluated, foo is replaced by 5 and the javascript engine passes that value to the functions as an argument before executing the statements inside the functions' bodies, javascript takes a copy of the originally passed argument (which is a primitive) and creates a local copy.
... these copies, existing only inside the functions' scopes, are accessible via the identifiers we specified in the functions' definitions (num for addtwo, foo for addtwo_v2) then, the functions' statements are executed: in the first function, a local num variable had been created.
...(note that window.foo could still be used to access the external foo variable.) in conclusion, any changes inside our functions won't affect the original foo at all, as we are modifying copies of it that's why primitives are immutable - instead of changing them directly, we're modifying a copy, without affecting the original.
Fundamental CSS comprehension - Learn web development
above the two rules, add a css comment with some text inside it to indicate that this is a set of general styles for the overall page.
... write a ruleset that gives the <p> inside the footer an effective font size of 15px (but expressed in ems) and an appropriate line height to place it in the center of the footer's content box.
... as a last little touch, give the paragraph inside the <article> an appropriate padding value so that its left edge lines up with the <h2> and footer paragraph, and set its color to be fairly light so it is easy to read.
Images, media, and form elements - Learn web development
if you place an image inside a box that is smaller or larger than the intrinsic dimensions of the image file in either direction, it will either appear smaller than the box, or overflow the box.
... you can make other choices about images inside containers.
... if we use contain as a value the image will be scaled down until it is small enough to fit inside the box.
Sizing items in CSS - Learn web development
in the example above, try adding some text inside the empty element.
...as we discovered in our previous lesson on overflow, a set height can cause content to overflow if there is more content than the element has space to fit inside it.
...in the case of a box inside another container, if you give the child box a percentage width it will be a percentage of the width of the parent container.
Normal Flow - Learn web development
you can't set width or height on inline elements — they just sit inside the content of block level elements.
...the normal layout flow (mentioned in the layout introduction article) is the system by which elements are placed inside the browser's viewport.
... inline elements behave differently — they don't appear on new lines; instead, they sit on the same line as one another and any adjacent (or wrapped) text content, as long as there is space for them to do so inside the width of the parent block level element.
Responsive design - Learn web development
flexible layout before responsive design a number of approaches were developed to try to solve the downsides of the liquid or fixed-width methods of building websites.
...this is still an approach used today, and in most stylesheets, you will find the following css somewhere: img { max-width: 100%; } there are obvious downsides to this approach.
...consider the sites that you visit on your phone — it is probably fairly unusual to come across a site that is the desktop version scaled down, or where you need to scroll sideways to find things.
How can we design for all types of users? - Learn web development
summary when you're building a website, one top issue to consider is universal design: accommodating all users regardless of disability, technical constraints, culture, location, and so on.
...if no parent can be found, the default font size within the browser is considered as the base size for the calculation (usually the equivalent of 16 pixels).
...let's consider this html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>font size experiment</title> </head> <body> <div class="container"> <h1>this is our main heading <span class="subheading">this is our subheading</span> </h1> <p>[lengthly text that spans many lines]</p> </div> </body> </html> we have a div with class container.
HTML forms in legacy browsers - Learn web development
for that reason, it's considered best practice to work with "unobtrusive" javascript.
... conclusion as you can see, considering browser and operating system default form control appearance is important.
...the basic premise is to consider whether altering the default implemenation is worth the work before embarking on the challenge.
Your first form - Learn web development
from a ux point of view, this is considered bad practice, so you should avoid using this type of button unless you really have a good reason to include one.
... first of all, add a <style> element to your page, inside your html head.
... it should look like so: <style> </style> inside the style tags, add the following css: form { /* center the form on the page */ margin: 0 auto; width: 400px; /* form outline */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } ul { list-style: none; padding: 0; margin: 0; } form li + li { margin-top: 1em; } label { /* uniform size & alignment */ display: inline-block; width: 90px; text-align: right; } input, textarea { /* to make sure that all text fields have the same font settings by default, textareas have a monospace font */ font: 1em sans-serif; /* uniform text field size */ width: 300px; box-sizing: border-box; /* match form field borders */ border: 1px solid #999; } input:focus, textarea:focus { /* additional highl...
Tips for authoring fast-loading HTML pages - Learn web development
tables are still considered valid markup but should be used for displaying tabular data.
...consider compressing your images before adding them to your page, using compression features built into image-manipulation tools such as photoshop, or using a specialized tool such as compress jpeg or tiny png,.
... ideally, your basic minimum requirements should be based on the consideration of modern browsers that support the relevant standards.
Debugging HTML - Learn web development
"consider adding a lang attribute to the html start tag to declare the language of this document.": this is not an error but a warning.
... "end of file reached when inside an attribute value.
... ignoring tag": this one is rather cryptic; it refers to the fact that there is an attribute value not properly formed somewhere, possibly near the end of the file because the end of the file appears inside the attribute value.
Marking up a letter - Learn web development
put the two addresses inside <address> elements.
... the provided css should be included inside an appropriate tag.
... you just need to put the provided css inside an html element.
What’s in the head? Metadata in HTML - Learn web development
browsers will support favicons in more common formats like .gif or .png, but using the ico format will ensure it works as far back as internet explorer 6.) adding the following line into your html's <head> block to reference it: <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> here is an example of a favicon in a bookmarks panel: there are lots of other icon types to consider these days as well.
... the <link> element should always go inside the head of your document.
...instead of pointing to an external script file, you can also choose to put your script inside the <script> element.
Adding vector graphics to the Web - Learn web development
you can make the image into a hyperlink easily by nesting the <img> inside an <a> element.
... how to include svg code inside your html you can also open up the svg file in a text editor, copy the svg code, and paste it into your html document — this is sometimes called putting your svg inline, or inlining svg.
...ser code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; summary this article has provided you with a quick tour of what vector graphics and svg are, why they are useful to know about, and how to include svg inside your webpages.
Responsive images - Learn web development
the header image will likely span the whole of the width of the header, and the content image will fit somewhere inside the content column.
... the content images have been set so that if the body element becomes smaller than the image, the images start to shrink so that they always stay inside the body, rather than overflowing it.
...you can supply mime types inside type attributes so the browser can immediately reject unsupported file types: <picture> <source type="image/svg+xml" srcset="pyramid.svg"> <source type="image/webp" srcset="pyramid.webp"> <img src="pyramid.png" alt="regular pyramid built from four equilateral triangles"> </picture> do not use the media attribute, unless you also need art direction.
Test your skills: Strings - Learn web development
you already have half of a famous quote inside a variable called quotestart; we would like you to: look up the other half of the quote, and add it to the example inside a variable called quoteend.
...save the result inside a variable called finalquote.
...do the calculation inside the placeholder.
Adding features to our bouncing balls demo - Learn web development
if the online editor you are using doesn't have separate javascript/css panels, feel free to put them inline <script>/<style> elements inside the html page.
... inside the if() statements, if the tests return true we don't want to update velx/vely; we want to instead change the value of x/y so the evil circle is bounced back onto the screen slightly.
...the following code block should be put inside the method definition: let _this = this; window.onkeydown = function(e) { if (e.key === 'a') { _this.x -= _this.velx; } else if (e.key === 'd') { _this.x += _this.velx; } else if (e.key === 'w') { _this.y -= _this.vely; } else if (e.key === 's') { _this.y += _this.vely; } } so when a key is pressed, the event object's keycode property is consulted to see which key is pressed.
Object building practice - Learn web development
immediately inside the for loop, we use an if statement to check whether the current ball being looped through is the same ball as the one we are currently checking.
...to negate the check, so that the code inside the if statement only runs if they are not the same.
... if a collision is detected, the code inside the inner if statement is run.
Test your skills: JSON - Learn web development
the values of these variables are then printed to the screen inside paragraphs.
... some hints/questions: the json data is provided as text inside the displaycatinfo() function.
... why are the para1.textcontent = motherinfo; and para2.textcontent = kitteninfo; lines inside the displaycatinfo() function, and not at the end of the script?
Multimedia: Images - Learn web development
you need to be considerate of data usage.
... you also need to be considerate of memory as many mobile devices have limited ram.
...which is why you could consider offering your images in that flavor, too, for the browsers that support it.
The "why" of web performance - Learn web development
in a sense, web performance can be considered a subset of web accessibility.
... with performance as with accessibility, you consider what device a site visitor is using to access the site and the device connection speed.
... as an example, consider the loading experience of cnn.com, which at the time of this writing had over 400 http requests with a file size of over 22.6mb.
Getting started with Ember - Learn web development
this creates a new directory inside the current directory you are in called todomvc, containing the scaffolding for a new ember app.
... now run the following command to place the common todomvc css inside your app: npm install --save-dev todomvc-app-css todomvc-common next, find the ember-cli-build.js file inside the todomvc directory (it's right there inside the root) and open it in your chosen code editor.
... starting the development server you may start the app in development mode by typing the following command in your terminal, while inside the todomvc directory: ember server this should give you an output similar to the following: build successful (190ms) – serving on http://localhost:4200/ slowest nodes (totaltime >= 5%) | total (avg) -----------------------------------------+----------- broccolimergetrees (17) | 35ms (2 ms) package /assets/vendor.js (1) | 13ms concat: vendor styles/asse...
Routing in Ember - Learn web development
to do this you’ll need to enter the following commands into your terminal, inside the root directory of your app: ember generate route index ember generate route completed ember generate route active the second and third commands should have not only generated new files, but also updated an existing file, app/router.js.
...the location in the page where <todolist /> is rendered is determined by the {{ outlet }} inside the parent route, which in this case is application.hbs.
... updating the todos display inside todolist one small final thing that we need to fix is that previously, inside todomvc/app/components/todo-list.hbs, we were accessing the todo-data service directly and looping over all todos, as shown here: {{#each this.todos.all as |todo| }} since we now want to have our todolist component show a filtered list, we'll want to pass an argument to the todolist component representing the "curre...
Componentizing our React app - Learn web development
go back to src/app.js, copy the first <li> from inside the unordered list, and paste it into todo.js so that it reads like this: export default function todo() { return ( <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> </div> <div classname="btn-group"> <b...
... copy the <form> tags and everything between them from inside app.js, and paste them inside form()’s return statement.
... </label> </h2> <input type="text" id="new-todo-input" classname="input input__lg" name="text" autocomplete="off" /> <button type="submit" classname="btn btn__primary btn__lg"> add </button> </form> ); } export default form; the <filterbutton /> do the same things you did to create form.js inside filterbutton.js, but call the component filterbutton() and copy the html for the first button inside the <div> element with the class of filters from app.js into the return statement.
Understanding client-side JavaScript frameworks - Learn web development
along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props and saving data state.
...in this article we'll look at adding a set of todo item data to our app.vue component, which we'll then loop through and display inside todoitem components using the v-for directive.
...adding a new todo form: vue events, methods, and models we now have sample data in place and a loop that takes each bit of data and renders it inside a todoitem in our app.
Implementing feature detection - Learn web development
note how the javascript representations of those properties that are stored inside the htmlelement.style object use lower camel case, not hyphens, to separate the words.
...this is a property that allows you to run media query tests inside javascript.
... finally, add another <script> element at the bottom of the html body (just before the </body> tag), and put the following script inside the tags: if (modernizr.geolocation) { navigator.geolocation.getcurrentposition(function(position) { let latlng = new google.maps.latlng(position.coords.latitude,position.coords.longitude); let myoptions = { zoom: 8, center: latlng, maptypeid: google.maps.maptypeid.terrain, disabledefaultui: true } let map = new google.maps.map(document.getelementbyi...
Handling common HTML and CSS problems - Learn web development
if you have a widget, make sure it has a distinct class, and then start the selectors that select elements inside the widget with this class, so conflicts are less likely.
... for example, in the firefox dev tools, you get this kind of output at the bottom of the dom inspector: if for example you were trying to use this selector, you'd be able to see that it wouldn't select the input element as desired: form > #date (the date form input isn't directly inside the <form>; you'd be better off using a general descendant selector instead of a child selector).
...it is really easy and convenient to use, although it does have some downsides (see the link above for details), and it is arguable that parsing every stylesheet in your site and add prefixes at run time can be a drain on the computer's processing power for a large site.
Accessibility API cross-reference
for an index, use <index> with a <l>(list) inside.
...in aria, used to nest browsable rich text content inside interactive content document n/a n/a document document a drop down list, different from combobox droplist n/a n/a listbox for math & chemistry equation n/a n/a math a scrollable list of articles where scrolling may cause articles to be added to or removed from either end of the list.
... n/a n/a canvas n/a <canvas> (accessible alternative richtext content may be nested inside, but the canvas itself is presentational) a dialog for picking a color n/a color_chooser color_chooser n/a <input type=color> a dialog for picking a file n/a file_chooser file_chooser n/a invoked with <input type=file> no explanation given n/a n/a invalid n/a contains acc...
Adding a new event
create xpcom interface for the dom event if your event class should be accessible via xpcom interface, you should create a new nsidomfooevent interface in dom/interfaces/events/.
...if all information of the event is stored by its internal event, c++ event handlers can access them with following code: ns_imethodimp aneventlistener::handleevent(nsidomevent* aevent) { internalfooevent* internalevent = aevent->getinternalnsevent()->asfooevent(); if (ns_warn_if(!internalevent)) { return ns_error_unexpected; } dosomethingwith(internalevent->mbar); aevent->preventdefault(); return ns_ok; } implement dom event class generate dom event implementation if it's possible if you're creating simple dom event class, it might be generated automatically.
... in nsidomevent.idl, you need to define ns_newdomfooevent().
Debugging Table Reflow
block reflow another way to debug the reflow process is implemented inside nsblockframe.cpp.
...ow the available options are: reflow really-noisy-reflow max-element-size space-manager verify-lines damage-repair lame-paint-metrics lame-reflow-metrics disable-resize-opt these options can be combined with a comma separated list messages generated by the reflow switch: block(div)(1)@00be5ac4: reflowing dirty lines computedwidth=9000 computedheight=1500 this message is generated inside of nsresult nsblockframe::reflowdirtylines(nsblockreflowstate& astate) it first shows the block id and address and then the computed width and height from the htmlreflowstate.
...th + padding due to col spans #define fix_adj 5 // fixed width + padding due to col spans #define pct 6 // percent width of cell or col #define pct_adj 7 // percent width of cell or col from percent colspan #define min_pro 8 // desired width due to proportional <col>s or cols attribute #define final 9 // width after the table has been balanced, considering all of the others in the last log snippet none of these width's has been set.
Debugging on Mac OS X
if you try to do that then xcode will simply copy the source files under the project directory rather than link to them (still the case in xcode 10?) which breaks debugging and the possibility to modify-rebuild-relaunch from inside xcode.
...the .app file is typically found inside the dist folder in your build directory.
...set the executable by clicking on the "executable" drop-down, and selecting the plugin-container.app that is inside the app bundle of the copy of firefox you want to debug.
Reviewer Checklist
make sure the patch doesn't create any unused code (e.g., remove strings when removing a feature) all caught exceptions should be logged at the appropriate level, bearing in mind personally identifiable information, but also considering the expense of computing and recording log output.
... if working on a new feature, consider adding prefs to control the behavior.
... consider adding prefs to disable the feature entirely in case bugs are found later in the release cycle.
SVG Guidelines
for example, consider an image of a path with a gradient fill.
...consider an image that involves some complex gradients and filters.
...most of time, cdata isn't needed, for example, the content in <style> tags doesn't need to be wrapped in a cdata section as the content inside the tag is already correctly parsed as css.
Error codes returned by Mozilla APIs
xxx currently unused - consider removing.
...xxx currently unused - consider removing.
...(0x80540008) ns_error_wont_handle_content (0x805d0001) moz_error_storage_error (0x80630001) ns_error_schemavalidator_no_schema_loaded (0x80640001) ns_error_schemavalidator_no_dom_node_specified (0x80640002) ns_error_schemavalidator_no_type_found (0x80640003) ns_error_schemavalidator_type_not_found (0x80640004) note: there are other errors in these files: gfx/public/nsidevicecontext.h base/public/nsneterror.h parser/htmlparser/public/nsiparser.h layout/base/nslayouterrors.h profile/public/nsiprofileinternal.idl security/manager/ssl/public/nsicmsmessageerrors.idl directory/xpcom/base/public/nsildaperrors.idl content/base/public/nscontenterrors.h see also mozilla error lookup lets you quickly look up the error name by its code in different formats.
Limitations of frame scripts
for example: nsisessionstore nsiwindowmediator <need more examples> places api the places api can't be used inside a frame script.
...it looks something like this: window.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindow); this will no longer work.
... in the content process the root tree item is an nsitabchild, that cannot be converted to an nsidomwindow, so the second getinterface call here will fail.
Limitations of frame scripts
for example: nsisessionstore nsiwindowmediator <need more examples> places api the places api can't be used inside a frame script.
...it looks something like this: window.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindow); this will no longer work.
... in the content process, the root tree item is an nsitabchild, that cannot be converted to an nsidomwindow, so the second getinterface call here will fail.
Browser API
the following new events can be listened for: mozbrowseractivitydone sent when something inside the browser <iframe> triggers a web activity, and that web activity's message is consumed by the receiving app.
... mozbrowsercaretstatechanged sent when the text selected inside the browser <iframe> content changes.
... mozbrowserselectionstatechanged sent when the text selected inside the browser <iframe> content changes.
Gecko Keypress Event
if gecko doesn't replace the charcode with an ascii character, the web application developers would need to consider all non-latin keyboard layouts (arabic, greek, hebrew, russian, etc.).
... when handling web content accesskeys, the handlers should consider both characters that are available on the key (without and with shift).
...because numerals are common in short cuts, the numeral from the key should be considered as a low priority shortcut key candidate (bug 429219).
OS.File for the main thread
ge(); img.onload = function() { var canvas = document.createelementns('http://www.w3.org/1999/xhtml', 'canvas'); canvas.width = img.naturalwidth; canvas.height = img.naturalheight; var ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); (canvas.toblobhd || canvas.toblob).call(canvas, function(b) { var r = cc['@mozilla.org/files/filereader;1'].createinstance(ci.nsidomfilereader); //new filereader(); r.onloadend = function() { // r.result contains the arraybuffer.
...this is considerably slower (not just for the application but for the whole system) and more battery expensive but also safer: if the system shuts down improperly (typically due to a kernel freeze or a power failure) or if the device is disconnected before the buffer is flushed, the file has more chances of not being corrupted.
...if your data is user-critical (e.g., preferences, application data), you may wish to consider adding options tmppath and/or flush to reduce the likelihood of corruption, as detailed above.
source-editor.jsm
all changes made to the text between the two calls is considered to be a single edit for the purposes of undo operations.
... ignorecase boolean if true, the search is performed in a case-insensitive manner; otherwise case is considered.
...all changes made between a call to startcompoundchange() and its corresponding call to endcompoundchange() are considered to be a single operation on the undo stack.
SVN for Localizers
mac os x users can find svn inside the command line tools (available on the apple developer website), or use tools like homebrew or fink.
... inside mozilla.com/trunk/locales, there are separate directories for each locale that is localizing mozilla.com.
... note: the directory you create will be located inside the directory that you're currently in with your console (or cygwin console).
Profiling with Xperf
this is shorthand for "allocated inside, freed inside", "allocated inside, freed outside", "allocated outside, freed inside".
... these refer to the time range that was selected for the summary graph; for example, something that's in the aofi category was allocated before the start of the selected time range, but the free event happened inside.
...also experiment with turning columns on and off; removing a column will allow data to be aggregated without considering that column's contributions.
Profiling with the Firefox Profiler
for very time-sensitive profiling, you may want to consider a non-sampling profiler.
... because of the non-zero overhead of the instrumentation, the sample label shouldn't be placed inside hot loops.
... warning: dumping texture data slows performance considerably, and requires a lot of storage for the profile files.
PKCS #11 Module Specs
the value is considered quoted if the first character after the '=' is ', ", {, [, or <.
...embedded '\' charaters are considered escape characters for the next character in the stream.
...valid names inside nss_params are: flags - comma separated list of flag values, parsed case-insensitive.
SpiderMonkey 1.8.5
while this was never specified behaviour, it is no longer true; numeric values which are integers are frequently encoded as jsdouble inside the jsval.
...note also that spidermonkey can now fit a full 32-bit integer (jsint) inside a jsval without promoting to a jsdouble.
... the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd.
SpiderMonkey 1.8.7
while this was never specified behaviour, it is no longer true; numeric values which are integers are frequently encoded as jsdouble inside the jsval.
...note also that spidermonkey can now fit a full 32-bit integer (jsint) inside a jsval without promoting to a jsdouble.
... the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd.
Redis Tips
* * notice: failing an execution of multi is not considered * an error.
... if the structure matters, consider using redis hashes or flattening your data across your keyspace.
... or consider storing the json data in mongodb and manipulating pointers and commonly-used and/or rapidly-changing metadata in redis.
Gecko object attributes
applied to: listitem, option exposed in aria: aria-setsize live region attribues atomic true when the entire region should be presented as a whole, when changes within it are considered important enough to automatically present.
...if not specified, the default should be considered "additions text", which indicates that newly created objects and changes to text and text equivalents should be considered relevant, and that the hiding or removal of items is not.
... exposed in aria: aria-relevant container-atomic is this change inside a region that should always be presented at once.
Finishing the Component
the rule of thumb is that interfaces outside of the sdk are considered "experimental" or unfrozen.
...in the weblock component, the shouldload method looks like this: ns_imethodimp weblock::shouldload(print32 contenttype, nsiuri *contentlocation, nsisupports *ctxt, nsidomwindow *window, prbool *_retval) uniform resource locators the method passes in an interface pointer of type nsiuri, which is based on the uniform resource identifier, or uri.
... here is the complete implementation of the shouldload() method: ns_imethodimp weblock::shouldload(print32 contenttype, nsiuri *contentlocation, nsisupports *ctxt, nsidomwindow *window, prbool *_retval) { if (!contentlocation) return ns_error_failure; nsembedcstring scheme; contentlocation->getscheme(scheme); if (strcmp("http", scheme.get()) != 0 && strcmp("https", scheme.get()) != 0 && strcmp("ftp", scheme.get()) != 0) { // this isn't a type of uri that we deal with *_retval = pr_true; return ns_ok...
Mozilla internal string guide
outside of libxul you should use ns_free to deallocate the result when you no longer need it, inside libxul free() is preferred..
... // call init(const char16_t*) - bad signature, will need to do runtime length calculation inside init(l"start value"); // bad - l"..." is not portable!
...you could consider not using a macro at all but a named constexpr constant instead.
IAccessible2
refer to @ref _arrayconsideration "special consideration when using arrays" for more details.
...refer to @ref _arrayconsideration "special consideration when using arrays" for more details.
...refer to @ref _arrayconsideration "special consideration when using arrays" for more details.
IAccessibleTable
refer to @ref _arrayconsideration "special consideration when using arrays" for more details.
...refer to @ref _arrayconsideration "special consideration when using arrays" for more details.
...refer to @ref _arrayconsideration "special consideration when using arrays" for more details.
amIWebInstaller
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview boolean installaddonsfromwebpage(in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, [optional] in amiinstallcallback acallback, [optional] in pruint32 ainstallcount); boolean isinstallenabled(in astring amimetype, in nsiuri areferer); note: prio...
...r to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
...boolean installaddonsfromwebpage( in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, in amiinstallcallback acallback, optional in pruint32 ainstallcount optional ); parameters amimetype the mimetype for the add-ons.
nsIAccessibilityService
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsiaccessibleretrieval method overview nsiaccessible createouterdocaccessible(in nsidomnode anode); nsiaccessible createrootaccessible(in nsipresshell ashell, in nsidocument adocument); nsiaccessible createhtml4buttonaccessible(in nsisupports aframe); nsiaccessible createhypertextaccessible(in nsisupports aframe); nsiaccessible createhtmlbraccessible(in nsisupports aframe); nsiaccessible createhtmlbuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlaccessiblebymarkup(in nsiframe aframe, in nsiweakreference aweakshell, in nsidomnode adomnode); nsiaccessible c...
...reatehtmlliaccessible(in nsisupports aframe, in nsisupports abulletframe, in astring abullettext); nsiaccessible createhtmlcheckboxaccessible(in nsisupports aframe); nsiaccessible createhtmlcomboboxaccessible(in nsidomnode anode, in nsiweakreference apresshell); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlhraccessible(in nsisupports aframe); nsiaccessible createhtmlimageaccessible(in nsisupports aframe); nsiaccessible createhtmllabelaccessible(in nsisupports aframe); nsiaccessible createhtmllabelaccessible(in nsidomnode anode, in nsiweakreference apresshell); nsiaccessible createhtmlobjectframeaccessible(in nsobjectframe aframe); nsiaccessible createhtml...
...radiobuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlselectoptionaccessible(in nsidomnode anode, in nsiaccessible aaccparent, in nsiweakreference apresshell); nsiaccessible createhtmltableaccessible(in nsisupports aframe); nsiaccessible createhtmltablecellaccessible(in nsisupports aframe); nsiaccessible createhtmltableheadaccessible(in nsidomnode adomnode); nsiaccessible createhtmltextaccessible(in nsisupports aframe); nsiaccessible createhtmltextfieldaccessible(in nsisupports aframe); nsiaccessible createhtmlcaptionaccessible(in nsisupports aframe); nsiaccessible getaccessible(in nsidomnode anode, in nsipresshell apresshell, in nsiweakreference aweakshell, inout nsiframe framehint, out boolean aishidden); nsiaccessible addnativerootaccessible(in voi...
nsIAccessibleProvider
xformsitemcheckgroup 0x00002012 used for xforms item element that is used inside xforms select elements represented by group of checkboxes.
... xformsitemradiogroup 0x00002013 used for xforms item element that is used inside xforms select1 elements represented by radio group.
... xformsitemcombobox 0x00002015 used for xforms item element that is used inside xforms select1 elements represented by combobox.
nsIBrowserBoxObject
note: please consider using nsicontainerboxobject instead.
... attributes attribute type description docshell nsidocshell read only.
... obsolete since gecko 1.9 the nsidocshell object that manages the contained document.
nsICommandLineRunner
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsicommandline method overview void init(in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type description helptext autf8string process and combine the help text provided by each command-line handler.
...void setwindowcontext( in nsidomwindow awindow ); parameters awindow the dom window object which will be set.
... it is an nsidomwindow object.
nsIEditorBoxObject
note: please consider using nsicontainerboxobject instead.
... attributes attribute type description docshell nsidocshell read only.
... obsolete since gecko 1.9 the nsidocshell object that manages the contained document.
nsIIFrameBoxObject
note: please consider using nsicontainerboxobject instead.
... attributes attribute type description docshell nsidocshell read only.
... obsolete since gecko 1.9 the nsidocshell object that manages the contained document.
nsILoginManager
to create an instance, use: var loginmanager = components.classes["@mozilla.org/login-manager;1"] .getservice(components.interfaces.nsiloginmanager); method overview void addlogin(in nsilogininfo alogin); nsiautocompleteresult autocompletesearch(in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); boolean fillform(in nsidomhtmlformelement aform); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledho...
... nsiautocompleteresult autocompletesearch( in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement ); parameters asearchstring missing description apreviousresult missing description aelement missing description return value missing description countlogins() returns the number of logins matching the specified criteria.
... boolean fillform( in nsidomhtmlformelement aform ); parameters aform the htmlform to attempt to fill out.
nsIMsgFolder
id markmessagesflagged(in nsisupportsarray messages, in boolean markflagged); void markthreadread(in nsimsgthread thread); void setlabelformessages(in nsisupportsarray messages, in nsmsglabelvalue label); nsimsgdatabase getmsgdatabase(in nsimsgwindow msgwindow); void setmsgdatabase(in nsimsgdatabase msgdatabase); nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); nsimsgdbhdr getmessageheader(in nsmsgkey msgkey); boolean shouldstoremsgoffline(in nsmsgkey msgkey); boolean hasmsgoffline(in nsmsgkey msgkey); nsiinputstream getofflinefilestream(in nsmsgkey msgkey, out pruint32 offset, out pruint32 size); void downloadmessagesforoffline(in nsisupportsarray messages, in nsimsgwindow window); ...
... dbtransferinfo nsidbfolderinfo subfolders nsisimpleenumerator readonly: returns an enumerator containing a list of nsimsgfolder items that are subfolders of the instance this is called on.
... void markthreadread(in nsimsgthread thread); setlabelformessages() void setlabelformessages(in nsisupportsarray messages, in nsmsglabelvalue label); getmsgdatabase() nsimsgdatabase getmsgdatabase(in nsimsgwindow msgwindow); setmsgdatabase() void setmsgdatabase(in nsimsgdatabase msgdatabase); getdbfolderinfoanddb() nsimsgdatabase getdbfolderinfoanddb(out nsidbfolderinfo folderinfo); getmessageheader() nsimsgdbhdr getmessageheader(in nsmsgkey msgkey); shouldstoremsgoffline() boolean shouldstoremsgoffline(in nsmsgkey msgkey); hasmsgoffline() boolean hasmsgoffline(in nsmsgkey msgkey); getofflinefilestream() nsiinputstream getofflinefilestream(in nsmsgkey msgkey, out pruint32 offset, ...
nsIMsgThread
inherits from: nsisupports method overview void addchild(in nsimsgdbhdr child, in nsimsgdbhdr inreplyto, in boolean threadinthread, in nsidbchangeannouncer announcer); nsimsgdbhdr getchildat(in long index); nsmsgkey getchildkeyat(in long index); nsimsgdbhdr getchild(in nsmsgkey msgkey); nsimsgdbhdr getchildhdrat(in long index); nsimsgdbhdr getroothdr(out long index); void removechildat(in long index); void removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); void markchildread(in boolean bread); nsimsgdbhdr getfirstunreadchild(); nsisimpleenumerator enumeratemessages(in nsmsgkey parent); ...
... void addchild(in nsimsgdbhdr child, in nsimsgdbhdr inreplyto, in boolean threadinthread, in nsidbchangeannouncer announcer); parameters child the message to add inreplyto the message this should be in reply to threadinthread announcer an nsidbchangeannouncer to receive notification when the change is made.
... removechildat() void removechildat(in long index); parameters index the index to remove the message from removechildhdr() void removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); parameters child the message to remove announcer an nsidbchangeannouncer to receive notification when the change is made.
nsIMsgWindow
rootdocshell nsidocshell this is used to track the chrome window's nsidocshell object.
... messagewindowdocshell nsidocshell readonly: this retrieves the nsidocshell object for the message pane.
... domwindow nsidomwindow the message window's global chrome window object.
Component; nsIPrefBranch
it is considered reset to its default value.
...if you find yourself wondering what is the maximum amount of data you can store in a string preference, consider storing data separately, for example in a flat file or an sqlite database.
...if you find yourself wondering what is the maximum amount of data you can store in a string preference, consider storing data separately, for example in a flat file or an sqlite database.
nsISHEntry
to create an instance, use: var shentry = components.classes["@mozilla.org/browser/session-history-entry;1"] .createinstance(components.interfaces.nsishentry); method overview void addchildshell(in nsidocshelltreeitem shell); nsidocshelltreeitem childshellat(in long index); void clearchildshells(); nsishentry clone(); void create(in nsiuri uri, in astring title, in nsiinputstream inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean dynamiccreation); native code onl...
... document nsidomdocument dom document.
...void addchildshell( in nsidocshelltreeitem shell ); parameters shell childshellat() nsidocshelltreeitem childshellat( in long index ); parameters index the child shell at index; null if index is out of bounds.
nsITaskbarPreviewController
method overview boolean drawpreview(in nsidomcanvasrenderingcontext2d ctx); boolean drawthumbnail(in nsidomcanvasrenderingcontext2d ctx, in unsigned long width, in unsigned long height); boolean onactivate(); void onclick(in nsitaskbarpreviewbutton button); void onclose(); attributes attribute type description height unsigned long the height in pixels of the preview ...
... boolean drawpreview( in nsidomcanvasrenderingcontext2d ctx ); parameters ctx an nsidomcanvasrenderingcontext2d object representing the drawing context into which the preview is to be rendered.
... boolean drawthumbnail( in nsidomcanvasrenderingcontext2d ctx, in unsigned long width, in unsigned long height ); parameters ctx an nsidomcanvasrenderingcontext2d object representing the drawing context into which the thumbnail is to be rendered.
nsITreeContentView
last changed in gecko 1.8.0 inherits from: nsisupports method overview long getindexofitem(in nsidomelement item); nsidomelement getitematindex(in long index); attributes attribute type description root nsidomelement the element in the dom which this view uses as root content.
...long getindexofitem( in nsidomelement item ); parameters item a tree row for which to find the row index.
...nsidomelement getitematindex( in long index ); parameters index the row index for which to get the item return value the nsidomelement item.
nsIUpdate
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiupdatepatch getpatchat(in unsigned long index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update.
...nsidomelement serialize( in nsidomdocument updates ); parameters updates the dom document into which to serialize the update.
... return value the patch object serialized into an nsidomelement.
nsIUpdatePatch
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsidomelement serialize(in nsidomdocument updates); attributes attribute type description finalurl astring the final url this patch was being downloaded from.
...nsidomelement serialize( in nsidomdocument updates ); parameters updates the dom document into which to serialize the patch.
... return value the patch object serialized into an nsidomelement.
nsIWebContentHandlerRegistrar
rbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a service: var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); method overview void registercontenthandler(in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protocol,in domstring uri, in domstring title, in nsidomwindow contentwindow) methods registercontenthandler summary of registercontenthandler void registercontenthandler( in domstring mimetype, in domstring uri, in domstring title, in...
... nsidomwindow contentwindow ); parameters mimetype the desired mime type as a string uri the uri to the handler as a string.
... registerprotocolhandler summary of registerprotocolhandler void registerprotocolhandler( in domstring protocol, in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters protocol the protocol the site wishes to handle, specified as a string.
nsIWebProgressListener
(see below for a description of document requests.) other types of requests, such as requests for inline content (for example images and stylesheets) are considered normal requests.
..."); var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, arequest, aflag, astatus) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindowutils) .outerwindowid; sendasyncmessage("myaddonmessage", { name: "onstatechange", flag: aflag, status: astatus, }); }, onlocationchange: function(aprogress, arequest, auri, aflag) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) ...
... .getinterface(ci.nsidomwindowutils) .outerwindowid; sendasyncmessage("myaddonmessage", { name: "onlocationchange", outerwindowid: outerwindowid, uri: auri.spec, charset: auri.charset, flag: aflag, }); }, // for definitions of the remaining functions see related documentation onprogresschange: function(awebprogress, arequest, curself, maxself, curtot, maxtot) {}, onstatuschange: function(awebprogress, arequest, astatus, amessage) {}, onsecuritychange: function(awebprogress, arequest, astate) {} } let filter = cc["@mozilla.org/appshell/component/browser-status-filter;1"] .createinstance(ci.nsiwebprogress); filter.addprogre...
nsIWorkerScope
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents the global scope in which a worker's script runs.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsiworkerglobalscope last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); void close(); attributes attribute type description onclose nsidomeventlistener a listener object to be called when the worker stops running.
... onmessage nsidomeventlistener a listener object to be called when a message is posted on the port.
nsIXULTemplateResult
method overview astring getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeenremoved(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type description id astring id of the result.
...the question mark is considered part of the variable name, thus avar should be ?name and not simply name.
...void rulematched( in nsisupports aquery, in nsidomnode arulenode ); parameters aquery the query that matched.
nsIXmlRpcClient
supported arguments are: nsisupportspruint8, nsisupportspruint16, nsisupportsprint16, nsisupportsprint32: i4, nsisupportsprbool: boolean, nsisupportschar, nsisupportscstring: string, nsisupportsfloat, nsisupportsdouble: double, nsisupportsprtime: datetime.iso8601, nsiinputstream: base64, nsisupportsarray: array, nsidictionary: struct note that both nsisupportsarray and nsidictionary can only hold any of the supported input types.
... return value will be converted as follows: i4 or int: nsisupportsprint32 boolean: nsisupportsprbool string: nsisupportscstring double: nsisupportsdouble datetime.iso8601: nsisupportsprtime base64: nsisupportscstring array: nsisupportsarray struct: nsidictionary faults (server side errors) are indicated by returning ns_error_failure.
...te method to call arguments array of arguments to pass to the remote method count void asynccall ( in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, [array, size_is(count)] in nsisupports arguments, in pruint32 count ); createtype() convenience: return the correct nsisupportsprimitive for a given xml-rpc type, or nsisupportsarray or nsidictionary.
nsIZipReader
the only character that must be escaped inside the brackets is ].
...if ] is to appear inside the brackets as a character to not match, it must be escaped.
... example demonstrating this function: list contents of xpi and read file contents openinner() opens a zip file inside a zip file for reading.
nsPIPromptService
this interface defines the meaning of each indexes of getint(), setint(), getstring() and setstring() of the nsidialogparamblock interface but they are defined on in c++.
... method overview void dodialog(in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl); methods dodialog() opens a dialog.
... void dodialog( in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl ); parameters aparent the parent window of the dialog.
Weak reference
if the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.
...this technique can significantly simplify certain relationships, and you should consider it when an owning reference is inappropriate, but where a raw pointer might end up dangling.
... } alternatives this technique is useful, but in situations where you need this, there are two alternatives which you may want to consider: you might hold an owning reference, but arrange to release it out-of-band; this must be before the destructor, which would otherwise never be called.
Accessibility Inspector - Firefox Developer Tools
here we are mainly talking about exposing information to people with visual disabilities — this is done via the accessibility apis available inside web browsers, which expose information on what roles the different elements on your page play (e.g., are they just text, or are they buttons, links, form elements, etc.?).
... indexinparent — an index value indicating what number child the item is, inside its parent.
... if the item is the first item inside its parent, it has a value of 0.
Edit fonts - Firefox Developer Tools
fonts are considered "used" when there is text content in the inspected element that has the font applied to it.
... variable fonts, or opentype font variations, define a new font file format that allows the font designer to include multiple variations of a typeface inside a single font file.
... here are the registered axes along with their corresponding css properties: axis tag css property "wght" font-weight "wdth" font-stretch "slnt" (slant) font-style: oblique + angle "ital" font-style: italic "opsz" font-optical-sizing any axis that is not on the list of registered axes is considered a custom axis.
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
extend lines infinitely: by default, grid lines/tracks are only shown inside the element with display: grid set on it; when toggling this option on, the grid lines extend to the edge of the viewport along each axis.
... a target icon that when clicked immediately selects the html element that this grid entry relates to, inside the html pane.
... extend lines infinitely by default, the grid lines/tracks are only shown inside the element with display: grid set on it.
BiquadFilterNode.type - Web APIs
frequencies outside the given range of frequencies are attenuated; the frequencies inside it pass through.
... peaking frequencies inside the range get a boost or an attenuation; frequencies outside it are unchanged.
...it is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated.
BiquadFilterNode - Web APIs
frequencies outside the given range of frequencies are attenuated; the frequencies inside it pass through.
... peaking frequencies inside the range get a boost or an attenuation; frequencies outside it are unchanged.
...it is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated.
CanvasRenderingContext2D.isPointInStroke() - Web APIs
the canvasrenderingcontext2d.ispointinstroke() method of the canvas 2d api reports whether or not the specified point is inside the area contained by the stroking of a path.
... return value boolean a boolean, which is true if the point is inside the area contained by the stroking of a path, otherwise false.
...t const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create ellipse const ellipse = new path2d(); ellipse.ellipse(150, 75, 40, 60, math.pi * .25, 0, 2 * math.pi); ctx.linewidth = 25; ctx.strokestyle = 'red'; ctx.fill(ellipse); ctx.stroke(ellipse); // listen for mouse moves canvas.addeventlistener('mousemove', function(event) { // check whether point is inside ellipse's stroke if (ctx.ispointinstroke(ellipse, event.offsetx, event.offsety)) { ctx.strokestyle = 'green'; } else { ctx.strokestyle = 'red'; } // draw ellipse ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.fill(ellipse); ctx.stroke(ellipse); }); result specifications specification status comment html living standardthe definition o...
Element.getClientRects() - Web APIs
html example 1: this html creates three paragraphs with a <span> inside, each embedded in a <div> block.
... <h3>a paragraph with a span inside</h3> <p>both the span and the paragraph have a border set.
.../th></tr> </thead> <tbody> <tr><td>tbody</td></tr> </tbody> </table> </div> <div> <strong>table's rect</strong> <table class="withclientrectsoverlay"> <caption>caption</caption> <thead> <tr><th>thead</th></tr> </thead> <tbody> <tr><td>tbody</td></tr> </tbody> </table> </div> css the css draws borders around the paragraph and the <span> inside each <div> block for the first example, around the <ol> and <li> for the second example, and around <table>, <th>, and <td> elements for the third example.
Element.insertAdjacentElement() - Web APIs
'afterbegin': just inside the targetelement, before its first child.
... 'beforeend': just inside the targetelement, after its last child.
...empdiv); }); afterbtn.addeventlistener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('afterend',tempdiv); } setlistener(tempdiv); }); have a look at our insertadjacentelement.html demo on github (see the source code too.) here we have a sequence of <div> elements inside a container.
Using files from web applications - Web APIs
accessing selected file(s) consider this html: <input type="file" id="input" multiple> the file api makes it possible to access a filelist containing file objects representing the files selected by the user.
... consider this html: <input type="file" id="fileelem" multiple accept="image/*" style="display:none"> <button id="fileselect">select some files</button> the code that handles the click event can look like this: const fileselect = document.getelementbyid("fileselect"), fileelem = document.getelementbyid("fileelem"); fileselect.addeventlistener("click", function (e) { if (fileelem) { fileelem.c...
... consider this html: <input type="file" id="fileelem" multiple accept="image/*" class="visually-hidden"> <label for="fileelem">select some files</label> and this css: .visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); } /* separate rule for compatibility, :focus-within is required on modern firefox and chrome */ input...
Fullscreen API - Web APIs
you may wish to consider using a library such as fscreen for vendor agnostic access to the fullscreen api.
... no support 9 — 65notes alternate name notes before firefox 44, firefox incorrectly allowed elements inside a <frame> or <object> element to request, and to be granted, fullscreen.
... no support 9 — 65notes alternate name notes before firefox 44, firefox incorrectly allowed elements inside a <frame> or an <object> to request, and to be granted, fullscreen.
Basic concepts - Web APIs
indexeddb is a way for you to persistently store data inside a user's browser.
... this transaction model is really useful when you consider what might happen if a user opened two instances of your web app in two different tabs simultaneously.
...the only place where the schema of the database can be updated is inside the handler of that event.
Using IndexedDB - Web APIs
indexeddb is a way for you to persistently store data inside a user's browser.
...once you are inside the transaction, you can access the object stores that hold your data and make your requests.
... version changes while a web app is open in another tab when your web app changes in such a way that a version change is required for your database, you need to consider what happens if the user has the old version of your app open in one tab and then loads the new version of your app in another.
Using the Notifications API - Web APIs
to avoid duplicating code, we have stored a few bits of housekeeping code inside the handlepermission() function, which is the first main block inside this snippet.
... inside here we explicitly set the notification.permission value (some old versions of chrome failed to do this automatically), and show or hide the button depending on what the user chose in the permission dialog.
... 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!
Page Visibility API - Web APIs
use cases let's consider a few use cases for the page visibility api.
... tabs which are playing audio are considered foreground and aren’t throttled.
... videoelement.addeventlistener("play", function(){ document.title = 'playing'; }, false); } properties added to the document interface the page visibility api adds the following properties to the document interface: document.hidden read only returns true if the page is in a state considered to be hidden to the user, and false otherwise.
ParentNode.querySelectorAll() - Web APIs
if you need only a single result, consider the queryselector() method instead.
...list of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with a class of either note or alert: var matches = document.queryselectorall("div.note, div.alert"); here, we get a list of <p> elements whose immediate parent element is a <div> with the class highlighted and which are located inside a container whose id is test.
... html consider this html, with its three nested <div> blocks.
RTCIceCandidate.priority - Web APIs
the rtcicecandidate interface's read-only priority property specifies the candidate's priority according to the remote peer; the higher this value is, the better the remote peer considers the candidate to be.
...the larger this value is, the more preferable the remote peer considers this candidate to be.
... usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the priority is the number after the protocol, so it's the fourth field in the candidate string.
Screen Wake Lock API - Web APIs
performance considerations release the screen wake lock when user ends activity that required always-on screen.
... if your app is performing long-running downloads, consider using background fetch.
... if you app is synchronizing data from a remote server, consider using background sync.
Service Worker API - Web APIs
it is designed to be fully async; as a consequence, apis such as synchronous xhr and localstorage can't be used inside a service worker.
...if successful, your service worker will be downloaded to the client and attempt installation/activation (see below) for urls accessed by the user inside the whole origin, or inside a subset specified by you.
... you can listen for the installevent; a standard action is to prepare your service worker for usage when this fires, for example by creating a cache using the built in storage api, and placing assets inside it that you'll want for running your app offline.
ShadowRoot - Web APIs
shadowroot.innerhtml sets or returns a reference to the dom tree inside the shadowroot.
... inside the <custom-square> element's class definition we include some life cycle callbacks that make a call to an external function, updatestyle(), which actually applies the size and color to the element.
...from here we use standard dom traversal techniques to find the <style> element inside the shadow dom and then update the css found inside it: function updatestyle(elem) { var shadow = elem.shadowroot; var childnodes = shadow.childnodes; for(var i = 0; i < childnodes.length; i++) { if(childnodes[i].nodename === 'style') { childnodes[i].textcontent = 'div {' + 'width: ' + elem.getattribute('l') + 'px;' + 'height: ' + elem.getattribute('l...
Storage API - Web APIs
one of the most likely methods—one which the specification specifically encourages, in fact—would be to consider the popularity and/or usage levels of individual sites to determine what their quotas should be.
... "persistent" the user agent will retain the data as long as possible, clearing all "best-effort" boxes before considering clearing a box marked "persistent".
... if it becomes necessary to consider clearing persistent boxes, the user agent will notify the user and provide a way to clear one or more persistent boxes as needed.
SubtleCrypto.wrapKey() - Web APIs
wrapping a key helps protect it in untrusted environments, such as inside an otherwise unprotected data store or in transmission over an unprotected network.
...*/ window.crypto.subtle.generatekey( { name: "rsa-pss", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign", "verify"] ) .then((keypair) => { return wrapcryptokey(keypair.privatekey); }) .then((wrappedkey) => { console.log(wrappedkey); }); subjectpublickeyinfo wrap this example wraps an rsa public encryption key.
...*/ window.crypto.subtle.generatekey( { name: "rsa-oaep", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["encrypt", "decrypt"] ) .then((keypair) => { return wrapcryptokey(keypair.publickey); }) .then((wrappedkey) => { console.log(wrappedkey); }); json web key import this code wraps an ecdsa private signing key.
Using Touch Events - Web APIs
from interfaces to gestures an application may consider different factors when defining the semantics of a gesture.
...the directionality of a swipe (for example left to right, right to left, etc.) is another factor to consider.
... // touchmove handler function process_touchmove(ev) { // set call preventdefault() ev.preventdefault(); } best practices here are some best practices to consider when using touch events: minimize the amount of work that is done in the touch handlers.
Geometry and reference spaces in WebXR - Web APIs
after putting on a headset, consider the virtual world around you to have a coordinate system in which your position is (0, 0, 0)—that is, you're at the center of everything.
... next, consider the xr controller you have in your left hand.
...consider the model of a player's avatar standing in the game world's space.
Inputs and input sources - Web APIs
not only would this controller then take the responsibility of clicking through the user interface of your app, but it would also be considered the "main hand," while other controllers would then be off-hand or additional controllers.
... note: if an input source doesn't have a primary action, the input source is considered to be an auxiliary input source.
... transient actions if an xr device uses the mouse to simulate a controller when in the inline mode, the approximate sequence of things takes place: the user presses the mouse button while inside the <canvas> presenting the webxr scene.
Lighting a WebXR setting - Web APIs
it is at this time that the scene's lighting is considered and applied as appropriate to the pixel before the pixel is stored into the framebuffer.
...in this section, we provide some basic mixed reality lighting guidelines to consider as you construct, render, and light your scene.
... temporal and spatial filtering consider an attack that uses a building's automated lighting system to flash the lights on and off quickly in a known pattern.
Basic concepts behind Web Audio API - Web APIs
audio graphs the web audio api involves handling audio operations inside an audio context, and has been designed to allow modular routing.
... inside the context, create sources — such as <audio>, oscillator, or stream.
... audio buffers: frames, samples and channels an audiobuffer takes as its parameters a number of channels (1 for mono, 2 for stereo, etc), a length, meaning the number of sample frames inside the buffer, and a sample rate, which is the number of sample frames played per second.
Background audio processing using AudioWorklet - Web APIs
let's start at the inside and work our way out.
... in general, the lifetime policy of any audio node is simple: if the node is still considered to be actively processing audio, it will continue to be used.
... in the case of an audioworkletnode, the node is considered to be active if its process() function returns true and the node is either generating content as a source for audio data, or is receiving data from one or more inputs.
Web Workers API - Web APIs
you can run whatever code you like inside the worker thread, with some exceptions.
... for example, you can't directly manipulate the dom from inside a worker, or use some default methods and properties of the window object.
... audio workers provide the ability for direct scripted audio processing to be done inside a web worker context.
Window.print() - Web APIs
WebAPIWindowprint
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprintchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 5opera full support 6notes full support 6notes...
... notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari full support 1.1webview android full support 1notes full support 1notes notes starting with webview 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.chrome android full support 18notes full support 18notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.firefox android no support ...
... nonotes no support nonotes notes see bug 1247609.opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android full support 1.0notes full support 1.0notes notes starting with samsung internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.legend ...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
this[sproperty] : this); }; myarray.mymethod(); // prints "zero,one,two" myarray.mymethod(1); // prints "one" settimeout(myarray.mymethod, 1000); // prints "[object window]" after 1 second settimeout(myarray.mymethod, 1500, "1"); // prints "undefined" after 1,5 seconds // passing the 'this' object with .call won't work // because this will change the value of this inside settimeout itself // while we want to change the value of this inside myarray.mymethod // in fact, it will be an error because settimeout code expects this to be the window object: settimeout.call(myarray, myarray.mymethod, 2000); // error: "ns_error_xpc_bad_op_on_wn_proto: illegal operation on wrappednative prototype object" settimeout.call(myarray, myarray.mymethod, 2500, 2); // same error a...
...also, es2015 supports arrow functions, with lexical this allowing us to write setinterval( () => this.mymethod) if we're inside myarray method.
...loop() is recursively called inside settimeout() after the logic has completed executing.
XRBoundedReferenceSpace.boundsGeometry - Web APIs
the read-only xrboundedreferencespace property boundsgeometry is an array of dompointreadonly objects which specifies the points making up a polygon inside which the viewer is allowed to move.
... syntax bounds = xrreferencespace.boundsgeometry; value the boundsgeometry property is an array of dompointreadonly objects, each of which defines one vertex in a polygon inside which the viewer is required to remain.
...however, if the user's surroundings permit them to move in such a way as to exit the defined bounds, your content must be able to gracefully handle the situation, which is not considered an error condition.
Using the aria-relevant attribute - Accessibility
values a space-delimited list of one or more of the following values: additions element nodes added to the accessibility tree within the live region; should be considered relevant.
... removals are deletion of nodes in the accessiblity tree; should be considered relevant.
... text are changes to the textual content of existing nodes; should be considered relevant.
ARIA: timer role - Accessibility
required javascript features keypress used to handle keyboard input and control the focus click, touch handle as appropriate for your widget as well changing attribute values aria-activedescendant is used to manage the focus inside the application container.
...the author of the timer must take full responsibility for not letting users get stuck in a focus limbo or trap focus inside something the user cannot exit of.
... as an illustration of aria-atomic, consider a site with a simple clock, showing hours and minutes.
ARIA: feed role - Accessibility
by identifying the elements inside of an article that provide the title and the primary content, assistive technologies can provide functions that enable users to jump from article to article and efficiently discern which articles they want to read.
... keyboard interaction supporting the following, or a similar, interface is recommended when focus is inside the feed: page down: move focus to next article.
...each article should preferably have aria-describedby referring to one or more elements inside the article that serve as the primary content of the article.
ARIA: List role - Accessibility
it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list.
... <section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section> description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively.
...so, the li elements are not exposed to assistive technologies, but elements contained inside of those li elements, including nested lists, are visible to assistive technologies.
ARIA: img role - Accessibility
the aria img role can be used to identify multiple elements inside page content that should be considered as a single image.
... you shouldn't count on the alt text of individual elements images for conveying context to assistive technologies; most screenreaders will consider the element with role="img" set on it to be to be like a black box, and not access the individual elements inside it.
...this will cause screen readers to just consider it as a single entity and describe it using the label, rather than trying to read out all the child nodes: <svg role="img" aria-label="description of your svg image"> <!-- contents of the svg image --> </svg> using role="img" to confer meaning that is obscured or implied in certain cases, assistive technology users won't be able to get the meaning of content expressed in certain ways, thro...
ARIA: tab role - Accessibility
the aria tab role indicates an interactive element inside a tablist that, when activated, displays its associated tabpanel.
...some assistive technology will provide a count of the number of tab role elements inside a tablist, and inform users of which tab they currently have targeted.
...we then find all tabs with aria-selected=true inside the parent element and sets it to false, then sets the triggering element's aria-selected to true.
ARIA: button role - Accessibility
the values include aria-pressed="false" when a button is not currently pressed, aria-pressed="true" to indicate a button is currently pressed, and aria-pressed="mixed" if the button is considered to be partially pressed.
...for most buttons, this name will be the same as the text inside the button.
... if aria-pressed="mixed" is used, the button is considered to be partially pressed.
An overview of accessible web applications and widgets - Accessibility
for example, consider an "inline edit" widget: a component that allows users to edit a piece of text in place, without switching contexts.
... when the widget is not inside a form, both the enter and spacebar keys should select or activate the control.
...once keyboard focus is inside the container, the arrow keys should allow the user to navigate between each tab (the <li> elements).
Keyboard-navigable JavaScript widgets - Accessibility
for techniques for managing focus within widgets, see "managing focus inside groups" below.
... managing focus inside groups when a user tabs away from a widget and returns, focus should return to the specific element that had focus, for example, the tree item or grid cell.
...dom focus events are considered informational only: generated by the system after something is focused, but not actually used to set focus.
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
the ::slotted() css pseudo-element represents any element that has been placed into a slot inside an html template (see using templates and slots for more information).
... this only works when used inside css placed within a shadow dom.
... /* selects any element placed inside a slot */ ::slotted(*) { font-weight: bold; } /* selects any <span> placed inside a slot */ ::slotted(span) { font-weight: bold; } syntax ::slotted( <compound-selector-list> )where <compound-selector-list> = <compound-selector>#where <compound-selector> = [ <type-selector>?
:where() - CSS: Cascading Style Sheets
WebCSS:where
to make selecting the links inside them simpler, but still distinct, we could use :is() or :where(), in the following manner: html { font-family: sans-serif; font-size: 150%; } :is(section.is-styling, aside.is-styling, footer.is-styling) a { color: red; } :where(section.where-styling, aside.where-styling, footer.where-styling) a { color: orange; } however, what if we later want to override the color of links in the fo...
... footer a { color: blue; } this won't work for the red links, because the selectors inside :is() count towards the specificity of the overall selector, and class selectors have a higher specificity than element selectors.
... however, selectors inside :where() have specificity 0, so the orange footer link will be overidden by our simple selector.
@font-face - CSS: Cascading Style Sheets
to provide the browser with a hint as to what format a font resource is — so it can select a suitable one — it is possible to include a format type inside a format() function: src: url(ideal-sans-serif.woff) format("woff"), url(basic-sans-serif.ttf) format("truetype"); the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg".
... by allowing authors to provide their own fonts, @font-face makes it possible to design content without being limited to the so-called "web-safe" fonts (that is, the fonts which are so common that they're considered to be universally available).
... the @font-face at-rule may be used not only at the top level of a css, but also inside any css conditional-group at-rule.
Basic concepts of flexbox - CSS: Cascading Style Sheets
in doing so, you should consider each line as a new flex container.
... before we can make sense of these properties we need to consider the concept of available space.
...try this in the live example — i have given the flex container a height in order that you can see how the items can be moved around inside the container.
Layout using named grid lines - CSS: Cascading Style Sheets
* {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } when defining the grid, i name my lines inside square brackets.
...to do this add the names inside the square brackets with whitespace between them [sidebar-end main-start].
...if you consider grid systems such as those found in frameworks like foundation or bootstrap, these are based on a 12 column grid.
Introducing the CSS Cascade - CSS: Cascading Style Sheets
WebCSSCascade
if several @font-face rules with the same descriptor are defined, only the most appropriate @font-face, as a whole, is considered.
... 1 user agent normal 2 user normal 3 author normal 4 animations 5 author !important 6 user !important 7 user agent !important 8 transitions in case of equality, the specificity of a value is considered to choose one or the other.
...inline styles within the html: user-agent css: li { margin-left: 10px } author css 1: li { margin-left: 0 } /* this is a reset */ author css 2: @media screen { li { margin-left: 3px } } @media print { li { margin-left: 1px } } user css: .specific { margin-left: 1em } html: <ul> <li class="specific">1<sup>st</sup></li> <li>2<sup>nd</sup></li> </ul> in this case, declarations inside li and .specific rules should apply.
Pagination - CSS: Cascading Style Sheets
to ensure that the pagination is understandable by people using a screenreader, we mark the items up as a list inside a <nav> element, and then use css to display the layout visually as a row.
... recipe download this example choices made this pattern is laid out using flexbox — one flex container nested inside another.
... the <nav> element is designated a flex container in order that we can center the list inside using the justify-content property.
box-shadow - CSS: Cascading Style Sheets
the presence of the inset keyword changes the shadow to one inside the frame (as if the content was depressed inside the box).
... inset shadows are drawn inside the border (even transparent ones), above the background, but below content.
...the specification does not include an exact algorithm for how the blur radius should be calculated, however, it does elaborate as follows: …for a long, straight shadow edge, this should create a color transition the length of the blur distance that is perpendicular to and centered on the shadow’s edge, and that ranges from the full shadow color at the radius endpoint inside the shadow to fully transparent at the endpoint outside it.
clip - CSS: Cascading Style Sheets
WebCSSclip
the <top> and <bottom> values are offsets from the inside top border edge of the box, while <right> and <left> are offsets from the inside left border edge of the box — that is, the extent of the padding box.
...if any side's value is auto, the element is clipped to that side's inside border edge.
...this is different from rect(auto, auto, auto, auto), which clips to the element’s inside border edges.
font-weight - CSS: Cascading Style Sheets
note that only four font weights are considered for relative weight calculation; see the meaning of relative weights section below.
...note that only four font weights are considered for relative weight calculation; see the meaning of relative weights section below.
... note that when using relative weights, only four font weights are considered — thin (100), normal (400), bold (700), and heavy (900).
list-style - CSS: Cascading Style Sheets
because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside.
... constituent properties this property is a shorthand for the following css properties: list-style-image list-style-position list-style-type syntax /* type */ list-style: square; /* image */ list-style: url('../img/shape.png'); /* position */ list-style: inside; /* type | position */ list-style: georgian inside; /* type | image | position */ list-style: lower-roman url('../img/shape.png') outside; /* keyword value */ list-style: none; /* global values */ list-style: inherit; list-style: initial; list-style: unset; the list-style property is specified as one, two, or three keywords in any order.
...rmal syntax <'list-style-type'> | <'list-style-position'> | <'list-style-image'> examples setting list style type and position html list 1 <ul class="one"> <li>list item1</li> <li>list item2</li> <li>list item3</li> </ul> list 2 <ul class="two"> <li>list item a</li> <li>list item b</li> <li>list item c</li> </ul> css .one { list-style: circle; } .two { list-style: square inside; } result specifications specification status comment css lists module level 3the definition of 'list-style' in that specification.
overscroll-behavior-block - CSS: Cascading Style Sheets
contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing block overscrolling in this demo we have two block-level boxes, one inside the other.
...the inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large height so it will also scroll vertically.
overscroll-behavior-inline - CSS: Cascading Style Sheets
contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing inline overscrolling in this demo we have two block-level boxes, one inside the other.
...the inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large width so it will also scroll horizontally.
overscroll-behavior-x - CSS: Cascading Style Sheets
contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling horizontally in our simple overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other.
...the inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large width so it will scroll horizontally.
text-transform - CSS: Cascading Style Sheets
this resulted in differences between browsers in the way the first letter was calculated (firefox considered - and _ as letters, but other browsers did not.
... both webkit and gecko incorrectly considered letter-based symbols like ⓐ to be real letters.
... full-width is a keyword that forces the writing of a character — mainly ideograms and latin scripts — inside a square, allowing them to be aligned in the usual east asian scripts (like chinese or japanese).
unicode-bidi - CSS: Cascading Style Sheets
this means that inside the element, reordering is strictly in sequence according to the direction property; the implicit part of the bidirectional algorithm is ignored.
... isolate this keyword indicates that the element's container directionality should be calculated without considering the content of this element.
... plaintext this keyword makes the elements directionality calculated without considering its parent bidirectional state or the value of the direction property.
Audio and Video Delivery - Developer guides
consider this html: <video> <source id="mp4_src" src="video.mp4" type='video/mp4; codecs="avc1.42e01e, mp4a.40.2"'> </source> <source id="3gp_src" src="video.3gp" type='video/3gpp; codecs="mp4v.20.8, samr"'> </source> <source id="ogg_src" src="video.ogv" type='video/ogv; codecs="theora, vorbis"'> </source> </video> since firefox doesn't support mp4 and 3gp on some platforms due to their pa...
...consider using a different format or using a fallback.
... setting up adaptive streaming media sources let's say you want to set up an adaptive streaming media source on a server, to be consumed inside an html5 media element.
Orientation and motion data explained - Developer guides
there are two coordinate frames to consider when using orientation and motion events: earth coordinate frame the earth coordinate frame is the coordinate frame fixed on the center of the earth; that is, the axes are aligned based on the pull of gravity and the standard magnetic north orientation.
... note: on a phone or tablet, the orientation of the device is always considered in relation to the standard orientation of the screen; this is the "portrait" orientation on most devices.
... on a laptop computer, the orientation is considered in relation to the keyboard.
User input and controls - Developer guides
using features such as contenteditable elements you can implement fast rich-text editors and with drag&drop let users moving elements inside your app.
... finger touch when developing web applications meant to be installed on touchscreen devices, it’s a good practice to take into consideration the different capabilities in terms of screen resolution and user input.
...the demo uses javascript to draw a ball inside a <canvas> element.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
(if this attribute is not set, the <button> is associated with its ancestor <form> element, if any.) this attribute lets you associate <button> elements to <form>s anywhere in the document, not just inside a <form>.
... formenctype html5 if the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), specifies how to encode the form data that is submitted.
... formmethod html5 if the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), this attribute specifies the http method used to submit the form.
<dfn>: The Definition element - HTML: Hypertext Markup Language
WebHTMLElementdfn
the <p> element, the <dt>/<dd> pairing, or the <section> element which is the nearest ancestor of the <dfn> is considered to be the definition of the term.
... specifying the term being defined the term being defined is identified following these rules: if the <dfn> element has a title attribute, the value of the title attribute is considered to be the term being defined.
...it has been in orbit for over 20 years, scanning the sky and returning data and photographs of unprecedented quality and detail.</p> <p>indeed, the <abbr title="hubble space telescope">hst</abbr> has arguably done more to advance science than any device ever built.</p> note the <abbr> element nested inside the <dfn>.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
note: you cannot use this attribute if the <img> element is inside an <a> or <button> element.
...to do so, nest the <img> tag inside the <a>.
...if the alt attribute is purposefully left off because the image has no textual equivalent, consider alternate methods to present what the image is trying to communicate.
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
if you wanted to submit a default value for the checkbox when it is unchecked, you could include an <input type="hidden"> inside the form with the same name and value, generated by javascript perhaps.
... essentially, then, the indeterminate attribute adds a third possible state to the checkbox: "i don't know." in this state, the browser may draw the checkbox in grey or with a different mark inside the checkbox.
... for instance, browsers on macos may draw the checkbox with a hyphen "-" inside to indicate an unexpected state.
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
the browser will consider each child <source> element and choose the best match among them.
... examples these examples demonstrate how different attributes of the <source> element change the selection of the image inside <picture>.
... if the <source>'s media condition evaluates to false, the browser skips it and evaluates the next element inside <picture>.
Preloading content with rel="preload" - HTML: Hypertext Markup Language
for example: resources that are pointed to from inside css, like fonts or images.
... embed: a resource to be embedded inside an <embed> element.
... object: a resource to be embedded inside an <object> element.
Choosing between www and non-www URLs - HTTP
this way, search engines don't index the same page several times, potentially leading to it being considered as duplicate content or spam, and even removing or lowering your page from the search engine result pages.
...in the previous example, http://www.example.org/whaddup would serve the same content as http://example.org/whaddup, but with an additional <link> element in the head: <link href="http://example.org/whaddup" rel="canonical"> unlike the previous case, browser history will consider non-www and www urls as independent entries.
... deciding the case this is a very subjective topic it could be considered a bikeshedding issue.
Evolution of HTTP - HTTP
on august 6th 1991, tim berners-lee's post on the public alt.hypertext newsgroup is now considered as the official start of the world wide web as a public project.
...theoretically, several parallel connections could be used (typically between 5 and 8), bringing considerable overhead and complexity.
...high-traffic web sites showed the most rapid adoption, saving considerably on data transfer overheads and subsequent budgets.
Browser detection using the user agent - HTTP
considerations before using browser detection when considering using the user agent string to detect which browser is being used, your first step is to try to avoid it if possible.
...also consider the following.
...if there is a lot calculated by this layout function before it determines the new layout of the page, then consider debouncing the event listener such that it is not called as often.
HTTP conditional requests - HTTP
weak validation weak validation differs from strong validation, as it considers two versions of the document as identical if the content is equivalent.
... for example, a page that would differ from another only by a different date in its footer, or different advertising, would be considered identical to the other with weak validation.
... these same two versions are considered different when using strong validation.
Content negotiation - HTTP
though strictly speaking user-agent is not in this list, it is sometimes also used to send a specific representation of the requested resource, though this is not considered as a good practice.
... the user-agent header though there are legitimate uses of this header for selecting content, it is considered bad practice to rely on it to define what features are supported by the user agent.
... agent-driven negotiation server-driven negotiation suffers from a few downsides: it doesn't scale well.
Referrer-Policy - HTTP
there is effort from browsers in moving to a stricter default value, namely strict-origin-when-cross-origin (see https://github.com/whatwg/fetch/pull/952), consider using this value (or a stricter one), if possible, when changing the referrer-policy.
...carefully consider the impact of this setting.
... integration with html you can also set referrer policies inside html.
JavaScript data types and data structures - JavaScript
caution: although bitwise operators can be used to represent several boolean values within a single number using bit masking, this is usually considered a bad practice.
...this technique should only be considered when it is the last measure that can be taken to optimize size.
...this has the downside that the data is available to any script running in the same context.
Details of the object model - JavaScript
a class defines all of the properties that characterize a certain set of objects (considering methods and fields in java, or members in c++, to be properties).
... you might think that, having called the workerbee constructor from inside the engineer constructor, you have set up inheritance appropriately for engineer objects.
...for example, consider the following statements: function hobbyist(hobby) { this.hobby = hobby || 'scuba'; } function engineer(name, projs, mach, hobby) { this.base1 = workerbee; this.base1(name, 'engineering', projs); this.base2 = hobbyist; this.base2(hobby); this.machine = mach || ''; } engineer.prototype = new workerbee; var dennis = new engineer('doe, dennis', ['collabra'], 'hugo'); further...
Indexed collections - JavaScript
for example, consider an array called emp, which contains employees' names indexed by their numerical employee number.
...if provided, thisobject becomes the value of the this keyword inside the body of the callback function.
... 1] < b[b.length - 1]) return -1; if (a[a.length - 1] > b[b.length - 1]) return 1; if (a[a.length - 1] == b[b.length - 1]) return 0; } myarray.sort(sortfn) // sorts the array so that myarray = ["wind","fire","rain"] if a is less than b by the sorting system, return -1 (or any negative number) if a is greater than b by the sorting system, return 1 (or any positive number) if a and b are considered equivalent, return 0.
Keyed collections - JavaScript
the private data and methods belong inside the object and are stored in the privates weakmap object.
... -0 and +0 are considered equal.
... nan is considered equal to itself (contrary to ===).
Map - JavaScript
nan is considered the same as nan (even though nan !== nan) and all other values are considered equal according to the semantics of the === operator.
... in the current ecmascript specification, -0 and +0 are considered equal, although this was not so in earlier drafts.
... setting object properties setting object properties works for map objects as well, and can cause considerable confusion.
globalThis - JavaScript
the this keyword could be used inside functions running in non–strict mode, but this will be undefined in modules and inside functions running in strict mode.
... html and the windowproxy in many engines globalthis will be a reference to the actual global object, but in web browsers, due to iframe and cross-window security considerations, it references a proxy around the actual global object (which you can't directly access).
... naming several other popular name choices such as self and global were removed from consideration because of their potential to break compatibility with existing code.
Iteration protocols - JavaScript
therefore inside of the function, the this keyword can be used to access the properties of the iterable object, to decide what to provide during the iteration.
...inside of this generator function, each entry can be provided by using yield.
..., 'b', 'c']) { console.log(value); } // "a" // "b" // "c" console.log([...'abc']); // ["a", "b", "c"] function* gen() { yield* ['a', 'b', 'c']; } console.log(gen().next()); // { value: "a", done: false } [a, b, c] = new set(['a', 'b', 'c']); console.log(a); // "a" non-well-formed iterables if an iterable's @@iterator method doesn't return an iterator object, then it's considered a non-well-formed iterable.
for await...of - JavaScript
like the await operator, the statement can only be used inside an async function.
... async function* asyncgenerator() { let i = 0; while (i < 3) { yield i++; } } (async function() { for await (let num of asyncgenerator()) { console.log(num); } })(); // 0 // 1 // 2 for a more concrete example of iterating over an async generator using for await...of, consider iterating over data from an api.
...rejectedpromises()) { console.log(numorpromise); } } catch (e) { console.log('catched', e) } // 0 // 1 // promise { 2 } // promise { <rejected> 3 } // 4 // catched 5 // called finally to make finally blocks of a sync generator to be always called use appropriate form of the loop, for await...of for the async generator and for...of for the sync one and await yielded promises explicitly inside the loop.
Autoplay guide for media and Web Audio APIs - Web media technologies
media with an active audio track are considered to be audible, and autoplay blocking applies to them.
... that means that both of the following are considered autoplay behavior, and are therefore subject to the browser's autoplay blocking policy: <audio src="/music.mp4" autoplay> and audioelement.play(); the following web features and apis may be affected by autoplay blocking: the html <audio> and <video> elements the web audio api from the user's perspective, a web page or app that spontaneously starts making noise without warning can be...
... consider this html for a media element: <video src="myvideo.mp4" autoplay onplay=handlefirstplay(event)"> here we have a <video> element whose autoplay attribute is set, with an onplay event handler set up; the event is handled by a function called handlefirstplay(), which receives as input the play event.
Optimizing startup performance - Web Performance
other than the reasons suggested above, consider the impact of a non-responsive page or user interface.
...you should also consider gzipping your data to make it as small as you can.
...for games, consider having background music playing or a nice splash screen displayed.
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: none|<funciri>|inherit; animatable: yes clip-rule it indicates how to determine what side of a path is inside a shape in order to know how a <clippath> should clip its target.
... value: accumulate|new|inherit; animatable: no fill it defines the color of the inside of the graphical element it applies to.
... value: <number>|<percentage>; animatable: yes fill-rule it indicates how to determine what side of a path is inside a shape.
clipPathUnits - SVG: Scalable Vector Graphics
value userspaceonuse | objectboundingbox default value userspaceonuse animatable yes userspaceonuse this value indicates that all coordinates inside the <clippath> element refer to the user coordinate system as defined when the clipping path was created.
... objectboundingbox this value indicates that all coordinates inside the <clippath> element are relative to the bounding box of the element the clipping path is applied to.
... it means that the origin of the coordinate system is the top left corner of the object bounding box and the width and height of the object bounding box are considered to have a length of 1 unit value.
maskContentUnits - SVG: Scalable Vector Graphics
value userspaceonuse | objectboundingbox default value userspaceonuse animatable yes userspaceonuse this value indicates that all coordinates inside the <mask> element refer to the user coordinate system as defined when the mask was created.
... objectboundingbox this value indicates that all coordinates inside the <mask> element are relative to the bounding box of the element the mask is applied to.
... a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox.
patternContentUnits - SVG: Scalable Vector Graphics
value userspaceonuse | objectboundingbox default value userspaceonuse animatable yes userspaceonuse this value indicates that all coordinates inside the <pattern> element refer to the user coordinate system as defined when the pattern tile was created.
... objectboundingbox this value indicates that all coordinates inside the <pattern> element are relative to the bounding box of the element the pattern is applied to.
... a bounding box could be considered the same as if the content of the <pattern> were bound to a "0 0 1 1" viewbox for a pattern tile of width and height of 100%.
rendering-intent - SVG: Scalable Vector Graphics
colors that are outside the gamut are converted to colors that have the same saturation but fall just inside the gamut.
... saturation this value leaves colors that fall inside the gamut unchanged.
... this method usually converts out of gamut colors to colors that have the same lightness but fall just inside the gamut.
<image> - SVG: Scalable Vector Graphics
WebSVGElementimage
the <image> svg element includes images inside svg documents.
...to include svg files and run scripts inside them, try <object> inside of <foreignobject>.
...this specific element and its behavior only apply inside svg documents or inline svg.
Namespaces crash course - SVG: Scalable Vector Graphics
dtds were never designed with mixed content in mind, and past attempts to create mixed content dtds are now considered to have failed.
...however, sometimes it is necessary to define parameters so that they can be reused on many different elements and still be considered to be the same parameter, independently of the element with which they are used.
...consider the following example.
SVG animation with SMIL - SVG: Scalable Vector Graphics
smil allows you to: animate the numeric attributes of an element (x, y, ...) animate transform attributes (translation or rotation) animate color attributes follow a motion path this is done adding an svg element like <animate> inside the svg element to animate.
...to do so, we add an <animate> element inside the <circle> element.
... if you want to animate more attributes inside the same element, just add more <animate> elements.
Gradients in SVG - SVG: Scalable Vector Graphics
you must give the gradient an id attribute; otherwise it can't be referenced by other elements inside the file.
...to insert one, you create a <lineargradient> node inside the definitions section of your svg file.
...inside the linear gradient are several <stop> nodes.
SVG fonts - SVG: Scalable Vector Graphics
internet explorer hasn't considered implementing this, the functionality has been removed from chrome 38 (and opera 25) and firefox has postponed its implementation indefinitely to concentrate on woff.
...it also shows how glyphs are created: by simply adding any graphical svg content inside.
... there are two further elements that can be defined inside font: <hkern> and <vkern>.
Mixed content - Web security
passive content list this section lists all types of http requests which are considered passive content: <img> (src attribute) <audio> (src attribute) <video> (src attribute) <object> subresources (when an <object> performs http requests) mixed active content mixed active content is content that has access to all or parts of the document object model of the https page.
... active content examples this section lists some types of http requests which are considered active content: <script> (src attribute) <link> (href attribute) (this includes css stylesheets) <iframe> (src attribute) xmlhttprequest requests fetch() requests all cases in css where a <url> value is used (@font-face, cursor, background-image, and so forth).
... <object> (data attribute) navigator.sendbeacon (url attribute) other resource types like web fonts and workers may be considered active mixed content, as they are in chrome.
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
the element must be defined before any other output document element inside the output document element for which it establishes attribute values.
... but it may be after or inside elements that won't be part of the output (like <xsl:choose> or <xsl:apply-templates> etc.).
...when used inside an <xsl:template> element, the parameter is local to that template.
Compiling from Rust to WebAssembly - WebAssembly
calling external functions in javascript from rust the next part looks like this: #[wasm_bindgen] extern { pub fn alert(s: &str); } the bit inside the #[ ] is called an "attribute", and it modifies the next statement somehow.
...you have an npm package inside of the pkg directory.
...this isn't considered a best practice, but this is a demo, so it's ok for now.
Classes and Inheritance - Archive of obsolete content
consider the following: let circle = circle(2, 3, 5); circle.draw(); // => typeerror: circle.draw is not a function this is not quite right.
...consider the following: let circle = circle(2, 3, 5); circle instanceof shape; // => false since instances of circle inherit from shape, we definitely want the result of this expression to be true.
context-menu - Archive of obsolete content
the example above works because <img> elements can't contain other elements, but in the example below, node.nodename is not guaranteed to be "p" - for example, it won't be "p" if the user context-clicked a link inside a paragraph: var cm = require("sdk/context-menu"); cm.item({ label: "a paragraph", context: cm.selectorcontext("p"), contentscript: 'self.on("context", function (node) {' + ' console.log(node.nodename);' + ' return true;' + '});' }); the content script is executed for every page that a context menu is shown for.
... if you run this add-on you'll see that it always logs "body", even if you click on a paragraph element inside the page: info: contextmenu-example: clicked: body by contrast, this add-on uses the pagecontext: var script = "self.on('click', function (node, data) {" + " console.log('clicked: ' + node.nodename);" + "});"; var cm = require("sdk/context-menu"); cm.item({ label: "body context", context: cm.pagecontext(), contentscript: script }); it will log the name of t...
widget - Archive of obsolete content
for example, this widget contains an image, so it looks like a simple icon: require("sdk/widget").widget({ id: "mozilla-icon", label: "my mozilla widget", contenturl: "http://www.mozilla.org/favicon.ico" }); you can make contenturl point to an html or icon file which you have packaged inside your add-on.
... the widget: data = require("sdk/self").data var clockpanel = require("sdk/panel").panel({ width:215, height:160, contenturl: data.url("clock.html") }); widget = require("sdk/widget").widget({ id: "open-clock-btn", label: "clock", contenturl: data.url("history.png") }); widget.panel = clockpanel; // will not be anchored widget.panel.show(); also, if you try to call panel.show() inside your widget's click event listener, the panel will not be anchored: data = require("sdk/self").data var clockpanel = require("sdk/panel").panel({ width:215, height:160, contenturl: data.url("clock.html") }); require("sdk/widget").widget({ id: "open-clock-btn", label: "clock", contenturl: data.url("history.png"), panel: clockpanel, onclick: function() { // will not be ancho...
frame/utils - Archive of obsolete content
usage module exports create function that takes the nsidomdocument of a privileged document and creates a browser element in its documentelement: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,foo'); let frame = create(window.document); optionally create can be passed set of options to configure created frame even further.
... parameters document : nsidomdocument options : object optional options: name type type string string that defines access type of the document loaded into it.
test/utils - Archive of obsolete content
if the callback is defined, then the beforefn is considered asynchronous, and the callback must be invoked before the test runs.
...if the callback is defined, then the afterfn is considered asynchronous, and the callback must be invoked before the next test runs.
ui/frame - Archive of obsolete content
right now it can be used in conjunction with a toolbar: you create a frame, then supply it to the toolbar's constructor, and the content is then displayed inside the toolbar.
...so there are three cases to consider: sending messages from a frame script to the main add-on code sending messages from the main add-on code to all instances of a frame, across all browser windows sending messages from the main add-on code to a single instance of a frame, attached to a specific browser window in all cases, postmessage() takes two arguments: the message itself and a targetorigin.
cfx - Archive of obsolete content
for example, if you type: cfx run ---no-run you will see something like: to launch the application, enter the following command: /path/to/firefox/firefox-bin -profile /path/to/profile/tmpjdnlp6.mozrunner -foreground -no-remote this enables you to run the add-on without going through cfx, which might be useful if you want to run it inside a debugger like gdb.
... for example, if you type: cfx run ---no-run you will see something like: to launch the application, enter the following command: /path/to/firefox/firefox-bin -profile /path/to/profile/tmpjdnlp6.mozrunner -foreground -no-remote this enables you to run the add-on without going through cfx, which might be useful if you want to run it inside a debugger like gdb.
Creating annotations - Archive of obsolete content
999/xhtml" xml:lang="en"> <head> <title>annotation</title> <style type="text/css" media="all"> body { font: 100% arial, helvetica, sans-serif; background-color: #f5f5f5; } textarea { width: 180px; height: 180px; margin: 10px; padding: 0px; } </style> </head> <body> <textarea rows='10' cols='20' id='annotation-box'> </textarea> </body> </html> save this inside data/editor as annotation-editor.html.
... here's the code: var textarea = document.getelementbyid('annotation-box'); textarea.onkeyup = function(event) { if (event.keycode == 13) { self.postmessage(textarea.value); textarea.value = ''; } }; self.on('message', function() { var textarea = document.getelementbyid('annotation-box'); textarea.value = ''; textarea.focus(); }); save this inside data/editor as annotation-editor.js.
Creating Reusable Modules - Archive of obsolete content
md5 is a commonly used hash function: although it's no longer considered secure, it works fine outside a security context.
... var filepicker = require("./filepicker.js"); var md5 = require("./md5.js"); require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5.hashfile(filepicker.promptforfile())); } }); distributing modules with jpm, we use npm as the package manager for sdk modules that don't ship inside firefox.
Modifying Web Pages Based on URL - Archive of obsolete content
self.port.on("replacepage", function(message) { document.body.innerhtml = "<h1>" + message + "</h1>"; }); in the add-on script, we'll send the content script a message inside onattach.
... // import the page-mod api var pagemod = require("sdk/page-mod"); // import the self api var self = require("sdk/self"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: self.data.url("my-script.js"), // send the content script a message inside onattach onattach: function(worker) { worker.port.emit("replacepage", "page matches ruleset"); } }); the replacepage message isn't a built-in message: it's a message defined by the add-on in the port.emit() call.
Using third-party modules (jpm) - Archive of obsolete content
the add-on sdk is extensible by design: you can use the modules that ship inside firefox, but you can also create your own modules and make them available for anyone else to use.
... with jpm, we use npm as the package manager for sdk modules that don't ship inside firefox.
Drag & Drop - Archive of obsolete content
next, setup the handlers so that files can be dropped on the application: function _dragover(aevent) { var dragservice = components.classes["@mozilla.org/widget/dragservice;1"].getservice(components.interfaces.nsidragservice); var dragsession = dragservice.getcurrentsession(); var supported = dragsession.isdataflavorsupported("text/x-moz-url"); if (!supported) supported = dragsession.isdataflavorsupported("application/x-moz-file"); if (supported) dragsession.candrop = true; } function _dragdrop(aevent) { var dragservice = components.classes["@mozilla.org/widget/dragser...
...vice;1"].getservice(components.interfaces.nsidragservice); var dragsession = dragservice.getcurrentsession(); var _ios = components.classes['@mozilla.org/network/io-service;1'].getservice(components.interfaces.nsiioservice); var uris = new array(); // if sourcenode is not null, then the drop was from inside the application if (dragsession.sourcenode) return; // setup a transfer item to retrieve the file data var trans = components.classes["@mozilla.org/widget/transferable;1"].createinstance(components.interfaces.nsitransferable); trans.adddataflavor("text/x-moz-url"); trans.adddataflavor("application/x-moz-file"); for (var i=0; i<dragsession.numdropitems; i++) { var uri = null; dragsession.getdata(trans, i); var flavor = {}, ...
HTML in XUL for rich tooltips - Archive of obsolete content
ooltiphtml", "<font color='red'>red foo</font>") document.getelementbyid("htmltip2").setattribute("tooltiphtml", "<font color='green'>green foo</font>") }, onmousetooltip: function(event) { //get the html tooltip string assigned to the element that the mouse is over (which will soon launch the tooltip) var txt = event.target.getattribute("tooltiphtml"); // get the html div element that is inside the custom xul tooltip var div = document.getelementbyid("myhtmltipdiv"); //clear the html div element of any prior shown custom html while(div.firstchild) div.removechild(div.firstchild); //safely convert html string to a simple dom object, stripping it of javascript and more complex tags var injecthtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interface...
...s.nsiscriptableunescapehtml) .parsefragment(txt, false, null, div); //attach the dom object to the html div element div.appendchild(injecthtml); } } window.addeventlistener('load', htmltip.onload, false); in the xul overlay, xmlns:html is used to enable html tags to be used inside the xul.
Miscellaneous - Archive of obsolete content
simulating mouse and key events https://developer.mozilla.org/samples/domref/dispatchevent.html also, new in firefox 3 / gecko 1.9: var utils = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindowutils); utils.sendmouseevent("mousedown", 10, 10, 0, 1, 0); utils.sendmouseevent("mouseup", 10, 10, 0, 1, 0); getting the currently selected text from browser.xul overlay context: var selectedtext = document.commanddispatcher.focusedwindow.getselection().tostring(); or: content.getselection(); // |window| object is implied; i.e., window.content.getselection() or: getbrowserselect...
... then create a xpcom service that adds the certificates inside that directory to the certs database on application startup.
Scrollbar - Archive of obsolete content
scrollbars inside browser elements will be styled to.
...so to make this work with osx, make an extra override: override chrome://global/skin/nativescrollbars.css chrome://app-global/skin/scrollbars.css change some color values inside the app/chrome/skin/global/scrollbars.css to test that the css is used.
Extension Versioning, Update and Compatibility - Archive of obsolete content
if you are running apache server, you might consider adding addtype application/xhtml+xml .xhtml to the .htacess file.
...windows users should consider hashtab for interactive (non-build-script) use.
Install Manifests - Archive of obsolete content
accepted values are: 1 opens optionsurl in a dialog box 2 options are displayed inside the add-on manager 3 opens optionsurl in a new tab (if the application supports that), or a dialog box optionstype defaults to 1 if there is an optionsurl included in install.rdf or 2 if there is no optionsurl and the file options.xul exists in the root of the add-on.
...if a value for the application's os is encountered that requires any specific abi, the abi is considered important for that os and the application will refuse to install the add-on if it does not find a matching os/abi combination.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
venkman, the javascript debugger venkman is a full-fledged javascript debugger that runs inside firefox.
...let’s look inside nslocalfilewin.cpp—we’ll see, for example, that it’s checking for the presence of a “:” in the drive name.
Adding menus and submenus - Archive of obsolete content
adding elements to existing menus just as explained in the previous sections, the best place to overlay your extension menu is inside the tools menu.
... that is, unless there's a place inside the menu structure where your extension menus make more sense.
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
consider the following xul fragment throughout the rest of this section.
... please consider creating an unprivileged sandbox and execute your code by calling evalinsandbox.
Setting Up a Development Environment - Archive of obsolete content
inside the helloworld2 directory, you'll see two directories: bin and src.
...in the projects tab you should be able to see the directory structure inside the src directory.
The Essentials of an Extension - Archive of obsolete content
in this case it is the menupopup element that's inside of the tools menu element.
...now we know that all of our objects are inside this object, which is unlikely to be duplicated or overwritten by other extensions.
User Notifications and Alerts - Archive of obsolete content
there's a catch, though: these notifications are inside the current tab, so switching tabs will make a notification disappear.
...this is not good from a ui perspective, so you consider custom alerts the very last resort.
Adding preferences to an extension - Archive of obsolete content
inside that, we create a file, defaults.js, that describes the default value of our preferences: pref("extensions.stockwatcher2.symbol", "goog"); the standard for third-party preferences, such as those used in extensions, is to use the string "extensions", a period, the name of the extension, another period, then a preference name, as seen in the example above.
...the <hbox> element is used to lay out the user interface by indicating that the widgets inside it should be positioned horizontally, next to each other in the window.
Creating a dynamic status bar extension - Archive of obsolete content
inforeceived() when the server responds to our request, our the inforeceived() function, which is embedded inside refreshinformation(), gets called automatically.
... we embed this function inside refreshinformation() so that its variable scope includes the variables used by that function.
Getting the page URL in NPAPI plugin - Archive of obsolete content
via dom from benjamin smedberg: the npapi gives you the ability to get access to the nsidomwindow object which contains the current plugin via the npnvdomelement enum passed to npn_getvalue.
... this returns an addrefed nsidomelement interface pointer from which you can call .ownerdocument (on nsidomnode), queryinterface that object to nsidom3document, and call .documenturi.
Images, Tables, and Mysterious Gaps - Archive of obsolete content
now consider what happens when we put that line in a table cell (figure 6).
...in the simplest case, we might add a style like this: td img {display: block;} consider this rule when applied to the following markup: <table cellspacing="0" cellpadding="0" border="0" width="500"> <tr><td><img src="nav1.gif"><img src="nav2.gif"><img src="nav3.gif"><img src="nav4.gif"><img src="nav5.gif"></td></tr> <tr><td style="background: red;"> <img src="smallred.gif" height="1" width="1"></td></tr> <tr><td> <p style="margin: 0.5em;">this is text in another cell of the tabl...
Bookmark Keywords - Archive of obsolete content
the %s is a little flag that means "insert user input here." it doesn't have to go at the end of the location field-- it can be anywhere inside the field.
...thus we could type any of the following into the address bar and get back useful results: <tt>google geitost</tt> <tt>google mozilla keyword bookmark</tt> <tt>google bookmark site:developer.netscape.com</tt> <tt>google netscape xml support -site:netscape.com</tt> a few examples in the course of writing this article, a number of potentially useful bookmarks were considered as possible examples.
Creating a Firefox sidebar extension - Archive of obsolete content
open your profile folder open the extensions folder (create it if it doesn't exist) create a new text file, and put the path to your extension folder inside, e.g.
... since we are packaging the extension with a jar file, we need to update the chrome.manifest file to take to jar file into consideration: example 7.
Getting Started - Archive of obsolete content
directories inside classic.jar is one directory, skin.
...create a directory called chrome inside it.
Exception logging in JavaScript - Archive of obsolete content
exception reporting in firefox 3 firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting: any methods on interfaces annotated with the [function] attribute in idl (see, for example, nsidomeventlistener) that throw exceptions always report those exceptions into the error console.
...consider this call chain: here we see c++ code calling javascript, which calls back into c++, which then calls back into javascript.
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
for example, if the user clicks on an image inside a link, this property will be set to the image, not the link.
...age.beforeshow = function (menu, context) { menu.reset(); if (matchesmycriteria(context)) menu.add("match!"); }; add an item to both the hyperlink context menu and the image context menu: jetpack.menu.context.page.on("a, img").set("a link or image"); add an item to the image context menu, but only for images contained in hyperlinks: jetpack.menu.context.page.on("a > img").set("an image inside a link"); add a "recent tweets" submenu to the jetpack menu.
Microsummary XML grammar reference - Archive of obsolete content
a generator is considered to be able to summarize a page if at least one of the <include> expressions matches the url of the page and none of the <exclude> expressions match the url of the page.
...white space between the child element tags and the regular expressions they contain is also not significant; it is not considered part of the regular expression, and it does not affect evaluation of the expressions.
New Security Model for Web Services - Archive of obsolete content
an entry is created if and only if the declaration file is considered valid (validation based on the syntax described above); an invalid document will result in access denial.
...normally a server will be either inside or outside of a firewall, so this is not a problem.
Table Layout Strategy - Archive of obsolete content
inside this routine the corresponding table layout strategy is created and initialized (basictablelayoutstrategy::initialize).
...th + padding due to col spans #define fix_adj 5 // fixed width + padding due to col spans #define pct 6 // percent width of cell or col #define pct_adj 7 // percent width of cell or col from percent colspan #define min_pro 8 // desired width due to proportional <col>s or cols attribute #define final 9 // width after the table has been balanced, considering all of the others the priority of allocations for columns is as follows: max(min_con, min_adj) max (pct, pct_adj) fix fix_adj max(des_con, des_adj), but use min_pro if present for a fixed width table, the column may get more space if the sum of the col allocations is insufficient column width info columns get their width information from style info <col width="200px"> and from the...
URIs and URLs - Archive of obsolete content
not all resources are network "retrievable"; e.g., human beings, corporations, and bound books in a library can also be considered resources.
...nsiuri and nsiurl in a strict sense necko does only know urls, uris by the above definition are much too generic to be properly represented inside a library.
Binding Attachment and Detachment - Archive of obsolete content
no bindings will be attached to elements that match the style rule, but are inside an element that has style display:none set.
... if the binding needs to execute any initialization code following its attachment to an element, it can do so using a <constructor> block inside <implementation> section.
XML in Mozilla - Archive of obsolete content
you can use xhtml elements inside an arbitrary xml document by using the xhtml namespace.
...see the proprietary dom/interfaces/core/nsidomxmldocument.idl interface.
button.type - Archive of obsolete content
place a menupopup element inside the button in this case.
...place a panel element inside the button.
Building accessible custom components in XUL - Archive of obsolete content
(technically, it draws the border inside the element instead of outside.) <code> grid.spreadsheet description:focus, grid.spreadsheet label:focus { outline: 1px dotted black; outline-offset: -2px; } </code> however, neither of those are our biggest problem.
...we want to be able to tab to the spreadsheet, then tab off of it, without cycling through every single cell inside the spreadsheet.
Deprecated and defunct markup - Archive of obsolete content
{many elements on this page are wrongly marked as deprecated, this page needs review} the following xul tags and attribute should be considered deprecated, if not defunct.
...--neil 03 march 2011 <bulletinboard> (made to support left/top styles, but <stack> can now do as well) <gripper> (inside of <scrollbar><thumb>; not to be used by itself) <listboxbody> (internal use only; part of xbl for <listbox>) <menubutton> (experiment in combining buttons and menus; use <button type> instead) <nativescrollbar> (displayed a native scrollbar; had been for mac only with native themes on) <outliner> (former name for <tree>; <listbox> had been "<tree>") <popup> (use menupopup) <pack...
Introduction to XUL - Archive of obsolete content
note that the frame is qualified with the prefix html:, since it is an html object being used inside a default xul namespace.
... the frame also has a special attribute called flex, which indicates how much the frame is allowed to stretch to consume available space inside its window.
Node - Archive of obsolete content
ArchiveMozillaXULNode
summary this is a scriptable interface corresponding to the nsidomnode xpcom interface.
... constants the nsidomnode interface is the primary datatype for the entire document object model.
Panels - Archive of obsolete content
note that the panel is not placed in a separate file and is instead placed inside another window.
...when you want to associate a panel with a button, place the <panel> element directly inside the button element.
Positioning - Archive of obsolete content
for a menupopup placed inside a menu, button or toolbarbutton, the position attribute controls how the menupopup is anchored to the parent menu, button or toolbarbutton.
...roughly equivalent to topleft topleft with the additional consideration of the offset mentioned.
Popup Guide - Archive of obsolete content
a popup is not created as a separate window or file, instead it is included inside another window or dialog.
... platform specific menu considerations see special per-platform menu considerations for some notes about handling menus on certain platforms, for instance creating the application menu on a macintosh.
documentCharsetInfo - Archive of obsolete content
« xul reference documentcharsetinfo obsolete since gecko 12.0 type: nsidocumentcharsetinfo this read-only property contains the nsidocumentcharsetinfo object for the document which is used to handle which character set should be used to display the document.
... the properties of the nsidocumentcharsetinfo object were merged into the docshell in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9).
Attribute Substitution - Archive of obsolete content
that is '?name?age' is considered to be a single variable with that name, not two variables together.
...<label value="?name" class="?gender^?nationality"/> the caret is considered a separator between variables, however it will not appear in the output.
Bindings - Archive of obsolete content
this tag doesn't go in the query block but instead inside a rule element.
...note that when bindings are used, the bindings and the action must be enclosed inside a rule element.
Building Menus With Templates - Archive of obsolete content
you might be wondering why we couldn't just put the datasources attribute on the menupopup instead and not have a menupopup inside the action body.
...the houses match the first rule so a menupopup and menuitem element are generated and inserted inside the street content (the menu element).
Building Trees - Archive of obsolete content
rather than generate content for every row in the tree, the results are stored in a list inside the builder.
...for instance, consider the following css: treechildren::-moz-tree-cell(dave) { background-color: lightgreen; } this would set the background color of a cell to green for any cell with the “dave” property.
Filtering - Archive of obsolete content
this can be done by modifying the dom nodes inside the query and rebuilding the template.
... <action> <menupopup> <menuitem uri="?country" label="?countrytitle" value="?country"/> </menupopup> </action> the result will be two generated menuitems, one for each country, inside a menupopup.
Simple Query Syntax - Archive of obsolete content
instead, the builder uses a default query, and the action is placed directly inside the <template> element.
...in reality, the builder could be considered to convert a simple query into an extended query, so that it can be processed in the same way.
Template Logging - Archive of obsolete content
unexpected <queryset> element a <queryset> element was placed in an invalid location; they should be placed directly inside the <template> element with no other kinds of elements as siblings.
...you should specify an element inside the first <action> body with a uri attribute.
Using Recursive Templates - Archive of obsolete content
the content of the action body is again generated for each result, but instead of being inserted inside the outermost groupbox, this new content is inserted inside the content generated from the previous iteration.
... the content is always inserted directly inside the element with the uri attribute.
Things I've tried to do with XUL - Archive of obsolete content
(to add insult, xul layout code *explicitly* trims off '%' from width/height, thus treating it as pixels.) for reference, i'd like the following to give a vbox that resizes along with the window, with the green, red, and blue inside boxes always maintaining a 30%-20%-50% ratio to the height of the parent vbox.
...so, as soon as you add a label or some other element inside, there will be a different amount of "empty space" to allocate in different boxes.
Adding Event Handlers - Archive of obsolete content
for example, when the mouse is moved over a button that is inside a box, a 'mousemove' event is generated, and sent first to the window, followed by the document, and then the box.
...naturally, an event attached to an element higher up will receive notification of all elements inside it, whereas an event attached to a button will only receive events pertaining to that button.
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
event handlers as you might expect, mouse clicks, key presses and other events are passed to each of the elements inside the content.
...you can add event handlers to the elements inside the content if needed.
Adding Labels and Images - Archive of obsolete content
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.
...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.
Adding Style Sheets - Archive of obsolete content
toolbar > button matches all buttons that are directly inside toolbar elements.
... toolbar > button.bigbuttons matches all button elements with a class of bigbuttons that are directly inside toolbar elements.
Broadcasters and Observers - Archive of obsolete content
you should declare all your broadcasters inside a broadcasterset element so that they are all kept together.
...the observes element itself does not change but the element it is inside changes, which in this case is a button.
Creating an Installer - Archive of obsolete content
inside the jar file, you can add all the various files that you want to have installed.
...these files will typically be placed inside a directory in the archive but they do not have to be.
Localization - Archive of obsolete content
inside these archives, you will find the files that hold the localized text for each window.
... inside the archives, you would place the dtd files in which you declare entities.
Manifest Files - Archive of obsolete content
the path 'content/browser' specifies the path inside the archive where the xul files are located.
...many people put this as a subdirectory inside mozilla's chrome directory, but this isn't necessary.
Trees and Templates - Archive of obsolete content
effectively, the elements outside (or above) the element with the uri attribute are not duplicated whereas the element with the uri attribute and the elements inside it are duplicated for each resource.
... as the tree builder is used and not the content builder, the structure of the elements in the above example must be as shown, with the treechildren element inside the rule.
checkbox - Archive of obsolete content
this attribute only has any effect when used inside a prefwindow.
...defaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulcheckboxelement ...
columns - Archive of obsolete content
the columns element may be nested inside another columns element.
... other elements placed inside a columns element occupy the full height of the grid and are placed in their corresponding positions between the columns.
key - Archive of obsolete content
ArchiveMozillaXULkey
« xul reference home [ examples | attributes | properties | methods | related ] the key element defines a window-global keyboard shortcut and must be placed inside a keyset element.
...isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata details on key, keycode, and modifiers attributes for example, consider the following key: <key key="r" modifiers="shift"/> this key will only match when the shift key is pressed as well as the r key, and no other keys.
label - Archive of obsolete content
ArchiveMozillaXULlabel
related elements description attributes label interfaces nsiaccessibleprovider, nsidomxullabelelement notes labels are not focusable note: starting in gecko 2.0, labels are properly not focusable.
... they used to incorrectly inherit from nsidomxulcontrolelement.
listbox - Archive of obsolete content
this attribute only has any effect when used inside a prefwindow.
... related elements listcell, listcol, listcols, listhead, listheader, listitem interfaces nsiaccessibleprovider, nsidomxulmultiselectcontrolelement ...
listitem - Archive of obsolete content
this attribute only has any effect when used inside a prefwindow.
... related elements listbox, listcell, listcol, listcols, listhead, listheader interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
menu - Archive of obsolete content
ArchiveMozillaXULmenu
control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu.
... related elements menubar, menuitem, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider, nsidomxulcontainerelement, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
menubar - Archive of obsolete content
on the macintosh, the menubar is displayed along the top of the screen, and all non-menu related elements inside the menubar will be ignored.
... to look native (at least on windows), the menubar element needs to be placed inside a toolbox element.
menuitem - Archive of obsolete content
control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu.
... related elements menu, menubar, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
menuseparator - Archive of obsolete content
control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu.
... lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menubar, menuitem, menulist, menupopup interfaces nsiaccessibleprovider, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
panel - Archive of obsolete content
ArchiveMozillaXULpanel
warning: for firefox versions between 3.6 and 4.0, placing an iframe, browser or editor inside a panel is not supported.
... related interfaces nsiaccessibleprovider, nsidomxulpopupelement ...
richlistbox - Archive of obsolete content
this attribute only has any effect when used inside a prefwindow.
... related interfaces nsiaccessibleprovider, nsidomxulmultiselectcontrolelement ...
rows - Archive of obsolete content
ArchiveMozillaXULrows
the rows element may be nested inside another rows element.
... non-row related elements placed inside a rows element occupy the full width of the grid and are placed in their corresponding positions between the rows.
tab - Archive of obsolete content
ArchiveMozillaXULtab
« xul reference home [ examples | attributes | properties | methods | related ] a single tab which should be placed inside a tabs element.
... interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
a tabs element should be placed inside a tabbox and should contain tab elements.
... interfaces nsiaccessibleprovider, nsidomxulselectcontrolelement ...
textnode - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] normally when substituting rdf resources in template rules, you place the rdf property name inside an attribute value preceded with rdf:.
... this is useful if you want to use the html element or other elements that have text content inside them instead of in attributes.
titlebar - Archive of obsolete content
elements inside the titlebar usually don't receive any mouse events, so e.g.
... buttons inside it can't be clicked and textboxes can't be focused with the mouse.
tree - Archive of obsolete content
ArchiveMozillaXULtree
unlike other elements, the data to display inside the tree is not specified using tags, but is determined from a view object.
... interfaces nsiaccessibleprovider, nsidomxultreeelement, nsidomxulmultiselectcontrolelement script examples to have alternating colors for each row, use the style rules like the following: treechildren::-moz-tree-row(selected) { background-color: #ffffaa; } treechildren::-moz-tree-row(odd) { background-color: #eeeeee; } treechildren::-moz-tree-row(odd, selected) { background-color: #ffffaa; } treechildren::-moz-tree-cell-text(selec...
treeitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a treeitem should be placed inside a treechildren element and should contain treerow elements.
... elements that appear inside the element with the attribute will be repeated for each node in the rdf datasource.
treerow - Archive of obsolete content
it should be placed inside a treeitem element.
...if child rows are necessary, they should be placed in a treechildren element inside the parent treeitem.
nsIContentPolicy - Archive of obsolete content
acontext {optional_inline}} the nsidomnode or nsidomwindow that initiated the request, or something that can queryinterface() to one of those; can be null if inapplicable.
...the nsidomnode or nsidomwindow that initiated the request, or something that can query interface to one of those; can be null if inapplicable.
Gecko Compatibility Handbook - Archive of obsolete content
since a browser is supposed to ignore html tags it does not recognize and render the content inside the tags, web page authors have used the technique of combining proprietary html that will work as expected in each browser.
...to understand why, consider the following: html without optional ending tags equivalent html with optional ending tags <select> <option>optionvalue </select> <select> <option>optionvalue</option> </select> now consider if we used the xml empty tag notation: the <option />.
Extentsions FAQ - Archive of obsolete content
e and the corresponding css see http://www.w3.org/tr/rec-css2/cascade.html#cascade friday, october 13 - 20, 2006 (↑ top) how to get a refenece to the sidebar window assuming you have chrome privileges, this should work: var ci = components.interfaces; var toplevelwindow = window.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindow) .queryinterface(ci.nsidomchromewindow); var sidebar = toplevelwindow.document.getelementbyid("sidebar"); alert(sidebar.contentdocument); is there anyone successfully using dojo in a firefox extension and where to fine sample codes?
... friday, october 6 - 13, 2006 (↑ top) has anyone experienced problem with update that it only considers themes and extensions during the update check, ignoring langpacks with firefox 2.0?
NP_GetMIMEDescription - Archive of obsolete content
one mime type // example inside http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/plugin.cpp #define mime_type_description "application/basic-plugin:bsp:basic example plug-in for mozilla" const char* np_getmimedescription(void) { return(mime_types_description); } two mime types const char* np_getmimedescription(void) { return "application/basic-example-plugin:xmp1:example 1;application/basic-example2-...
... #include <gio/gio.h> const char* desc = g_content_type_get_description("audio/ogg"); javascript inside a web page, you can retrieve these informations with this code: var mimetype = navigator.mimetypes['application/basic-example-plugin']; if (mimetype) { alert(mimetype.type + ':' + mimetype.suffixes + ':' + mimetype.description); } ...
Encryption and Decryption - Archive of obsolete content
(for more information about rc4 and other ciphers used with ssl, see "introduction to ssl.") an encryption key is considered full strength if the best known attack to break the key is no faster than a brute force attempt to test every key possibility.
... because it is relatively trivial to break an rsa key, an rsa public-key encryption cipher must have a very long key, at least 1024 bits, to be considered cryptographically strong.
Array comprehensions - Archive of obsolete content
for future-facing usages, consider using array.prototype.map, array.prototype.filter, arrow functions, and spread syntax.
... syntax [for (x of iterable) x] [for (x of iterable) if (condition) x] [for (x of iterable) for (y of iterable) x + y] description inside array comprehensions, these two kinds of components are allowed: for...of and if the for-of iteration is always the first component.
Generator comprehensions - Archive of obsolete content
for future-facing usages, consider using generator.
... syntax (for (x of iterable) x) (for (x of iterable) if (condition) x) (for (x of iterable) for (y of iterable) x + y) description inside generator comprehensions, these two kinds of components are allowed: for...of and if the for-of iteration is always the first component.
Legacy generator function expression - Archive of obsolete content
for future-facing usages, consider using the function* expression.
... the function keyword can be used to define a legacy generator function inside an expression.
New in JavaScript 1.5 - Archive of obsolete content
functions can now be declared inside an if clause.
... functions can now be declared inside an expression.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
consider the code in listing 4.
... add a statement inside the server-side script block to expose a particular server-side function to the browser.
XForms Repeat Element - Archive of obsolete content
here comes the output: <br/> <xf:output ref="@id"><xf:label>output: </xf:label></xf:output> <div xf:repeat-nodeset="nest"><xf:output ref="."><xf:label>nested output: </xf:label></xf:output></div> </div> repeat in anonymous content (usage in xbl) you can use repeat elements inside anonymous content to create powerful new widgets.
... in this scenario, though, you should use the anonid attribute to identify the repeat element that has been placed inside anonymous content.
XForms Switch Module - Archive of obsolete content
binding a switch to a data node will also set a context that the expressions contained inside the case elements can build upon.
...if no case is initially selected, the first case inside the switch becomes selected and visible.
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
bare pseudo-classes the second piece of the problem comes when we consider the effects of a "bare" pseudo-class in a selector.
...consider the effects of the following rule: a:hover {color: red;} in a document with an unclosed named anchor, any text that follows the anchor's open tag will be colored red (unless another css rule intervenes).
Common causes of memory leaks in extensions - Extensions
consider the following example code that could be part of your browser.xul overlay: gbrowser.addeventlistener("domcontentloaded", function(evt) { var contentdoc = evt.originaltarget; var i = 0; // refresh the title once each second setinterval(function() { contentdoc.title = ++i; }, 1000); }, false); one would normally expect that the interval (or timer) would be destroyed as soon as t...
... consider the following example: var myobserver = { observe: function(subject, topic, data) { window.document.documentelement.setattribute( "pbm", (data == "enter") ?
Game monetization - Game development
when you've spent your time building a game, distributing it and promoting it you should consider earning some money out of it.
... publishers taking your games for revenue share, and/or licensing may require implementing their own apis, which could take extra work, so consider that in your rates too.
Publishing games - Game development
game monetization when you spend your time building, publishing and promoting your game, you will at some point consider earning money out of it.
... game monetization is essential to anyone who considers their game development work a serious endeavour on the path to becoming an independent game developer able to make a living, so read on and see what your options are.
Building up a basic demo with PlayCanvas editor - Game development
animating our scene animating 3d models might be considered an advanced thing to do, but all we want to do is to control a few properties of a given object — we can use a script component to do that.
...add the following line inside this function, to rotate the cube on every frame: this.entity.rotate(dt*10, dt*20, dt*30); in the line above this.entity refers to the object to which the script will be attached (the box); using the dt variable, which contains the delta time passed since the previous frame, we can rotate the box by a different amount around all three axes.
WebVR — Virtual Reality for the Web - Game development
boris smus has written about the concept of responsive webvr, where a single web game can be played on various devices like laptops without vr hardware, pcs with oculus rift, or smartphones inside google cardboard and still deliver a unique and valuable experience across all of them.
... immersion is more important than gameplay or graphics - you have to feel you're "inside" the experience.
Efficient animation for web games - Game development
the downside of using this vs.
...though it is possibly overkill for simple games, you may also want to consider using web worker threads.
Collision detection - Game development
for better readability of the code we will define the b variable for storing the brick object in every loop of the collision detection: function collisiondetection() { for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { var b = bricks[c][r]; // calculations } } } if the center of the ball is inside the coordinates of one of our bricks, we'll change the direction of the ball.
... for the center of the ball to be inside the brick, all four of the following statements need to be true: the x position of the ball is greater than the x position of the brick.
Create the Canvas and draw on it - Game development
before we can start writing the game's functionality, we need to create a basic structure to render the game inside.
...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.
Move the ball - Game development
delete all the javascript you currently have inside your html file except for the first two lines, and add the following below them.
...now, let's draw the ball — add the following inside your draw() function: ctx.beginpath(); ctx.arc(50, 50, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); try your updated code now — the ball should be repainted on every frame.
Paddle and keyboard controls - Game development
inside the draw() function, we will check if the left or right cursor keys are pressed when each frame is rendered.
...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 its size.
Build the brick field - Game development
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.
...now we need to add some code inside the nested loop stucture to draw each brick.
Collision detection - Game development
first, add a new line inside your update() function that checks for collision detection between ball and bricks, as shown below: function update() { game.physics.arcade.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.
...inside the function we remove the brick in question from the screen simply by running the kill() method on it.
Initialize the framework - Game development
before we can start writing the game's functionality, we need to create a basic structure to render the game inside.
... save the phaser code inside a /js directory in the same location as your index.html file.
Move the ball - Game development
the code inside it is executed on every frame, so it's a perfect place to put the code that will update the ball's position on screen.
... add the following new lines of the code inside update(), as shown: function update() { ball.x += 1; ball.y += 1; } the code above adds 1 to the x and y properties representing the the ball coordinates on the canvas, on each frame.
Callback function - MDN Web Docs Glossary: Definitions of Web-related terms
a callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.
...a good example is the callback functions executed inside a .then() block chained onto the end of a promise after that promise fulfills or rejects.
Speculative parsing - MDN Web Docs Glossary: Definitions of Web-related terms
the downside is that there's more work lost when the speculation fails.
...<script>document.write("<div></div>");</script> inside the head element will be interpreted as <script>document.write("</head><body><div></div>");</script> which is unbalanced.
Advanced styling effects - Learn web development
the really nice thing about filters however, is that they work on the exact shapes of the content inside the box, not just the box itself as one big chunk, so it is worth knowing the difference.
...instead, the circle function is taking its centre point from the centre of the image file, as if we had put a compass in the middle of the file and drawn a circle that fits inside the file.
Test your skills: Images and Form elements - Learn web development
we want the image to scale down to fit inside the box without any extra white space, but we do not mind if some part of the image is cropped.
...your task is to make the following changes to the way this form looks: use attribute selectors to target the search field and button inside .myform.
Organizing your CSS - Learn web development
for example, you might have something like the below selector, which applies the rule to a <p> with a class of box inside an <article> with a class of main.
... so for example, with partials, you could have several style files inside a directory, say foundation/_code.scss, foundation/_lists.scss, foundation/_footer.scss, foundation/_links.scss, etc., then use the sass @use role to load them into other stylesheets: // foundation/_index.sass @use 'code' @use 'lists' @use 'footer' @use 'links' if the partials are all loaded into an index file, as implied above, you can then load that entire directory into another stylesheet i...
Overflowing content - Learn web development
css tries to avoid "data loss" let's consider two examples that demonstrate the default behavior of css when there is overflow.
...if you have a long word in a small box, you might consider using the word-break or overflow-wrap properties.
Attribute selectors - Learn web development
[attr=value] a[href="https://example.com"] matches elements with an attr attribute whose value is exactly value — the string inside the quotes.
... substring matching selectors these selectors allow for more advanced matching of substrings inside the value of your attribute.
Combinators - Learn web development
body article p in the example below, we are matching only the <p> element which is inside an element with a class of .box.
...for example, to select only <p> elements that are direct children of <article> elements: article > p in this next example, we have an unordered list, nested inside of which is an ordered list.
CSS selectors - Learn web development
it is a pattern of elements and other terms that tell the browser which html elements should be selected to have the css property values inside the rule applied to them.
...for example, ::first-line always selects the first line of text inside an element (a <p> in the below case), acting as if a <span> was wrapped around the first formatted line and then selected.
Grids - Learn web development
add this to the css inside your file: .container { display: grid; } unlike flexbox, the items will not immediately look any different.
...therefore if one of your tracks has something large inside it there will be less free space to share out.
Practical positioning examples - Learn web development
the unordered list contains three list items with links inside, which will become the actual tabs to click on for displaying our content panels.
...here we simply set a fixed height to make sure the panels fit snugly inside the info-box, position relative to set the <div> as the positioning context, so you can then place positioned child elements relative to it and not the <html> element, and finally we clear the float set in the css above so that it doesn't interfere with the remainder of the layout.
What is CSS? - Learn web development
note: a browser is sometimes called a user agent, which basically means a computer program that represents a person inside a computer system.
...inside those will be one or more declarations, which take the form of property and value pairs.
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
</div> in case of complex html hierarchies, if a rule seems to be ignored, check if the element is inside another element with a different style.
...</div> in this example the body * selector applies the rule to all elements inside body, at any hierarchy level, including the .stockup class.
create fancy boxes - Learn web development
as you will notice, color gradients are considered to be images and can be manipulated as such */ background-image: linear-gradient(175deg, rgba(0,0,0,0) 95%, #8da389 95%), linear-gradient( 85deg, rgba(0,0,0,0) 95%, #8da389 95%), linear-gradient(175deg, rgba(0,0,0,0) 90%, #b4b07f 90%), linear-gradient( 85deg, rgba(0,0,0,0) 92%, #b4b07f 92%), linear-gradient...
...even if it is necessary, it's somewhat considered bad practice.
Styling links - Learn web development
the text "http" should therefore only appear in external links (like the second and third ones), and we can select this with an attribute selector: a[href*="http"] selects <a> elements, but only if they have an href attribute with a value that contains "http" somewhere inside it.
...we center the text inside each link, set the line-height to 3 to give the buttons some height (which also has the advantage of centering the text vertically), and set the text color to black.
How do I use GitHub Pages? - Learn web development
here's what you'd type if you've put your website in a directory called test-site on your desktop: cd desktop/test-site when the command line is pointing inside your website directory, type the following command, which tells the git tool to turn the directory into a git repository: git init an aside on command line interfaces the best way to upload your code to github is via the command line — this is a window where you type in commands to do things like create files and run programs, rather than clicking inside a user interface.
... it will look something like this: note: you could also consider using a git graphical user interface to do the same work, if you feel uncomfortable with the command line.
Test your skills: Form validation - Learn web development
to help, you might want to consider adding some simple css to show when a form field is valid or invalid.
... again, to help you might want to consider adding some simple css to show when a form field is valid or invalid.
Use JavaScript within a webpage - Learn web development
you run javascript from inside your html webpages.
...for example, if you've implemented a nice javascript progress bar, make sure to supplement it with matching text percentages inside the html.
Test your skills: Multimedia and embedding - Learn web development
the audio is called audio.mp3, and it is in a folder inside the current folder called media.
...the files are called video.mp4 and video.webm, and are in a folder inside the current folder called media.
Assessment: Structuring planet data - Learn web development
if the online editor you are using doesn't have separate javascript/css panels, feel free to put them inline <script>/<style> elements inside the html page.
... create all the content rows inside the table body, remembering to make all the row headings into headings semantically.
General asynchronous programming concepts - Learn web development
we couldn't render our 1 million blue circles inside our worker; it can basically just do the number crunching.
...consider the following thread diagrams: main thread: task a --> task b in this case, let's say task a is doing something like fetching an image from the server and task b then does something to the image like applying a filter to it.
Asynchronous JavaScript - Learn web development
the former allows standard functions to implicitly behave asynchronously with promises, whereas the latter can be used inside async functions to wait for promises before the function continues.
... choosing the right approach to finish this module off, we'll consider the different coding techniques and features we've discussed throughout, looking at which ones you should use when, with recommendations and reminders of common pitfalls where appropriate.
Function return values - Learn web development
our draw() function draws 100 random circles somewhere on an html <canvas>: function draw() { ctx.clearrect(0, 0, width, height); for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } inside each loop iteration, three calls are made to the random() function, to generate a random value for the current circle's x-coordinate, y-coordinate, and radius, respectively.
...therefore, a sentence is printed out inside the paragraph element that states the square, cube, and factorial values of the number.
Test your skills: Events - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
... events 1 in our first events-related task, you need to create a simple event handler that causes the text inside the button (btn) to change when it is clicked on, and change back when it is clicked again.
Test your skills: Loops - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
... loops 1 in our first looping task we want you start by creating a simple loop that goes through all the items in the provided myarray and prints them out on the screen inside list items (i.e., <li> elements), which are appended to the provided list.
Basic math in JavaScript — numbers and operators - Learn web development
first try entering some simple examples of your own, such as 10 + 7 9 * 8 60 % 3 you can also try declaring and initializing some numbers inside variables, and try using those in the sums — the variables will behave exactly like the values they hold for the purposes of the sum.
....queryselector('p'); btn.addeventlistener('click', updatebtn); function updatebtn() { if (btn.textcontent === 'start machine') { btn.textcontent = 'stop machine'; txt.textcontent = 'the machine has started!'; } else { btn.textcontent = 'start machine'; txt.textcontent = 'the machine is stopped.'; } } open in new window you can see the equality operator being used just inside the updatebtn() function.
Test your skills: Arrays - Learn web development
in this task we'd like you to create an array of three items, stored inside a variable called myarray.
... go over each item in the array and add its index number after the name inside parentheses, for example ryu (0).
Aprender y obtener ayuda - Learn web development
different learning methods it is interesting to consider that there are two main ways in which your brain learns things — focused and diffuse learning: focused learning is what you might more traditionally associate with academic subjects.
... make sure the text is centered inside each menu item etc.
Multimedia: video - Learn web development
optimizing video delivery it's best to compress all video, optimize <source> order, set autoplay, remove audio from muted video, optimize video preload, and consider streaming the video.
... consider streaming video streaming allows the proper video size and bandwidth (based on network speed) to be delivered to the end user.
Client-Server Overview - Learn web development
the web application dynamically creates an html page by putting the data (from the database) into placeholders inside an html template.
... for example, consider the following django (python) code that maps two url patterns to two view functions.
Website security - Learn web development
for example, consider a site search function where the search terms are encoded as url parameters, and these terms are displayed along with the results.
...consider two-factor authentication for your site, so that in addition to a password the user must enter another authentication code (usually one that is delivered via some physical hardware that only the user will have, such as a code in an sms sent to their phone).
Ember app structure and componentization - Learn web development
this is because the default css absolutely positions the checkbox + label with negative top and left values to move it next to the input, rather than it being inside the "main" section.
...enter the following lines into your terminal, one by one: ember generate component todo-list ember generate component todo ember generate component footer you’ll now see the following inside your todomvc/app/components directory: now that we have all of our component structure files, we can cut and paste the html for each component out of the application.hbs file and into each of those components, and then re-write the application.hbs to reflect our new abstractions.
Deployment and next steps - Learn web development
create a .gitlab-ci.yml file inside your project's root and give it the following content: image: node:latest pages: stage: deploy script: - npm install - npm run build artifacts: paths: - public only: - master here we are telling gitlab to use an image with the latest version of node to build our app.
...we already covered most of its content, so it won't take you much time to complete it — you should consider it as practise!
Working with Svelte stores - Learn web development
but not all application state belongs inside your application's component hierarchy.
... create a new file — stores.js — inside your src directory.
Using Vue computed properties - Learn web development
computed: { listsummary() { const numberfinisheditems = this.todoitems.filter(item =>item.done).length return `${numberfinisheditems} out of ${this.todoitems.length} items completed` } } now we can add {{listsummary}} directly to our template; we'll add this inside an <h2> element, just above our <ul>.
... add the described <h2> and update the <ul> inside your app's template as follows: <h2 id="list-summary">{{listsummary}}</h2> <ul aria-labelledby="list-summary" class="stack-large"> <li v-for="item in todoitems" :key="item.id"> <to-do-item :label="item.label" :done="item.done" :id="item.id"></to-do-item> </li> </ul> you should now see the list summary in your app, and the total number of items update as you add more todo items!
Styling Vue components with CSS - Learn web development
to keep the style definitions close to the component we can add a <style> element inside it.
... to use the scoped modifier, create a <style> element inside todoitem.vue, at the bottom of the file, and give it a scoped attribute: <style scoped> </style> next, copy the following css into the newly created <style> element: .custom-checkbox > .checkbox-label { font-family: arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-weight: 400; font-size: 16px; font-size: 1rem; line-height: 1.25; color: #0b0c0c; display: ...
Introduction to cross browser testing - Learn web development
ios safari on iphone/ipad, chrome and firefox on iphone/ipad/android), also do tests in any other browsers you have included inside your target list.
... testing on prerelease browsers it is often a good idea to test on prerelease versions of browsers; see the following links: firefox developer edition edge insider preview safari technology preview chrome canary opera developer this is especially prevalent if you are using very new technologies in your site, and you want to test against the latest implementations, or if you are coming across a bug in the latest release version of a browser, and you want to see if the browser's developers have fixed the bug in a newer version.
Learn web development
frameworks and tooling: after mastering the essentials of vanilla html, css, and javascript, you should learn about client-side web development tools, and then consider digging into client-side javascript frameworks, and server-side website programming.
... you can update the learning-area repository with any changes made to the master version on github with the following steps: in your command prompt/terminal, go inside the learning-area directory using cd.
Embedding API for Accessibility
text zoom on a per-window basis the nsidomwindow::gettextzoom(float *zoomfactor) and nsidomwindow::settextzoom(float zoomfactor) methods can be used to set a wide range of text zoom factors on a content window.
...for double-sized text, use nsidomwindow::settextzoom(2.0); using accessibility preferences there are a number of prefs related to accessibility.
Multiprocess on Windows
since gecko's main thread uses com, and com requires threads to declare their threading model, the main thread must initialize itself to live inside its own single threaded apartment (sta).
...as you should already know, you can't directly touch a com object's reference count unless you're already inside the apartment which contains that object.
Software accessibility: Where are we today?
hearing impaired we must also consider the increasing numbers of aging baby boomers that are beginning to experience problems with their sight, vision or dexterity.
...extremely consistent keystroke support is a very important consideration.
Mozilla’s UAAG evaluation report
we consider this to be a very difficult problem.
...however, any such use should be carefully considered, given the potential impact on network traffic of automatically making such requests for every link/object in the page.
A bird's-eye view of the Mozilla framework
let’s consider a resource description framework (rdf) example, where rdf is a framework for describing and interchangingmetadata, that is, information about information.
... inside an xpcom component figure 3 shows a more detailed view of an xpcom component.
Creating reftest-based unit tests
for example, the html 4.01 specification at the w3c specifies that text inside of a <blockquote> will be indented, but it does not specify the number of pixels of the indentation.
...create a directory (inside firefox's source code tree) and make that your current directory (i.e.
Simple Thunderbird build
it now needs to be placed inside the mozilla source code, in a directory named comm/ (this is inverse from thunderbird 59 and earlier): hg clone https://hg.mozilla.org/mozilla-central source/ cd source/ hg clone https://hg.mozilla.org/comm-central comm/ the source code requires 3.6gb of free space or more and additionally 5gb or more for default build.
...closed), you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction).
Multiple Firefox profiles
from profile manager inside firefox if you already have firefox instance running, you can open another profile from the integrated profile manager on any platform: type about:profiles into the browser url search bar.
...if you choose a folder that isn't empty, and you later remove the profile and choose the \"delete files\" option, everything inside that folder will be deleted.
Limitations of chrome scripts
a common pattern here is to use the notificationcallbacks property of the nsihttpchannel to get the dom window that initiated the load, like this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var domwindow = httpchannel.notificationcallbacks.getinterface(ci.nsidomwindow); } } or this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var domwindow = httpchannel.notificationcallbacks.getinterface(ci.nsiloadcontext).associatedwindow; } } in multiprocess firefox these patterns will no longer work: the getinterface call will fail.
... to make the shim unnecessary: register event listeners on the global object inside a frame script.
Process scripts
this can be achieved by traversing the docshell tree up to the top window and then retrieving its content message manager, as follows: function contentmmfromcontentwindow(window) { let tree = window.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidocshelltreeitem); let top = tree.sametyperoottreeitem; let iface = queryinterface(ci.nsidocshell).queryinterface(ci.nsiinterfacerequestor); return iface.getinterface(ci.nsicontentframemessagemanager); } this is intended for unprivileged pages running in a content process.
... if the above doesn't work try this: function contentmmfromcontentwindow_method2(acontentwindow) { return acontentwindow.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidocshell) .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsicontentframemessagemanager); } ...
mozbrowsercontextmenu
details the details property returns an anonymous javascript object with the following properties: clientx the x value of the coordinate that was clicked inside the browser <iframe>'s viewport.
... clienty the y value of the coordinate that was clicked inside the browser <iframe>'s viewport.
Embedding the editor
the problem with this ownership model is that there can be only one editor per <editor> tag, yet the document loaded in the <iframe> may itself contain multiple <iframe>s (consider a frameset document, or a document itself containing an <html:iframe>).
...you should be able to qi from nsidocshell to one of these; if this succeeds, it indicates that the frame is editable.
Gecko's "Almost Standards" Mode
a common case that this affects is the layout of images inside table cells.
...for example, consider the following doctype: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> the parts are as follows: public identifier: "-//w3c//dtd html 4.01 transitional//en" system identifier: "http://www.w3.org/tr/html4/loose.dtd" thus any html 4.01 transitional or frameset doctype with a uri (system identifier) will trigger "almost standards" m...
Getting from Content to Layout
nscssframeconstructor gets notified from the document's presshell (which implements nsidocumentobserver and observes the document) about all nodes in the document.
... to give a trivial example of when this might be necessary, consider: "<span>foo <div></div> bar</span>".
HTTP Cache
similarity with the old cache: this interface may be with some limitations considered as a mirror to nsicachesession, but less generic and not inclining to abuse.
...regular expression: (.([^,]+)?,)* the first letter is an identifier, identifiers are to be alphabetically sorted and always terminate with ',' a - when present the scope is belonging to an anonymous load b - when present the scope is in browser element load i - when present must have a decimal integer value that represents an app id the scope belongs to, otherwise there is no app (app id is considered 0) p - when present the scope is of a private browsing load, this never persists cachestorageservice keeps a global hashtable mapped by the scope key.
Introduction to Layout in Mozilla
ution reflow painting setting up assume basic knowledge of embedding and network apis (doc shell, streams) content dll auto-registers a document loader factory (dlf) @mozilla.org/content-viewer-factory/view;1?type=text/html all mime types mapped to the same class, nscontentdlf nsdocshell receives inbound content via nsdsuricontentlistener invokes nsidlf::createinstance, passes mime type to dlf nscontentdlf creates a nshtmldocument object, invokes startdocumentload.
...h parser node objects some buffering and fixup occurs here opencontainer, closecontainer, addleaf content sink creates and attaches content nodes using nsicontent interface content sink maintains stack of “live” elements more buffering and fixup occurs here insertchildat, appendchildto, removechildat frame construction content sink uses nsidocument interface to notify of Δs in content model contentappended, contentinserted, contentremoved presshell is registered as document observer receives contentappended, etc.
JavaScript-DOM Prototypes in Mozilla
one of these interfaces is nsidomhtmlimageelement, others are nsidomnshtmlimageelement (netscape extensions to the standard interface), nsidomeventtarget, nsidomeventlistener, nsidom3node, and so on.
...ns_get_iid(nsidomnode) for node).
AddonManager
callback) void installaddonsfromwebpage(in string mimetype, in nsidomwindow source, in nsiuri uri, in addoninstall installs[]) void addinstalllistener(in installlistener listener) void removeinstalllistener(in installlistener listener) promise?
... void installaddonsfromwebpage( in string mimetype, in nsidomwindow source, in nsiuri uri, in addoninstall installs[] ) parameters mimetype the mimetype of add-ons being installed source the nsidomwindow that started the installs uri the nsiuri that started the installs installs the array of addoninstalls to be installed addinstalllistener() adds a new installlistener if the listener is not already registered.
Examples
consider the following cases: function f() { return promise.reject(new error("boom!")); // if nobody catches the error, how will it be reported?
...for instance, consider: let deferred = promise.defer(); let p1 = deferred.promise.then(); let p2 = deferred.promise.then(); deferred.reject(new error("i am an uncaught error")); p1 = p2 = deferred = null; in this snippet, the error is reported both at p1 and at p2.
Promise.jsm
if you just need a promise, consider using a dom promise instead.
... if you need a deferred, because you want to create a promise and manually resolve or reject it, consider using promiseutils.jsm instead.
Sqlite.jsm
when a statement is executed via executecached(), the prepared statement object is cached inside the opened connection.
...the downside is the cached statement object lingers in the opened connection, taking up memory.
L10n Checks
if you want to test the localization for de, run: check-l10n-completeness browser/locales/l10n.ini ../l10n/ de add-ons (xpi) mode l10n checks gathers the locales to compare from the chrome.manifest file inside the xpi file.
...you pass both paths to the xpi file and both paths to the locales inside the files, e.g.: check-l10n-completeness -i xpis en-us-langpack.xpi my-langpack.xpi jar:chrome/en-us.jar!locale/ jar:chrome/my.jar!locale/my/ jar/zip file (jar) mode l10n checks can compare two locales found in different jar files.
Localizing with Koala
they can be found in two files, inside the browser/chrome/browser directory: searchbar.dtd, search.properties.
...for example, try issuing "hg status" inside c:\mozilla\l10n\locale\x-testing\3.6: c:\mozilla\l10n\locale\x-testing\3.6> hg status ?
Localizing with Mozilla Translator
from cvs to mercurial in mt so, you have a firefox product in mt with a platform neutral and, inside it, several directories (''components'' in mt terminology) more or less like the second sample above, checked out from cvs.
... when mozilla l10n switched to ''source l10n'', one of the many problems that mt had to solve was how to fit a directory structure in what had been designed for five jars, and the ''patch'' consisted of providing a ''read from dir instead of jar'' and ''put everything inside platform neutral''.
Release phase
add the following lines to your ~/.ssh/config file, replacing user@host.domain with your mozilla ldap account name: host hg.mozilla.org user user@host.domain if you have already cloned the remote repository using the http protocol using this command: $ hg clone http://hg.mozilla.org/releases/l10n-central/x-testing then you will need to edit the .hg/hgrc file (inside the x-testing local clone) to tell mercurial to push using ssh.
...this is done by generating a diff between the new release revision being considered and the previously approved release revision.
gettext
consider the following code snippet: <?php $num = 1; printf(ngettext("%d user likes this.", "%d users like this.", $num), $num); ?> depending on the value of the $num variable, this code will either use the singular ("user likes) or the plural ("users like") form of the string.
...consider another example, gaeilge (irish): plural-forms: nplurals=3; plural=n==1 ?
Basics
a n n ] [ x1 x2 x3 : xn ] in mozilla, mathml runs inside the main browser.
... mathml button html content <div style="text-align: center"> <button style="white-space: normal;"> <span style="color: brown;"> for example, <b>click</b> this mathml continued fraction<br/> inside this html button<br /> </span> <math> <mrow> <mfrac> <mi>&pi;</mi> <mn>4</mn> </mfrac> <mo>=</mo> <mfrac numalign="left"> <mstyle scriptlevel="0"> <mn>1</mn> </mstyle> <mstyle scriptlevel="0"> <mrow> <mn>2</mn> <mo>+</mo> <mfrac numalign="left"> <mstyle scriptlevel="0"> <msup><mn>1</mn><mn>2</mn></msup> </mstyle> <mstyle scriptlevel="0"> <mrow> <mn>2</mn> <mo>+</mo> <mfrac numalign="left"> ...
Mozilla Web Developer FAQ
the <link> and <style> elements should be inside the <head> element.
... things that look like xml comments are treated as xml comments—even inside script or style elements.
DMD
/dmd.cpp:1286) #02: malloc (/home/njn/moz/mi5/go64dmd/memory/build/../../../memory/build/replace_malloc.c:153) #03: moz_xmalloc (/home/njn/moz/mi5/memory/mozalloc/mozalloc.cpp:84) #04: nscyclecollectingautorefcnt::incr(void*, nscyclecollectionparticipant*) (/home/njn/moz/mi5/go64dmd/dom/xul/../../dist/include/nsisupportsimpl.h:250) #05: nsxulelement::create(nsxulprototypeelement*, nsidocument*, bool, bool,mozilla::dom::element**) (/home/njn/moz/mi5/dom/xul/nsxulelement.cpp:287) #06: nsxblcontentsink::createelement(char16_t const**, unsigned int, mozilla::dom::nodeinfo*, unsigned int, nsicontent**, bool*, mozilla::dom::fromparser) (/home/njn/moz/mi5/dom/xbl/nsxblcontentsink.cpp:874) #07: nscomptr<nsicontent>::startassignment() (/home/njn/moz/mi5/go64dmd/dom/xml/../../dis...
...::sizeofincludingthis(unsigned long (*)(void const*)) const (/home/njn/moz/mi5/go64dmd/parser/html/../../../dom/base/nsinode.h:307) #06: mozilla::dom::nodeinfo::nodetype() const (/home/njn/moz/mi5/go64dmd/dom/base/../../dist/include/mozilla/dom/nodeinfo.h:127) #07: nshtmldocument::docaddsizeofexcludingthis(nswindowsizes*) const (/home/njn/moz/mi5/dom/html/nshtmldocument.cpp:3710) #08: nsidocument::docaddsizeofincludingthis(nswindowsizes*) const (/home/njn/moz/mi5/dom/base/nsdocument.cpp:12820) } } the choice of whether to record an allocation stack trace for all blocks is controlled by an option (see below).
Gecko Profiler FAQ
in general, the gecko profiler is a profiling tool that helps you figure out what happens inside the browser as a performance issue is happening, it doesn’t help with reproducing the performance issues in the first place.
...(see many of the questions above for examples of such limitations.) note that these tools should all be considered as complementary, it’s typical to capture a profile in gecko profiler and based on some investigations decide to delve into some part of it using a native profiler, etc.
NSPR Contributor Guide
when you consider a new api for nspr ask yourself if your proposed feature can implement it across all platforms supported by nspr.
...give consideration to providing a test case when fixing a bug if an existing test case did not catch a bug it should have caught.
NSPR Poll Method
we consider a stack of nspr i/o layers on top of the network transport.
...for example, consider an i/o layer that buffers input data.
An overview of NSS Internals
a trust anchor is just another x.509 certificate that is already known and has been deliberately marked as trusted by a software vendor, administrators inside an organizational infrastructure, or the software user.
...for example: certificates were valid at the time the signature was made, name in certificates matches the expected signer (check subject name, common name, email, based on application), the trust restrictions recorded inside the certificate (extensions) permit the use (e.g., encryption might be allowed, but not signing), and based on environment/application policy it might be required to perform a revocation check (ocsp or crl), that asks the issuer(s) of the certificates whether there have been events that made it necessary to revoke the trust (revoke the validity of the cert).
NSS 3.12.4 release notes
expressions inside unions may not include unions or exclusions.
... inside a union, to be matched and not treated as a special character, these characters must be escaped: \ ( | ) [ ~ except when they occur inside a bracketed expression, where only \ and ] require escaping.
NSS 3.12.6 release notes
bug 275744: support for tls compression rfc 3749 bug 494603: update nss's copy of sqlite3 to 3.6.22 to get numerous bug fixes bug 496993: add accessor functions for ssl_implementedciphers bug 515279: cert_pkixverifycert considers a certificate revoked if cert_processocspresponse fails for any reason bug 515870: gcc compiler warnings in nss 3.12.4 bug 518255: the input buffer for sgn_update should be declared const bug 519550: allow the specification of an alternate library for sqlite bug 524167: crash in [[@ find_objects_by_template - nsstoken_findcertificatebyissuerandserialnumber] ...
... bug 542538: nss: add function for recording ocsp stapled replies bug 544191: use system zlib on mac os x bug 544584: segmentation fault when enumerating the nss database bug 544586: various nss-sys-init patches from fedora bug 545273: remove unused function sec_init bug 546389: nsssysinit binary built inside source tree documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation.
NSS 3.14 release notes
because the test coverage and interoperability testing is not yet at the same level as other nss code, this feature should be considered "experimental" and may contain bugs.
...note that ssl cipher suites with "md5" in their names are not disabled by this change; those cipher suites use hmac-md5, not plain md5, and are still considered safe.
NSS sources building testing
these can be found by looking at the files with the .def file extension, inside the nss/lib directory hierarchy.
...inside the directory you'll find text file output.log, which contains a detailed report of all tests being executed.
NSS tools : signtool
in some situations, a digital signature may be considered as legally binding as a handwritten signature.
...this option makes the manifest files (required by the jar format) considerably smaller, but they contain slightly less information.
Scripting Java
all the functionality covered in this chapter should thus be considered an extension.
... as an example, consider the following java class that defines a number of overloaded methods and calls them.
Hacking Tips
(gdb) continue compiling self-hosted:650:20470-21501 bailout from self-hosted:20:403-500 invalidate self-hosted:20:403-500 note: the line 3196, listed above, corresponds to the location of the jit spew inside jit::invalidate function.
... to run these benchmarks localy, you can clone arewefastyet sources and look inside the benchmarks directory to run individual benchmarks with your js shell.
64-bit Compatibility
for example, consider this code: #define pointer_tagbits 3 static inline uintptr_t unmaskpointer(uintptr_t v) { return v & ~pointer_tagbits; } the value 3 will be inverted to 0xfffffffc, then zero-extended to 0x00000000fffffffc - a subtle and nasty bug, assuming it is unintended.
... the best way to fix this is to make types explicit, such as: const uintptr_t pointer_tagbits = 3 or by using a cast inside the macro.
TPS Tests
tps consists of a firefox extension of the same name, along with a python test runner, both of which live inside mozilla-central.
... for example, consider the first action in the phase above: [bookmarks.add, bookmarks_initial] you could rewrite this as a custom function so as to add some custom logging: [async () => { logger.loginfo("adding bookmarks_initial"); await bookmarks.add(bookmarks_initial); }] note that this is probably best used for debugging, and new tests that want custom behavior should add it to the tps addon so that othe...
Secure Development Guidelines
fd_set(fd, &fdset); } file i/o: race conditions operating on files can often lead to race conditions since the file system is shared with other processes you check the state of a file at one point in time and immediately after the state might have changed most file name operations suffer from these race conditions, but not when performed on file descriptors file i/o: race conditions consider the following example int main(int argc, char **argv) { char *file = argv[1]; int fd; struct stat statbuf; stat(file, &statbuf); if (s_islink(statbuf.st_mode)) { bailout(“symbolic link”); } else if (statbuf.st_uid != getuid) { bailout(“you don’t own the file”); } fd = open(file, o_rdwr); write(fd, argv[2], strlen(argv[2]...
... unlock(locka); unlock(lockb); } writing secure code: good coding practices banned api list badly designed apis can often lead to vulnerabilities it’s too easy to use the api inappropriately for example, consider the libc string handling apis strcpy() performs no bounds checking strncpy() doesn’t always 0-terminate strncat() length parameter is very confusing banned api list examples of incorrect strncat usage buffer overflow strncat(buffer, string, sizeof(buffer)); off-by-one strncat(buffer, string, sizeof(buffer) – strlen(string)); correct usage s...
Handling Mozilla Security Bugs
the applicant's nomination for membership will then be considered for a period of a few days, during which members of the security bug group can speak out in favor of or against the applicant.
...if necessary mozilla.org staff will serve as the "court of final appeal." a final point about duplicate bug reports: note that security bugs marked as duplicates are still considered separate as far as disclosure is concerned.
AT APIs Support
supported at apis at apis terms microsoft active accessibility (msaa) an api devised by microsoft so that accessibility aids can track what's going on inside the user interface of any software package that supports it.
... assistive technology service provider interface (at-spi) an api devised by sun microsystems so that accessibility aids can track what's going on inside the user interface of any software package that supports it.
XUL Accessibility
aggregating the text from element subtree if the child node is hidden then it's ignored excepting the case when the element used as label is hidden itself if the child node is text node then its rendered value is appended if the child node is element then if it implements nsidomxullabeledcontrolelement then the value of label property is appended otherwise if it's a label element then then value attribute is appended otherwise append tooltiptext attribute append the accessible value searching specific element in neighbour of the element search inside the element subtree go up through parents (max level is 5) and search inside theirs subtrees if the element is an...
...name the following rules to generate accessible name are applied: check aria-labelledby attribute, name is generated from elements pointed by aria-labelledby attribute <description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-labelledby="descr1 descr2" /> if the element implements nsidomxullabeledcontrolelement or nsidomxulselectcontrolitemelement interface then it is used label property if the element doesn't implement nsidomxulselectcontrolelement then label attribute is used if neighbour of the element has label element pointing to this element by the control attribute, if the label element is found then use value attribute or its content.
Embedded Dialog API
most if not all of these dialogs will need to be child/dependent/transient windows, so each method responsible for actually opening a window must take an nsidomwindow *aparent parameter, and use that window as the dialog's parent, if non-null.
...embedded dialog posing interface coding conventions the nsidomwindow *aparent parameter mentioned above should be the first parameter to each method in which it appears.
Mork
MozillaTechMork
meta-rows do not appear to be used at all, although the parser seems to consider setting the charset, row scope, and atom scope.
...if inside the meta-dictionary, the only cell we care about is if the key is 'a' (for atom scope).
XML Extras
additionally, "foo.com:80" and "foo.com:313" are considered different hosts for security purposes.
... nsidomserializer (currently, the javascript constructor is xmlserializer()) nsidomparser (currently, the javascript constructor is domparser()) nsixmlhttprequest please see the xml linking and pointing section in xml in mozilla document for fixptr and xpointer documentation.
Using XPCOM Utilities to Make Things Easier
inside the macro, the interface name expands to ns_get_iid(), which is another macro that extracts the iid from the generated header of the interface.
...consider the following real class: class myenumerator : public nsisimpleenumerator { public: ns_decl_isupports ns_decl_nsisimpleenumerator myenumerator(); virtual ~myenumerator() {} }; the declaration of this nsisimpleenumerator class doesn't include any methods other than the contructor and destructor.
Components.ID
components.classes, components.classesbyid, components.interfaces provide pretty much all the nsids that most javascript code would ever need to deal with.
... the exception to this is the case where a component is written in javascript and needs to register itself with the component manager using its own nsid - an id that is not already registered and thus does not appear in components.classes.
Components.utils.Sandbox
system principal to specify the system principal, you can create it using code like: cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); content principal you can specify a content principal for a particular origin in one of three ways: as an nsiprincipal, for example by using the nodeprincipal property of a dom node as an nsidomwindow, such as that returned by the dom window property as a string uri like "http://www.example.com/" (discouraged) when possible, specify a window or an nsiprincipal object instead of using a string uri.
...}; complex objects can be cloned into the sandbox using components.utils.cloneinto: mysandbox.someobject = components.utils.cloneinto({ a: 'string', b: 21 }, mysandbox); obviously you need to consider the security implications of the functions you import.
Components.utils.importGlobalProperties
the following strings are supported: string/object xpcom component atob blob btoa crypto css fetch file nsidomfile indexeddb nodefilter firefox 60 nsidomnodefilter obsolete since gecko 60 rtcidentityprovider textdecoder textencoder url urlsearchparams xmlhttprequest nsixmlhttprequest obsolete since gecko 60 for string/object in table without a minimum firefox version, it is not exactly k...
...the downside of using hiddendomwindow is that on startup of firefox, the hiddendomwindow objects cannot be accessed until it is fully loaded.
nsDirectoryService
class id f00152d0-b40b-11d3-8c9c-000064657374 contractid @mozilla.org/file/directory_service;1 supported interfaces nsiproperties nsidirectoryservice remarks this component is a singleton and should therefore be accessed via the xpcom service manager.
... see also using nsidirectoryservice nsiproperties.get() nsidirectoryserviceprovider ...
IAccessibleAction
refer to @ref _arrayconsideration "special consideration when using arrays" for more details.
...if there are more than one, the first one is considered the "default" action of the object.
amIWebInstallInfo
originatingwindow nsidomwindow the window that started the installs.
... note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), this was an nsidomwindowinternal.
amIWebInstallPrompt
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void confirm(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
...void confirm( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pruint32 acount optional ); parameters awindow the window that triggered the installs.
nsIAbstractWorker
dom/interfaces/threads/nsidomworkers.idlscriptable this interface is an abstract interface used to implement the web workers architecture.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description onerror nsidomeventlistener the error listener for the worker.
nsIContainerBoxObject
attributes attribute type description docshell nsidocshell read only.
... the nsidocshell object that manages the contained document.
nsIContentSecurityPolicy
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean permitsancestry(in nsidocshell docshell); void refinepolicy(in astring policystring, in nsiuri selfuri); void scanrequestdata(in nsihttpchannel achannel); void sendreports(in astring blockeduri, in astring violateddirective); short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri...
...boolean permitsancestry( in nsidocshell docshell ); parameters docshell containing the protected resource.
nsICookiePromptService
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision); constants constant value description deny_cookie 0 holds the value for a denying the cookie.
... long cookiedialog( in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision ); parameters parent the parent window for the dialog.
nsIFilePicker
to create an instance, use: var filepicker = components.classes["@mozilla.org/filepicker;1"] .createinstance(components.interfaces.nsifilepicker); method overview void appendfilter(in astring title, in astring filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepickershowncallback); short show(); obsolete since gecko 57.0 attributes attribute type description addtorecentdocs boolean if true, the file is added to the operating system's "recent documents" list (if the operating system has one; nothing hap...
... void init( in nsidomwindow parent, in astring title, in short mode ); parameters parent the nsidomwindow parent.
nsIGeolocationUpdate
method overview void update(in nsidomgeoposition position); methods update() notify the geolocation service that a new geolocation has been discovered.
...void update( in nsidomgeoposition position ); parameters position a nsidomgeoposition object describing the updated position information.
nsILoginManagerPrompter
to call this service, use: var loginmanagerprompter = components.classes["@mozilla.org/login-manager/prompter;1"] .getservice(components.interfaces.nsiloginmanagerprompter); method overview void init(in nsidomwindow awindow); void prompttochangepassword(in nsilogininfo aoldlogin, in nsilogininfo anewlogin); void prompttochangepasswordwithusernames([array, size_is(count)] in nsilogininfo logins, in pruint32 count, in nsilogininfo anewlogin); void prompttosavepassword(in nsilogininfo alogin); methods init() initialize the prompter.
... void init( in nsidomwindow awindow ); parameters awindow the in which the user is doing some login-related action that is resulting in a need to prompt them for something.
nsIMarkupDocumentViewer
inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview void scrolltonode(in nsidomnode node); void sizetocontent(); attributes attribute type description allowplugins boolean if true, plugins are allowed within the doc shell.
...void scrolltonode( in nsidomnode node ); parameters node the nsidomnode of the node to make visible.
nsIMenuBoxObject
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) to get access to the box object for a given menu, use code like this: var boxobject = xulmenu.boxobject.queryinterface(components.interfaces.nsimenuboxobject); method overview boolean handlekeypress(in nsidomkeyevent keyevent); void openmenu(in boolean openflag); attributes attribute type description activechild nsidomelement the currently active menu or menuitem child of the menu box.
...methods handlekeypress() boolean handlekeypress( in nsidomkeyevent keyevent ); parameters keyevent the key event to handle for the menu.
nsIMicrosummaryService
atoruri); nsisimpleenumerator getbookmarks(); nsimicrosummarygenerator getgenerator(in nsiuri generatoruri); nsimicrosummaryset getmicrosummaries(in nsiuri pageuri, in long long bookmarkid); nsimicrosummary getmicrosummary(in long long bookmarkid); boolean hasmicrosummary(in long long bookmarkid); nsimicrosummarygenerator installgenerator(in nsidomdocument xmldefinition); boolean ismicrosummary(in long long bookmarkid, in nsimicrosummary microsummary); nsimicrosummary refreshmicrosummary(in long long bookmarkid); void removemicrosummary(in long long bookmarkid); void setmicrosummary(in long long bookmarkid, in nsimicrosummary microsummary); methods addgenerator() install the microsummary generator...
...nsimicrosummarygenerator installgenerator( in nsidomdocument xmldefinition ); parameters xmldefinition an nsidomdocument xml document defining the generator.
nsIMsgMessageService
adisplayconsumer is (for now) an nsidocshell which the message is loaded into.
... adisplayconsumer for now, a nsidocshell which the message is loaded into.
nsINavBookmarksService
from c++ code inside the places component, use nsbookmarksupdatebatcher defined in nsnavbookmarks.h to scope batches.
... runinbatchmode() this method runs the passed callback in batch mode (inside a database transaction).
nsINavHistoryQuery
hasbegintime boolean read only: whether or not, the corresponding begin time is considered.
... hasendtime boolean read only: whether or not, the corresponding end time is considered.
nsIPrincipal
principals are considered equal if they are the same principal, they have the same origin, or have the same certificate fingerprint id.
...note: for the future: perhaps we should consider a certificate principal for a given uri subsuming a codebase principal for the same uri?
nsIPrompt
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this interface is identical to nsipromptservice but without the parent nsidomwindow parameter.
...if you are using this interface, you must remove the nsidomwindow arguments from those methods.
nsIRequest
consider, for example, a http response with a "cache-control: no-cache" header.
... note: suspended requests are still considered pending.
nsISmsDatabaseService
domstring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void deletemessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void createmessagelist(in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid); void getnextmessageinlist(in long listid, in long requestid, [optional] in unsigned long long processid); void clearmessagelist(in long listid); void markmessageread(in long messageid, in boolean value, in long requestid, [optional] in unsigned long long processid) methods saverecei...
... createmessagelist() void createmessagelist( in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid ); parameters filter a smsfilter to filter out sms messages from a list.
nsISmsService
to create an instance, use: var smsservice = components.classes["@mozilla.org/sms/smsservice;1"] .createinstance(components.interfaces.nsismsservice); method overview [implicit_jscontext] nsidommozsmsmessage createsmsmessage(in long id, in domstring delivery, in domstring sender, in domstring receiver, in domstring body, in jsval timestamp, in bool read ); unsigned short getnumberofmessagesfortext(in domstring text); boolean hassupport(); void send(in domstring number, in domstring message, in long requestid, [optional] in unsigned long long processid); ...
... methods createsmsmessage() [implicit_jscontext] nsidommozsmsmessage createsmsmessage( in long id, in domstring delivery, in domstring sender, in domstring receiver, in domstring body, in jsval timestamp, in bool read ); parameters id a number representing the id of the message.
nsITransferable
requestingnode nsidomnode the source dom node this transferable was created from.
...pt callers, one needs to get to the document that the transferable corresponds to, and then get the load context from the document like this: var loadcontext = doc.defaultview.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsiloadcontext); in c++ callers, if you have the corresponding document, you can just call nsidocument.getloadcontext() to get to the load context object.
nsITreeBoxObject
treebody nsidomelement readonly: obtain the treebody content node.
...a page is considered to be the amount displayed by the tree.
nsITreeColumns
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsitreecolumn getcolumnat(in long index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns.
...nsitreecolumn getcolumnfor( in nsidomelement element ); parameters element a dom element return value a nsitreecolumn for this element.
nsIUpdatePrompt
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 checkforupdates(); void showupdateavailable(in nsiupdate update); void showupdatedownloaded(in nsiupdate update, [optional] in boolean background); void showupdateerror(in nsiupdate update); void showupdatehistory(in nsidomwindow parent); void showupdateinstalled(); methods checkforupdates() presents a user interface that checks for and displays the available updates.
...void showupdatehistory( in nsidomwindow parent ); parameters parent an nsidomwindow indicating the parent window to which to anchor the update list window.
nsIVariant
nsresult getasid(out nsid retval); violates the xpcom interface guidelines print16 getasint16(); native code only!
... violates the xpcom interface guidelines getasid() nsresult getasid( out nsid retval ); parameters retval if the internal value is an iid then it is returned.
nsIWebBrowser
contentdomwindow nsidomwindow the top-level dom window.
... see also nsibasewindow nsicontextmenulistener nsidomwindow nsiembeddingsitewindow nsiinterfacerequestor nsishistorylistener nsitooltiplistener nsiuricontentlistener nsiweakreference nsiwebbrowserchrome nsiwebbrowserchromefocus nsiwebprogresslistener ...
nsIWebBrowserChrome3
1.0 66 introduced gecko 2.0 inherits from: nsiwebbrowserchrome2 last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); methods onbeforelinktraversal() determines the appropriate target for a link.
... astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the original link target.
nsIWebBrowserFindInFrames
attributes attribute type description currentsearchframe nsidomwindow frame at which to start the search.
... rootsearchframe nsidomwindow frame within which to confine the search (normally the content area frame).
nsIWorker
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents a dom worker thread.
...method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port.
nsIWorkerGlobalScope
dom/interfaces/threads/nsidomworkers.idlscriptable this interface is an abstract interface representing the 'inside' of a worker.
... onerror nsidomeventlistener self nsiworkerglobalscope returns the global scope object itself.
nsIWorkerMessageEvent
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents an event in a web worker thread's event queue.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data.
nsIXFormsModelElement
1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned.
... return value an nsidomdocument.
nsIXMLHttpRequest
here is a comment from johnny stenback <jst@netscape.com>: the mozilla implementation of nsixmlhttprequest implements the interface nsidomeventtarget and that's how you're supported to add event listeners.
... try something like this: nscomptr<nsidomeventtarget> target(do_queryinterface(myxmlhttpreq)); target->addeventlistener(ns_literal_string("load"), mylistener, pr_false) where mylistener is your event listener object that implements the interface nsidomeventlistener.
nsIXSLTException
inherits from: nsiexception last changed in gecko 1.7 attributes attribute type description sourcenode nsidomnode the context node, may be null.
... stylenode nsidomnode the node in the stylesheet that triggered the exception.
nsIXULSortService
obsolete since gecko 1.9 void sort(in nsidomnode anode, in astring asortkey, in astring asorthints); constants constant value description sort_comparecase 0x0001 sort_integer 0x0100 methods native code only!insertcontainernode obsolete since gecko 1.9 (firefox 3)this feature is obsolete.
...void sort( in nsidomnode anode, in astring asortkey, in astring asorthints ); parameters anode a node in the xul widget whose children are to be sorted.
XPCOM primitive
(however, if you are designing that kind of api today, you should probably use nsivariant instead.) idl data type interface component idl nsidptr nsisupportsid @mozilla.org/supports-id;1 [scriptable, uuid(d18290a0-4a1c-11d3-9890-006008962422)] interface nsisupportsid : nsisupportsprimitive { attribute nsidptr data; string tostring(); }; astring nsisupportsstring @mozilla.org/supports-string;1 [scriptable, uuid(d79dc970-4a1c-11d3-9890-006008962422)] interface nsisupportsstring : nsisupportsprimitive { attribute astring data...
...4f0-568d-11d3-baf8-00805f8a5dd7)] interface nsisupportsvoid : nsisupportsprimitive { [noscript] attribute voidptr data; string tostring(); }; nsisupports nsisupportsinterfacepointer @mozilla.org/supports-interface-pointer;1 [scriptable, uuid(995ea724-1dd1-11b2-9211-c21bdd3e7ed0)] interface nsisupportsinterfacepointer : nsisupportsprimitive { attribute nsisupports data; attribute nsidptr dataiid; string tostring(); }; ...
Frequently Asked Questions
{ // i only need the |nsifoo| interface for a short time // so i control its lifetime by declaring it inside // a block statement.
... interface pointers considered harmful by don box originally appeared in the september 1995 issue of "the c++ report".
Using the clipboard
if (source instanceof ci.nsidomwindow) // note: in gecko versions >16, you can import the privatebrowsingutils.jsm module // and use privatebrowsingutils.privacycontextfromwindow(sourcewindow) instead source = source.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation); res.init(source); } return res; } here, the string "t...
...next we need to initialize it with a "privacy context", which will ensure that source data from inside private browsing mode will be cleared when the mode is exited.
XPCOM
you'll have to turn to the xpcom newsgroup or another experienced nscomptr user, or find the answer by experimentation.using nsiclassinfoif you use a c++ class which implements nsiclassinfo from javascript, then you don't have to explicitly call queryinterface on the javascript object to access the object's interfaces.using nsidirectoryservicensdirectoryservice implements the nsiproperties interface.
...if the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.working with multiple versions of interfacesin this short note we illustrate how one can update an xpcom module in order for it to work in both firefox 2 and firefox 3, even if the interfaces have changed in the interim.working with out parameterswrappedjsobjectwrappedjsobject is a property sometimes available on xpconnect wrappers.
XPIDL Syntax
MozillaTechXPIDLSyntax
libidl only considers a single line feed as a newline, and not carriage returns (although xpidl begs to differ).
...text inside raw code fragments are not otherwise parsed by xpidl directly.
Building a Thunderbird extension 5: XUL
the status bar is implemented in a xul file called messenger.xul, which can be found in the chrome/messenger/content/messenger folder which is packaged inside the omni.ja archive.
... to view this xul file use the dom inspector extension (no longer supported) or look inside the omni.ja archive, which is located in the thunderbird program folder.
Drawing and Event Handling - Plugins
if a plug-in does not make this call, it is considered a windowed plug-in.
...because the browser does not need to draw the background behind the plug-in, opaque windowless plug-ins are considerably more efficient than transparent plug-ins.
Debugger.Frame - Firefox Developer Tools
(note that the debuggee is not considered an “immediate caller” of handler methods it triggers.
... even though the debuggee and debugger share the same javascript stack, frames pushed for spidermonkey’s calls to handler methods to report events in the debuggee are never considered visible frames.) invocation functions and “debugger” frames aninvocation function is any function in this interface that allows the debugger to invoke code in the debuggee: debugger.object.prototype.call, debugger.frame.prototype.eval, and so on.
Debugger - Firefox Developer Tools
allowunobservedasmjs a boolean value indicating whether asm.js code running inside this debugger instance’s debuggee globals is invisible to debugger api handlers and breakpoints.
... collectcoverageinfo a boolean value indicating whether code coverage should be enabled inside each debuggee of this debugger instance.
Index - Firefox Developer Tools
for each resource, you'll see: 107 cookies cookies, dev tools, firefox, guide, storage, storage inspector, tools, l10n:priority when you select an origin inside the cookies storage type from the storage tree, all the cookies present for that origin will be listed in a table.
...this table contains the following columns: 109 indexeddb dev tools, firefox, guide, indexeddb, storage, storage inspector, tools, l10n:priority when you select an origin inside the indexed db storage type in the storage tree of the storage inspector, a table lists the details of all the databases present for that origin.
Call Tree - Firefox Developer Tools
let's expand the entry for swap(): there were 253 samples taken inside swap().
...if we look at the code for sort(), it should be fairly obvious that the high platform data cost is coming from repeated calls to console.log(): function sort(unsorted) { console.log(bubblesort(unsorted)); console.log(selectionsort(unsorted)); console.log(quicksort(unsorted)); } it would certainly be worthwhile considering more efficient ways of implementing this.
Waterfall - Firefox Developer Tools
if this is inside a callback from a promise, this will also show the "async stack".
... for example, consider code like this: var timerbutton = document.getelementbyid("timer"); timerbutton.addeventlistener("click", handleclick, false); function handleclick() { console.time("timer"); runtimer(1000).then(timerfinished); } function timerfinished() { console.timeend("timer"); console.log("ready!"); } function runtimer(t) { return new promise(function(resolve) { settimeout(resolve, t); ...
Cookies - Firefox Developer Tools
when you select an origin inside the cookies storage type from the storage tree, all the cookies present for that origin will be listed in a table.
... you can edit cookies by double-clicking inside cells in the table widget and editing the values they contain, and add new cookies by clicking the "plus" (+) button and then editing the resulting new row to the value you want.
Animation - Web APIs
WebAPIAnimation
it will cause the end styling state to be written to the element being animated, in the form of properties inside a style attribute.
... consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences.
CSSRule - Web APIs
WebAPICSSRule
if this rule is a style rule inside an @media block, the parent rule would be that cssmediarule.
...(until the documentation is completed, see the interface definition in the mozilla source code: nsidomcssimportrule.) cssrule.media_rule 4 cssmediarule cssrule.font_face_rule 5 cssfontfacerule cssrule.page_rule 6 csspagerule cssrule.keyframes_rule 7 csskeyframesrule cssrule.keyframe_rule 8 csskeyframerule reserved for future use 9 should be used to define color profiles in the fu...
CSSStyleDeclaration.setProperty() - Web APIs
we know that the rule we want to alter to do this is contained inside the second stylesheet applied to the page, so we grab a reference to it using document.stylesheets[1].
... we then loop through the different rules contained inside the stylesheet, which are contained in the array found at stylesheet.cssrules; for each one, we check whether its cssstylerule.selectortext property is equal to the selector .box p, which indicates it is the one we want.
CanvasRenderingContext2D.isPointInPath() - Web APIs
fillrule the algorithm by which to determine if a point is inside or outside the path.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create circle const circle = new path2d(); circle.arc(150, 75, 50, 0, 2 * math.pi); ctx.fillstyle = 'red'; ctx.fill(circle); // listen for mouse moves canvas.addeventlistener('mousemove', function(event) { // check whether point is inside circle if (ctx.ispointinpath(circle, event.offsetx, event.offsety)) { ctx.fillstyle = 'green'; } else { ctx.fillstyle = 'red'; } // draw circle ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.fill(circle); }); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.ispointinpath'...
Compositing and clipping - Web APIs
everything that's drawn after creating the clipping path will only appear inside that path.
...again the stars only appear inside the defined clipping path.
ConstrainDouble - Web APIs
exact a double-precision floating-point number specifying a specific, required, value the property must have to be considered acceptable.
... ideal a double-precision floating-point number specifying a value the property would ideally have, but which can be considered optional if necessary to find a match.
ConstrainULong - Web APIs
exact an integer specifying precise, required, value the property must have to be considered acceptable.
... ideal an integer specifying a value the property would ideally have, but which can be considered optional if necessary to find a match.
Constraint validation API - Web APIs
in this case the custom error message is cleared, the element is considered valid, and no message is shown.
...inside this function we work out whether the value is invalid because it is empty, or because it doesn't match the pattern, using an if() block, and set a custom validity error message.
DedicatedWorkerGlobalScope.onmessage - Web APIs
messages are passed to the worker when the value inside the form input first changes.
...a dedicatedworkerglobalscope.onmessage handler is used to handle messages from the main script: onmessage = function(e) { console.log('message received from main script'); var workerresult = 'result: ' + (e.data[0] * e.data[1]); console.log('posting message back to main script'); postmessage(workerresult); } notice how in the main script, onmessage has to be called on myworker, whereas inside the worker script you just need onmessage because the worker is effectively the global scope (the dedicatedworkerglobalscope, in this case).
DedicatedWorkerGlobalScope.postMessage() - Web APIs
inside the handler a calculation is done from which a result message is created; this is then sent back to the main thread using postmessage(workerresult); onmessage = function(e) { console.log('message received from main script'); var workerresult = 'result: ' + (e.data[0] * e.data[1]); console.log('posting message back to main script'); postmessage(workerresult); } in the main script, onmes...
...sage would have to be called on a worker object, whereas inside the worker script you just need onmessage because the worker is effectively the global scope (dedicatedworkerglobalscope).
DeprecationReportBody - Web APIs
web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
...we loop over each report using a basic for loop, then iterate over each entry of in the report's body (a deprecationreportbody instance) using a for...in structure, displaying each key/value pair inside a list item.
Document.cookie - Web APIs
WebAPIDocumentcookie
consider also that: any of the following cookie attribute values can optionally follow the key-value pair, specifying the cookie to set/update, and preceded by a semi-colon separator: ;path=path (e.g., '/', '/mydir') if not specified, defaults to the current path of the current document location.
... the dash is considered part of the prefix.
Document.querySelectorAll() - Web APIs
list of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with a class of either note or alert: var matches = document.queryselectorall("div.note, div.alert"); here, we get a list of <p> elements whose immediate parent element is a <div> with the class highlighted and which are located inside a container whose id is test.
... html consider this html, with its three nested <div> blocks.
Document - Web APIs
WebAPIDocument
document.hiddenread only returns a boolean value indicating if the page is considered hidden or not.
... document.hasfocus() returns true if the focus is currently located anywhere inside the specified document.
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
st) such element mybody = document.getelementsbytagname("body")[0]; // now, get all the p elements that are descendants of the body mybodyelements = mybody.getelementsbytagname("p"); // get the second item of the list of p elements myp = mybodyelements[1]; myp.style.background = "rgb(255,0,0)"; } in this example, we set the myp variable to the dom object for the second p element inside the body: first, we get a list of all the body elements via mybody = document.getelementsbytagname("body")[0] since there is only one body element in any valid html document, this list will have only one item, which we retrieve by selecting the first element in that list using [0].
...the following figure shows the recently created text node object inside the document tree.
Element: click event - Web APIs
an element receives a click event when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.
... safari mobile considers the following elements to be typically interactive (and thus they aren't affected by this bug): <a> (but it must have an href) <area> (but it must have an href) <button> <img> <input> <label> (but it must be associated with a form control) <textarea> this list is incomplete; you can help mdn by doing further testing/research and expanding it.
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
security considerations it is not uncommon to see innerhtml used to insert text into a web page.
... javascript function log(msg) { var logelem = document.queryselector(".log"); var time = new date(); var timestr = time.tolocaletimestring(); logelem.innerhtml += timestr + ": " + msg + "<br/>"; } log("logging mouse events inside this container..."); the log() function creates the log output by getting the current time from a date object using tolocaletimestring(), and building a string with the timestamp and the message text.
Element.insertAdjacentText() - Web APIs
'afterbegin': just inside the element, before its first child.
... 'beforeend': just inside the element, after its last child.
Element: mousedown event - Web APIs
the mousedown event is fired at an element when a pointing device button is pressed while the pointer is inside the element.
... note: this differs from the click event in that click is fired after a full click action occurs; that is, the mouse button is pressed and released while the pointer remains inside the same element.
Element.querySelectorAll() - Web APIs
ts contained within the element "mybox": var matches = mybox.queryselectorall("p"); this example returns a list of all <div> elements within "mybox" with a class of either "note" or "alert": var matches = mybox.queryselectorall("div.note, div.alert"); here, we get a list of the document's <p> elements whose immediate parent element is a div with the class "highlighted" and which are located inside a container whose id is "test".
... html consider this html, with its three nested <div> blocks.
Element.setAttribute() - Web APIs
boolean attributes are considered to be true if they're present on the element at all, regardless of their actual value; as a rule, you should specify the empty string ("") in value (some people use the attribute's name; this works but is non-standard).
...all that matters is that if the attribute is present at all, regardless of its actual value, its value is considered to be true.
Element.shadowRoot - Web APIs
inside the <custom-square> element's class definition we include some life cycle callbacks that make a call to an external function, updatestyle(), which actually applies the size and color to the element.
...from here we use standard dom traversal techniques to find the <style> element inside the shadow dom and then update the css found inside it: function updatestyle(elem) { const shadow = elem.shadowroot; const childnodes = array.from(shadow.childnodes); childnodes.foreach(childnode => { if (childnode.nodename === 'style') { childnode.textcontent = ` div { width: ${elem.getattribute('l')}px; height: ${elem.getattribute('l')}px; ...
Element.slot - Web APIs
WebAPIElementslot
a slot is a placeholder inside a web component that users can fill with their own markup (see using templates and slots for more information).
... when <my-paragraph> is used in the document, the slot is populated by a slotable element by including it inside the element with a slot attribute with the value my-text.
Element - Web APIs
WebAPIElement
element.scroll() scrolls to a particular set of coordinates inside a given element.
... element.scrollto() scrolls to a particular set of coordinates inside a given element.
EventTarget.removeEventListener() - Web APIs
for example, consider this call to addeventlistener(): element.addeventlistener("mousedown", handlemousedown, true); now consider each of these two calls to removeeventlistener(): element.removeeventlistener("mousedown", handlemousedown, false); // fails element.removeeventlistener("mousedown", handlemousedown, true); // succeeds the first call fails because the value of usecapture doesn't match.
... now consider this: element.addeventlistener("mousedown", handlemousedown, { passive: true }); here, we specify an options object in which passive is set to true, while the other options are left to the default value of false.
ExtendableEvent.waitUntil() - Web APIs
if the promise passed to waituntil() rejects, the install is considered a failure, and the installing service worker is discarded.
... this is primarily used to ensure that a service worker is not considered installed until all of the core caches it depends on are successfully populated.
FileSystemEntrySync - Web APIs
you cannot do the following: move a directory inside itself or to any child at any depth move an entry into its parent if a name different from its current one isn't provided move a file to a path occupied by a directory or move a directory to a path occupied by a file move any element to a path occupied by a directory that is not empty.
...you cannot copy an entry inside itself if it is a directory, nor can you copy it into its parent without providing a new name.
FormData - Web APIs
WebAPIFormData
methods formdata.append() appends a new value onto an existing key inside a formdata object, or adds the key if it does not already exist.
... formdata.set() sets a new value for an existing key inside a formdata object, or adds the key/value if it does not already exist.
Guide to the Fullscreen API - Web APIs
let's consider this <video> element: <video controls id="myvideo"> <source src="somevideo.webm"></source> <source src="somevideo.mp4"></source> </video> we can put that video into full-screen mode as follows: var elem = document.getelementbyid("myvideo"); if (elem.requestfullscreen) { elem.requestfullscreen(); } this code checks for the existence of the requestfullscreen() method before calling it.
...to get the same fullscreen behavior in webkit, you need to add your own "width: 100%; height: 100%;" css rules to the element yourself: #myvideo:-webkit-full-screen { width: 100%; height: 100%; } on the other hand, if you're trying to emulate webkit's behavior on gecko, you need to place the element you want to present inside another element, which you'll make fullscreen instead, and use css rules to adjust the inner element to match the appearance you want.
Geolocation API - Web APIs
a geolocationposition instance is returned by a successful call to one of the methods contained inside geolocation, inside a success callback, and contains a timestamp plus a geolocationcoordinates object instance.
... geolocationpositionerror a geolocationpositionerror is returned by an unsuccessful call to one of the methods contained inside geolocation, inside an error callback, and contains an error code and message.
GlobalEventHandlers.onselect - Web APIs
the select event only fires after text inside an <input type="text"> or <textarea> is selected.
... examples this example logs the text you select inside a <textarea> element.
HTMLFormElement - Web APIs
fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled.
... elements that are considered form controls the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements ...
HTMLFrameSetElement - Web APIs
htmlframesetelement.cols is a domstring structured as a comma-seperated list specifing the width of each column inside a frameset.
... htmlframesetelement.rows is a domstring structured as a comma-seperated list specifing the height of each column inside a frameset.
HTMLImageElement.complete - Web APIs
the image is considered completely loaded if any of the following are true: neither the src nor the srcset attribute is specified.
... examples consider a photo library app that provides the ability to open images into a lightbox mode for improved viewing as well as editing of the image.
HTMLImageElement.naturalHeight - Web APIs
this is the height the image is if drawn with nothing constraining its height; if you don't specify a height for the image, or place the image inside a container that either limits or expressly specifies the image height, it will be rendered this tall.
... html <div class="box"> <img src="/files/16797/clock-demo-400px.png" class="image"> </div> <div class="output"> </div> the html features a 400x398 pixel image which is placed inside a <div>.
HTMLImageElement.naturalWidth - Web APIs
this is the width the image is if drawn with nothing constraining its width; if you neither specify a width for the image nor place the image inside a container that limits or expressly specifies the image width, this is the number of css pixels wide the image will be.
... html <div class="box"> <img src="/files/16797/clock-demo-400px.png" class="image"> </div> <div class="output"> </div> the html features a 400x398 pixel image which is placed inside a <div>.
HTMLInputElement.setSelectionRange() - Web APIs
optionally, in newer browser versions, you can specify the direction in which selection should be considered to have occurred.
... selectiondirection optional a string indicating the direction in which the selection is considered to have been performed.
HTMLSlotElement.name - Web APIs
a slot is a placeholder inside a web component that users can fill with their own markup.
... every time the element inserted in the slot changes, we log a report to the console saying which slot has changed, and what the new node inside the slot is.
In depth: Microtasks and the JavaScript runtime environment - Web APIs
when a fragment of javascript code runs, it runs inside an execution context.
...consider the javascript program below: let outputelem = document.getelementbyid("output"); let userlanguages = { "mike": "en", "teresa": "es" }; function greetuser(user) { function localgreeting(user) { let greeting; let language = userlanguages[user]; switch(language) { case "es": greeting = `¡hola, ${user}!`; break; case "en": default: g...
The HTML DOM API - Web APIs
for example, consider a document with two elements, one of which has two more elements nested inside it: while the document interface is defined as part of the dom specification, the html specification significantly enhances it to add information specific to using the dom in the context of a web browser, as well as to using it to represent html documents specifically.
...for example, consider a <a> element, which is represented in the dom by an object of type htmlanchorelement.
Recommended Drag Types - Web APIs
to drag multiple links, separate each link inside the text/uri-list data with a crlf linebreak.
... lines that begin with a number sign (#) are comments, and should not be considered urls.
Headers - Web APIs
WebAPIHeaders
methods headers.append() appends a new value onto an existing header inside a headers object, or adds the header if it does not already exist.
... headers.set() sets a new value for an existing header inside a headers object, or adds the header if it does not already exist.
IDBDatabase - Web APIs
idbdatabase.createmutablefile() creates a file handle, allowing files to be stored inside an indexeddb database.
...y", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; this next line opens up a transaction on the database, then opens an object store that we can then manipulate the data inside of.
IDBKeyRange - Web APIs
instance methods idbkeyrange.includes() returns a boolean indicating whether a specified key is inside the key range.
...this means that the cursor will only retrieve records with keys inside that range.
Checking when a deadline is due - Web APIs
var minutecheck = now.getminutes(); var hourcheck = now.gethours(); var daycheck = now.getdate(); var monthcheck = now.getmonth(); var yearcheck = now.getfullyear(); the date object has a number of methods to extract various parts of the date and time inside it.
...when a notification is fired for each item object, its notification property is set to "yes" so this check will not pass on the next iteration, via the following code inside the createnotification() function (read using indexeddb for an explanation): // now we need to update the value of notified to "yes" in this particular data object, so the // notification won't be set off on it again // first open up a tranaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that ...
IntersectionObserver.IntersectionObserver() - Web APIs
you can provide any combination of the following options: root an element or document object which is an ancestor of the intended target, whose bounding rectangle will be considered the viewport.
... any part of the target not visible in the visible area of the root is not considered visible.
Timing element visibility with the Intersection Observer API - Web APIs
if it's become at least 75% visible, then we consider the ad visible and we start the timer by setting the ad's dataset.lastviewstarted attribute to the transition time in entry.time, then add the ad to the set visibleads so we know to process it as time goes by.
... drawing an ad's timer inside each ad, for demonstration purposes, we draw the current value of its totalviewtime, converted into minutes and seconds.
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
the keyboardevent interface's key read-only property returns the value of the key pressed by the user, taking into consideration the state of modifier keys such as shift as well as the keyboard locale and layout.
... keyboardevent sequence example consider the event sequence generated when we interact with the shift and the 2 key using a u.s keyboard layout as compared to when we do so using a uk keyboard layout.
Using the MediaStream Recording API - Web APIs
next, we call getusermedia() and inside it define: the constraints: only audio is to be captured for our dictaphone.
... note: all of the code below is placed inside the getusermedia success callback.
MessageEvent - Web APIs
the different scripts are using the same worker file to perform the calculation — they can both access it, even if their pages are running inside different windows.
...ctively: first.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobalscope.onconnect handler to connect to the same port discussed above.
MouseScrollEvent - Web APIs
method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type description axis read only long indic...
... methods initmousescrollevent() see nsidommousescrollevent::initmousescrollevent().
Node.getRootNode() - Web APIs
WebAPINodegetRootNode
this will differ in exact form depending on where you called getrootnode(); for example: calling it on an element inside a standard web page will return an htmldocument object representing the entire page.
... calling it on an element inside a shadow dom will return the associated shadowroot.
Node.nodeType - Web APIs
WebAPINodenodeType
node.text_node 3 the actual text inside an element or attr.
...== node.document_node; // true document.doctype.nodetype === node.document_type_node; // true document.createdocumentfragment().nodetype === node.document_fragment_node; // true var p = document.createelement("p"); p.textcontent = "once upon a time…"; p.nodetype === node.element_node; // true p.firstchild.nodetype === node.text_node; // true comments this example checks if the first node inside the document element is a comment, and displays a message if not.
Node.textContent - Web APIs
WebAPINodetextContent
if the node is a cdata section, comment, processing instruction, or text node, textcontent returns the text inside the node, i.e., the node.nodevalue.
...sometimes people use innerhtml to retrieve or write text inside an element, but textcontent has better performance because its value is not parsed as html.
NodeFilter.acceptNode() - Web APIs
the children of skipped nodes are still considered.
... example var nodeiterator = document.createnodeiterator( // node to use as root document.getelementbyid('someid'), // only consider nodes that are text nodes (nodetype 3) nodefilter.show_text, // object containing the function to use for the acceptnode method // of the nodefilter { acceptnode: function(node) { // logic to determine whether to accept, reject or skip node // in this case, only accept nodes that have content // other than whitespace if ( !
NodeFilter - Web APIs
the children of skipped nodes are still considered.
... example const nodeiterator = document.createnodeiterator( // node to use as root document.getelementbyid('someid'), // only consider nodes that are text nodes (nodetype 3) nodefilter.show_text, // object containing the function to use for the acceptnode method // of the nodefilter { acceptnode: function(node) { // logic to determine whether to accept, reject or skip node // in this case, only accept nodes that have content // other than whitespace if ( !
PannerNode - Web APIs
pannernode.coneinnerangle is a double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction.
...you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
RTCDataChannel.bufferedAmountLowThreshold - Web APIs
the rtcdatachannel property bufferedamountlowthreshold is used to specify the number of bytes of buffered outgoing data that is considered "low." the default value is 0.
... syntax var threshold = adatachannel.bufferedamountlowthreshold; adatachannel.bufferedamountlowthreshold = threshold; value the number of queued outgoing data bytes below which the buffer is considered to be "low." example in this snippet of code, bufferedamountlowthreshold is set to 64kb, and a handler for the bufferedamountlow event is established by setting the rtcdatachannel.onbufferedamountlow property to a function which should send more data into the buffer by calling send().
RTCIceCandidateStats.deleted - Web APIs
if this value is true, the candidate described by the rtcicecandidatestats object is no longer under consideration.
... the net result is the same; the candidate is no longer under consideration if this value is true.
RTCIceTransport.state - Web APIs
however, there are still candidates pairings to consider, and there may still be gathering underway on one or both of the two devices.
...in addition, all candidate pairs have been considered and a pair has been selected for use.
RTCIceTransportState - Web APIs
however, there are still candidates pairings to consider, and there may still be gathering underway on one or both of the two devices.
...in addition, all candidate pairs have been considered and a pair has been selected for use.
RTCPeerConnection.addTrack() - Web APIs
for example, consider this function that an application might use to begin streaming a device's camera and microphone input over an rtcpeerconnection to a remote peer: async opencall(pc) { const gumstream = await navigator.mediadevices.getusermedia( {video: true, audio: true}); for (const track of gumstream.gettracks()) { pc.addtrack(track, gumstream); } } the remote peer might ...
... the rtcrtpsender being considered has never been used to send data.
RTCStatsReport - Web APIs
since this only provides statistics related to inbound data, without considering the local peer's state, any values that require knowledge of both, such as round-trip time, is not included.
...this information considers only the outbound rtp stream, so any data which requires information about the state of the remote peers (such as round-trip time) is unavailable, since those values can't be computed without knowing about the other peers' states.
RTCStatsType - Web APIs
since this only provides statistics related to inbound data, without considering the local peer's state, any values that require knowledge of both, such as round-trip time, is not included.
...this information considers only the outbound rtp stream, so any data which requires information about the state of the remote peers (such as round-trip time) is unavailable, since those values can't be computed without knowing about the other peers' states.
Range.setEnd() - Web APIs
WebAPIRangesetEnd
syntax range.setend(endnode, endoffset); parameters endnode the node inside which the range should end.
... exceptions exceptions are thrown as domexception objects of the following types: invalidnodetypeerror the node specified by endnode is a doctype node; range endpoints cannot be located inside a doctype node.
Range - Web APIs
WebAPIRange
range.comparenode() returns a constant representing whether the node is before, after, inside, or surrounding the range.
... range.comparepoint() returns -1, 0, or 1 indicating whether the point occurs before, inside, or after the range.
Report - Web APIs
WebAPIReport
web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
...we loop over each report using a basic for loop, then iterate over each entry of in the report's body using a for...in structure, displaying each key/value pair inside a list item.
ReportingObserver - Web APIs
web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); later on in the example we deliberately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, success, failure); } else { navigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the event h...
...andler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
SVGGeometryElement - Web APIs
normal hit testing rules apply; the value of the pointer-events property on the element determines whether a point is considered to be within the fill.
...normal hit testing rules apply; the value of the pointer-events property on the element determines whether a point is considered to be within the stroke.
onnotificationclose - Web APIs
note: trying to create a notification inside the serviceworkerglobalscope using the notification() constructor will throw an error.
...}); example //inside a service worker.
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
therefore, it's common to call self.skipwaiting() from inside of an installevent handler.
... self.skipwaiting(); // perform any other actions required for your // service worker to install, potentially inside // of event.waituntil(); }); specifications specification status comment service workersthe definition of 'skipwaiting()' in that specification.
SharedWorker - Web APIs
the different scripts are using the same worker file to perform the calculation — they can both access it, even if their pages are running inside different windows.
...ctively: first.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobalscope.onconnect handler to connect to the same port discussed above.
SharedWorkerGlobalScope.applicationCache - Web APIs
don't use it to make offline websites — consider using service workers instead.
... example if a shared worker has an appcache associated with it, you can return a reference to the cache using self.applicationcache from inside the shared worker.
SourceBuffer.abort() - Web APIs
example the spec description of abort() is somewhat confusing — consider for example step 1 of reset parser state.
...for example, consider this code: sourcebuffer.addeventlistener('updateend', function (_) { ...
SourceBuffer.timestampOffset - Web APIs
the timestampoffset property of the sourcebuffer interface controls the offset applied to timestamps inside media segments that are appended to the sourcebuffer.
...their sourcebuffer.updating property is currently true), a media segment inside the sourcebuffer is currently being parsed, or this sourcebuffer has been removed from the mediasource.
Using the Storage Access API - Web APIs
</iframe> now on to the code executed inside the embedded document.
...}); note that access requests are automatically denied unless the embedded content is currently processing a user gesture such as a tap or click — so this code needs to be run inside some kind of user gesture-based event handler, for example: btn.addeventlistener('click', () => { // run code here }); ...
SubtleCrypto.exportKey() - Web APIs
*/ window.crypto.subtle.generatekey( { name: "rsa-pss", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign", "verify"] ).then((keypair) => { const exportbutton = document.queryselector(".pkcs8"); exportbutton.addeventlistener("click", () => { exportcryptokey(keypair.privatekey); }); }); subjectpublickeyinfo exp...
...*/ window.crypto.subtle.generatekey( { name: "rsa-oaep", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["encrypt", "decrypt"] ).then((keypair) => { const exportbutton = document.queryselector(".spki"); exportbutton.addeventlistener("click", () => { exportcryptokey(keypair.publickey); }); }); json web key import t...
TouchEvent.targetTouches - Web APIs
the targettouches read-only property is a touchlist listing all the touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element.
... syntax var touches = touchevent.targettouches; return value touches a touchlist listing all the touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element.
WebGLRenderingContext.vertexAttribPointer() - Web APIs
this is independent from the location inside the array buffer, so your attributes can be sent in a different order than how they are stored in the array buffer.
...keep in mind that these webgl functions have a slow performance and it is better to store the state inside your javascript application.
Basic scissoring - Web APIs
although the clear() drawing command writes the clear color (set by clearcolor()) to all pixels in the drawing buffer, scissor() defines a mask that only allows pixels inside the specified rectangular area to be updated.
...because only fragments within the specified rectangular area successfully pass the scissor test, only pixels inside that area are updated, and we get a rectangle on the screen.
Raining rectangles - Web APIs
timer = settimeout(drawanimation, 17); } function playerclick (evt) { // we need to transform the position of the click event from // window coordinates to relative position inside the canvas.
... var position = [ evt.pagex - evt.target.offsetleft, gl.drawingbufferheight - (evt.pagey - evt.target.offsettop), ]; // if the click falls inside the rectangle, we caught it.
Lighting in WebGL - Web APIs
sunlight, for example, is considered directional light.
... for our purposes, we're going to simplify the lighting model by only considering simple directional and ambient lighting; we won't have any specular highlights or point light sources in this scene.
WebRTC connectivity - Web APIs
the pending description (returned by rtcpeerconnection.pendinglocaldescription and rtcpeerconnection.pendingremotedescription) indicates a description which is currently under consideration following a call to setlocaldescription() or setremotedescription(), respectively.
... the pendinglocaldescription contains not just the offer or answer under consideration, but any local ice candidates which have already been gathered since the offer or answer was created.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
a polite peer, essentially, is one which may send out offers, but then responds if an offer arrives from the other peer with "okay, never mind, drop my offer and i'll consider yours instead." an impolite peer, which always ignores incoming offers that collide with its own offers.
... the old way consider this onnegotiationneeded event handler: pc.onnegotiationneeded = async () => { try { await pc.setlocaldescription(await pc.createoffer()); signaler.send({description: pc.localdescription}); } catch(err) { console.error(err); } }; because the createoffer() method is asynchronous and takes some time to complete, there's time in which the remote peer might attempt to send an o...
Signaling and video calling - Web APIs
now let's consider the signaling protocol we will implement.
... optionally, see rfc 8445: interactive connectivity establishment, section 2.3 ("negotiating candidate pairs and concluding ice") if you want greater understanding of how this process is completed inside the ice layer.
WebRTC API - Web APIs
interoperability because implementations of webrtc are still evolving, and because each browser has different levels of support for codecs and webrtc features, you should strongly consider making use of the adapter.js library provided by google before you begin to write your code.
... see also mediadevices mediastreamevent mediastreamconstraints mediastreamtrack messageevent mediastream media capture and streams api firefox multistream and renegotiation for jitsi videobridge peering through the webrtc fog with socketpeer inside the party bus: building a web app with multiple live video streams + interactive graphics web media technologies ...
Writing WebSocket client applications - Web APIs
to begin listening for incoming data, you can do something like this: examplesocket.onmessage = function (event) { console.log(event.data); } receiving and interpreting json objects let's consider the chat client application first alluded to in using json to transmit objects.
... 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.
Fundamentals of WebXR - Web APIs
webvr was generally considered to be an experimental api designed to help specification writers determine the best approaches to creating an api for virtual reality on the web.
... basic concepts before getting into too much detail, let's consider some basic concepts that you need to know before you learn how to develop xr code.
WebXR permissions and security - Web APIs
the document is considered trustworthy, in that it is responsible and is both currently active and has focus.
... if your code is executing during the launch of a web application, the runtime may consider the act of launching your web application to qualify as user intent.
Advanced techniques: Creating and sequencing audio - Web APIs
also, it would be really nice to consider an instrument-wide bpm control.
... this.dataset.playing = 'true'; } else { window.cleartimeout(timerid); this.dataset.playing = 'false'; } }) }); summary we've now got an instrument inside our browser!
Web audio spatialization basics - Web APIs
as if its extensive variety of sound processing (and other) options wasn't enough, the web audio api also includes facilities to allow you to emulate the difference in sound as a listener moves around a sound source, for example panning as you move around a sound source inside a 3d game.
... the boombox sits inside a room (defined by the edges of the browser viewport), and in this demo, we can move and rotate it with the provided controls.
Window.mozAnimationStartTime - Web APIs
returns the time, in milliseconds since the epoch, at which animations started now should be considered to have started.
... syntax time = window.mozanimationstarttime; parameters time is the time in milliseconds since the epoch at which animations for the current window should be considered to have started.
Window: popstate event - Web APIs
to better understand when the popstate event is fired, consider this simplified sequence of events that occurs when the current history entry changes due to either the user navigating the site or the history being traversed programmatically.
...the destination entry is now considered to be current.
Window.window - Web APIs
WebAPIWindowwindow
for example, if we refer to "this.window.location.href", a javascript module could define a property called "window" inside of a class it defined (since no global "window" variable exists for it by default) which could be created after passing in a window object to the module class' constructor.
... thus, "this.window" inside of its functions would refer to that window object.
Window - Web APIs
WebAPIWindow
see mozscreenpixelspercsspixel in nsidomwindowutils for a conversion factor to adapt to screen pixels if needed.
... globaleventhandlers.onmousemove called continously when the mouse is moved inside the window.
Worker.onmessage - Web APIs
WebAPIWorkeronmessage
messages are passed to the worker when the value inside the form input first changes.
...the worker.js script, an onmessage handler is used to the handle messages from the main script: onmessage = function(e) { console.log('message received from main script'); var workerresult = 'result: ' + (e.data[0] * e.data[1]); console.log('posting message back to main script'); postmessage(workerresult); } notice how in the main script, onmessage has to be called on myworker, whereas inside the worker script you just need onmessage because the worker is effectively the global scope (dedicatedworkerglobalscope).
WorkerGlobalScope.console - Web APIs
example this property allows you to have access to a browser console for debugging purposes, inside a worker.
... so for example you could call console.log('test'); inside a worker (which would basically be the equivalent of self.console.log('test');, as these are being called on the worker scope, which can be referenced with workerglobalscope.self), to return a test message out to the browser console.
WorkerGlobalScope.location - Web APIs
example if you called the following in a document served at localhost:8000 console.log(location); inside a worker (which would basically be the equivalent of self.console.log(self.location);, as these are being called on the worker scope, which can be referenced with workerglobalscope.self), you will get a workerlocation object written to the console — something like the following: workerlocation {hash: "", search: "", pathname: "/worker.js", port: "8000", hostname: "localhost"…} hash: "" ...
... note: firefox has a bug with using console.log inside shared/service workers (see bug 1058644), which may return strange results, but this should be fixed soon.
WorkerGlobalScope.performance - Web APIs
example if you called console.log(performance); inside a worker (which would basically be the equivalent of self.console.log(self.performance);, as these are being called on the worker scope, which can be referenced with workerglobalscope.self), you will get a workerperformance object written to the console — something like the following: workerperformance {now: function} __proto__: workerperformance constructor: function workerperformance() { [native code] } now: functi...
... note: firefox has a bug with using console.log inside shared/service workers (see bug 1058644), which may return strange results, but this should be fixed soon.
Synchronous and asynchronous requests - Web APIs
you should consider using the fetch() api with the keepalive flag.
... when fetch with keepalive isn't available, you can consider using the navigator.sendbeacon() api, which can support these use cases while typically delivering a good ux.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
for example, consider a device which uses a 2560x1440 pixel frame buffer (which is used to render two views, for the left and right eyes, side by side each at a resolution of 1280x1440 pixels).
... consider a frame buffer which at full size looks like this: if, on this device, it's determined that due to gpu limitations the browser needs to reduce image quality in order to improve performance to an acceptable level, it might choose to halve the resolution.
ARIA live regions - Accessibility
aria-controls="myregionid1 myregionsid2".
... advanced use case: clock as an illustration of aria-atomic, consider a site with a simple clock, showing hours and minutes.
Using the alertdialog role - Accessibility
the tab order inside the alert dialog must wrap.
... when the alert dialog is correctly labeled and focus is moved to a control inside the dialog, screen readers should announce the dialog's accessible role, name and optionally description before announcing the focused element.
Using the group role - Accessibility
the group role is used to identify a set of user interface objects which, in contrast with a region, are not intended to be included in a table of contents or a page summary (such as the structures that are dynamically created by a script or assistive technologies); a group should not be considered a major perceivable section on a page.
... assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce the group when focus first lands on a control inside it, and if aria-describedby has been set, the description may be spoken.
ARIA annotations - Accessibility
wai-aria version 1.3 sees the addition of a set of new features, collectively known as aria annotations, which allow the creation of accessible annotations inside web documents.
...9">march 30 2019, 19:29</time></p> </div> <div role="comment" id="thread-2" data-author="chris"> <h3>marcus said</h3> <p class="comment-text">the guitar solo could do with a touch more chorus, and a slightly lower volume.</p> <p><time datetime="2019-03-29t15:35">march 29 2019, 15:35</time></p> </div> nested comments are also possible with aria annotations — simply nest the comments inside one another, like so: <div role="comment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="comment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> <div role="comment" data-author="marcus"> <h3>marcus replied</h3> <p class="comment-text">i don't know about that.
ARIA: article role - Accessibility
articles are not considered a navigational landmark, but many assistive technologies that support landmarks also support a means to navigate among articles.
... inside an application or other widget that causes screen readers and other assistive technologies to be in pass-through mode, an article can be used to indicate that these should switch back to treating the enclosed content as regular web content.
ARIA: contentinfo role - Accessibility
mega-footers do not nest additional <footer> elements or contentinfo landmarks inside of the document's footer.
...note that a footer element nested within an article, aside, main, nav, or section is not considered contentinfo.
ARIA: grid role - Accessibility
even though both data grids and layout grids employ the same aria roles, states, and properties, differences in their content and purpose surface factors that are important to consider in keyboard interaction design.
... row a row inside the grid.
ARIA: Listitem role - Accessibility
the aria listitem role can be used to identify an item inside a list of items.
... <section role="list"> <div role="listitem">list item 1</div> <div role="listitem">list item 2</div> <div role="listitem">list item 3</div> </section> description any content that consists of an outer container with a list of elements inside it can be identified to assistive technologies using the list and listitem containers respectively.
Web applications and ARIA FAQ - Accessibility
you may want to consider implementing aria using progressive enhancement techniques—such as adding aria using javascript, not directly to your markup—in order to more gracefully support older browsers and assistive technologies.
... degrading gracefully from html5 to aria when delivering content to browsers that aren't html5-aware, you may want to consider gracefully degrading to the use of aria where necessary.
Text labels and names - Accessibility
use a legend to label a fieldset when grouping a set of form elements together with a <fieldset> element, you should include a nested <legend> element inside it, containing a clear description of the group.
... the form element can be placed inside the <label>, in which case the association between the form element and the label is obvious from the structure.
:host - CSS: Cascading Style Sheets
WebCSS:host
the :host css pseudo-class selects the shadow host of the shadow dom containing the css it is used inside — in other words, this allows you to select a custom element from inside its shadow dom.
... in this example we have a simple custom element — <context-span> — that you can wrap around text: <h1>host selectors <a href="#"><context-span>example</context-span></a></h1> inside the element's constructor, we create style and span elements, fill the span with the content of the custom element, and fill the style element with some css rules: let style = document.createelement('style'); let span = document.createelement('span'); span.textcontent = this.textcontent; const shadowroot = this.attachshadow({mode: 'open'}); shadowroot.appendchild(style); shadowroot.appendchild...
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
WebCSS:is
/* selects any paragraph inside a header, main or footer element that is being hovered */ :is(header, main, footer) p:hover { color: red; cursor: pointer; } /* the above is equivalent to the following */ header p:hover, main p:hover, footer p:hover { color: red; cursor: pointer; } /* backwards-compatible version with :-*-any() and :matches() (it is not possible to group selectors into single rule, because pr...
...in, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-moz-any(header, main, footer) p'); } catch(e) { console.log('your browser doesn\'t support :is(), :matches(), or :any()'); } } } } matcheditems.foreach(applyhandler); function applyhandler(elem) { elem.addeventlistener('click', function(e) { alert('this paragraph is inside a ' + e.target.parentnode.nodename); }); } simplifying list selectors the :is() pseudo-class can greatly simplify your css selectors.
@charset - CSS: Cascading Style Sheets
WebCSS@charset
it must be the first element in the style sheet and not be preceded by any character; as it is not a nested statement, it cannot be used inside conditional group at-rules.
... if several @charset at-rules are defined, only the first one is used, and it cannot be used inside a style attribute on an html element or inside the <style> element where the character set of the html page is relevant.
@media - CSS: Cascading Style Sheets
WebCSS@media
syntax the @media at-rule may be placed at the top level of your code or nested inside any other conditional group at-rule.
... also consider using level 4 media queries to improve the user's experience.
At-rules - CSS: Cascading Style Sheets
WebCSSAt-rule
@namespace — tells the css engine that all its content must be considered prefixed with an xml namespace.
... nested at-rules — a subset of nested statements, which can be used as a statement of a style sheet as well as inside of conditional group rules: @media — a conditional group rule that will apply its content if the device meets the criteria of the condition defined using a media query.
Coordinate systems - CSS: Cascading Style Sheets
whenever the mouse enters, moves around inside, or exits the inner box, the corresponding event is handled by updating a set of informational messages within the box, listing out the current mouse coordinates in each of the four available coordinate systems.
... let inner = document.queryselector(".inner"); let log = document.queryselector(".log"); function setcoords(e, type) { let idx = type + "x"; let idy = type + "y"; document.getelementbyid(idx).innertext = e[idx]; document.getelementbyid(idy).innertext = e[idy]; } a reference to the <div> inside the inner box which contains the paragraphs that will show the coordinate information is fetched into log.
Box alignment in grid layout - CSS: Cascading Style Sheets
on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items.
... self alignment justify-self align-self place-self justify-items align-items place-items these properties deal with aligning the item inside the grid area it is placed into.
Handling Overflow in Multicol - CSS: Cascading Style Sheets
in this guide we look at how multicol deals with overflow, both inside the column boxes and in situations where there is more content than will fit into the container.
... overflow inside column boxes an overflow situation happens when an item's size is larger than the column box.
Styling Columns - CSS: Cascading Style Sheets
as column boxes created inside multicol containers are anonymous boxes, there is little we can do to style them.
...in the next guide we will take a look at making elements inside a container span across all columns.
Using feature queries - CSS: Cascading Style Sheets
testing for lack of support in addition to asking the browser if it supports a feature, you can test for the opposite by adding in the not keyword: @supports not (property: value) { css rules to apply } the css inside the following example feature query will run if the browser does not support row-gap.
...you do however need to structure your css in a certain way, writing css for non-supporting browsers and overwriting it with the css inside the feature query.
CSS Containment - CSS: Cascading Style Sheets
it tells the browser that the internal layout of the element is totally separate from the rest of the page, and that everything about the element is painted inside its bounds.
...by using contain: layout you can tell the browser it only needs to check this element — everything inside the element is scoped to that element and does not affect the rest of the page, and the containing box establishes an independent formatting context.
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
aligning content on the cross axis — the align-content property so far we have been aligning the items, or an individual item inside the area defined by the flex-container.
...you might think that this should be a use case for a justify-self property, however consider the image below.
Ordering Flex Items - CSS: Cascading Style Sheets
we will also consider the implications of reordering items from an accessibility point of view.
... if you are using a reverse value, or otherwise reordering your items, you should consider whether you actually need to change the logical order in the source.
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
the box alignment module for many people the first reason they start to look at flexbox is because of the ability to properly align flex items inside a flex container.
...one of these flex items has two elements nested inside it, which would not ordinarily participate in flex layout.
CSS Fragmentation - CSS: Cascading Style Sheets
it also occurs when a block spans more than one column inside a column layout container, or spans a page break when printed.
... reference box-decoration-break break-after break-before break-inside orphans widows specifications specification status comment css fragmentation module level 3 candidate recommendation initial definition.
Basic Concepts of grid layout - CSS: Cascading Style Sheets
in this example, i have a containing div with a class of wrapper and, inside are five child elements.
...these tracks will be auto-sized by default, resulting in their size being based on the content that is inside them.
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
in this next example, i am using alignment to align items inside a grid that is set to writing-mode: vertical-lr.
... if you use absolute positioning within a grid area, then you will again be using physical offsets to push the item around inside the grid area.
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
my mark-up is a container with elements inside for a header, footer, main content, navigation, sidebar, and a block into which i am intending to place advertising.
... .wrapper { max-width: 1024px; margin: 0 auto; font: 1.2em helvetica, arial, sans-serif; } .wrapper > * { border: 2px solid #f08c00; background-color: #ffec99; border-radius: 5px; padding: 10px; } .wrapper { display: grid; grid-template-columns: repeat(12, [col-start] 1fr); grid-gap: 20px; } to demonstrate how this grid system works i have four child elements inside my wrapper.
Subgrid - CSS: Cascading Style Sheets
note that line numbering restarts inside the subgrid — column line 1, when inside the subgrid, is the first line of the subgrid.
... take a look at the next example — it uses the same parent and child grid as in the example above, however inside the subgrid i have twelve items trying to autoplace into ten grid cells.
Consistent list indentation - CSS: Cascading Style Sheets
making a list first, we consider a single, pure list item.
...if it's changed to inside, then the markers are brought inside the <li>'s content, as though they're an inline box placed at the very beginning of the <li>.
The stacking context - CSS: Cascading Style Sheets
each stacking context is completely independent of its siblings: only descendant elements are considered when stacking is processed.
... each stacking context is self-contained: after the element's contents are stacked, the whole element is considered in the stacking order of the parent stacking context.
CSS selectors - CSS: Cascading Style Sheets
syntax: a b example: div span will match all <span> elements that are inside a <div> element.
... syntax: a > b example: ul > li will match all <li> elements that are nested directly inside a <ul> element.
CSS values and units - CSS: Cascading Style Sheets
position the <position> type defines 2d positioning of an object inside a positioning area, for example a background image inside a container.
... white space is allowed, but optional inside the parentheses.
Center an element - CSS: Cascading Style Sheets
in this recipe you will see how to center one box inside another.
... recipe download this example choices made to center one box inside another we make the containing box a flex container.
Recipe: Media objects - CSS: Cascading Style Sheets
if the image is larger, the track stops growing at 200 pixels and as the image has a max-width of 100% applied, it scales down so that it continues to fit inside the column.
... when we nest one media object inside another we need to place it into the second track in the regular layout, and the first track when flipped.
Paged media - CSS: Cascading Style Sheets
it allows you to set page breaks, control printable area, style left and right pages differently, and control breaks inside elements.
... widely supported properties include: page-break-before page-break-after page-break-inside orphans widows @page ...
WebKit CSS extensions - CSS: Cascading Style Sheets
t-border-start-style** -webkit-border-start-width** -webkit-border-vertical-spacing -webkit-box-align** -webkit-box-direction** -webkit-box-flex-group** -webkit-box-flex** -webkit-box-lines** -webkit-box-ordinal-group** -webkit-box-orient** -webkit-box-pack** -webkit-box-reflect** c -webkit-column-axis -webkit-column-break-after -webkit-column-break-before -webkit-column-break-inside -webkit-column-progression -webkit-cursor-visibility d-i -webkit-dashboard-region -webkit-font-size-delta -webkit-font-smoothing -webkit-highlight -webkit-hyphenate-character -webkit-hyphenate-limit-after -webkit-hyphenate-limit-before -webkit-hyphenate-limit-lines -webkit-initial-letter l -webkit-line-align -webkit-line-box-contain -webkit-line-clamp -webkit-line-grid -w...
... -webkit-alt* -webkit-color-correction -webkit-flow-from -webkit-flow-into -webkit-grid-columns (see grid-column) -webkit-grid-rows (see grid-row) -webkit-hyphenate-charset -webkit-image-set (see image-set()) -webkit-mask-attachment -webkit-match-nearest-mail-blockquote-color -webkit-overflow-scrolling -webkit-region-break-after -webkit-region-break-before -webkit-region-break-inside -webkit-region-fragment -webkit-shape-inside -webkit-touch-callout (see touch-action) background-origin-x (unprefixed!) background-origin-y (unprefixed!) * still supported in the safari technology preview, but not in a generally released browser.
box-flex-group - CSS: Cascading Style Sheets
when dividing up the box's extra space, the browser first considers all elements within the first flex group.
...instead, distribution of space inside the flex container is now handled using flex-basis, flex-grow, and flex-shrink.
box-lines - CSS: Cascading Style Sheets
WebCSSbox-lines
the default value is single, which means that all elements will be placed in a single row or column, and any elements that don't fit will simply be considered overflow.
...each line computes flexes independently, so only elements on that line are considered when evaluating box-flex and box-flex-groups.
calc() - CSS: Cascading Style Sheets
WebCSScalc
consider the following code: .foo { --widtha: 100px; --widthb: calc(var(--widtha) / 2); --widthc: calc(var(--widthb) / 2); width: var(--widthc); } after all variables are expanded, widthc's value will be calc( calc( 100px / 2) / 2), then when it's assigned to .foo's width property, all inner calc()s (no matter how deeply nested) will be flattened to just parentheses, so the width property's va...
...in short: a calc() inside of a calc() is identical to just parentheses.
<color> - CSS: Cascading Style Sheets
there are a few caveats to consider when using color keywords: html only recognizes the 16 basic color keywords found in css1, using a specific algorithm to convert unrecognized values (often to completely different colors).
... accessibility considerations some people have difficulty distinguishing colors.
contain - CSS: Cascading Style Sheets
WebCSScontain
nice article</h2> <p>content here.</p> <img src="i-just-showed-up.jpg" alt="social"> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; } as you can see, because of the way floats work, the first image ends up inside the area of the second article: fixing with contain if we give each article the contain property with a value of content, when new elements are inserted the browser understands it only needs to recalculate the containing element's subtree, and not anything outside it: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> <img src="i-just-showed-up.jpg" al...
...t="social"> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; contain: content; } this also means that the first image no longer floats down to the second article, and instead stays inside it's containing element's bounds: specifications specification status comment css containment module level 1the definition of 'contain' in that specification.
<display-listitem> - CSS: Cascading Style Sheets
list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords.
... examples html <div class="fake-list">i will display as a list item</div> css .fake-list { display: list-item; list-style-position: inside; } result specifications specification status css display module level 3the definition of 'display-listitem' in that specification.
flex - CSS: Cascading Style Sheets
WebCSSflex
negative values are considered invalid.
...negative values are considered invalid.
hyphens - CSS: Cascading Style Sheets
WebCSShyphens
values none words are not broken at line breaks, even if characters inside the words suggest line break points.
... manual words are broken for line-wrapping only where characters inside the word suggest line break opportunities.
image() - CSS: Cascading Style Sheets
therefore, if the fragment is not understood within image(), the image will be considered invalid.
...as a use case, consider a dark image being used as a background for some white text.
inherit - CSS: Cascading Style Sheets
WebCSSinherit
for non-inherited properties, this specifies a behavior that typically makes relatively little sense and you may consider using initial instead, or unset on the all property.
... examples exclude selected elements from a rule /* make second-level headers green */ h2 { color: green; } /* ...but leave those in the sidebar alone so they use their parent's color */ #sidebar h2 { color: inherit; } in this example the h2 elements inside the sidebar might be different colors.
margin-left - CSS: Cascading Style Sheets
in this case, it is set to the value centering the element inside its parent.
...in this case, it is set to the value centering the border area inside the available width, if fixed.
margin-right - CSS: Cascading Style Sheets
in this case, it is set to the value centering the element inside its parent.
...in this case, it is set to the value centering the border area inside the available width, if fixed.
overflow-wrap - CSS: Cascading Style Sheets
soft wrap opportunities introduced by the word break are considered when calculating min-content intrinsic sizes.
... break-word the same as the anywhere value, with normally unbreakable words allowed to be broken at arbitrary points if there are no otherwise acceptable break points in the line, but soft wrap opportunities introduced by the word break are not considered when calculating min-content intrinsic sizes.
position - CSS: Cascading Style Sheets
WebCSSposition
fari on iossamsung internetpositionchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes before firefox 57, absolute positioning did not work correctly when applied to elements inside tables that have border-collapse applied to them (bug 1379306).notes before firefox 30, absolute positioning of table rows and row groups was not supported (bug 63895).ie full support 4opera full support 4safari full support 1webview android full ...
...support ≤37chrome android full support 18firefox android full support 4notes full support 4notes notes before firefox 57, absolute positioning did not work correctly when applied to elements inside tables that have border-collapse applied to them (bug 1379306).notes before firefox 30, absolute positioning of table rows and row groups was not supported (bug 63895).opera android full support 14safari ios full support 1samsung internet android full support 1.0absolutely-positioned flex childrenchrome...
shape-image-threshold - CSS: Cascading Style Sheets
any pixels whose alpha component's value is greater than the threshold are considered to be part of the shape for the purposes of determining its boundaries.
...the gradient is established as a css shape using shape-outside, so that pixels within the gradient which are at least 20% opaque (that is, those pixels with an alpha component greater than 0.2) are considered part of the shape.
text-overflow - CSS: Cascading Style Sheets
the ellipsis is displayed inside the content area, decreasing the amount of text displayed.
...the string is displayed inside the content area, shortening the size of the displayed text.
scale() - CSS: Cascading Style Sheets
when a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks.
... also, consider making use of the prefers-reduced-motion media feature — use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences.
white-space - CSS: Cascading Style Sheets
the white-space css property sets how white space inside an element is handled.
... hang pre-line preserve collapse wrap remove break-spaces preserve preserve wrap wrap formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | pre | nowrap | pre-wrap | pre-line | break-spaces examples basic example code { white-space: pre; } line breaks inside <pre> elements pre { word-wrap: break-word; /* ie 5.5-7 */ white-space: pre-wrap; /* modern browsers */ } in action html <div id="css-code" class="box"> p { white-space: <select> <option>normal</option> <option>nowrap</option> <option>pre</option> <option>pre-wrap</option> <option>pre-line</option> <option>break-spaces</option> </select> } </div> ...
Audio and video manipulation - Developer guides
for efficiency, you should consider using requestanimationframe() instead of settimeout() when running on browsers that support it.
...you can combine webgl and the <video> element to create video textures, which means you can put video inside 3d scenes.
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
so it's important to consider your use of color carefully.
... color blindness & web design (usability.gov: united states department of health and human services) palette design example let's consider a quick example of selecting an appropriate color palette for a site.
HTML attribute: max - HTML: Hypertext Markup Language
WebHTMLAttributesmax
valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and both the <progress> and <meter> elements, the max attribute is a number that specifies the most positive value a form control to be considered valid.
... type="time" max="17:00" step="900"> datetime-local yyyy-mm-ddthh:mm <input type="datetime-local" min="2019-12-25t23:59"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step="5" max="100"> note: when the data entered by the user doesn't adhere to the maximum value set, the value is considered invalid in contraint validation and will match the :invalid and :out-of-range pseudoclasses see client-side validation and rangeoverflow for more information.
HTML attribute: min - HTML: Hypertext Markup Language
WebHTMLAttributesmin
valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and the <meter> element, the min attribute is a number that specifies the most negative value a form control to be considered valid.
...nput type="time" min="09:00" step="900"> datetime-local yyyy-mm-ddthh:mm <input type="datetime-local" min="2019-12-25t19:30"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step="5" max="100"> note: when the data entered by the user doesn't adhere to the min value set, the value is considered invalid in contraint validation and will match the :invalid pseudoclass see client-side validation and rangeunderflow for more information.
HTML attribute: step - HTML: Hypertext Markup Language
WebHTMLAttributesstep
the number spinner, if present, will only show valid float values of 1.2 and greater note: when the data entered by the user doesn't adhere to the stepping configuration, the value is considered invalid in contraint validation and will match the :invalid and :out-of-range pseudoclasses see client-side validation and stepmismatch for more information.
...if providing instructions outside of labels, which allows more flexible positioning and design, consider using aria-labelledby or aria-describedby.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
a tainted canvas is one which is no longer considered secure, and any attempts to retrieve image data back from the canvas will cause an exception to be thrown.
...consider the html5 boilerplate apache server configuration file for cors images, shown below: <ifmodule mod_setenvif.c> <ifmodule mod_headers.c> <filesmatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$"> setenvif origin ":" is_cors header set access-control-allow-origin "*" env=is_cors </filesmatch> </ifmodule> </ifmodule> in short, this configures the server to allow graphic fil...
Date and time formats used in HTML - HTML: Hypertext Markup Language
that means it's possible for the first few days of january to be considered part of the previous week-year, and for the last few days of december to be considered part of the following week-year.
...for example, the first thursday of 1953 was on january 1, so that week—beginning on monday, december 29—is considered the first week of the year.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
the default closed state displays only the triangle and the label inside <summary> (or a user agent-defined default string if no <summary>).
...here's what your browser does with it: providing a summary this example adds a summary to the above example by using the <summary> element inside <details>, like this: <details> <summary>system requirements</summary> <p>requires a computer running an operating system.
<dt>: The Description Term element - HTML: Hypertext Markup Language
WebHTMLElementdt
the html <dt> element specifies a term in a description or definition list, and as such must be used inside a <dl> element.
... permitted parents before a <dt> or a <dd> element, inside a <dl> or (in whatwg html) a <div> that is inside a <dl>.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
it is possible to use the :valid and :invalid css pseudo-classes to style a <form> element based on whether or not the elements inside the form are valid.
... dialog: when the form is inside a <dialog>, closes the dialog on submission.
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
if it is, we: print out its name and file size into a list item inside the previous <div> (obtained from file.name and file.size).
... if the file type is invalid, we display a message inside a list item telling the user that they need to select a different file type.
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
if the pattern attribute is specified, the content of a password control is only considered valid if the value passes validation; see validation for more information.
... additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, password field inputs support the following attributes: attribute description maxlength the maximum length the value may be, in utf-16 characters minlength the minimum length in characters that will be considered valid pattern a regular expression the value must match in order to be valid placeholder an example value to display in the field when the field is empty readonly a boolean attribute which, if present, indicates that the field's contents should not be editable size the number of characters wide the input field should be maxlength the max...
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
the precise value, however, is not considered important.
... consider this range control: <input type="range" id="volume" min="0" max="11" value="7" step="1"> screenshotlive sample this control is horizontal (at least on most if not all major browers; others might vary).
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
we had to put the icons on a <span> next to the input, not on the input itself, because in chrome the generated content is placed inside the form control, and can't be styled or shown effectively.
...queryselector('#hour'); var minuteselect = document.queryselector('#minute'); // hide fallback initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new date input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'time'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker and show the fallback nativepicker.style.display = 'none'; fallbackpicker.style.display = 'block'; fallbacklabel.style.display = 'block'; // populate the hours and minutes dynamically populatehours(); populateminutes(); } function populatehours() { // populate the hours <select> with the 6 open hours of the ...
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
WebHTMLElementmeter
when used with the low attribute and high attribute, it gives an indication where along the range is considered preferable.
... for example, if it is between the min attribute and the low attribute, then the lower range is considered preferred.
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
(if this attribute is not set, the <output> is associated with its ancestor <form> element, if any.) this attribute lets you associate <output> elements to <form>s anywhere in the document, not just inside a <form>.
...assistive technology will thereby announce the results of ui interactions posted inside it without requiring that focus is switched away from the controls that produce those results.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
in finished works, combining both is considered redundant and amateurish.</p> <p>in very old writing, paragraphs were separated with a special character: ¶, the <i>pilcrow</i>.
... nowadays, this is considered claustrophobic and hard to read.</p> <p>how hard to read?
<table>: The Table element - HTML: Hypertext Markup Language
WebHTMLElementtable
deprecated attributes align this enumerated attribute indicates how the table must be aligned inside the containing document.
... ideally, consider alternate ways to present the table's content, including breaking it apart into a collection of smaller, related tables that don't have to rely on using the colspan and rowspan attributes.
<tbody>: The Table Body element - HTML: Hypertext Markup Language
WebHTMLElementtbody
if you use <tbody>, you can't also have table rows (<tr> elements) which are direct children of the <table> but not included inside the <tbody>.
... all non-header and non-footer rows must be inside the <tbody> if one is used.
<template>: The Content Template element - HTML: Hypertext Markup Language
WebHTMLElementtemplate
consider the following html and javascript: html <div id="container"></div> <template id="template"> <div>click me</div> </template> javascript const container = document.getelementbyid("container"); const template = document.getelementbyid("template"); function clickhandler(event) { alert("clicked a div"); } const firstclone = template.content.clonenode(true); firstclone.addeventlistener("cl...
...ick", clickhandler); container.appendchild(firstclone); const secondclone = template.content.firstelementchild.clonenode(true); secondclone.addeventlistener("click", clickhandler); container.appendchild(secondclone); result firstclone is a documentfragment instance, so while it gets appended inside the container as expected, clicking on it does not trigger the click event.
Inline elements - HTML: Hypertext Markup Language
for example, even if the display of the span element is changed to "block", it still would not allow to nest a div element inside it.
...you can't put block elements inside inline elements.
Link types - HTML: Hypertext Markup Language
if not inside the <head> element, the standard doesn't distinguish between a hyperlink applying to a specific part of the document or to the document as a whole.
...starting with firefox 44, the value of the crossorigin attribute is taken into consideration, making it possible to make anonymous prefetches.
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
if any of those headers have ”nonstandard” values, webkit/safari does not consider the request to be a “simple request”.
... what values webkit/safari consider “nonstandard” is not documented, except in the following webkit bugs: require preflight for non-standard cors-safelisted request headers accept, accept-language, and content-language allow commas in accept, accept-language, and content-language request headers for simple cors switch to a blacklist model for restricted accept headers in simple cors requests no other browsers implement these extra restrictions, because they’re not part of the spec.
Content Security Policy (CSP) - HTTP
WebHTTPCSP
csp makes it possible for server administrators to reduce or eliminate the vectors by which xss can occur by specifying the domains that the browser should consider to be valid sources of executable scripts.
... sample violation report let's consider a page located at http://example.com/signup.html.
Using HTTP cookies - HTTP
WebHTTPCookies
the cookie is usually stored by the browser, and then the cookie is sent with requests made to the same server inside a cookie http header.
...the %x2f ("/") character is considered a directory separator, and subdirectories match as well.
Alt-Svc - HTTP
WebHTTPHeadersAlt-Svc
ma=<max-age>optional the number of seconds for which the alternative service is considered fresh.
...in that case, early entries are considered more preferable.
Content-Security-Policy-Report-Only - HTTP
header type response header forbidden header name no this header is not supported inside a <meta> element.
... sample violation report let's consider a page located at http://example.com/signup.html.
Expect-CT - HTTP
if a cache receives a value greater than it can represent, or if any of its subsequent calculations overflows, the cache will consider this value to be either 2,147,483,648 (231) or the greatest positive integer it can represent.
...browsers implement their own trust model regarding which ct logs are considered trusted for the certificate to have been logged to.
If-None-Match - HTTP
the comparison with the stored etag uses the weak comparison algorithm, meaning two files are considered identical if the content is equivalent — they don't have to be identical byte for byte.
... for example, two pages that differ by the date of generation in the footer would still be considered as identical.
CSS Houdini
the css working group does a lot of work to ensure every feature is performant, handles all edge cases, and considers security, privacy, and accessibility.
... as you extend css with houdini, make sure to keep these considerations in mind, and start small before moving on to more ambitious projects.
Concurrency model and the event loop - JavaScript
a downside of this model is that if a message takes too long to complete, the web application is unable to process user interactions like click or scroll.
... legacy exceptions exist like alert or synchronous xhr, but it is considered a good practice to avoid them.
Expressions and operators - JavaScript
consider these examples: w = z = x = y is equivalent to w = (z = (x = y)) or x = y; z = y; w = y z += x *= y is equivalent to z += (x *= y) or tmp = x * y; x *= y; z += tmp (except without the tmp).
...this operator is primarily used inside a for loop, to allow multiple variables to be updated each time through the loop.
Assertions - JavaScript
the beginning and end of a string are considered non-words.
... // 4) use \b to match characters inside borders of an entity.
Regular expression syntax cheatsheet - JavaScript
inside a character set, the dot loses its special meaning and matches a literal dot.
...the beginning and end of a string are considered non-words.
Private class fields - JavaScript
syntax class classwithprivatefield { #privatefield } class classwithprivatemethod { #privatemethod() { return 'hello world' } } class classwithprivatestaticfield { static #private_static_field } examples private static fields private fields are accessible on the class constructor from inside the class declaration itself.
...like private static fields, they are only accessible from inside the class declaration.
Classes - JavaScript
y); } } const p1 = new point(5, 5); const p2 = new point(10, 10); p1.distance; //undefined p2.distance; //undefined console.log(point.distance(p1, p2)); // 7.0710678118654755 binding this with prototype and static methods when a static or prototype method is called without a value for this, such as by assigning a variable to the method and then calling it, the this value will be undefined inside the method.
... function animal() { } animal.prototype.speak = function() { return this; } animal.eat = function() { return this; } let obj = new animal(); let speak = obj.speak; speak(); // global object (in non–strict mode) let eat = animal.eat; eat(); // global object (in non-strict mode) instance properties instance properties must be defined inside of class methods: class rectangle { constructor(height, width) { this.height = height; this.width = width; } } static (class-side) data properties and prototype data properties must be defined outside of the classbody declaration: rectangle.staticwidth = 20; rectangle.prototype.prototypewidth = 25; field declarations public and private field declarations are an experimental fe...
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
the javascript warning "date.prototype.tolocaleformat is deprecated; consider using intl.datetimeformat instead" occurs when the non-standard date.prototype.tolocaleformat method is used.
... message warning: date.prototype.tolocaleformat is deprecated; consider using intl.datetimeformat instead error type warning.
ReferenceError: "x" is not defined - JavaScript
variables defined inside a function cannot be accessed from anywhere outside the function, because the variable is defined only in the scope of the function function numbers() { var num1 = 2, num2 = 3; return num1 + num2; } console.log(num1); // referenceerror num1 is not defined.
... however, a function can access all variables and functions defined inside the scope in which it is defined.
arguments.callee - JavaScript
it can be used to refer to the currently executing function inside the function body of that function.
...1 : factorial(n - 1)*n; }); this has numerous benefits: the function can be called like any other from inside your code it does not create a variable in the outer scope (except for ie 8 and below) it has better performance than accessing the arguments object another feature that was deprecated was arguments.callee.caller, or more specifically function.caller.
The arguments object - JavaScript
arguments is an array-like object accessible inside functions that contains the values of the arguments passed to that function.
...you can refer to a function's arguments inside that function by using its arguments object.
Array.prototype.find() - JavaScript
thisarg optional object to use as this inside callback.
... if a thisarg parameter is provided to find, it will be used as the this value inside each invocation of the callback.
Array.prototype.includes() - JavaScript
values of zero are all considered to be equal, regardless of sign.
... (that is, -0 is considered to be equal to both 0 and +0), but false is not considered to be the same as 0.
Function.prototype.apply() - JavaScript
so you end up with an array inside an array.
...for alternative methods, please consider one of the following approaches: using object.__proto__: function.prototype.construct = function (aargs) { let onew = {}; onew.__proto__ = this.prototype; this.apply(onew, aargs); return onew; }; using closures: function.prototype.construct = function(aargs) { let fconstructor = this, fnewconstr = function() { fconstructor.apply(this, aargs); }; fnewconstr.prototype = fco...
Intl.Locale.prototype.numeric - JavaScript
for example, the string "a-21" will be considered less than "a-123".
...kn is considered a locale string "extension subtag".
Object.defineProperty() - JavaScript
inherited properties will be considered as well.
... adding properties and default values it is important to consider the way default values of attributes are applied.
Promise.prototype.catch() - JavaScript
this is considered good practice in contrast to throwing strings; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information like stack traces.
..." }).then(function(){ console.log('after a catch the chain is restored'); }, function () { console.log('not fired due to the catch'); }); gotchas when throwing errors // throwing an error will call the catch method most of the time var p1 = new promise(function(resolve, reject) { throw new error('uh-oh!'); }); p1.catch(function(e) { console.error(e); // "uh-oh!" }); // errors thrown inside asynchronous functions will act like uncaught errors var p2 = new promise(function(resolve, reject) { settimeout(function() { throw new error('uncaught exception!'); }, 1000); }); p2.catch(function(e) { console.error(e); // this is never called }); // errors thrown after resolve is called will be silenced var p3 = new promise(function(resolve, reject) { resolve(); throw new error...
WebAssembly.Global - JavaScript
global.prototype.value the value contained inside the global variable — this can be used to directly set and get the global's value.
... instance methods global.prototype.valueof() old-style method that returns the value contained inside the global variable.
WebAssembly.Module.customSections() - JavaScript
syntax webassembly.module.customsections(module, sectionname); parameters module the webassembly.module object whose custom sections are being considered.
...(read high level structure for information on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other purposes, for example the name custom section, which allows developers to provide names for all the functions and locals in the module (like "symbols" in a native build).
WebAssembly.Table() constructor - JavaScript
webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
... this example shows that we're creating and accessing the table from javascript, but the same table is visible and callable inside the wasm instance too.
WebAssembly.Table.prototype.set() - JavaScript
the table, both of which print out a simple value): webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
... this example shows that we're creating and accessing the table from javascript, but the same table is visible and callable inside the wasm instance too.
WebAssembly.Table - JavaScript
webassembly.instantiatestreaming(fetch('table2.wasm'), importobject) .then(function(obj) { console.log(tbl.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function invocation operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g.
... this example shows that we're creating and accessing the table from javascript, but the same table is visible and callable inside the wasm instance too.
Lexical grammar - JavaScript
only the following unicode code points are treated as line terminators in ecmascript, other line breaking characters are treated as white space (for example, next line, nel, u+0085 is considered as white space).
...ead so it should be used with caution: function comment(x) { console.log('hello ' + x /* insert the value of x */ + ' !'); } comment('world'); in addition, you can use it to disable code to prevent it from running, by wrapping code in a comment, like this: function comment() { /* console.log('hello world!'); */ } comment(); in this case, the console.log() call is never issued, since it's inside a comment.
Destructuring assignment - JavaScript
uring an array, you can unpack and assign the remaining part of it to a variable using the rest pattern: const [a, ...b] = [1, 2, 3]; console.log(a); // 1 console.log(b); // [2, 3] be aware that a syntaxerror will be thrown if a trailing comma is used on the left-hand side with a rest element: const [a, ...b,] = [1, 2, 3]; // syntaxerror: rest element may not have a trailing comma // always consider using rest operator as the last element unpacking values from a regular expression match when the regular expression exec() method finds a match, it returns an array containing first the entire matched portion of the string and then the portions of the string that matched each parenthesized group in the regular expression.
... {a, b} = {a: 1, b: 2} is not valid stand-alone syntax, as the {a, b} on the left-hand side is considered a block and not an object literal.
Logical OR (||) - JavaScript
even though the || operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive.
...if you only need to filter out null or undefined, consider using the nullish coalescing operator.
Nullish coalescing operator (??) - JavaScript
in other words, if you use || to provide some default value to another variable foo, you may encounter unexpected behaviors if you consider some falsy values as usable (eg.
...this behavior may cause unexpected consequences if you consider 0, '', or nan as valid values.
Object initializer - JavaScript
examples creating objects an empty object with no properties can be created like this: let object = {} however, the advantage of the literal or initializer notation is, that you are able to quickly create objects with properties inside the curly braces.
... let a = {x: 1, x: 2} console.log(a) // {x: 2} in ecmascript 5 strict mode code, duplicate property names were considered a syntaxerror.
Strict equality (===) - JavaScript
unlike the equality operator, the strict equality operator always considers operands of different types to be different.
...+0 and -0 are considered to be the same value.
Strict inequality (!==) - JavaScript
unlike the inequality operator, the strict inequality operator always considers operands of different types to be different.
... like the strict equality operator, the strict inequality operator will always consider operands of different types to be different: 3 !== "3"; // true examples comparing operands of the same type console.log("hello" !== "hello"); // false console.log("hello" !== "hola"); // true console.log(3 !== 3); // false console.log(3 !== 4); // true console.log(true !== true); // false console.log(true !== false); // true console.log(nu...
Function expression - JavaScript
the function keyword can be used to define a function inside an expression.
...nothoisted(); // typeerror: nothoisted is not a function var nothoisted = function() { console.log('bar'); }; named function expression if you want to refer to the current function inside the function body, you need to create a named function expression.
block - JavaScript
in non-strict code, function declarations inside blocks behave strangely.
... in strict mode, starting with es2015, functions inside blocks are scoped to that block.
if...else - JavaScript
syntax if (condition) statement1 [else statement2] condition an expression that is considered to be either truthy or falsy.
...any value that is not false, undefined, null, 0, -0, nan, or the empty string (""), and any object, including a boolean object whose value is false, is considered truthy when used as the condition.
with - JavaScript
consider this example: function f(foo, values) { with (foo) { console.log(values); } } if you call f([1,2,3], obj) in an ecmascript 5 environment, then the values reference inside the with statement will resolve to obj.
...so, in a javascript environment that supports ecmascript 2015, the values reference inside the with statement could resolve to [1,2,3].values.
JavaScript shells - JavaScript
es6console.com - an open-source javascript console to test ecmascript 2015 code inside the browser.
... mozrepl - connect to firefox and other mozilla apps, explore and modify them from the inside, while they're running.
MathML element reference - MathML
if you want to learn more about content markup you should consider chapter 4 in the mathml 3 specification.
...rscript) p <mpadded> (space around content) <mphantom> (invisible content with reserved space) r <mroot> (radical with specified index) <mrow> (grouped sub-expressions) s <ms> (string literal) <mscarries> (annotations such as carries) <mscarry> (single carry, child element of <mscarries>) <msgroup> (grouped rows of <mstack> and <mlongdiv> elements) <msline> (horizontal lines inside <mstack> elements) <mspace> (space) <msqrt> (square root without an index) <msrow> (rows in <mstack> elements) <mstack> (stacked alignment) <mstyle> (style change) <msub> (subscript) <msup> (superscript) <msubsup> (subscript-superscript pair) t <mtable> (table or matrix) <mtd> (cell in a table or a matrix) <mtext> (text) <mtr> (row in a table or a matrix) u <munder> (undersc...
MathML documentation index - MathML
WebMathMLIndex
12 <menclose> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <menclose> element renders its content inside an enclosing notation specified by the notation attribute.
...inside a <mtable> only <mtr> and <mtd> elements may appear.
The "codecs" parameter in common media types - Web media technologies
f a one-digit flag indicating whether the color should be allowed to use the full range of possible values (1), or should be constrained to those values considered legal for the specified color configuration (that is, the studio swing representation).
...all cbp streams are considered to also be bp streams.
Populating the page: how browsers work - Web Performance
for the most part, browsers are considered single threaded.
...in this phase, taking the viewport size into consideration, the browser determines what the dimensions of all the different boxes are going to be on the screen.
Understanding latency - Web Performance
latency is generally considered to be the amount of time it takes from when a request is made by the user to the time it takes for the response to get back to that user.
... when a request is in a queue, waiting for a network connection it is considered blocked.
Add to Home screen - Progressive web apps (PWAs)
you'll see fox pictures, but more important, you'll see a "home" icon with a plus (+) icon inside it — this is the "add to home screen" icon displayed for any site that has the necessary features in place.
... manifest the web manifest is written in standard json format and should be placed somewhere inside your app directory (in the root is probably best) with the name somefilename.webmanifest (we've chosen manifest.webmanifest).
Introduction to progressive web apps - Progressive web apps (PWAs)
an app could be considered a pwa when it meets certain requirements, or implements a set of given features: works offline, is installable, is easy to synchronize, can send push notifications, etc.
... modern web apps can have this native app feel via properties set inside the web app manifest, and via a feature available in modern smartphone browsers called web app installation.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
it's the only piece of service worker code that sits inside the app.js file; everything else that is service worker-specific is written in the sw.js file itself.
... the service worker does not install until the code inside waituntil is executed.
clip-rule - SVG: Scalable Vector Graphics
/> </g> as a presentation attribute, it also can be used as a property directly inside a css stylesheet usage context categories presentation attribute value nonzero | evenodd | inherit animatable yes normative document svg 1.1 (2nd edition) nonzero see description of fill-rule property.
...venodd" /> </clippath> <rect clip-path="url(#emptystar)" width="50" height="90" fill="blue" /> <!-- right: nonzero --> <clippath id="filledstar"> <use xlink:href="#star" clip-rule="nonzero" /> </clippath> <rect clip-path="url(#filledstar)" width="50" height="90" x="50" fill="red" /> </svg> elements the following elements can use the clip-rule attribute, but only if they are inside a <clippath> element.
d - SVG: Scalable Vector Graphics
WebSVGAttributed
all subsequent sets of parameters are considered implicit absolute arc curve (a) commands.
...all subsequent sets of parameters are considered implicit relative arc curve (a) commands.
rx - SVG: Scalable Vector Graphics
WebSVGAttributerx
the way the value of the rx attribute is interpreted depend on both the ry attribute and the width of the rectangle: if a properly specified value is provided for rx but not for ry (or the opposite), then the browser will consider the missing value equal to the defined one.
... if rx is greater than half of the width of the rectangle, then the browser will consider the value for rx as half of the width of the rectangle.
ry - SVG: Scalable Vector Graphics
WebSVGAttributery
the way the value of the ry attribute is interpreted depend on both the rx attribute and the width of the rectangle: if a properly specified value is provided for ry but not for rx (or the opposite), then the browser will consider the missing value equal to the defined one.
... if ry is greater than half of the width of the rectangle, then the browser will consider the value for ry as half of the width of the rectangle.
xlink:href - SVG: Scalable Vector Graphics
if the reference is to a <glyph> element and that glyph is available, then that glyph is rendered instead of the characters that are inside of the <altglyph> element.
... if the reference is to an <altglyphdef> element, then if an appropriate set of alternate glyphs is located from processing the <altglyphdef> element, then those alternate glyphs are rendered instead of the characters that are inside of the <altglyph> element.
xml:space - SVG: Scalable Vector Graphics
svg supports the built-in xml xml:space attribute to handle whitespace characters inside elements.
... child elements inside an element may also have an xml:space attribute that overrides the parentʼs one.
<altGlyph> - SVG: Scalable Vector Graphics
WebSVGElementaltGlyph
if the reference is to a <glyph> element and that glyph is available, then that glyph is rendered instead of the character(s) that are inside of the <altglyph> element.
... if the reference is to an <altglyphdef> element, then if an appropriate set of alternate glyphs is located from processing the <altglyphdef> element, then those alternate glyphs are rendered instead of the character(s) that are inside of the <altglyph> element.
<defs> - SVG: Scalable Vector Graphics
WebSVGElementdefs
objects created inside a <defs> element are not rendered directly.
... graphical objects can be referenced from anywhere, however, defining these objects inside of a <defs> element promotes understandability of the svg content and is beneficial to the overall accessibility of the document.
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
it is used as the outermost element of svg documents, but it can also be used to embed an svg fragment inside an svg or html document.
...it is unnecessary for inner svg elements or inside html documents.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
t with no position at (0, 0) implementation status unknown defer keyword removed from preserveaspectratio attribute removed (bug 1280425) added non-scaling-size, non-rotation and fixed-position keywords for vector-effect property not implemented yet (bug 1318208) vector-effect has no effect within 3d rendering context implementation status unknown consider clip and overflow on svg document referenced by <image> implementation status unknown paths change notes b and b path commands implementation status unknown z and z path commands to add path coordinate data to previous command implementation status unknown not render <path>, <polygon> and <polyline> with no data implementation statu...
...edpoints as alias of svganimatedpoints.points implementation status unknown auto behavior for rx and ry in <ellipse> implementation status unknown text change notes text-decoration-fill and text-decoration-stroke properties not implemented yet (bug 1303569) inline-size attribute for <text> implementation status unknown shape-inside property inplementation status unknown shape-subtract property inplementation status unknown white-space implementation status unknown deprecated xml:space attribute implementation status unknown kerning property removed implementation status unknown path attribute for <textpath> implemented (bug 1446617) reference basic sha...
Introduction - SVG: Scalable Vector Graphics
a downside is loading svg can be slow.
... attribute values in svg must be placed inside quotes, even if they are numbers.
Positions - SVG: Scalable Vector Graphics
that is, the top left corner of the document is considered to be the point (0,0), or point of origin.
...however, this is the same way elements in html are positioned (by default, ltr documents are considered not the rtl documents which position x from right-to-left).
choose - XPath
object1 the first object to consider returning.
... object2 the second object to consider returning.
Introduction to using XPath in JavaScript - XPath
xmldoc.documentelement : xmldoc.ownerdocument.documentelement); var personiterator = xmldoc.evaluate('//person', xmldoc, nsresolver, xpathresult.any_type, null ); note when the xpathresult object is not defined, the constants can be retrieved in privileged code using components.interfaces.nsidomxpathresult.any_type (ci.nsidomxpathresult).
... similarly, an xpathevaluator can be created using: components.classes["@mozilla.org/dom/xpath-evaluator;1"].createinstance(components.interfaces.nsidomxpathevaluator) appendix implementing a user defined namespace resolver this is an example for illustration only.
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
the element must be defined before any other output document element inside the output document element for which it establishes attribute values.
... but it may be after or inside elements that won't be part of the output (like <xsl:choose> or <xsl:apply-templates> etc.).
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
level defines how levels of the source tree should be considered in generating sequential numbers.
...the ancestor, self, and preceding axes are all considered.
Compiling a New C/C++ Module to WebAssembly - WebAssembly
copy it into a sub-directory called html_template inside your previous new directory.
...from inside your latest directory (and while inside your emscripten compiler environment terminal window), compile your c code with the following command.
WebAssembly Concepts - WebAssembly
this article explains the concepts behind how webassembly works including its goals, the problems it solves, and how it runs inside the web browser's rendering engine.
... webassembly goals webassembly is being created as an open standard inside the w3c webassembly community group with the following goals: be fast, efficient, and portable — webassembly code can be executed at near-native speed across different platforms by taking advantage of common hardware capabilities.
Exported WebAssembly functions - WebAssembly
when you call them, you get some activity in the background to convert the arguments into types that wasm can work with (for example converting javascript numbers to int32), the arguments are passed to the function inside your wasm module, the function is invoked, and the result is converted and passed back to javascript.
...this may well change in the future though — a new int64 type is being considered for future standards, which could then be used by wasm.
2015 MDN Fellowship Program - Archive of obsolete content
github: nickdesaulniers twitter: @lostoracle web app performance brief project description web performance is a feature that needs to be considered from serving content to rendering to interactivity.
Content Scripts - Archive of obsolete content
for example, consider a page that adds a variable foo to the window object using a page script: <!doctype html"> <html> <head> <script> window.foo = "hello from page script" </script> </head> </html> another script loaded into the page after this script will be able to access foo.
Content Processes - Archive of obsolete content
recall that the window object inside the sandbox is actually a wrapper to the real object.
Private Properties - Archive of obsolete content
consider the following example: function point(x, y) { this._x = x; this._y = y; } the properties _x and _y are intended to be private, and should only be accessed by member functions.
Firefox Compatibility - Archive of obsolete content
this page is out of date: now the sdk ships inside firefox, compatibility between the sdk modules and firefox versions is no longer an issue.
Porting the Library Detector - Archive of obsolete content
how the library detector works all the work is done inside a single file, librarydetector.xul this contains: a xul overlay a script the xul overlay adds a box element to the browser's status bar: the script does everything else.
SDK API Lifecycle - Archive of obsolete content
unstable the api is in the process of settling, but has not yet had sufficient real-world testing to be considered stable.
XUL Migration Guide - Archive of obsolete content
in such cases it's worth considering changing your user interface to align with the sdk apis.
hotkeys - Archive of obsolete content
no matter what you choose, it's likely to annoy some people, and to clash with some other add-on, so consider making the combination you choose user-configurable.
notifications - Archive of obsolete content
iconurl string the url of an icon to display inside the message.
page-mod - Archive of obsolete content
"top": the page-mod will be applied to top-level tab documents "frame": the page-mod will be applied to all iframes inside tab documents if the option is set at all, you must set at least one of "top" and "frame".
tabs - Archive of obsolete content
note that by attaching inside ready event, this becomes tab-centric: if the user navigates to a new page in the same tab, then the content scripts will be reattached to the new page.
/loader - Archive of obsolete content
wantxrays: a boolean value indicating whether code outside the sandbox wants x-ray vision with respect to objects inside the sandbox.
dev/panel - Archive of obsolete content
ceiving messages from the panel document pass the other messageport to the panel document in the ports argument to postmessage // main.js // require the sdk modules const { panel } = require("dev/panel"); const { tool } = require("dev/toolbox"); const { class } = require("sdk/core/heritage"); const { messagechannel } = require("sdk/messaging"); const channel = new messagechannel(); const addonside = channel.port1; const panelside = channel.port2; // messages from the panel arrive here addonside.onmessage = function(event) { console.log(event.data); } const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool's panel", icon: "./my-icon.png", url: "./my-panel.html", onready: function() { // send a port to the panel document this.postmessage("...
io/text-streams - Archive of obsolete content
inside callback, this is the textwriter object.
lang/functional - Archive of obsolete content
env); return 1; // assume success and return 1 }); setup('dev'); // returns 1 // prints "successfully initialized dev" // future attempts to call this function just return the cached // value that was returned previously setup('production'); // returns 1 // no print message is displayed since the function isn't executed parameters fn : function the function that will be executed only once inside the once wrapper.
net/xhr - Archive of obsolete content
finally, we need to also consider attenuating http/https requests such that they're "sandboxed" and don't communicate potentially sensitive cookie information.
cfx to jpm - Archive of obsolete content
requiring modules from test code similarly, suppose you've written some tests for your add-on: my-addon lib my-addon.js test test-my-addon-js with cfx, code inside "test-my-addon.js" can import "my-addon.js" using a statement like this: var my_addon = require("my-addon"); // this will not work with jpm!
jpm - Archive of obsolete content
under the hood, jpm sign creates an unlisted add-on inside addons.mozilla.org, which means you must distribute the xpi file yourself for your users to install it.
Implementing the widget - Archive of obsolete content
inside the data subdirectory create another subdirectory widget.
Logging - Archive of obsolete content
the following add-on logs the html content of every tab the user loads, by calling console.log() inside a content script: require("sdk/tabs").on("ready", function(tab) { tab.attach({ contentscript: "console.log(document.body.innerhtml);" }); }); console output if you are running your add-on from the command line (for example, executing jpm run or jpm test) then the console's messages appear in the command shell you used.
Localization - Archive of obsolete content
to reference localized strings from html, add a data-l10n-id attribute to the html tag where you want the localized string to appear, and assign the identifier to it: <html> <body> <h1 data-l10n-id="hello_id"></h1> </body> </html> then you can use this html file to build your interface, for example inside a panel: var button = require("sdk/ui/button/action").actionbutton({ id: "localized-hello", label: "localized hello", icon: "./icon-16.png", onclick: function() { hello.show(); } }); var hello = require("sdk/panel").panel({ height: 75, width: 150, contenturl: require("sdk/self").data.url("my-panel.html") }); given locale files for "en-us" and "fr" which provide translation...
Boxes - Archive of obsolete content
this keeps the image from stretching inside the box: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <box align="start" style="display:block"> <image src="chrome://global/skin/icons/error.png" style="padding:5px"/> <textbox /> <image src="chrome://global/skin/icons/error.png" style="padding:5px"/> <button label="h...
Canvas code snippets - Archive of obsolete content
this can be used to determine if the mouse cursor is inside a certain shape or not.
File I/O - Archive of obsolete content
then you may use file.append("myfile.txt"); to make it point to myfile.txt inside that directory.
HTML to DOM - Archive of obsolete content
quest.send(null); our next step is to create the document object that will represent the dom into which we'll insert our newly-retrieved html: var doc = document.implementation.createhtmldocument("example"); doc.documentelement.innerhtml = request.responsetext; after this any manipulation that we might want to do will be something as simple as the following: doc.body.textcontent = "this is inside the body!"; using a hidden iframe element to parse html to a window's dom sample code may need more work.
Sidebar - Archive of obsolete content
resizing the sidebar programmatically in case you need to change the width of the sidebar, use the following code: function setsidebarwidth(newwidth) { var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.getelementbyid("sidebar-box").width=newwidth; } or function setsidebarwidth(newwidth) { window.top.document.getelementbyid("sidebar-box").width=newwidth; } you can also disable the ability to resize it manually, using the mous...
View Source for XUL Applications - Archive of obsolete content
the rest of those methods should be considered private, and might become inaccessible in the future.
Deploying a Plugin as an Extension - Archive of obsolete content
the downside to this method is that once the plugin is installed, it might be difficult for users to upgrade, uninstall, or disable the plugin.
Displaying web content in an extension without security issues - Archive of obsolete content
however, if the document is loaded into <iframe type="content"> or <browser type="content">, it will be considered a content document, and so will be all the frames it loads (the "type" attribute is ignored at that point).
Enhanced Extension Installation - Archive of obsolete content
the firefox build system will just create the {guid} folder for the default theme and place its install manifest inside, and on the first startup of the application it will be automatically registered.
Interaction between privileged and non-privileged pages - Archive of obsolete content
var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.addeventlistener("myextensionevent", function(e) { myextension.mylistener(e); }, false, true); if you need to to pass lots of data, consider using cdata sections instead of the simp...
Listening to events in Firefox extensions - Archive of obsolete content
for navigation that occurs inside a single frame, events fire only in the affected frame.
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
it does not have strict typing like java, making it extremely flexible and giving it qualities that in some senses could be considered similar to lisp.
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
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.
Appendix F: Monitoring DOM changes - Archive of obsolete content
while these are not exceptionally efficient (they run for every http request, and considerably more often for some methods), they work very well for certain applications pure css pure css can be more powerful than most people suspect.
Connecting to Remote Content - Archive of obsolete content
let domparser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); let filestream = components.classes["@mozilla.org/network/file-input-stream;1"] .createinstance(components.interfaces.nsifileinputstream); let xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); let xsldocument; filestream.init(somexslfile, -1, 0x01, 0444); // read o...
Performance best practices in extensions - Archive of obsolete content
consider using chrome workers you can use a chromeworker to execute long running tasks or do data processing.
Firefox addons developer guide - Archive of obsolete content
todo: all fixme notes inside the documents; add abbreviation definition to acronyms; add some link to the internal mdc documentation when it makes sense; indent source code; make sure documentation is relevant for all platforms: gnu/linux, macos, windows; add anchor links to figures & listings; add credits to original authors and license; completed sometimes, interfaces names are misspelled: s/nsl/nsi; talk about fu...
Using the Stylesheet Service - Archive of obsolete content
the stylesheets registered with this api apply to all documents; firefox 18 extended nsidomwindowutils with loadadditionalstylesheet() and removeadditionalstylesheet() to manage stylesheets for a specific document (bug 737003).
Search Extension Tutorial (Draft) - Archive of obsolete content
while this is generally considered acceptable behavior, considerable care must be taken to avoid violating the mozilla add-on guidelines or creating an adverse user experience.
Creating a status bar extension - Archive of obsolete content
we do this by embedding inside the statusbar named "status-bar" -- which is the firefox browser window's status bar -- a new statusbarpanel object we call "status-bar-sample-1".
DOMSubtreeModified - Archive of obsolete content
this event has been deprecated in favor of the mutation observer api this event can cause infinite loops if you decide to change the dom inside the event handler, hence it has been disabled in a number of browsers (see domattrmodified and domsubtreemodified events are no longer fired when style attribute is changed via cssom for example).
Notes on HTML Reflow - Archive of obsolete content
the xul box layout model, on the other hand, is constraint based , meaning that geometric preferences and constraints of neighboring elements are taken into consideration before the elements' final geometry can be computed.
Source code directories overview - Archive of obsolete content
config contains scripts and programs used by mozilla developers to manipulate the code base and to perform special actions inside makefiles.
Misc top level - Archive of obsolete content
back in the early days, this approach worked, because browsers would usually make a table cell exactly as wide and tall as an image it contained.no proxy for configurationthis document provides a comprehensive discussion of the manual proxy feature "no proxy for:", including configuration issues, testing and bugs.same-origin policy for file: urisin gecko 1.8 or earlier, any two file: uris are considered to be same-origin.
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
if you need scripting functionality, consider shipping a modified pluginhostctrl.dll that exposes methods you wish to call on your plugin.
Kill the XUL.mfl file for good - Archive of obsolete content
this is meant to speed up the operation of mozilla, however in a fileserver based environment, this can be problematic: at several megabytes a pop, these files will take up a considerable amount of space, because each user has his own...
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
as an example, consider the following failed assertion: assertion: no document: 'mdocument != nsnull', file d:/cvs-1.11.4/mozilla/content/xul/content/src/nsxulelement.cpp, line 3173 (note that i have my source tree in d:/cvs-1.11.4/mozilla) if you have a dword in hkcu\software\mozilla.org\windbgdlg\ named "d:/cvs-1.11.5/mozilla/content/xul/content/src/nsxulelement.cpp," (with the comma - matches are whole-word only) a...
Chromeless - Archive of obsolete content
one of the core capabilities of the chromeless platform is the ability to safely embed untrusted web applications inside these applications.
Enabling the behavior - updating the status periodically - Archive of obsolete content
we use it inside the loadtinderboxstatus function to make that function run a second (1,000 milliseconds) after startup and a minute (60,000 milliseconds) after each invocation.
Getting Started - Archive of obsolete content
select them all and zip them up, making sure to include the paths (do not include the \myskin directory inside of the zip, just the files inside of \myskin).
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
directories inside classic.jar is one directory, skin, as well as two files, preview.png and icon.png.
Dehydra Object Reference - Archive of obsolete content
.isconst boolean flag .isvolatile boolean flag .variantof type object "const int" and "int" are separate types in gcc; the const version is considered a variant of the normal version.
Download Manager preferences - Archive of obsolete content
see also nsidownloadmanager nsidownload nsidownloadmanagerui ...
Drag and drop events - Archive of obsolete content
you can see an example of these events in action here: view source view example see also ^: drag and drop html 5 working draft: drag and drop nsidragservice ...
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
(nsiwindowcreator.ns_iwindowcreator_iid); // get the window watcher service nsiwindowwatcher windowwatcher = (nsiwindowwatcher)servicemanager.getservicebycontractid("@mozilla.org/embedcomp/window-watcher;1", nsiwindowwatcher.ns_iwindowwatcher_iid); // set the window creator (from step 6) windowwatcher.setwindowcreator(windowcreator); // create the root xul window: nsidomwindow win = windowwatcher.openwindow(null, "chrome://your-app/content/window.xul", "mywindow", "chrome,resizable,centerscreen", null); // set this as the active window windowwatcher.setactivewindow(win); // hand over the application to xpcom/xul, this will block: appstartup.run(); here is an example of a locationprovider that works : public class locationprovider...
External CVS snapshots in mozilla-central - Archive of obsolete content
those directories shall be considered read-only, changes shall be delivered to the upstream software projects.
Block and Line Layout Cheat Sheet - Archive of obsolete content
(why?) brs_applytopmargin this flag is set if the top margin should be considered when placing a linebox that contains a block frame.
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
all loads that we consider in this document are initiated via the docshell.
Repackaging Firefox - Archive of obsolete content
important legal considerations before you get started, it is very important to know and abide by the legal requirements for distributing firefox.
Code snippets - Archive of obsolete content
let mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); // obtain a reference to sync's tabs "engine." let tabsengine = weave.service.enginemanager.get("tabs"); // iterate over each client having data.
Help Viewer - Archive of obsolete content
help viewer: allows information to be shown to the user inside mozilla.
Helper Apps (and a bit of Save As) - Archive of obsolete content
security considerations multiple checks for whether a file is executable (on windows) to keep from launching such files via ::shellexecute().
IO Guide/Directory Keys - Archive of obsolete content
"directory keys" are the keys for nsidirectoryservice, see description.
Me - Archive of obsolete content
ArchiveMozillaJetpackMetaMe
inside the function, this is the jetpack's content.function example jetpack.me.onfirstrun(function(){ jetpack.notifications.show("oh boy, i'm installed!");}); ...
jspage - Archive of obsolete content
tend(e,b);hash.extend(e,k.associate(k.map(string.tolowercase)));var a={before:function(m,l){if(l.parentnode){l.parentnode.insertbefore(m,l); }},after:function(m,l){if(!l.parentnode){return;}var n=l.nextsibling;(n)?l.parentnode.insertbefore(m,n):l.parentnode.appendchild(m);},bottom:function(m,l){l.appendchild(m); },top:function(m,l){var n=l.firstchild;(n)?l.insertbefore(m,n):l.appendchild(m);}};a.inside=a.bottom;hash.each(a,function(l,m){m=m.capitalize();element.implement("inject"+m,function(n){l(this,document.id(n,true)); return this;});element.implement("grab"+m,function(n){l(document.id(n,true),this);return this;});});element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]); }break;case"string":var l=element.properties.get(o);(l&&l.set)?l.set.apply(...
statusBar - Archive of obsolete content
syntax jetpack.statusbar.append(options); possible options are: url width (string/length) the width of the panel-item html (string) the html code which will be used inside the item onload (event) this event fires when the item was appended.
Message Summary Database - Archive of obsolete content
meta information the nsidbfolderinfo interface handles the folder meta data.
Microsummary topics - Archive of obsolete content
createinstance(components.interfaces.nsidomparser); var generatordoc = domparser.parsefromstring(generatortext, "text/xml"); var microsummaryservice = components.classes["@mozilla.org/microsummary/service;1"].
HostWindow - Archive of obsolete content
we are considering whether to support a sidebar in future versions of prism and welcome input on this subject.
New Skin Notes - Archive of obsolete content
just so that (perhaps) this might revive the topic, a side bar shouldn't exceed 16% to allow proper viewing at 800 pixels width ideally in my opinion, i find strange that i'm the only person not too fond of large side bars (or side bars at all, for that matter :) considering that in most articles we scroll down to read the text, and that the side bar scrolls as well, the links aren't there anymore, but the width remains wasted anyway.
PyDOM - Archive of obsolete content
inside chrome, you can use python via either html or xul.
RDF Datasource How-To - Archive of obsolete content
an "address book" datasource could translate a database file into statements like "spammer128@hotmail.com's real name is 'billy dumple'" and "spammer128@hotmail.com is considered an 'important friend'." statements from one datasource can be combined with statements from another datasource using a composite datasource.
Same origin policy for XBL - Archive of obsolete content
for the nsidomdocumentxbl interface's nsidomdocumentxbl.addbinding() and nsidomdocumentxbl.loadbindingdocument() methods, the originating principal is the one of the script making the call, or the principal of the document the call is made on if there isn't a script.
Space Manager Detailed Design - Archive of obsolete content
there are several cases it has to handle, as specified in the source file comments: // when comparing a rect to a band there are seven cases to consider.
Space Manager High Level Design - Archive of obsolete content
the classes that are considered part of the space manager are: nsspacemanager nsbanddata nsblockbanddata bandrect / bandlist (private structs) frameinfo (private struct) nsbandtrapezoid outside of the space manager itself, the clients of the space manager also play an important part in the management of he available and used space.
File object - Archive of obsolete content
directories and pipelines are considered special files.
Stress testing - Archive of obsolete content
the only downside is you can't specify how much of the resource to use, only which one to consume.
Supporting per-window private browsing - Archive of obsolete content
you can then take action based on this value, as any data or actions originating from this window should be considered private.
Actionscript Acceptance Tests - Archive of obsolete content
when this file is defined, the output from the testcase is matched line by line to the .out file and any difference is considered a failure.
Tamarin Build System Documentation - Archive of obsolete content
tamarin-redux mercurial builds are displayed in the top 3 sections: compile, smoke, test sandbox builds are displayed in next 3 sections: sandbox compile, sandbox smoke, sandbox test tamarin-central is considered a "sandbox" and will appear under sandbox phase what are the build phases?
Treehydra Manual - Archive of obsolete content
for example, if the current abstract value of a variable x is nonzero, and the analysis goes inside an if statement with the condition x == 1, then in the new abstract value of x will be nonzero meet 1.
Tuning Pageload - Archive of obsolete content
firefox (and all mozilla products/projects which do page-loading) ship with what are considered the "best" settings for the most cases.
[Deprecated] The Mozilla build VM - Archive of obsolete content
"good" first bugs may be a little stale, but at some point in their lives we considered that they would be a good first step for newcomers to mozilla.
Venkman Internals - Archive of obsolete content
a scriptwrapper is a pure js object defined only inside venkman.
When To Use ifdefs - Archive of obsolete content
this rule has many exceptions, some of which are listed here: the code in editor/ui/ is built by the suite, standalone composer, and thunderbird, but it is considered application-specific.
Binding Implementations - Archive of obsolete content
the implementation of the method is contained inside a body element.
XBL 1.0 Reference - Archive of obsolete content
bindings binding content children implementation constructor destructor field property getter setter method parameter body handlers handler resources stylesheet image binding attachment and detachment attachment using css attachment using element.style property <constructor> call <destructor> call binding documents dom interfaces the nsidomdocumentxbl interface anonymous content introduction scoping and access using the dom content generation rules for generation attribute forwarding insertion points <children> handling dom changes event flow and targeting flow and targeting across scopes focus and blur events mouseover and mouseout events anonymous content and css selecto...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
this saves low-bandwidth users considerable time since they do not need to download software packages they may not be interested in.
Using XPInstall to Install Plugins - Archive of obsolete content
using xpinstall to run an exe (native code) installer if you wish to run a native installer (exe) to install plugin software, but wish to make the delivery of this native installer streamlined and within the browser's process, then you ought to consider wrapping it in an xpi package.
addDirectory - Archive of obsolete content
a relative pathname is appended to the registry name of the package as specified by the package parameter to the initinstall method.this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry.
addFile - Archive of obsolete content
this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the machine; it is the location of information about the software inside the client version registry.
execute - Archive of obsolete content
summary launches a file inside the install archive.
gestalt - Archive of obsolete content
for information on that function, see inside macintosh: operating system utilities.
initInstall - Archive of obsolete content
the registry name provided here is not the location of the software on the machine, it is the location of information about the software inside the registry.
patch - Archive of obsolete content
note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry.
registerChrome - Archive of obsolete content
in this case, registerchrome does not require a path inside the archive, as it does now in order to locate the more flexible contents.rdf format of installation archives.
Learn XPI Installer Scripting by Example - Archive of obsolete content
inside the function, the two sizes are compared and if the available space is larger than the required space, the installation proceeds.
A XUL Bestiary - Archive of obsolete content
if, however, you write event handlers inside event listeners, as we will describe shortly, you can use these events to set off other actions.
allowevents - Archive of obsolete content
this means that elements placed inside a listitem do not respond to events, and instead clicking the mouse simply selects that item within the list.
checkState - Archive of obsolete content
constants for the possible values for this attribute are in the nsidomxulbuttonelement interface.
collapse - Archive of obsolete content
you should put a grippy element inside the splitter when it is used for collapsing.
colorpicker.type - Archive of obsolete content
« xul reference home type type: string if this attribute is not present, the colorpicker is displayed inside the window.
droppedLinkHandler - Archive of obsolete content
droppedlinkhandler(event, uri, name) -- firefox 51 or older droppedlinkhandler(event, links) -- firefox 52 or newer event -- drop event, or null if no event is available uri -- uri string of the dropped link name -- name string of the dropped link links -- array of the dropped items with nsidroppedlinkitem interface ...
eventnode - Archive of obsolete content
thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard navigation to apply.
noinitialfocus - Archive of obsolete content
« xul reference homenoinitialfocustype: booleanif false, the default value, the element is considered when determining which element should be initially focused in a dialog.
preference - Archive of obsolete content
this attribute only has any effect when used inside a prefwindow.
template - Archive of obsolete content
if this attribute is not specified, there should be a template element directly inside the node.
textbox.onblur - Archive of obsolete content
prior to gecko 1.9 (firefox 3), the script code would execute in the context of the anonymous html <input> element inside the textbox binding.
textbox.onfocus - Archive of obsolete content
prior to gecko 1.9 (firefox 3), the script code would execute in the context of the anonymous html <input> element inside the textbox binding.
toolbarbutton.type - Archive of obsolete content
place a menupopup element inside the button in this case.
tooltip - Archive of obsolete content
if this attribute is set to '_child', the first tooltip child element inside the element is used.
uri - Archive of obsolete content
ArchiveMozillaXULAttributeuri
elements that appear inside the element with the attribute will be repeated for each node in the rdf datasource.
Dynamically modifying XUL-based user interface - Archive of obsolete content
you need to use the methods of nsidomdocumentxbl interface instead.
Uploading and Downloading Files - Archive of obsolete content
fetch upload please refer to uploading a file section inside the fetch article.
ContextMenus - Archive of obsolete content
<hbox id="container" align="center" oncontextmenu="..."> <label value="name:"/> <textbox id="name"/> </hbox> in this example, an attempt to open a context menu anywhere inside the hbox will call the event listener attached using the oncontextmenu attribute.
MoveResize - Archive of obsolete content
resizing a popup the size of a popup is determined automatically based on the content inside the popup.
anchorNode - Archive of obsolete content
« xul reference anchornode type: nsidomelement this read-only property holds the dom node that was specified as the anchor when opening the popup.
browsers - Archive of obsolete content
« xul reference browsers type: nodelist of browser elements holds a list of the browser elements inside the tabbrowser.
docShell - Archive of obsolete content
« xul reference docshell type: nsidocshell this read-only property contains the nsidocshell object for the document.
externalToolbars - Archive of obsolete content
« xul reference externaltoolbars type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
firstPermanentChild - Archive of obsolete content
items that are placed directly inside the toolbar without being in the toolbarpalette are permanent.
lastPermanentChild - Archive of obsolete content
items that are placed directly inside the toolbar without being in the toolbarpalette are permanent.
menuitem.control - Archive of obsolete content
« xul reference control type: menu element returns the enclosing menu that the item is inside, if any, or null if there is no enclosing menu.
toolboxid - Archive of obsolete content
this will either be the toolbox's parent (if it's in a toolbox), or, if the toolbar is an external toolbar (that is, one not contained in a toolbox), the id of the toolbox it should be considered to be part of.
triggerNode - Archive of obsolete content
« xul reference triggernode type: nsidomnode this read-only property holds the dom node that generated the event triggering the opening of the popup.
statusbarpanel-menu-iconic - Archive of obsolete content
specify the image using the src attribute, and place a menupopup element inside the statusbarpanel.
Additional Navigation - Archive of obsolete content
retrieving parents a very uncommon form of navigation you can also do is to navigate upwards using a member tag, that is to get all the parents of a node, as in this example: <query> <content uri="?start"/> <member container="?parent" child="?start"/> </query> this might be used, for instance, to start at a particular photo and find all of the containers that it is inside.
Introduction - Archive of obsolete content
it is expected that there will be a template inside the element.
Multiple Queries - Archive of obsolete content
to use multiple queries, place each query element along with its rules inside a queryset element.
Multiple Rule Example - Archive of obsolete content
if the last rule has no specific conditions (for example a simple rule with no attributes on the <rule> element), it could be considered to be the final else block that matches all data.
Namespaces - Archive of obsolete content
"ferdinand magellan" gender="male"/> <person name="laura secord" gender="female"/> </people> <listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <action> <listitem uri="?" label="?ns:name"/> </action> </template> </listbox> once added to the template element the namespaces can then be referenced inside temple rule elements too, this works both in rdf and xml templates.
RDF Modifications - Archive of obsolete content
consider the following binding: <binding subject="?start" predicate="http://www.xulplanet.com/rdf/categoryname" object="?name"/> this binding involves a triple pointing out from the starting variable that has been used in these examples.
RDF Query Syntax - Archive of obsolete content
the template won't generate anything yet since we still need to fill in the content to be generated which goes in the missing part inside the rule.
Recursive Generation - Archive of obsolete content
however, for item c, the triple does match an item, so the data will be added to the potential result: (?start = http://www.xulplanet.com/rdf/c, ?relateditem = http://www.xulplanet.com/rdf/d) a match has occured, so the content within the action body will be created and added inside item c.
Result Generation - Archive of obsolete content
eventually, you will end up with a set of nodes you consider the endpoints of your query.
SQLite Templates - Archive of obsolete content
the query for an sqlite datasource is just an sql select statement, as text inside the query element.
Template Builder Interface - Archive of obsolete content
the builder property is a property of the nsidomxulelement interface, so all xul elements will have this property, although, as mentioned earlier, is will be set to null for most elements.
Template and Tree Listeners - Archive of obsolete content
after the observers have finished, the tree builder opens the row and adds any child rows inside.
XML Templates - Archive of obsolete content
you may wish to hide the inline xml by placing it inside a hidden box.
textbox (Toolkit autocomplete) - Archive of obsolete content
related interfaces nsiaccessibleprovider, nsiautocompleteinput, nsidomxulmenulistelement articles how to implement custom autocomplete search component ...
Textbox (XPFE autocomplete) - Archive of obsolete content
related interfaces nsiaccessibleprovider, nsidomxulmenulistelement ...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
<toolbarbutton id="myextension-button" class="toolbarbutton-1" label="&toolbarbutton.label;" tooltiptext="&toolbarbutton.tooltip;" onclick="myextension.onclick(event);"/> </toolbarpalette> onclick: function(event) { switch(event.button) { case 0: // left click break; case 1: // middle click break; case 2: // right click break; } } to add more buttons, put more <toolbarbutton> elements inside the <toolbarpalette> element.
Adding more elements - Archive of obsolete content
this is because they are inside horizontal boxes.
Additional Install Features - Archive of obsolete content
from there, we get the file 'grep' which is contained inside the 'bin' directory.
Box Objects - Archive of obsolete content
*note that x, y refers to the portion of the element that is just inside any borders, which is inconsistent with the other four boxobject position and size references, which include borders as part of the element.
Creating a Wizard - Archive of obsolete content
you can place whatever content you want inside each wizardpage.
Features of a Window - Archive of obsolete content
you should also consider that a user might be using a different theme or locale.
Focus and Selection - Archive of obsolete content
you can do this anywhere you have a xul browser document by simply: document.commanddispatcher.advancefocus(); in fact, the commanddispatcher simply implements the nsidomxulcommanddispatcher interface.
Introduction - Archive of obsolete content
attribute values in xul must be placed inside quotes, even if they are numbers.
Introduction to RDF - Archive of obsolete content
inside, the rdf element, you will place the data.
Introduction to XBL - Archive of obsolete content
however, to summarize, it causes two buttons to be added automatically inside the box, one an ok button and the other a cancel button.
Keyboard Shortcuts - Archive of obsolete content
the key element must be placed inside a keyset element.
List Controls - Archive of obsolete content
if you want to have three columns, you will need to add three listcell elements inside each listitem.
Modifying a XUL Interface - Archive of obsolete content
note that even though one of the radio buttons is inside an hbox, it is still part of the radio group.
Modifying the Default Skin - Archive of obsolete content
customize with userchrome.css if you place a file called 'userchrome.css' in a directory called 'chrome' inside your user profile directory, you can override settings without changing the archives themselves.
Property Files - Archive of obsolete content
use a chrome url to read a file from the locale: <stringbundleset id="stringbundleset"> <stringbundle id="strings" src="chrome://myplugin/locale/strings.properties"/> </stringbundleset> like other non-displayed elements, you should declare all your stringbundles inside a stringbundleset element so that they are all kept together.
Scroll Bars - Archive of obsolete content
some elements, such as text boxes, will also add scroll bars as necessary when the content inside is too large.
Scrolling Menus - Archive of obsolete content
it is always a vertical box and may contain any elements inside it.
Skinning XUL Files by Hand - Archive of obsolete content
but the advantages of using xul so far outweigh those of using the standard c++ toolkits that xul authoring should rightfully be considered in a separate category of development.
Stack Positioning - Archive of obsolete content
--> </hbox> </stack> in some case, setting the width or height this way may even be necessary because using the width/height attributes (eg, "width", "minwidth" and "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results.
Tree Selection - Archive of obsolete content
note that rows nested inside containers that are not open will not be selected.
Tree View Details - Archive of obsolete content
the tree will then redraw the tree as needed and the result is that the child rows will appear inside the container.
Updating Commands - Archive of obsolete content
in addition, you will need to consider when the state could change and when the commands should be updated.
XPCOM Interfaces - Archive of obsolete content
to get a different component, just replace the contract id inside the square brackets with the contract id of the component you want to use.
Using multiple DTDs - Archive of obsolete content
assuming you have an entity called somebutton.label defined in mainwindow.dtd, you can access the entity like this: <button id="somebutton" label="&somebutton.label"> multiple dtds if you want to use multiple dtds with your xul file, you can simply list all of the dtds inside your dtd declaration: <!doctype window [ <!entity % commondtd system "chrome://myextensions/locale/common.dtd"> %commondtd; <!entity % mainwindowdtd system "chrome://myextension/locale/mainwindow.dtd"> %mainwindowdtd; ]> you can now access the entities declared in the dtds as shown above.
Writing Skinnable XUL and CSS - Archive of obsolete content
skin files that don't import any other skin files, but that are only intended to be used in the context of another component's skin are also considered derived skin files, since they are implicitly importing information from the other component's skin.
XUL accessibility tool - Archive of obsolete content
add usability, i18n, security and other considerations to xul a11y guidelines -- make them more general sprinkle the a11y techniques throughout the turorial and reference.
XML - Archive of obsolete content
mozilla is a product made with all these technologies, but gecko is the thing sitting inside that renders that product.
XUL Coding Style Guidelines - Archive of obsolete content
xml, xul, html, and xhtml guidelines the following are considered good coding style for xml/xul documents.
XUL Event Propagation - Archive of obsolete content
the widget hierarchy consider the following xul file: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="events" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" oncommand="alert('window handler')"> <vbox> <vbox style="background-color: lightgrey;" oncommand="alert('box handler')"> <menu class="menu" la...
bindings - Archive of obsolete content
this element is optional in firefox 3/mozilla 1.9 and later; instead binding elements may be placed directly inside the rule element.
column - Archive of obsolete content
it is common to use columns only to define width and flexibility for the grid column and not place elements directly inside the column.
conditions - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element should appear directly inside a rule element and is used to define conditions for the rule.
datepicker - Archive of obsolete content
s(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
description - Archive of obsolete content
the text can be set either with the value attribute or by placing text inside the open and close description tags.
dialogheader - Archive of obsolete content
this element should be placed inside a dialog element.
editor - Archive of obsolete content
contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object docshell type: nsidocshell this read-only property contains the nsidocshell object for the document.
grid - Archive of obsolete content
ArchiveMozillaXULgrid
elements placed within both the columns and rows will be displayed, although usually only elements will be placed inside one of these.
grippy - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element that may be used inside a splitter which can be used to collapse a sibling element of the splitter.
groupbox - Archive of obsolete content
if a caption element is placed inside the groupbox, it will be used as a caption which appears along the top of the groupbox.
image - Archive of obsolete content
ArchiveMozillaXULimage
interfaces nsiaccessibleprovider nsidomxulimageelement ...
listhead - Archive of obsolete content
it is usual to place listheader elements inside the listhead, one for each column.
observes - Archive of obsolete content
the observes element should be placed inside the element that wants to observe the broadcaster.
preference - Archive of obsolete content
this element must be placed inside a preferences element.
radio - Archive of obsolete content
ArchiveMozillaXULradio
samenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements radiogroup, checkbox interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement, nsidomxullabeledcontrolelement ...
resizer - Archive of obsolete content
if you place a custom resizing button inside the resizer, the user will be able to resize the window by dragging it.
richlistitem - Archive of obsolete content
defaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
scale - Archive of obsolete content
ArchiveMozillaXULscale
related interfaces nsidomxulcontrolelement ...
script - Archive of obsolete content
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.
spacer - Archive of obsolete content
if you want a small gap, consider using a separator instead.
stack - Archive of obsolete content
ArchiveMozillaXULstack
in some case, setting the width or height this way may even be necessary because using the width/height attributes (eg, "width", "minwidth" and "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results.
<statusbarpanel> - Archive of obsolete content
specify the image using the src attribute, and place a menupopup element inside the statusbarpanel.
stringbundle - Archive of obsolete content
stringbundles should be placed inside a stringbundleset element.
tabbox - Archive of obsolete content
thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard navigation to apply.
timepicker - Archive of obsolete content
(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
treecell - Archive of obsolete content
this element should be placed inside a treerow.
treechildren - Archive of obsolete content
for content trees, the content will be placed inside this element.
triple - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a triple can be included inside a rule's conditions element.
wizard - Archive of obsolete content
in newer versions of mozilla, a statusbar may be placed directly inside the wizard element which will be shared among all pages.
wizardpage - Archive of obsolete content
the content in the pages should be placed inside the wizardpage element.
Custom app bundles for Mac OS X - Archive of obsolete content
top-level directory info.plist pkginfo see also xulrunner - tips xulrunner - mac faq external links inside application bundles property list key reference xrtemplate ...
Getting started with XULRunner - Archive of obsolete content
part of this change means the /chrome/chrome.manifest is no longer considered the "root" manifest.
Opening a Link in the Default Browser - Archive of obsolete content
this is how you do it: var extps = components.classes["@mozilla.org/uriloader/external-protocol-service;1"] .getservice(components.interfaces.nsiexternalprotocolservice); if (extps.externalprotocolhandlerexists("http")) { // handler for http:// urls exists } link within an iframe to enable a link inside an html document that is the "src" of an iframe to be opened in the default browser, setting the preference: pref("network.protocol-handler.expose-all", false); seems to work.
Using SOAP in XULRunner 1.9 - Archive of obsolete content
several alternatives were considered: soapclient 2.4 - this library contains a few javascript mistakes but nevertheless seems (fairly) widely used, mature and tested.
Windows and menus in XULRunner - Archive of obsolete content
keeping css, dtd and javascript out of the xul file is considered a best practice.
ant script to assemble an extension - Archive of obsolete content
"blogmark.xpi" <target name="createxpi" depends="createjar" description="assemble the final build blogmark.xpi"> <zip destfile="blogmark-${version}.xpi"> <zipfileset dir="." includes="chrome/blogmark.jar" /> <zipfileset dir="." includes="install.rdf" /> </zip> </target> everything inside the chrome directory is zipped into chrome/blogmark.jar <target name="createjar" depends="templates" description="assemble the jar"> <jar destfile="chrome/blogmark.jar"> <fileset dir="chrome/"> <include name="**/*"/> <exclude name="**/*~"/> <exclude name="**/...
2006-10-13 - Archive of obsolete content
firefox 2.0 should re-implement modal window.open to support web 2.0 user would like the option to show pop-up windows, using window.open(), from inside untrusted script, to be re-implemented.
2006-12-01 - Archive of obsolete content
discussions firefox 2.0 should re-implement modal window.open to support web 2.0 a plea to re-implement the option to show modal windows, using window.open(), from inside an untrusted script.
2006-10-20 - Archive of obsolete content
he wants to be able to build applications that will run inside the browser.
2006-10-20 - Archive of obsolete content
discussions mp3's considered a malicious file type?
2006-11-24 - Archive of obsolete content
the license would need to be compatible with all three mpl/gpl/lgpl (used by tamarin) to be considered for mozilla.
2006-11-10 - Archive of obsolete content
discussions developing an extension like xmlhttprequest / nsidocument / mozilla_internal_api a discussion on how to develop an extension similar to xmlhttprequest but for a different protocol than http, emulating the asynchronous aspect.
NPWindow - Archive of obsolete content
the plug-in is considered windowed.
NP_Port - Archive of obsolete content
syntax typedef struct np_port { cgrafptr port; /* grafport */ int32 portx; /* position inside the topmost window */ int32 porty; } np_port; fields the data structure has the following fields: port standard mac os port into which the plug-in should draw.
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
the downside to this method is that once the plugin is installed, it might be difficult for users to upgrade, uninstall, or disable the plugin.
The First Install Problem - Archive of obsolete content
example: [hkey_local_machine\software\mozillaplugins\]\@mycompany.com/myapplication,version=5.01\suffixes] inside this subkey, string values might look like: app typ avi note that these string values (reg_sz) don't actually have values affiliated with them.
Writing a plugin for Mac OS X - Archive of obsolete content
xcode will create a "build" directory next to the project file, and if you built it in release mode, that folder in turn contains a "release" directory with the plugin inside it.
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
the general idea is that you use the xid that was passed into your npp_setwindow() call and create a gtkplug to host inside of that socket.
Plugins - Archive of obsolete content
for example, the adobe reader plugin lets the user open pdf files directly inside the browser, and the quicktime and realplayer plugins are used to play special format videos in a web page.
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
the wording of this note should be reconsidered.
Introduction to Public-Key Cryptography - Archive of obsolete content
certficate-based authentication is generally considered preferable to password-based authentication because it is based on what the user has (the private key) as well as what the user knows (the password that protects the private key).
Introduction to SSL - Archive of obsolete content
at this point, the ssl protocol allows the server to consider the client authenticated and proceed with the connection as described in step 6.
SSL and TLS - Archive of obsolete content
for 64-bit machines, consider using stronger keys.
Vulnerabilities - Archive of obsolete content
a setting that disables the use of an antiphishing feature in an email client has a significant impact on only security, so a vulnerability with that setting would be considered a security configuration issue vulnerability.
Sunbird Theme Tutorial - Archive of obsolete content
for information on how to find the profile directory, see the mozillazine article: profile folder inside the profile directory, go to the <tt>extensions</tt> directory.
Theme changes in Firefox 2 - Archive of obsolete content
browser/safebrowsing/warning24x24.png new file; this is the warning icon that's displayed inside the safe browsing warning window.
Theme changes in Firefox 3.5 - Archive of obsolete content
this attribute can be used to style different parts of the browser window inside the private browsing mode.
Theme changes in Firefox 3 - Archive of obsolete content
the go button is now located inside the location bar, so the image for it (chrome://browser/skin/go-arrow.png) needs to be smaller.
Theme changes in Firefox 4 - Archive of obsolete content
inside that, create another new directory chrome.
Scratchpad - Archive of obsolete content
from firefox 47, you can open scratchpad inside the toolbox.
Using IO Timeout And Interrupt On NT - Archive of obsolete content
if these limitations with io timeout and interrupt are not acceptable to the needs of your programs, you can consider using the win95 version of nspr.
-moz-stack-sizing - Archive of obsolete content
ignore the stack won't consider this child when calculating its size.
-ms-hyphenate-limit-zone - Archive of obsolete content
a word is considered for hyphenation only if it begins at or outside of the logical left limit of the hyphenation zone.
-ms-wrap-through - Archive of obsolete content
its descendants are only subject to exclusion shapes defined inside the element.
::-ms-track - Archive of obsolete content
applying the color property within the ::-ms-track selector affects the tick marks inside the track area.
display-outside - Archive of obsolete content
layout-specific leaf types these display types require their parent to be of a particular display type, but can accept any display-inside value.
CSS - Archive of obsolete content
ArchiveWebCSS
stereo output produce a lateral sound stage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage.display-insidethe display-inside css property specifies the inner display type of the box generated by an element, dictating how its contents lay out inside the box.display-outsidethe display-outside css property specifies the outer display type of the box generated by an element, dictating how the element participates in its parent formatting context.
E4X for templating - Archive of obsolete content
a</label> )} note that the simple xmllist() constructor (<></>) may be useful to still be able to use an expression closure (i.e., without needing return statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to store such e4x in separate file templates (to be eval()d at a later time, taking into account security considerations, such as escaping with the above), e4x content using such functions can also be easily serialized inline (and then perhaps converted to the dom) as needed: var list = <>{_if(elems.length(), function () <> <markup/> <markup/> </>)}</>.toxmlstring(); iterating functions such as the following foreach (which can work with arrays, objects, or e4x objects) are quite convenient ...
Descendants and Filters - Archive of obsolete content
consider var element = <dogs> <fido color="brown"/> <spike color="black"/> <killer color="brown"/> </dogs>; var list = element.*.(@color == "brown"); originally, elements.* returns a list with all 3 dogs in it.
Iterator - Archive of obsolete content
for future-facing usages, consider using for..of loops and the iterator protocol.
Date.prototype.toLocaleFormat() - Archive of obsolete content
you might consider using some of the more general tolocale* methods of the date object or doing your own custom localization of the date to be displayed using some of the get* methods of the date object instead of using this method.
Expression closures - Archive of obsolete content
for future-facing usages, consider using arrow functions.
Legacy generator function - Archive of obsolete content
for future-facing usages, consider using function*.
Debug.setNonUserCodeExceptions - Archive of obsolete content
syntax debug.setnonusercodeexceptions [= bool]; remarks if this property is set to true within a given scope, the debugger can then choose whether to take some specified action on exceptions thrown inside that scope: for instance, if the developer wishes to break on user-unhandled exceptions.
for each...in - Archive of obsolete content
consider using for...of instead.
Archived JavaScript Reference - Archive of obsolete content
handler.enumerate() method used to be a trap for for...in statements, but has been removed from the ecmascript standard in es2016 and is deprecated in browsers.legacy generator functionthe legacy generator function statement declares legacy generator functions with the specified parameters.legacy generator function expressionthe function keyword can be used to define a legacy generator function inside an expression.
MSX Emulator (jsMSX) - Archive of obsolete content
therefore, jsmsx requires a very fast computer to emulate msx at the normal 50-60 interrupts per second inside a web browser.
StopIteration - Archive of obsolete content
for future-facing usages, consider using for..of loops and the iterator protocol.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
this involved floating the image inside the floated div.
background-size - Archive of obsolete content
feel free to put it inside, nothing is set in stone.
Reference - Archive of obsolete content
the confusion sets in when you consider that object is also a constructor function, therefore an instance of function, and, furthermore, an instance of object; this is where the recursion is introduced, and why you can infinitely do function.constructor; //function function.constructor.constructor; //function .
Writing JavaScript for XHTML - Archive of obsolete content
the receiving browser considers the content to be html, and does not utilise its xml parser.
Building Mozilla XForms - Archive of obsolete content
orks (replace {geckoversion} with the used gecko/toolkit version): <em:minversion>{geckoversion}.0</em:minversion> <em:maxversion>{geckoversion}.*</em:maxversion> for example, for the firefox 3.5 version of the extension, it might look like that: <em:minversion>1.9.1.0</em:minversion> <em:maxversion>1.9.1.*</em:maxversion> then zip the files again (or use an editor like vim that can edit files inside a zip archive).
XForms - Archive of obsolete content
however, xforms never gained traction and is now considered obsolete.
Archived open Web documentation - Archive of obsolete content
however, xforms never gained traction and is now considered obsolete.
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
for example, if an author writes: <style type="text/css"> body {font-size: 11px;} </style> ...then the text inside table cells should also be 11 pixels in size.
Popup Window Controls - Archive of obsolete content
replacements for popup windows if your popup was created during the time the web page was loading, you may consider using document.write() to emit appropriate html which will contain the same information as the popup window.
Using the Right Markup to Invoke Plugins - Archive of obsolete content
at a minimum, web authors will have to nest some alternate text inside their object elements telling users where to obtain the missing component.
Game distribution - Game development
consider various options, experiment and conclude.
Game promotion - Game development
you can also sell a full version of the game from inside your browser demo version, which will be a great move considering high competition, some developers even manage to make full browser versions.
2D collision detection - Game development
the complexity of an algorithm like this means we will need to consider performance optimization, covered in the next section.
Audio for Web games - Game development
for other more active sounds that are to be used during the game we could consider priming them as soon as something like a start button is pressed.
Desktop gamepad controls - Game development
next, we'll consider the gamepadbuttonpressedhandler() function: function gamepadbuttonpressedhandler(button) { var press = false; for(var i=0; i<buttonspressed.length; i++) { if(buttonspressed[i] == button) { press = true; } } return press; } the function takes a button as a parameter; in the loop it checks if the given button's number is among the currently pressed bu...
Desktop mouse and keyboard controls - Game development
inside them we can get the code of the key that was pressed from the keycode property of the event object, see which key it is, and then set the proper variable.
Unconventional controls - Game development
you can explore the hand's properties and implement any behaviour you like right inside your game.
Implementing game control mechanisms - Game development
we'll be playing mostly with the mainmenu.js and game.js files, and we'll explain the code inside the create() and update() methods in much more detail in later articles.
Crisp pixel art look with image-rendering - Game development
two downsides to this method are larger file sizes and compression artifacts.
Square tilemaps implementation: Static maps - Game development
we need to supply the atlas image, the coordinates and dimensions of the tile inside the atlas, and the target coordinates and size (a different tile size in here would scale the tile.) so, for instance, to draw the tree tile, which is the third in the atlas, at the screen coordinates (128, 320), we would call drawimage() with these values: context.drawimage(atlasimage, 192, 0, 64, 64, 128, 320, 64, 64); in order to support atlases with multiple rows and columns, you would ne...
Tiles and tilemaps overview - Game development
this set of articles covers the basics of creating tile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) besides the performance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a path-finding graph, or handling collisions) or to create a level editor.
Bounce off the walls - Game development
add this to your code, somewhere below the existing variable declarations: var ballradius = 10; now update the line that draws the ball inside the drawball() function to this: ctx.arc(x, y, ballradius, 0, math.pi*2); bouncing off the top and bottom there are four walls to bounce the ball off — let's focus on the top one first.
Finishing up - Game development
rendering the lives display now you need to add a call to drawlives() inside the draw() function and add it below the drawscore() call.
Track the score and win - Game development
= bricks[c][r]; if(b.status == 1) { if(x > b.x && x < b.x+brickwidth && y > b.y && y < b.y+brickheight) { dy = -dy; b.status = 0; score++; } } } } } calling drawscore() from the draw() function keeps the score up to date with every new frame — add the following line inside draw(), just below the drawpaddle() call: drawscore(); displaying a winning message when all bricks have been destroyed collecting the points works well, but you won't be adding them forever — what about when all the bricks have been destroyed?
Bounce off the walls - Game development
add the following line below the previous one: ball.body.bounce.set(1); try reloading index.html again — now you should see the ball bouncing off all the walls and moving inside the canvas area.
Extra lives - Game development
add the following lines below the existing scoretext definition inside your create() function: livestext = game.add.text(game.world.width-5, 5, 'lives: '+lives, { font: '18px arial', fill: '#0095dd' }); livestext.anchor.set(1,0); lifelosttext = game.add.text(game.world.width*0.5, game.world.height*0.5, 'life lost, click to continue', { font: '18px arial', fill: '#0095dd' }); lifelosttext.anchor.set(0.5); lifelosttext.visible = false; the livestext and lifelostte...
Game over - Game development
add the code below inside the create() function; just after you define the ball's attributes is fine: game.physics.arcade.checkcollision.down = false; this will make the three walls (top, left and right) bounce the ball back, but the fourth (bottom) will disappear, letting the ball fall off the screen if the paddle misses it.
Physics - Game development
add the physics.startsystem() method at the beginning of the create function (make it the first line inside the function), as shown below: game.physics.startsystem(phaser.physics.arcade); next, we need to enable our ball for the physics system — phaser object physics is not enabled by default.
Player paddle and controls - Game development
rendering the paddle, with physics next up, we will init our paddle by adding the following add.sprite() call inside the create() function — add it right at the bottom: paddle = game.add.sprite(game.world.width*0.5, game.world.height-5, 'paddle'); we can use the world.width and world.height values to position the paddle exactly where we want it: game.world.width*0.5 will be right in the middle of the screen.
Scaling - Game development
resize — creates the canvas with the same size as the available width and height, so you have to place the objects inside your game dynamically; this is more of an advanced mode.
Visual JS GE - Game development
you need to put your images in a folder, for example test_res/ , inside project_instance/res/.
Visual typescript game engine - Game development
i use one git repo but consider '/server' represent the standalone application.
Gecko FAQ - Gecko Redirect 1
it paints the browser's content area, which is the blank area inside the browser window's chrome.
Plug-in Development Overview - Gecko Plugin API Reference
consider the following example, where a media player plug-in can be controlled with an advancetonextsong() method called inside the script element: <object id="myplugin" type="audio/wav" data="music.wav"> </object> <script type="application/javascript"> var theplugin = document.getelementbyid('myplugin'); if (theplugin && theplugin.advancetonextsong) theplugin.advancetonextsong(); el...
API - MDN Web Docs Glossary: Definitions of Web-related terms
an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface.
Block (scripting) - MDN Web Docs Glossary: Definitions of Web-related terms
for example, you can put a block of statements after an if (condition) block, indicating that the interpreter should run the code inside the block if the condition is true, or skip the whole block if the condition is false.
Block - MDN Web Docs Glossary: Definitions of Web-related terms
for example, you can put a block of statements after an if (condition) block, indicating that the interpreter should run the code inside the block if the condition is true, or skip the whole block if the condition is false.
CORS-safelisted response header - MDN Web Docs Glossary: Definitions of Web-related terms
a cors-safelisted response header is an http header which has been safelisted so that it will not be filtered when responses are processed by cors, since they're considered safe (as the headers listed in access-control-expose-headers).
Selector (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
consider this css: p { color: green; } div.warning { width: 100%; border: 2px solid yellow; color: white; background-color: darkred; padding: 0.8em 0.8em 0.6em; } #customized { font: 16px lucida grande, arial, helvetica, sans-serif; } the selectors here are "p" (which applies the color green to the text inside any <p> element), "div.warning" (which makes any <div> element with the class "warning" look like a warning box), and "#customized", which sets the base font of the element with the id "customized" to 16-pixel tall lucida grande or one of a few fallback fonts.
Compile - MDN Web Docs Glossary: Definitions of Web-related terms
those are considered productivity tools.
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
for example, the above excerpt might be inside a function that runs when the user clicks the submit button for the form.
Cryptographic hash function - MDN Web Docs Glossary: Definitions of Web-related terms
equently) not invertible (each digest could come from a very large number of messages, and only brute-force can generate a message that leads to a given digest) tamper-resistant (any change to a message leads to a different digest) collision-resistant (it should be impossible to find two different messages that produce the same digest) cryptographic hash functions such as md5 and sha-1 are considered broken, as attacks have been found that significantly reduce their collision resistance.
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
the united states computer emergency readiness team (us-cert) defines symptoms of denial-of-service attacks to include: unusually slow network performance (opening files or accessing websites) unavailability of a particular website inability to access any website dramatic increase in the number of spam emails received—(this type of dos attack is considered an email bomb) disconnection of a wireless or wired internet connection longterm denial of access to the web or any internet services learn more general knowledge denial-of-service attack on wikipedia ...
Empty element - MDN Web Docs Glossary: Definitions of Web-related terms
many combinations have no semantic meaning, for example an <audio> element nested inside an <hr> element.
FTP - MDN Web Docs Glossary: Definitions of Web-related terms
you will still find it used on older hosting accounts, but it is safe to say that ftp is no longer considered best practice.
Falsy - MDN Web Docs Glossary: Definitions of Web-related terms
a falsy (sometimes written falsey) value is a value that is considered false when encountered in a boolean context.
Flex Item - MDN Web Docs Glossary: Definitions of Web-related terms
continuous runs of text inside flex containers will also become flex items.
Function - MDN Web Docs Glossary: Definitions of Web-related terms
a named function is a function with a function name: // function declaration function foo() {}; // named function expression (function bar() {}); // or using the ecmascript 2015 arrow notation const foo = () => {}; an inner function is a function inside another function (square in this case).
Global scope - MDN Web Docs Glossary: Definitions of Web-related terms
in client-side javascript, the global scope is generally the web page inside which all the code is being executed.
Hotlink - MDN Web Docs Glossary: Definitions of Web-related terms
the practice is often frowned upon as it can cause unwanted bandwidth usage on the website hosting the linked-to object, and copyright concerns — it is considered stealing when it is done without permission.
Idempotent - MDN Web Docs Glossary: Definitions of Web-related terms
to be idempotent, only the actual back-end state of the server is considered, the status code returned by each request may differ: the first call of a delete will likely return a 200, while successive ones will likely return a 404.
Java - MDN Web Docs Glossary: Definitions of Web-related terms
programs are compiled only once ahead of time into a proprietary byte code and package format that runs inside the java virtual machine (jvm).
Localization - MDN Web Docs Glossary: Definitions of Web-related terms
the following are common factors to consider: language unit of measure (e.g., kilometers in europe, miles in u.s.) text direction (e.g., european languages are left-to-right, arabic right-to-left) capitalization in latin script (e.g., english uses capitals for weekdays, spanish uses lowercase) adaptation of idioms (e.g., "raining cats and dogs" makes no sense when translated literally) use of register (e.g., in japanese respectful speech differs exceptionally from casual speech) number format (e.g., 10 000,00 in germany vs.
Native - MDN Web Docs Glossary: Definitions of Web-related terms
on the other hand, a web app that runs inside a browser is not native — it is run in the web browser, which sits on top of the native environment, not the native environment itself.
Parse - MDN Web Docs Glossary: Definitions of Web-related terms
parsing means analyzing and converting a program into an internal format that a runtime environment can actually run, for example the javascript engine inside browsers.
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
in addition, cors defines a subset of request headers as simple headers, request headers that are always considered authorized and are not explicitly listed in responses to preflight requests.
Scope - MDN Web Docs Glossary: Definitions of Web-related terms
for instance, the following is invalid: function examplefunction() { var x = "declared inside function"; // x can only be used in examplefunction console.log("inside function"); console.log(x); } console.log(x); // causes error however, the following code is valid due to the variable being declared outside the function, making it global: var x = "declared outside function"; examplefunction(); function examplefunction() { console.log("inside function"); console.log(...
Stylesheet - MDN Web Docs Glossary: Definitions of Web-related terms
internal stylesheets are placed inside a <style> element inside the <head> of a web document, and external stylesheets are placed inside a separate .css file, which is applied to a document by referencing the file inside a <link> element in the document's head.
TLD - MDN Web Docs Glossary: Definitions of Web-related terms
consider an example internet address: https://developer.mozilla.org here org is the tld; mozilla.org is the second-level domain name; and developer is a subdomain name.
Truthy - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, a truthy value is a value that is considered true when encountered in a boolean context.
Type - MDN Web Docs Glossary: Definitions of Web-related terms
comparison between structured types is not always an easy assumption, as even if the previous data structure is the same, there could be inherited structures inside of the prototype chain.
Brotli - MDN Web Docs Glossary: Definitions of Web-related terms
brotli is compatible with most modern browsers, but you may want to consider a fallback.
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
the status code of the response is known by the application caching, and it is considered cacheable.
About Scriptable Interfaces - Interfaces
status of this document this is just a starter document, it should not be considered complete.
Assessment: Accessibility troubleshooting - Learn web development
other considerations?
Accessible multimedia - Learn web development
you can't tab between the controls inside the native player.
Handling different text directions - Learn web development
there are a huge number of properties when you consider all of the individual border longhands, and you can see all of the mapped properties on the mdn page for logical properties and values.
Pseudo-classes and pseudo-elements - Learn web development
we are saying that we want to select the first line, of the first <p> element, which is inside an <article> element.
Test your skills: Selectors - Learn web development
make the first element inside the container font-size: 150% and the first line of that element red.
Type, class, and ID selectors - Learn web development
the universal selector the universal selector is indicated by an asterisk (*) and selects everything in the document (or inside the parent element if it is being chained together with another element and a descendant combinator).
CSS building blocks - Learn web development
overflow is what happens when there is too much content to be contained comfortably inside a box.
Test your skills: Flexbox - Learn web development
use flexbox to center the child inside the parent.
Test Your Skills: Fundamental layout comprehension - Learn web development
the image that is inside the article should have text wrapped around it.
Styling text - Learn web development
styling lists lists behave like any other text for the most part, but there are some css properties specific to lists that you need to know about, and some best practices to consider.
Learn to style HTML using CSS - Learn web development
css layout at this point we've already looked at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside.
What text editors are available? - Learn web development
here are the primary questions you should consider: which os (operating system) do i want to work with?
How do you make sure your website works properly? - Learn web development
since people can come to your website from all over the world, you should consider making it accessible to everybody.
How do you host your website on Google App Engine? - Learn web development
your website content must go inside the website folder, and its landing page must be called index.html, but apart from that it can take whatever form you like.
What are browser developer tools? - Learn web development
how to open the devtools in your browser the devtools live inside your browser in a subwindow that looks roughly like this, depending on what browser you are using: how do you pull it up?
What are hyperlinks? - Learn web development
that said, there are some nuances worth considering: types of links internal link a link between two webpages, where both webpages belong to the same website, is called an internal link.
What is a web server? - Learn web development
(the 404 error is so common that some web designers devote considerable time and effort to designing 404 error pages.) static vs.
What is accessibility? - Learn web development
let's consider video: hearing impairment how does a hearing-impaired person benefit from a video?
How do you set up a local testing server? - Learn web development
if this is ok, navigate to the directory that your example is inside, using the cd command.
Advanced form styling - Learn web development
for example, consider this simple test case: <span><input type="checkbox"></span> span { display: inline-block; background: red; } input[type="checkbox"] { width: 100px; height: 100px; } different browsers handle this in many different, often ugly ways: browser rendering firefox 71 (macos) firefox 57 (windows 10) chrome 77 (macos), safari 13, op...
CSS property compatibility table for form controls - Learn web development
due to the complexity of css and html forms, these tables can't be considered a perfect reference.
Test your skills: Advanced styling - Learn web development
second, we want you to provide a useful visual indicator of whether the data entered inside each input is valid or not.
Test your skills: Basic controls - Learn web development
create a submit button inside the remaining list item, with button text of "log in".
Test your skills: Other controls - Learn web development
inside the list, split the choices up into 2 subgroups — "mains" and "snacks".
Web forms — Working with user data - Learn web development
this article explains how you'd do this and the considerations you need to be aware of when doing so, with a practical case study.
HTML Cheatsheet - Learn web development
some elements are small and are "nested" inside larger ones.
Define terms with HTML - Learn web development
the terms described go inside <dt> elements.
Using data attributes - Learn web development
the main issues to consider are internet explorer support and performance.
Structuring a page of content - Learn web development
you don't need to know any css to do this assessment; you just need to put the provided css inside an html element.
Test your skills: Links - Learn web development
links 2 in this task we want you to fill in the four links so that they link to the appropriate places: the first link should link to an image called blue-whale.jpg, which is located in a directory called blue inside the current directory.
Test your skills: HTML images - Learn web development
the image is called blueberries.jpg, and it is in a folder inside the current folder called images.
Video and audio content - Learn web development
the paragraph inside the <video> tags this is called fallback content — this will be displayed if the browser accessing the page doesn't support the <video> element, allowing us to provide a fallback for older browsers.
Multimedia and Embedding - Learn web development
images in html there are other types of multimedia to consider, but it is logical to start with the humble <img> element used to embed a simple image in a webpage.
Test your skills: Conditionals - Learn web development
inside the first, you need to nest an if...else if...else that puts appropriate messages into the response variable depending on what the value of score is — if the machine is turned on.
Test your skills: Functions - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
JavaScript building blocks - Learn web development
functions allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
Storing the information you need — Variables - Learn web development
no value defined would mean that there is a box, but it has no value inside it.
Test your skills: Object basics - Learn web development
object basics 1 in this task you are provided with an object literal, and your tasks are to store the value of the name property inside the catname variable, using bracket notation.
Measuring performance - Learn web development
it also lets you know it the measured values are considered good or bad.
Web performance resources - Learn web development
<link rel="stylesheet" href="/path/to/my.css" media="print" onload="this.media='all'"> <noscript><link rel="stylesheet" href="/path/to/my.css"></noscript> the downside with this approach is the flash of unstyled text (fout.) the simplist way to address this is by inlining css that is required for any content that is rendered above the fold, or what you see in the browser viewport before scrolling.
What is web performance? - Learn web development
there are a lot of best practices to consider in making apps feel smooth, for example using css animations rather than javascript for animation, and minimizing the number of repaints the ui requires due to changes in the dom.
The business case for web performance - Learn web development
here are some kpis to consider: conversion rate the percent of your traffic that takes an intended action, such as completing a purchase or signing up for a newsletter.
Server-side website programming - Learn web development
displaying all of these using different static pages would be extremely inefficient, so instead such sites display static templates (built using html, css, and javascript), and then dynamically update the data displayed inside those templates when needed, such as when you want to view a different product on amazon.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
note that here we need this.incomplete.length, not this.todos.incomplete.length, because we are doing this inside the service, where the incomplete() getter is available directly (in the template, the contents of the service has been made available as todos via the @service('todo-data') todos; line inside the footer class, hence it being this.todos.incomplete.length there).
Beginning our React todo list - Learn web development
first, consider the jsx we have, and how it corresponds to our user stories: we have a <form> element, with an <input type="text"> for writing out a new task, and a button to submit the form.
Vue resources - Learn web development
this makes the new api typically considered a more advanced use case.
Git and GitHub - Learn web development
about pull requests (from github) a useful guide to managing pull requests, the way that your suggested code changes are delivered to people's repositories for consideration.
Client-side tooling overview - Learn web development
you then "push" changes to a "master" version of the code inside a remote repository stored on a server somewhere.
Accessibility Features in Firefox
keyboard support "mozilla firefox is a web-browser with superior keyboard support." alan cantor, cantor access consulting firefox includes keyboard access to all of its amazing features: browse with caret allows users to select arbitrary content with the keyboard and move through content as if inside a read-only editor.
Mozilla accessibility architecture
the reason that the doc accessible is not created directly in the widget code where it's needed is that the widget code has no knowledge what nsidomnode is associated with the current window's document object.
Accessibility information for UI designers and developers
or in this one, you could consider using patterns besides colored areas: again, if people are unable to distinguish the colors, they can rely on the patterns instead.
CSUN Firefox Materials
browse with caret allows users to select arbitrary content with the keyboard and move through content as if inside a read-only editor.
Mozilla's Section 508 Compliance
er means 2) java and in-page plugins cannot be used with the keyboard, so they must not be installed for keyboard-only users additional features for the keyboard: 1) find as you type allows for quick navigation to links and convenient text searching 2) browse with caret (f7 key toggles) allows users to select arbitrary content with the keyboard and move through content as if inside a readonly editor.
ZoomText
these builds are pretty stable considering they're only alpha, i'm having very good luck with them.
Frequently Asked Questions for Lightweight themes
consider visiting the firefox support website or the themes forum for more help.
Adding a new CSS property
some common mistakes to watch out for when writing custom parsing code (which might go away if we redesign the parser along the lines described in css3-syntax): make sure to call skipuntil() to look for the matching close parentheses, braces, or brackets whenever you hit an error inside of them.
Benchmarking
it also lacks features such as instruction level profiling which can be helpful in low level profiling, or finding the hot loop inside a large function, etc.
Chrome registration
also, the path inside overridden files is relative to the overridden path, not the original one (this can be annoying and/or useful in css files, for example).
Continuous Integration
perfherder alerts we track changes to talos and other performance frameworks inside perfherder, and try to automatically alert when there is a sustained change exceeding a certain magnitude (specified per test).
Creating MozSearch plugins
abquulttbgccagcnnzgabbgamj5thwgvjlaaaaabjru5erkjggg%3d%3d</image> <url type="text/html" method="get" template="http://developer.mozilla.org/en/docs/special:search?search={searchterms}"/> <searchform>http://developer.mozilla.org/en/docs/special:search</searchform> </searchplugin> notice in this case that instead of using <param> to define parameters to the search engine, they're simply embedded inside the template url.
Creating Sandboxed HTTP Connections
it would be better to have the entire implementation inside a class and storing the channel as a member: function myclass() { this.mchannel = null; // ...
Debugging update problems
that url might look something like: https://aus3.mozilla.org/update/3/firefox/12.0a1/20120106040225/darwin_x86_64-gcc3-u-i386-x86_64-shark/nightly-profiling/darwin%2010.8.0/default/default/update.xml?force=1 you can then request this url manually to see what's inside.
How Mozilla's build system works
legacy content the content below is considered legacy.
Installing headers using EXPORTS
here is an example <tt>makefile.in</tt> which has both c++ and idl headers: module = content xpidl_module = content_base exports = \ nsicontent.h \ nsidocument.h \ nsistylesheet.h \ $(null) xpidlsrcs = \ nsicontentpolicy.idl \ nsiselectioncontroller.idl \ $(null) include $(topsrcdir)/config/rules.mk ...
Old Thunderbird build
closed), you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction).
Simple Instantbird build
if the trunk is broken, you may wish to consider building one of the branches (to pull the source code from a branch, just replace the url to the repository in the hg clone instruction).
Gecko Logging
error 1 an error occurred, generally something you would consider asserting in a debug build.
Interface Compatibility
you should strongly consider migrating existing code to use js-ctypes instead of binary components.
Obsolete Build Caveats and Tips
purpose of this page the mozilla build process and code base have evolved considerably over the past few years.
Working with Mozilla source code
the firefox codebase: css guidelines this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers.
Index
10 firefox ui considerations for web developers activity stream, firefox, icons, mozilla, new tab, newtab, ui, web, web development, favicon there are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to visit or a site to manage in some way.
Cross Process Object Wrappers
consider this code: mm.addmessagelistener("gotloadevent", function (msg) { mm.sendasyncmessage("changedocumenturi", {newuri: "hello.com"}); let uri = msg.objects.document.documenturi; dump("received load event: " + uri + "\n"); }); this sends a message asking the frame script to change the current document uri, then accesses the current document uri via a cpow.
Frame script environment
may be null (see below) docshell the nsidocshell associated with the browser.
Frame script environment
the frame script's global is a contentframemessagemanager, giving it the following environment: content the dom window of the content loaded in the browser may be null (see below) docshell the nsidocshell associated with the browser.
Message manager overview
tab docshell : access the top-level docshell components : access privileged objects and apis addeventlistener() : listen to dom events addmessagelistener() : receive messages from the chrome process sendasyncmessage() : send asynchronous messages to the chrome process sendsyncmessage() : send synchronous messages to the chrome process interfaces nsidomeventtarget nsimessagelistenermanager nsimessagesender nsisyncmessagesender nsicontentframemessagemanager how to access the content frame message manager is the global object in frame scripts.
Multiprocess Firefox
limitations of frame scripts practices that will not work inside frame scripts, and what to do instead.
Firefox
the most useful is the url about:config, which displays preferences and settings that can be inspected and changed.firefox ui considerations for web developersthere are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to visit or a site to manage in some way.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
when this fires, we set the value inside the url bar input to be equal to the event object detail property — this is so that the url displayed continues to match the website being shown when the user navigates back and forth through the history.
mozbrowseractivitydone
the mozbrowseractivitydone event is fired when something inside the browser <iframe> triggers a web activity, and that web activity's message is consumed by the receiving app.
mozbrowserselectionstatechanged
the mozbrowserselectionstatechanged event is fired when the text selected inside the browser <iframe> content changes.
MozBeforePaint
this new property indicates the time, in milliseconds since epoch, at which all animations started in the specified window during the current refresh interval should be considered to have started running.
Embedding Mozilla
that means you can embed a web browser inside a third-party application, open channels and streams through the network backend, walk through the dom and so on.
HTML parser threading
nodes created by tree ops are owned by the parser for the lifetime of the parser, so for refcounting purposes, the parser owns each nsicontent object it creates by one reference no matter how many copies of the content handle for the node exist inside the parser.
Script security
inside the same compartment, all objects share a global and are therefore same-origin with each other.
IPDL Best Practices
consider the following protocol: async protocol pasyncquerier { child: pasyncquery(); } async protocol pasyncquery { child: kickoffquery(nsstring query); parent: returnresult(nsstring result); __delete__(); } in this situation, there is a guaranteed sequence of messages that will be sent.
IPDL Tutorial
}; virtual pexamplechild* toplevelchild::allocpexample() { refptr<examplechild*> actor = new examplechild(); return actor.forget(); } virtual bool toplevelchild::deallocpexample(pexamplechild* actor) { ns_release(static_cast<examplechild*>(actor)); return true; } if an object that implements a protocol can't be constructed inside allocpfoo, has been previously constructed and doesn't require an ipdl connection throughout its lifetime, or implements a refcounted protocol where the first form of constructor is not available, there is a second form of sendpfooconstructor which can be used: class examplechild { public: void dosomething() { amanagerchild->sendpexampleconstructor(this, ...); } }; internally,...
Infallible memory allocation
inside the allocation routine, the situation is different.
JavaScript Tips
xul tips when inserting code with an xul overlay, wrap functions and variables inside an object with a unique name to avoid conflicting with existing or future function and variable names.
Addon
the interface can represent many different kinds of add-ons and as such, some of the methods and properties are considered "required" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons.
Add-on Manager
for example: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getalladdons(function(aaddons) { // here aaddons is an array of addon objects }); // this code will execute before the code inside the callback notifications about changes to installed add-ons are dispatched to any registered addonlisteners.
API-provided widgets
this is only used to display the shortcut as part of the tooltip for builtin widgets (which have strings inside customizablewidgets.properties).
Widget Wrappers
this will point to the overflow chevron on overflowable toolbars if and only if your widget node is overflowed, to the anchor for the panel menu if your widget is inside the panel menu, and to the node itself in all other cases overflowed boolean indicating whether the node is currently in the overflow panel of the toolbar isgroup false, will be true for the group widget label for api-provided widgets, convenience getter for the label attribute of the dom node tooltiptext for api-provided widgets, convenience gette...
DeferredTask.jsm
this is always true when read from code inside the task function, but can also be true when read from external code, in case the task is an asynchronous generator function.
Downloads.jsm
close the message to stop."); } finally { yield list.remove(download); yield download.finalize(true); } } finally { yield list.removeview(view); } }).then(null, components.utils.reporterror); conversion from nsidownloadmanager starting in firefox for desktop version 26, the nsidownloadmanager and nsidownload interfaces are not available anymore.
PopupNotifications.jsm
this anchorid must point to an element contained inside the popupnotification object's icon box (for firefox windows, the global popupnotifications object uses the notification-popup-box element).
Promise
for example, the os.file.exists function returns a promise that will eventually fulfill with a boolean: promise<boolean> exists(string path); the rejection reason may be specified separately in the function's documentation, and is considered to be an error object unless otherwise specified.
Services.jsm
ge service clipboard nsiclipboard clipboard console nsiconsoleservice error console service contentprefs nsicontentprefservice content preferences service cookies nsicookiemanager2 cookie manager 2 service cpmm nsimessagesender child process message manager4 crashmanager crashmanager.jsm dirsvc nsidirectoryservice nsiproperties directory service domstoragemanager nsidomstoragemanager dom storage manager domrequest nsidomrequestservice domrequest service downloads nsidownloadmanager download manager droppedlinkhandler nsidroppedlinkhandler dropped link handler service els nsieventlistenerservice event listener s...
Bootstrapping a new locale
navigate to that level making sure you are *not* inside mozilla-1.9.x/ and then run the following commands.
Mozilla Content Localized in Your Language
reference material can be find here calendar calendar view: which date is considered the first day of the week, sunday or monday?
Localizing XLIFF files for iOS
here is an example of such a <trans-unit> <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> </trans-unit> your translations must be contained inside <target> child tags.
Localizing with Mercurial
inside your l10n directory, init your repo with mq by running hg init --mq.
Localizing with Pontoon
and there it is, opened inside pontoon: main toolbar as you can see, most of the interface is taken by the website being translated.
Localization sign-off reviews
this is done by generating a diff between the new release revision being considered and the previously approved release revision.
Localization technical reviews
that being the case, there are some criteria in a technical review that will only ever be considered once, as all reviews after this only evaluate the changes you're adding on top of this revision from release to release.
Test
if not, please consider installing some mathml fonts.
Fonts for Mozilla 2.0's MathML engine
the license allows you to "use this font as permitted by the eula for the product in which this font is included to display and print content", so consulting your lawyer is recommended if considering installing this on systems without the associated product.
MathML3Testsuite
when the markup is intentionally errorous, the correct behavior is not defined by the recommendation and hence the tests are considered passed if there is no fatal error (crash, etc).
MathML In Action
addeventlistener("click", zoomtoggle, false); } window.addeventlistener("load", load, false); consider an interesting markup like this { u t + f ( u ) x = 0 u ( 0 , x ) = { u - if x < 0 u + if x > 0 or other complex markups like these ell ^ y ( z ; z , τ ) := ∫ y ( ∏ l ( y l 2 π i ) θ ( y l 2 π i - z ) θ ′ ( 0 ) θ ( - z ) θ ( y l 2 π i ) ) × ( ∏ k θ ( e k 2 π i - ( α k ...
Updates
some improvements are particularly worth noting: a new html parser, which lets you use mathml inside non-xhtml documents.
MathML Demo: <mfrac> - fractions
and this is an example where the bevelled attribute is set inside the radical y 2 - t 2 1 ( 1 + | y 2 - t 2 | 2 ) and this shows a combination with a background image at a desired opacity mathml background image html content <div class="background"></div> <math display="block"> <mrow> <msub> <mi>z</mi> <mi>&alpha;</mi> </msub> <mrow> <mo>(</mo> <mi>f</mi> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mn...
MathML Demo: <mtable> - tables and matrices
math axis test, using externally aligned arrays inside symmetric fences.
Mozilla Quirks Mode Behavior
miscellaneous & style all of the style rules in layout/style/res/quirk.css apply only in quirks mode: orphaned li has an inside bullet (bug 1049).
Memory reporting
other considerations a number of the existing basic data structures already have sizeof{in,ex}cludingthis functions, e.g.
Refcount tracing and balancing
make-tree.pl has an option --exclude [file], where [file] is a newline-separated list of function names that will be excluded from consideration while building the tree.
Scroll-linked effects
the proposals currently under consideration are: web animations: a new api for precisely controlling web animations in javascript, with an additional proposal to map scroll position to time and use that as a timeline for the animation.
TimerFirings logging
fn timer (one_shot): [content] http://widgets.outbrain.com/outbrain.js:20:330 186 fn timer (one_shot): nsbrowserstatusfilter::timeouthandler 138 fn timer (one_shot): [content] https://self-repair.mozilla.org/repair/:7:13669 118 fn timer (one_shot): [content] http://a.visualrevenue.com/vrs.js:6:9423 108 fn timer (slack): layeractivitytracker 104 fn timer (slack): nsidocument::selectorcache 104 fn timer (slack): cctimerfired ...
A brief guide to Mozilla preferences
this method is considered user-hostile.
Patches and pushes
it can be considered a bit complicated at first, but after you do it the first time, it gets easier and easier after that :-) ...
Productization guide
for example, a search provider can deliver a very good quality of search results — but only in a specific country or language, and we have to take this into account when considering default search engines for a locale.
L20n HTML Bindings
consider the following source html: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> assume the following malicious translation: <save """ <input value="save" type="text"> or <a href="http://myevilwebsite.com" onclick="alert('pwnd!')" title="back to the homepage">cancel</a>.
NSPR's Position On Abrupt Thread Termination
apparently they have failed to consider the ramifications.
Optimizing Applications For NSPR
consider that the windows stack is swapped in and out with each thread switch.
Atomic Operations
since not all operating environments provide access to such functions, their performance may vary considerably.
Named Shared Memory
security considerations on unix platforms, depending on implementation, contents of the backing store for the shared memory can be exposed via the file system.
PR_CallOnce
from that time on, the client should consider the object read-only (or even opaque) and allow the runtime to manipulate its content appropriately.
PR_Interrupt
file i/o is considered instantaneous, so file i/o functions cannot be interrupted.
Building NSS
test results running all tests can take a considerable amount of time.
FIPS Mode - an explanation
whether it is hardware or software, that device will have all the cryptographic engines in it, and also will stores keys and perhaps certificates inside.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
jss is considered a fips-compliant software library since it only uses nss for any and all crypto routines.
JSS Provider Notes
the per-thread default token setting is only consulted inside getinstance().
Mozilla-JSS JCA Provider notes
the per-thread default token setting is only consulted inside getinstance().
NSS_3.12.2_release_notes.html
bug 450427: add comodo ecc certification authority certificate to nss bug 450536: remove obsolete xp_mac code bug 451024: certutil.exe crashes with segmentation fault inside pr_cleanup bug 451927: security/coreconf/winnt6.0.mk has invalid defines bug 452751: slot leak in pk11_findslotsbynames bug 452865: remove obsolete linker flags needed when libnss3 was linked with libsoftokn3 bug 454961: fix the implementation and use of pr_fgets in signtool bug 455348: change hyphens to underscores in debug_$(shell whoami).
NSS_3.12_release_notes.html
bug 429388: vfychain.main leaks memory bug 396044: warning: usage of uninitialized variable in ckfw/object.c(174) bug 396045: warning: usage of uninitialized variable in ckfw/mechanism.c(719) bug 401986: mac os x leopard build failure in legacydb bug 325805: diff considers mozilla/security/nss/cmd/pk11util/scripts/pkey a binary file bug 385151: remove the link time dependency from nss to softoken bug 387892: add entrust root ca certificate(s) to nss bug 433386: when system clock is off by more than two days, oscp check fails, can result in crash if user tries to view certificate [[@ secitem_compareitem_util] [[@ memcmp] bug 396256: certutil and pp do not print a...
NSS 3.15 release notes
please consider using secitem_reallocitemv2 in all future code.
NSS 3.29.2 release notes
bugs fixed in nss 3.29.2 nss 3.29 and 3.29.1 included a change that reduced the time that nss considered a tls session ticket to be valid.
NSS 3.39 release notes
it can be used to add a single flag to the flags= section inside the spec's nss= section.
NSS API Guidelines
these rules are derived from existing coding practices inside the security library, since consistency is more important than debates about what might look nice.
nss tech note1
in all other cases, only the first template structure passed to the decoder will be considered, even if additonal templates are passed in an array.
nss tech note2
for example, to log the softoken, use: nss_debug_pkcs11_module="nss internal pkcs #11 module" note: in the command prompt on windows, do not quote the name of the target module, otherwise the quotes are considered part of the name.
nss tech note6
if your build process modifies nss libraries in any way (for example, to strip the symbols), it should consider not doing so for the reasons cited above.
nss tech note7
rsa key pairs may be generated inside a crypto module (also known as a token).
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
operations the token does not support are considered impossible for the key to support.
Python binding for NSS
network byte order requirements when accessing the port inside a prnetaddr and simplify accessing the ipv4 vs.
NSS environment variables
before 3.0 nss_allow_weak_signature_alg boolean (any non-empty value to enable) enables the use of md2 and md4 inside signatures.
NSS tools : modutil
a complex string must not include newlines or carriage returns.outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens.
NSS tools : ssltab
-x turn on hex/ascii printing of undecoded data inside parsed ssl records.
NSS tools : ssltap
-x turn on hex/ascii printing of undecoded data inside parsed ssl records.
gtstd.html
although it is possible to use nss command line tools to operate a proper ca, these instructions do not provide nearly enough understanding of the many considerations required to competently operate a ca.
NSS_3.12.3_release_notes.html
nss_allow_weak_signature_alg boolean (any non-empty value to enable) enables the use of md2 and md4 hash algorithms inside signatures.
NSS Tools modutil
a complex string must notinclude newlines or carriage returns.) outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens.
NSS Tools pk12util
three of the options, -i, -o, and -l, should be considered commands of the pk12util invocation.
NSS Tools ssltap
-x turn on hex/ascii printing of undecoded data inside parsed ssl records.
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
a complex string must not include newlines or carriage returns.outside of complex strings, all white space (for example, spaces, tabs, and carriage returns) is considered equal and is used only to delimit tokens.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
-x turn on hex/ascii printing of undecoded data inside parsed ssl records.
Network Security Services
#11 for nss the strings nss uses to load pkcs #11 modules pkcs #11 faq using the jar installation manager to install a pkcs #11 cryptographic module pkcs #11 conformance testing - archived version ca certificates pre-loaded into nss mozilla ca certificate policy list of pre-loaded ca certificates consumers of this list must consider the trust bit setting for each included root certificate.
Necko Architecture
one of the arguments to the ondataavailable() notification is an nsiinputstream (which can be considered the underlying data).
Necko walkthrough
but the interface for clients of necko is important to consider: send request uri helps creates channel setup channel (headers, request data, response callback...) channel->asyncopen.
Rhino scopes and contexts
for a more concrete example, let's consider the following script: var g = 7; function f(a) { var v = 8; x = v + a; } f(6); we have a top-level variable g, and the call to f will create a new top-level variable x.
SpiderMonkey compartments
spidermonkey simply assumes that all objects referenced from outside the compartment are live, and then walks the object graph inside the compartment.
Creating JavaScript jstest reftests
for example, reportcompare sometimes considers numbers to be the same if they are "close enough" to each other, even if the == operator would return false.
GC Rooting Guide
consider: jsobject* somefunction(jscontext* cx) { js::rooted<jsobject*> obj(cx, foo()); eventlogger logger(cx); ...code...
Garbage collection
now consider allocations.
Tracing JIT
if the hit count of a particular pc reaches a threshold value, the target is considered hot.
SpiderMonkey Internals
in general, both functions inside spidermonkey and jsapi callback functions signal errors by calling js_reporterror or one of its variants, or js_setpendingexception, and returning js_false or null.
JSExtendedClass.wrappedObject
a wrapper object that wraps an array is considered an array for the purpose of array.prototype.concat and array.concat (which treat array arguments differently from other arguments, per ecma 262-3 §15.4.4.4).
JSNewResolveOp
jsresolve_with obsolete since javascript 1.8.8 the lookup is occurring for a name evaluated inside a with statement.
JSObjectOps.defaultValue
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.defineProperty
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.destroyObjectMap
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.dropProperty
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.enumerate
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.getAttributes
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.getProperty
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.getRequiredSlot
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.lookupProperty
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.newObjectMap
this documentation should be considered spidermonkey internals documentation, not api documentation.
JSObjectOps.setProto
this documentation should be considered spidermonkey internals documentation, not api documentation.
JS_ConvertArguments
this function also takes in consideration any additional custom types defined on cx using js_addargumentformatter.
JS_GetGCParameter
jsgc_high_frequency_time_limit / "highfrequencytimelimit" gcs less than this far apart in time will be considered 'high-frequency gcs'.
JS_GetPrivate
(but consider using js_valuetofunction instead to access it.) warning: it is dangerous to call js_getprivate on a jsobject * unless the object's jsclass is known.
JS_PushArguments
this function also takes in consideration any additional custom types defined in cx using js_addargumentformatter.
JS_SetInterruptCallback
important note: additional callbacks can occur inside the callback handler if it re-enters the js engine.
JS_SetOperationCallback
important note: additional callbacks can occur inside the callback handler if it re-enters the js engine.
JS_SetOptions
mxr id search for jsoption_no_script_rval jsoption_unrooted_global added in spidermonkey 1.8.1 instructs the garbage collector not to consider the context's global object a root.
JS_SetParent
(for some function objects, the parent chain is also used to implement lexical scoping, but this should be considered an implementation detail.) ordinarily an application sets a new object's parent by passing the parent object to js_newobject, and that is the preferred approach.
Parser API
note that declarations are considered statements; this is because declarations can appear in any statement context in the language recognized by the spidermonkey parser.
SpiderMonkey 1.8.8
the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd.
SpiderMonkey 17
the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd.
SpiderMonkey 24
the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd.
Running Automated JavaScript Tests
the test is considered to pass if the exit code of the js shell is zero (i.e., js didn't crash and there were no js errors).
SavedFrame
including and excluding chrome frames consider the following savedframe stack.
Shell global objects
if shouldignoreselfhosted is given, control whether self-hosted frames are considered when checking principals.
Split object
inner and outer objects are in certain other respects the same object: if object.hasownproperty is called on an inner object, and the named property is found on an outer object, that's considered close enough and hasownproperty returns true.
Web Replay
a simpler way of telling that a redirection is needed for a function is that the replay tests crash inside it while replaying.
Gecko Roles
role_option_pane a specialized pane whose primary use is inside a dialog.
XForms Accessibility
trunk builds are not considered stable and should not be installed on top of the firefox used for daily browsing.
Life After XUL: Building Firefox Interfaces with HTML
this page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox.
History Service Design
visits inside a slushy limit (> than the hard limit) will be removed only if we are over a maximum number of pages we can retain, for performance issues.
Using the Places history service
observers generally stop updating ui when they are inside a batch, potentially making the operations faster.
FUEL
consider using the add-ons sdk instead fuel is a javascript library designed to help developers build extensions using terminology and interfaces that are familiar to them.
STEEL
consider using the functions found in appconstants.jsm or services.jsm instead steel is the scriptable thunderbird easy extension library.
Creating the Component Code
consider the following: referencing objects by id in this case, you have two implementations of the nsisupports interface.
Packaging WebLock
<!doctype html> <html> <title>weblock installation</title> <script> /* * trigger function that downloads the xpi so the * install.js file inside can be read and executed */ function installweblock() { weblock_xpi = {'weblock extension': 'weblock.xpi'}; installtrigger.install(weblock_xpi); } </script> <h1>install weblock</h1> <p><a href="#" onclick="installweblock();">install weblock</a></p> </html> distributing your component once you have the component packaged properly and the necessary installation and trigger scripts, you ...
XPCOM hashtable guide
a few examples: a hashtable that maps utf-8 origin names to a dom window - nsinterfacehashtable<nscstringhashkey, nsidomwindow> a hashtable that maps 32 bit integers to floats - nsdatahashtable<nsuint32hashkey, float> a hashtable that maps nsisupports pointers to reference counted cacheentrys - nsrefptrhashtable<nsisupportshashkey, cacheentry> a hashtable that maps jscontext pointers to a contextinfo struct - nsclasshashtable<nsptrhashkey<jscontext>, contextinfo> a hashset of strings - nsthashtable<nsstringha...
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
this is also a synchronous (blocking) operation, so if you're in javascript, consider using netutil.jsm as described below.
Interfacing with the XPCOM cycle collector
if the collector finds a group of objects that all refer back to one another, and establishes that the objects' reference counts are all accounted for by internal pointers within the group, it considers that group cyclical garbage, which it then attempts to free.
Components.interfaces
properties of the components.interfaces object are used where xpcom methods expect a parameter of type nsid.
Components.utils.evalInSandbox
the evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.
Components.utils.forceGC
note: nsidomwindowutils.garbagecollect() offers similar functionality but will trigger the cycle collector in addition to the garbage collector in the javascript engine.
Components.utils.import
gecko 2.0 adds support for loading modules from chrome: urls, even those inside jar archives.
Components object
the components object has the following members: classes array of classes by contractid classesbyid array of classes by cid constructor constructor for constructor of components exception constructor for xpconnect exceptions id constructor for xpcom nsids interfaces array of interfaces by interface name interfacesbyid array of interfaces by iid issuccesscode function to determine if a given result code is a success code lastresult result code of most recent xpconnect call manager the global xpcom component manager results array of known result codes by name returncode pending result for curr...
Architecture basics
it lets you get pointers to components inside mozilla, and it lets you talk about their interfaces as well.
XPConnect wrappers
because these are wrapped, you won't be able to peek down inside them from the console.
nsIRegistry
try { st.first(); do { var data = st.currentitem(); if( data instanceof ci.nsiregistrynode ) print("nsiregistrynode: " + data.nameutf8 + " (" + data.key + ")"); st.next(); } while( components.lastresult == 0 ); } catch(e) {} now, the output is something like: profiles (344) profiles/default (530) profiles/foo (1046) profiles/bar (1518) the number inside the parenthesis is the "key." you can use this key with the rest of the nsiregistry api (see mxr).
Language bindings
it returns a reference to the clone:components.utils.createobjectincomponents.utils.createobjectin creates a new javascript object in the scope of the specified object's compartment.components.utils.evalinsandboxthe evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.components.utils.evalinwindowthis function enables code running in a more-privileged javascript context to evaluate a string in a less-privileged javascript context.
NS_InitXPCOM2
#include "nsxpcom.h" nsresult ns_initxpcom2( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider ); parameters aresult [out] the resulting xpcom service manager.
NS_InitXPCOM3
#include "nsxpcom.h" nsresult ns_initxpcom3( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider, nsstaticmoduleinfo const* astaticmodules, pruint32 astaticmodulecount ); parameters aresult [out] the resulting xpcom service manager.
NS_ConvertASCIItoUTF16
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
NS_ConvertUTF16toUTF8
2, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
NS_ConvertUTF8toUTF16
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
NS_LossyConvertUTF16toASCII
2, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsAdoptingCString
2, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsAdoptingString
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsAutoString
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsCAutoString
eters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsCString
2, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsDependentCString
2, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsDependentString
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsEmbedString
#include "nsembedstring.h" // or: #include "nsstringglue.h" if inside gecko class nsembedstring : public nsastring { ...
nsFixedCString
2, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsFixedString
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsPromiseFlatCString
2, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsPromiseFlatString
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
RefPtr
but this is considered bad form, and may soon be made a compile-time error.
nsString
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsXPIDLCString
2, pruint32) const - source parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsXPIDLString
uint32, pruint32) const - source parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
IAccessibleRelation
refer to @ref _arrayconsideration "special consideration when using arrays" for more details.
imgIDecoderObserver
if an image is decoded on load and not visibly discarded, decode notifications are nested logically inside load notifications as one might expect.
jsdIStackFrame
these are only valid inside the jsdiexecutionhook which gave it to you.
nsIAccelerometerUpdate
xpcom/system/nsiaccelerometer.idlnot scriptable replaced by nsidevicemotionupdate 1.0 66 introduced gecko 2.0 obsolete gecko 6.0 inherits from: nsiaccelerometer last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) this method is only used in content tabs to receive nsiacceleration data from the chrome process.
GetKeyBindings
nsidomdomstringlist getkeybindings( in pruint8 aactionindex ); parameters aactionindex[in] index of the given action.
nsIAccessibleEvent
domnode nsidomnode the nsidomnode associated with the event.
nsIAccessibleRole
role_option_pane 81 a specialized pane whose primary use is inside a dialog.
nsIAppStartup
constant value description econsiderquit 0x01 attempt to quit if all windows are closed.
nsIApplicationCache
see also offline resources in firefox nsiapplicationcachenamespace nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcacheservice nsidomofflineresourcelist ...
nsIApplicationCacheChannel
see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcacheservice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIApplicationCacheContainer
see also offline resources in firefox nsiapplicationcache nsiapplicationcachechannel nsiapplicationcacheservice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIApplicationCacheNamespace
see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcacheservice nsidomofflineresourcelist ...
nsIApplicationCacheService
see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsICacheEntryDescriptor
setexpirationtime() this method sets the time at which the cache entry should be considered invalid (in seconds since the epoch).
nsICommandLine
windowcontext nsidomwindow a window to be targeted by this command line.
nsICompositionStringSynthesizer
every instance is associated with a dom window at created by nsidomwindowutils.createcompositionstringsynthesizer().
nsIContentPrefService
the result may be null (nsidatatype:vtype_empty) if the preference's value is either null, or undefined (nsidatatype:vtype_void) if there is no saved preference by the specified name.
nsIContentPrefService2
if the preference is known not to exist, the value attribute of the returned object will be undefined (nsidatatype.vtype_void()).
nsIContentSniffer
note: implementations should consider the request read-only.
nsIContentView
id nscontentviewid id that can be used in conjunction with nsidomwindowutils to change the actual document, instead of just how it is transformed; this is a 64-bit unsigned integer.
nsIControllers
tcontrollercount(); nsicontroller getcontrollerforcommand(in string command); unsigned long getcontrollerid(in nsicontroller controller); void insertcontrollerat(in unsigned long index, in nsicontroller controller); void removecontroller(in nsicontroller controller); nsicontroller removecontrollerat(in unsigned long index); attributes attribute type description commanddispatcher nsidomxulcommanddispatcher obsolete since gecko 1.9 methods appendcontroller() adds a controller to the end of the list.
nsICookiePermission
these may be relocated somewhere else if we ever consider freezing this interface.
init
this content is now available at nsidirectoryservice.init().
registerProvider
this content is now available at nsidirectoryservice.registerprovider().
unregisterProvider
this content is now available at nsidirectoryservice.unregisterprovider().
getFile
the individual platform implementation of nsidirectoryserviceprovider maps the symbolic path location passed to this function and returns the appropriate nsifile.
nsIFeed
note: you should consider this a bit mask of values; at some point, the type may include more than one of these values ored together.
nsIFile
infile does not need to be a direct child of this nsifile to be considered a descendant.
nsIGeolocationProvider
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) this must be called on the main thread interface provides location information to the nsgeolocator via the nsidomgeolocationcallback interface.
nsIGlobalHistory2
embedders should consider filtering out these schemes and others, for example mailbox:, for the main nsiuri and the referrer.
nsIIdleService
in other words, even if the user is working in other applications, the idle service will still consider the user to be active.
nsIInstallLocation
itemlocations nsidirectoryenumerator an enumeration of nsifiles for: locations that contain items potential dropped-in xpis note: this enumeration resolves text links to the directories they refer to.
nsIMsgHeaderParser
that argument is for passing in addresses that were already mentioned in other header fields.) addresses are considered to be the same if they contain the same mailbox part (case-insensitive.) real names and other comments are not compared.
nsIPluginHost
it will *always malloc()* output buffer (caller is responsible to free it) if input buffer starts with lf, which comes from 4.x spec http://developer.netscape.com/docs/manuals/communicator/plugin/pgfn2.htm#1007754 "if no custom headers are required, simply add a blank line ('\n') to the beginning of the file or buffer.", it skips that '\n' and considers rest of the input buffer as data.
nsIPrintingPrompt
inherits from: nsisupports last changed in gecko 1.7 this interface is identical to nsipintingpromptservice but without the parent nsidomwindow parameter.
nsIProtocolHandler
uri_is_local_resource 1<<12 uris for this protocol are considered to be local resources.
nsIScriptableInputStream
note: it is also important to consider how a language bindings may interpret the string data type.
nsIScrollable
this is a generic interface without concern for the type of content that may be inside.
nsIServerSocket
see nsidnsservice.myhostname() if this is what you need.
nsISupportsID
inherits from: nsisupportsprimitive last changed in gecko 1.2 method overview string tostring(); attributes attribute type description data nsidptr provides access to the native type represented by the object.
nsISupportsInterfacePointer
dataiid nsidptr stores an iid corresponding to the data attribute.
nsIThread
consider use asynchronous callbacks instead.
nsITreeColumn
element nsidomelement the treecol element.
nsIWebNavigation
document nsidomdocument retrieves the current dom document for the frame, or lazily creates a blank document if there is none.
nsIWebNavigationInfo
this lets you determine whether a mime type can be displayed as-is inside a browser, or if the browser will instead forward handling of the data to a plug-in or an external helper application.
nsIWebProgress
last changed in gecko 1.8.0 inherits from: nsisupports method overview void addprogresslistener(in nsiwebprogresslistener alistener, in unsigned long anotifymask); void removeprogresslistener(in nsiwebprogresslistener alistener); attributes attribute type description domwindow nsidomwindow the dom window associated with this nsiwebprogress instance.
nsIWorkerFactory
dom/interfaces/threads/nsidomworkers.idlscriptable creates and returns a new worker 1.0 66 introduced gecko 2.0 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface was removed in gecko 8.0.
nsIWorkerMessagePort
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents a worker thread's message port, which is used to allow the worker to post messages back to its creator.
nsIXFormsNSInstanceElement
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(80669b92-8331-4f92-aaf8-06e80e6827b3)] interface nsixformsnsinstanceelement : nsisupports { nsidomdocument getinstancedocument(); }; methods getinstancedocument nsidomdocument getinstancedocument(); getinstancedocument returns a dom document that corresponds to the instance data associated with the instance element.
nsIXFormsNSModelElement
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(85fd60c7-1db7-40c0-ae8d-f723fdd1eea8)] interface nsixformsnsmodelelement : nsisupports { nsidomnodelist getinstancedocuments(); }; methods getinstancedocuments nsidomnodelist getinstancedocuments(); getinstancedocuments returns a nsidomnodelist containing all the instance documents for the model, making it possible to enumerate over instances in the model without knowing their names.
nsIXMLHttpRequestUpload
1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description onabort nsidomeventlistener onerror nsidomeventlistener onload nsidomeventlistener onloadstart nsidomeventlistener onprogress nsidomeventlistener see also nsixmlhttprequest nsixmlhttprequesteventtarget xmlhttprequest using xmlhttprequest ...
nsIXPConnect
the jsobject is returned inside a refcounted nsixpconnectjsobjectholder.
nsIZipEntry
content/base/public/nsidomserializer.idlscriptable please add a summary to this article.
nsIZipReaderCache
s.nsizipreadercache); method overview nsizipreader getinnerzip(in nsifile zipfile, in autf8string zipentry); nsizipreader getinnerzip(in nsifile zipfile, in string zipentry); obsolete since gecko 10 nsizipreader getzip(in nsifile zipfile); void init(in unsigned long cachesize); methods getinnerzip() returns a (possibly shared) cached nsizipreader for a zip inside another zip.
nsIZipWriter
once you pick a folder, it will create a zip file inside this folder with the same name as the folder.
Setting HTTP request headers
please also note that the code itself usually is wrapped inside a exports.main = function() { ...
Storage
in both cases, you execute more than one statement inside of a transaction.
The Thread Manager
application/extension javascript should consider using a chromeworker instead.") interfaces there are several interfaces that provide threading support: nsithreadmanager the thread manager itself lets you create threads.
Getting Started Guide
consider: // don't return |nscomptr|s...
XPCOM ABI
abi naming each abi is named with a string [target_xpcom_abi] of the following format: {cpu_arch}-{target_compiler_abi} {cpu_arch} [platforms] represents the cpu architecture and may be either: x86 - i386 and higher series (including x86-64 cpus in 32-bit mode) ppc - powerpc series alpha - alpha series x86_64 - amd64/emt64 series in 64-bit mode (32-bit mode is still considered x86) sparc - sparc series ia64 - itanium series {target_compiler_abi}[platforms] represents the compiler abi and may be either: msvc - microsoft visual c++ n32 - irix 6 c++ compiler gcc2 - gnu c++ compiler 2.x gcc3 - gnu c++ compiler 3.x or 4.x sunc - sun c++ compiler ibmc - ibm c++ compiler for example: firefox built with the gnu c++ compiler 4.0.0 for the intel pentium proc...
nsCOMPtr versus RefPtr
the downside of this inheritance is that do_queryobject requires an extra virtual call to operator() in the helper method.
Xptcall Porting Status
i consider it "done".
XSLT 2.0
saxon-b the extension demonstrates how one can use liveconnect code to communicate with the saxon-b library, but one might find the javascript code module approach used inside the extension xquseme as a more reusable approach.
Mozilla technologies
goal is to remove webshell and switch over entirely to docshell.embedded dialog apifeed content access apifirefox 2 and thunderbird 2 introduce a series of interfaces that make it easy for extension authors to access rss and atom feeds.life after xul: building firefox interfaces with htmlthis page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox.morkmork is a database file format invented by david mccusker for the mozilla code since the original netscape database information was proprietary and could not be released open source.
Cached compose window FAQ
the downsides are that we have had some bugs, it complicates and bloats the code, and it requires more testing.
DB Views (message lists)
these are the values filed in nsidbfolderinfo to remember the view settings for the folder.
Index
the downsides are that we have had some bugs, it complicates and bloats the code, and it requires more testing.
Mail and RDF
an example of how this might work inside the datasource: var msgcountarc = rdf.getresource("http://home.netscape.com/nc-rdf#totalmessages"); function gettarget(target, property, unused) { var folder = target.queryinterface(components.interfaces.nsimsgfolder); if (property == msgcountarc) { var msgcount = folder.gettotalmessages(false); var result = rdf.getliteral(msgcount.tostring()); ...
Mail composition back end
pizzarro <rhp@netscape.com> contents overview sending messages nsimsgsend sending listener interfaces nsimsgsendlistener nsimsgcopyservicelistener copy operations copy to sent folder drafts templates "send later" sending unsent messages sending unsent messages listener quoting sample programs overview i've done considerable work in the past few weeks reorganizing the mail composition back end, so i thought it would be helpful to put together a small doc on the new interfaces and how one can use them.
Thunderbird Binaries
note: while beta builds have had some testing, they should be considered preview only and should not be used in a production environment.
Thunderbird Configuration Files
if you don't already have one, consider running the following code in a terminal.
Creating a Custom Column
looking in messenger.xul reveals that the columns reside inside a tree with the id "threadtree" whose columns (treecols) reside in "threadcols".
Use SQLite
this will create an sqlite db named tbird.sqlite inside your profile directory with a table called attachments.
customDBHeaders Preference
as you follow along the step-by-step guide in creating a custom column, you may want to consider a preference setting that exposes custom header data for use in a custom column within thunderbird's main view.
Thunderbird extensions
tocols mailnews filters error reporting tools steel library (obsolete as of thunderbird 52, use https://github.com/protz/thunderbird-stdlib) developing new account types useful newsgroup discussions (anything that's very old should be regarded suspiciously, because there has been significant api rewrite over the past years making most techniques considerably easier) thunderbird api docs (mostly a collection of out-of-date pages, relevance is rather dubious) general links finding the code for a feature mozillazine articles on thunderbird community / communications thunderbird specific : add-ons section on developer.thunderbird.net thunderbird communication channels add-o...
Add to iPhoto
you can download the extension and poke through the code inside it if you'd like to see all of it.
Using Objective-C from js-ctypes
while ([synth isspeaking]) {} [synth release]; return 0; } save this file as test.m, and run with the following command, inside the same directory as the saved file (needs xcode).
Declaring and Using Callbacks
consider the following code: function myjscallback(foo, bar) { ....
Standard OS Libraries
wayland is not considered stable, but it's supposed to replace xorg in the long term.
StructType
if this isn't specified, the structure is considered opaque and you can't access its contents directly.
Mozilla
for example, a search provider can deliver a very good quality of search results — but only in a specific country or language, and we have to take this into account when considering default search engines for a locale.
Plug-in Development Overview - Plugins
consider the following example, where a media player plug-in can be controlled with an advancetonextsong() method called inside the script element: <object id="myplugin" type="audio/wav" data="music.wav"> </object> <script type="application/javascript"> var theplugin = document.getelementbyid('myplugin'); if (theplugin && theplugin.advancetonextsong) theplugin.advancetonextsong(); el...
Version, UI, and Status Information - Plugins
consider using this function as part of the plug-in's smartupdate process.
Inspecting web app manifests - Firefox Developer Tools
you also need to make sure the json inside the file is of the correct format.
Browser Console - Firefox Developer Tools
if you also want to use the other web developer tools in the regular web toolbox with add-on or browser code, consider using the browser toolbox.
Set event listener breakpoints - Firefox Developer Tools
there's an issue here — the console is showing that the keypress event is being fired somewhere inside jquery.
UI Tour - Firefox Developer Tools
they will be evaluated when code execution is paused: variable tooltip hover on a variable show a tooltip with its value inside: call stack when the debugger's paused, you'll see a call stack: each level of the call stack gets a line, with the name of the function and the filename and line number.
Debugger.Source - Firefox Developer Tools
(note that code passed to eval, the function constructor, or a similar function isnot considered to be loaded from a url; the url accessor on debugger.source instances for such sources should return undefined.) if the instance refers to webassembly code, the url of the script that called new webassembly.module with the string "> wasm" appended.
Debugger-API - Firefox Developer Tools
the debugger instance itself is not really a shadow of anything in the debuggee; rather, it maintains the set of global objects which are to be considered debuggees.
All keyboard shortcuts - Firefox Developer Tools
end end end expand currently selected node right arrow right arrow right arrow collapse currently selected node left arrow left arrow left arrow (when a node is selected) move inside the node so you can start stepping through attributes.
Network request details - Firefox Developer Tools
html preview if the response is html, a preview of the rendered html appears inside the response tab, above the response payload.
Examine and edit HTML - Firefox Developer Tools
if a shadow dom contains a "slotted" element (an element with a slot attribute after it has been inserted inside a <slot> element — see adding flexibility with slots for an explanation of how these are used), the "slotted" element will be shown inside its corresponding <slot> element, with a "reveal" link alongside it.
Work with animations - Firefox Developer Tools
finally, if you click inside the bar at the top of the timeline, you get a scrubber that you can drag left and right to move backwards and forwards through the animation, and pinpoint exactly what's happening when.
Page inspector keyboard shortcuts - Firefox Developer Tools
end end end expand currently selected node right arrow right arrow right arrow collapse currently selected node left arrow left arrow left arrow (when a node is selected) move inside the node so you can start stepping through attributes.
Allocations - Firefox Developer Tools
this shows you all the allocations that collectively triggered this gc event: if you're seeing these problems, consider whether you can reduce the number or size of the allocations you're making here.
Frame rate - Firefox Developer Tools
to fix it, we might consider splitting it into pieces and running the pieces inside requestanimationframe, or even running the entire function in a worker.
Intensive JavaScript - Firefox Developer Tools
as long as each function is reasonably small, the browser should be able to keep inside its frame budget.
IndexedDB - Firefox Developer Tools
when you select an origin inside the indexed db storage type in the storage tree of the storage inspector, a table lists the details of all the databases present for that origin.
Local Storage / Session Storage - Firefox Developer Tools
you can edit local and session storage items by double-clicking inside cells in the table widget and editing the values they contain: you can delete local storage and session storage entries using the context menu: you can also delete local and session storage entries by selecting an item and pressing the delete or backspace key.
Style Editor - Firefox Developer Tools
other preprocessors are actively working on adding support, or considering it.
Console messages - Firefox Developer Tools
network requests with response codes in the 400-499 (client error) or 500-599 (server error) ranges are considered errors.
Web Console Helpers - Firefox Developer Tools
you can supply any of the following: a selector string to be passed to document.queryselector to locate the iframe element the iframe element itself the content window inside the iframe see working with iframes.
The JavaScript input interpreter - Firefox Developer Tools
you can supply any of the following: a selector string that will be passed to document.queryselector to locate the iframe element the iframe element itself the content window inside the iframe see working with iframes.
Firefox Developer Tools
note: the collective term for the ui inside which the devtools all live is the toolbox.
AbortController.AbortController() - Web APIs
when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below).
AbortController.abort() - Web APIs
when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below).
AbortController.signal - Web APIs
when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below).
AbortController - Web APIs
when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below).
AbortSignal - Web APIs
when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below).
AbstractRange.startContainer - Web APIs
syntax var startnode = range.startcontainer value the dom node inside which the start position of the range is found.
Animation.commitStyles() - Web APIs
it will cause the end styling state to be written to the element being animated, in the form of properties inside a style attribute.
Animation.id - Web APIs
WebAPIAnimationid
syntax var animationsid = animation.id; animation.id = newidstring; value a domstring which can be used to identify the animation, or null if the animation has no id.
AudioBufferSourceNode.playbackRate - Web APIs
consider a sound buffer containing audio sampled at 44.1 khz (44,100 samples per second).
AudioContext - Web APIs
you need to create an audiocontext before you do anything else, as everything happens inside a context.
AudioDestinationNode - Web APIs
their speakers), so you can get it hooked up inside an audio graph using only a few lines of code: var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); source.connect(gainnode); gainnode.connect(audioctx.destination); to see a more complete implementation, check out one of our mdn web audio examples, such as voice-change-o-matic or violent theremin.
AudioListener.dopplerFactor - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.forwardX - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.forwardY - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.forwardZ - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.positionX - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.positionY - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.positionZ - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.setOrientation() - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.setPosition() - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.speedOfSound - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.upX - Web APIs
WebAPIAudioListenerupX
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.upY - Web APIs
WebAPIAudioListenerupY
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener.upZ - Web APIs
WebAPIAudioListenerupZ
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioListener - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
AudioParam.exponentialRampToValueAtTime() - Web APIs
note: exponential ramps are considered more useful when changing frequencies or playback rates than linear ramps because of the way the human ear works.
AudioParam.value - Web APIs
WebAPIAudioParamvalue
consider this example: const source = new audiobuffersourcenode(...); const rate = 5.3; source.playbackrate.value = rate; console.log(source.playbackrate.value === rate); the log output will be false, because the playback rate parameter, rate, was converted to the 32-bit floating-point number closest to 5.3, which yields 5.300000190734863.
AudioWorkletProcessor.process - Web APIs
the values of the array are calculated by taking scheduled automation events into consideration.
AuthenticatorAssertionResponse.authenticatorData - Web APIs
examples var options = { challenge: new uint8array(26), // will be another value, provided by the relying party server timeout: 60000 }; navigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var authenticatordata = assertionpkcred.response.authenticatordata; // maybe try to convert the authenticatordata to see what's inside // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'authenticatordata' in that specification.
Background Tasks API - Web APIs
it's an extremely busy chunk of code, and your main javascript code may run right inside this thread along with all of this.
BaseAudioContext.createPanner() - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
BasicCardRequest - Web APIs
} once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.billingAddress - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.cardNumber - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.cardSecurityCode - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.cardholderName - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.expiryMonth - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse.expiryYear - Web APIs
}); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
BasicCardResponse - Web APIs
} once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
Blob() - Web APIs
WebAPIBlobBlob
syntax var newblob = new blob(array, options); parameters array an array of arraybuffer, arraybufferview, blob, usvstring objects, or a mix of any of such objects, that will be put inside the blob.
BluetoothDevice - Web APIs
the bluetoothdevice interface of the web bluetooth api represents a bluetooth device inside a particular script execution environment.
Body.arrayBuffer() - Web APIs
WebAPIBodyarrayBuffer
if you need to play ogg during downloading (stream it) - consider htmlaudioelement: new audio("music.ogg").play(); in getdata() we create a new request using the request() constructor, then use it to fetch an ogg music track.
CDATASection - Web APIs
the symbols < and & don’t need escaping as they normally do when inside a cdata section.
CSSPseudoElement - Web APIs
examples basic example using element.pseudo using pseudo-elements, most modern browsers will automatically add quotation marks around text inside a <q> element.
Determining the dimensions of elements - Web APIs
for example, if a 600x400 pixel element is being displayed inside a 300x300 pixel scrollbox, scrollwidth will return 600 while scrollheight will return 400.
Cache.match() - Web APIs
WebAPICachematch
inside the catch() clause, match() is used to return the correct response.
CacheStorage.keys() - Web APIs
WebAPICacheStoragekeys
return value a promise that resolves with an array of the cache names inside the cachestorage object.
CanvasRenderingContext2D.addHitRegion() - Web APIs
fillrule the algorithm by which to determine if a point is inside or outside the hit region.
CanvasRenderingContext2D.clip() - Web APIs
syntax void ctx.clip([fillrule]); void ctx.clip(path [, fillrule]); parameters fillrule the algorithm by which to determine if a point is inside or outside the clipping region.
CanvasRenderingContext2D.fill() - Web APIs
syntax void ctx.fill([fillrule]); void ctx.fill(path [, fillrule]); parameters fillrule the algorithm by which to determine if a point is inside or outside the filling region.
CanvasRenderingContext2D.fillStyle - Web APIs
the canvasrenderingcontext2d.fillstyle property of the canvas 2d api specifies the color, gradient, or pattern to use inside shapes.
CanvasRenderingContext2D.textBaseline - Web APIs
this differs from the ideographic baseline in that the ideographic baseline doesn't consider descenders.
A basic ray-caster - Web APIs
not exactly a new member of the id software family, but pretty decent considering it's a fully interpreted environment, and i didn't have to worry about memory allocation or video modes or coding inner routines in assembler or anything.
Manipulating video using canvas - Web APIs
every pixel in the frame's image data that is found that is within the parameters that are considered to be part of the green screen has its alpha value replaced with a zero, indicating that the pixel is entirely transparent.
Hit regions and accessibility - Web APIs
fallback content the content inside the <canvas> ...
Optimizing canvas - Web APIs
pre-render similar primitives or repeating objects on an offscreen canvas if you find yourself repeating some of the same drawing operations on each animation frame, consider offloading them to an offscreen canvas.
Transformations - Web APIs
also if you're translating inside a loop and don't save and restore the canvas state, you might end up missing part of your drawing, because it was drawn outside the canvas edge.
Using images - Web APIs
using backdrops can make your script considerably smaller because we can avoid the need for code to generate the background.
Clients.claim() - Web APIs
WebAPIClientsclaim
example the following example uses claim() inside service worker's "activate" event listener so that clients loaded in the same scope do not need to be reloaded before their fetches will go through this service worker.
Console API - Web APIs
by far the most commonly-used method is console.log, which is used to log the current value contained inside a specific variable.
CredentialsContainer.store() - Web APIs
the store() method of the credentialscontainer stores a set of credentials for the user inside a credential instance, returning this in a promise.
CredentialsContainer - Web APIs
credentialscontainer.store()secure context stores a set of credentials for a user, inside a provided credential instance and returns that instance in a promise.
CustomElementRegistry.define() - Web APIs
.attachshadow({mode: 'open'}); // create spans var wrapper = document.createelement('span'); wrapper.setattribute('class','wrapper'); var icon = document.createelement('span'); icon.setattribute('class','icon'); icon.setattribute('tabindex', 0); var info = document.createelement('span'); info.setattribute('class','info'); // take attribute content and put it inside the info span var text = this.getattribute('text'); info.textcontent = text; // insert icon var imgurl; if(this.hasattribute('img')) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } var img = document.createelement('img'); img.src = imgurl; icon.appendchild(img); // create some css to apply to the shadow dom ...
DOMHighResTimeStamp - Web APIs
the time origin the time origin is a standard time which is considered to be the beginning of the current document's lifetime.
DOMMatrix - Web APIs
WebAPIDOMMatrix
this interface should be available inside web workers, though some implementations don't allow it yet.
DOMMatrixReadOnly - Web APIs
this interface should be available inside web workers, though some implementations doesn't allow it yet.
DOMTokenList.forEach() - Web APIs
we when retrieve an iterator containing the values using foreach(), writing each one to the <span>'s node.textcontent inside the foreach() inner function.
DataTransferItemList.length - Web APIs
the drag item list is considered to be disabled if the item list's datatransfer object is not associated with a drag data store.
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.
DedicatedWorkerGlobalScope: message event - Web APIs
messageevent event handler property onmessage examples this code creates a new worker and sends it a message using worker.postmessage(): const worker = new worker("static/scripts/worker.js"); worker.addeventlistener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); the worker can listen for this message using addeventlistener(): // inside static/scripts/worker.js self.addeventlistener('message', (event) => { console.log(`received message from parent: ${event.data}`); }); alternatively, it could listen using the onmessage event handler property: // static/scripts/worker.js self.onmessage = (event) => { console.log(`received message from parent: ${event.data}`); }; specifications specification status ...
DedicatedWorkerGlobalScope: messageerror event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessageerror examples listen for messageerror using addeventlistener(): // inside worker.js self.addeventlistener('messageerror', (event) => { self.postmessage('error receiving message'); console.error(event); }); the same, but using the onmessageerror event handler property: // inside worker.js self.onmessageerror = (event) => { self.postmessage('error receiving message'); console.error(event); }; specifications specification status html living standard living standard ...
DedicatedWorkerGlobalScope.name - Web APIs
example if a worker is created using a constructor with a name option: var myworker = new worker("worker.js", { name : "myworker" }); the dedicatedworkerglobalscope will now have a name of "myworker", returnable by running self.name from inside the worker.
DisplayMediaStreamConstraints.audio - Web APIs
the audio track is always considered optional.
Document.applets - Web APIs
WebAPIDocumentapplets
removal is being considered in webkit and edge.
Document.characterSet - Web APIs
users can override the developer-specified encoding inside the content-type header or inline like <meta charset="utf-8">, such as with firefox's view → text encoding menu.
Document.createProcessingInstruction() - Web APIs
obsolete added note that the namespace of the target name is not checked whether it is well-formed, defined what is considered an illegal character for the target name and specified the returned processinginstruction object more precisely.
Document.createTouch() - Web APIs
consequently, these parameters should be considered deprecated and not used.
Document.domain - Web APIs
WebAPIDocumentdomain
exceptions securityerror an attempt has been made to set domain under one of the following conditions: the document is inside a sandboxed <iframe> the document has no browsing context the 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...
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
for example, if you know the content you are looking for is somewhere inside the body tag, you can use this: document.evaluate(".//h2", document.body, null, xpathresult.any_type, null); notice in the above document.body has been used as the context instead of document so the xpath starts from the body element.
Document.getElementsByClassName() - Web APIs
examples get all elements that have a class of 'test': document.getelementsbyclassname('test') get all elements that have both the 'red' and 'test' classes: document.getelementsbyclassname('red test') get all elements that have a class of 'test', inside of an element that has the id of 'main': document.getelementbyid('main').getelementsbyclassname('test') get the first element with a class of 'test', or undefined if there is no matching element: document.getelementsbyclassname('test')[0] we can also use methods of array.prototype on any htmlcollection by passing the htmlcollection as the method's this value.
Document.hasFocus() - Web APIs
WebAPIDocumenthasFocus
the hasfocus() method of the document interface returns a boolean value indicating whether the document or any element inside the document has focus.
Document.hidden - Web APIs
WebAPIDocumenthidden
the document.hidden read-only property returns a boolean value indicating if the page is considered hidden or not.
Document: keypress event - Web APIs
<p>press inside this iframe first to focus it, then try pressing keys on the keyboard.</p> <p id="log"></p> const log = document.getelementbyid('log'); document.addeventlistener('keypress', logkey); function logkey(e) { log.textcontent += ` ${e.code}`; } onkeypress equivalent document.onkeypress = logkey; specifications specification status ui events working draft ...
Document.open() - Web APIs
WebAPIDocumentopen
for example: all event listeners currently registered on the document, nodes inside the document, or the document's window are removed.
Document.querySelector() - Web APIs
here, the first <input> element with the name "login" (<input name="login"/>) located inside a <div> whose class is "user-panel main" (<div class="user-panel main">) in the document is returned: var el = document.queryselector("div.user-panel.main input[name='login']"); negation as all css selector strings are valid, you can also negate selectors: var el = document.queryselector("div.user-panel:not(.main) input[name='login']"); this will select an input with a parent div with the ...
Document.referrer - Web APIs
WebAPIDocumentreferrer
inside an <iframe>, the document.referrer will initially be set to the same value as the href of the parent window's window.location.
Document.timeline - Web APIs
WebAPIDocumenttimeline
note: a document timeline that is associated with a non-active document is also considered to be inactive.
Document.tooltipNode - Web APIs
defined in nsidomxuldocument.idl.
Document.visibilityState - Web APIs
'prerender' the page content is being prerendered and is not visible to the user (considered hidden for purposes of document.hidden).
DocumentOrShadowRoot.elementFromPoint() - Web APIs
if you need to find the specific position inside the element, use document.caretpositionfrompoint().
How to create a DOM tree - Web APIs
dynamically creating a dom tree consider the following xml document: <?xml version="1.0"?> <people> <person first-name="eric" middle-initial="h" last-name="jung"> <address street="321 south st" city="denver" state="co" country="usa"/> <address street="123 main st" city="arlington" state="ma" country="usa"/> </person> <person first-name="jed" last-name="brown"> <address street="321 north st" city="atlanta" state="ga" country="usa"/> <address street="123 west st" city="seattle" state="wa" country="usa"/> <address street="321 south avenue" city...
Introduction to the DOM - Web APIs
there are also some common terminology considerations to keep in mind.
Document Object Model (DOM) - Web APIs
it is uncertain whether some may be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided: documenttouch domconfiguration domerrorhandler domimplementationlist domimplementationregistry domimplementationsource domlocator domobject domsettabletokenlist domuserdata elementtraversal entity entityreference namelist notation typeinfo userdatahandler html dom a document containing html is described ...
EcdsaParams - Web APIs
warning: sha-1 is also supported here but the sha-1 algorithm is considered vulnerable and should no longer be used.
EffectTiming.duration - Web APIs
consider using "auto" rather than 0 if that makes sense.
EffectTiming.endDelay - Web APIs
the animation's end time—the time at which an iteration is considered to have finished—is the time at which the animation finishes an iteration (its initial delay, animationeffecttimingreadonly.delay, plus its duration,duration, plus its end delay.
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
that css looks like this: #box { width: 200px; height: 200px; left: 50px; top: 50px; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; } all this does is specify the size, border, and color information, as well as indicate that the box should be centered both vertically and horizontally inside its container.
Element.animate() - Web APIs
WebAPIElementanimate
for example, consider this simple animation — the keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only specified the end state of the animation, and the beginning state is implied.
Element.getAttributeNode() - Web APIs
the attr node inherits from node, but is not considered a part of the document tree.
Element: keydown event - Web APIs
omposition, do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keydown", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keydown example this example logs the keyboardevent.code value whenever you press down a key inside the <input> element.
Element: keyup event - Web APIs
rt of composition, do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keyup", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keyup example this example logs the keyboardevent.code value whenever you release a key inside the <input> element.
Element: mousemove event - Web APIs
the mousemove event is fired at an element when a pointing device (usually a mouse) is moved while the cursor's hotspot is inside it.
Element: mouseup event - Web APIs
the mouseup event is fired at an element when a button on a pointing device (such as a mouse or trackpad) is released while the pointer is located inside it.
Element.scroll() - Web APIs
WebAPIElementscroll
the scroll() method of the element interface scrolls the element to a particular set of coordinates inside a given element.
Element.scrollTo() - Web APIs
WebAPIElementscrollTo
the scrollto() method of the element interface scrolls to a particular set of coordinates inside a given element.
ElementCSSInlineStyle.style - Web APIs
setting styles styles should not be set by assigning a string directly to the style property (as in elt.style = "color: blue;"), since it is considered read-only, as the style attribute returns a cssstyledeclaration object which is also read-only.
Comparison of Event Targets - Web APIs
there are five targets to consider: property defined in purpose event.target dom event interface the dom element on the lefthand side of the call that triggered this event, eg: element.dispatchevent(event) event.currenttarget dom event interface the eventtarget whose eventlisteners are currently being processed.
Event.composed - Web APIs
WebAPIEventcomposed
https://mdn.github.io/web-components-examples/composed-composed-path/, window ] whereas the <closed-shadow> element's composed path is a follows: array [ closed-shadow, body, html, htmldocument https://mdn.github.io/web-components-examples/composed-composed-path/, window ] in the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary.
Event.composedPath() - Web APIs
https://mdn.github.io/web-components-examples/composed-composed-path/, window ] whereas the <closed-shadow> element's composed path is a follows: array [ closed-shadow, body, html, htmldocument https://mdn.github.io/web-components-examples/composed-composed-path/, window ] in the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary.
Event.explicitOriginalTarget - Web APIs
defined in /dom/public/idl/events/nsidomnsevent.idl this event property is not defined in the w3.org dom level 2 events ...
Event.originalTarget - Web APIs
defined in /dom/public/idl/events/nsidomnsevent.idl this event property is not defined in the w3.org dom level 2 events ...
ExtendableEvent() - Web APIs
currently no possible options exist inside the spec, but this has been defined for forward compatibility across the different derived events.
ExtendableMessageEvent.data - Web APIs
examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
ExtendableMessageEvent.lastEventId - Web APIs
examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
ExtendableMessageEvent.origin - Web APIs
examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
ExtendableMessageEvent.ports - Web APIs
examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
ExtendableMessageEvent.source - Web APIs
examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
File.File() - Web APIs
WebAPIFileFile
syntax new file(bits, name[, options]); parameters bits an array of arraybuffer, arraybufferview, blob, usvstring objects, or a mix of any of such objects, that will be put inside the file.
FileReaderSync - Web APIs
this method is deprecated, consider using readasarraybuffer() instead.
FileSystemDirectoryEntry.getDirectory() - Web APIs
{ let reader = new filereader(); reader.addeventlistener("loadend", function() { dictionary = json.parse(reader.result); }); reader.readastext(dictfile); }); }); }); } the loaddictionaryforlanguage() function starts by using getdirectory() to obtain the filesystemdirectoryentry object representing a subfolder named "dictionaries" located inside the specified app data directory.
FileSystemDirectoryEntry.getFile() - Web APIs
{ let reader = new filereader(); reader.addeventlistener("loadend", function() { dictionary = json.parse(reader.result); }); reader.readastext(dictfile); }); }); }); } the loaddictionaryforlanguage() function starts by using getdirectory() to obtain the filesystemdirectoryentry object representing a subfolder named "dictionaries" located inside the specified app data directory.
FileSystemEntry.copyTo() - Web APIs
errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it.
FileSystemEntry.getParent() - Web APIs
the parent of the root directory is considered to be the root directory, itself, so be sure to watch for that.
FileSystemEntry.moveTo() - Web APIs
errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as moving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it.
FileSystemFileEntry - Web APIs
inside the success callback, event handlers are set up to handle the error error and writeend events.
File and Directory Entries API - Web APIs
the synchronous api is intended to be used inside a worker and will return the values you desire.
Using FormData Objects - Web APIs
you can also append a file or blob directly to the formdata object, like this: data.append("myfile", myblob, "filename.txt"); when using the append() method it is possible to use the third optional parameter to pass a filename inside the content-disposition header that is sent to the server.
FormData.append() - Web APIs
WebAPIFormDataappend
the append() method of the formdata interface appends a new value onto an existing key inside a formdata object, or adds the key if it does not already exist.
FormData.set() - Web APIs
WebAPIFormDataset
the set() method of the formdata interface sets a new value for an existing key inside a formdata object, or adds the key/value if it does not already exist.
GeolocationPosition.coords - Web APIs
it contains the location, that is longitude and latitude on the earth, the altitude, and the speed of the object concerned, regrouped inside the returned value.
GlobalEventHandlers.onclick - Web APIs
note: when using the click event to trigger an action, also consider adding this same action to the keydown event, to allow the use of that same action by people who don't use a mouse or a touch screen.
GlobalEventHandlers.onkeydown - Web APIs
example this example logs the keyboardevent.code value whenever you press down a key inside the <input> element.
GlobalEventHandlers.onkeypress - Web APIs
examples basic example this example logs the keyboardevent.code value whenever you press a key inside the <input> element.
GlobalEventHandlers.onkeyup - Web APIs
example this example logs the keyboardevent.code value whenever you release a key inside the <input> element.
msAudioDeviceType - Web APIs
syntax <audio src="sound.mp3" msaudiodevicetype="communications" /> by default, audio on your system will output to your default speakers and be considered a foreground element, meaning that the audio will play only when the element is active in the app.
inert - Web APIs
WebAPIHTMLElementinert
this can be useful when building uis such as modals where you would want to "trap" the focus inside the modal when it's visible.
HTMLFormElement: submit event - Web APIs
bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface submitevent event handler property globaleventhandlers.onsubmit note that the submit event fires on the <form> element itself, and not on any <button> or <input type="submit"> inside it.
HTMLIFrameElement.referrerPolicy - Web APIs
carefully consider the impact of this setting.
HTMLIFrameElement - Web APIs
htmliframeelement.allowpaymentrequest is a boolean indicating whether the payment request api may be invoked inside a cross-origin iframe.
Image() - Web APIs
examples var myimage = new image(100, 200); myimage.src = 'picture.jpg'; document.body.appendchild(myimage); this would be the equivalent of defining the following html tag inside the <body>: <img width="100" height="200" src="picture.jpg"> specifications specification status comment html living standardthe definition of 'image()' in that specification.
HTMLImageElement.align - Web APIs
it may be worth noting that vertical-align offers several additional options for its value; you may wish to consider these when changing your code to use it.
HTMLImageElement.longDesc - Web APIs
consider the following older html: <img src="taco-tuesday.jpg" longdesc="image-descriptions/taco-tuesday.html"> here, the longdesc is used to indicate that the user should be able to access a detailed description of the image taco-tuesday.jpg in the html file image-descriptions/taco-tuesday.html.
HTMLImageElement.srcset - Web APIs
syntax htmlimageelement.srcset = imagecandidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a comma-separated list of one or more image candidate strings to be used when determining which image resource to present inside the <img> element represented by the htmlimageelement.
HTMLImageElement.useMap - Web APIs
consider a <map> that looks like this: <map name="mainmenu-map"> <area shape="circle" coords="25, 25, 75, 75" href="/index.html" alt="return to home page"> <area shape="rect" coords="25, 25, 100, 150" href="/index.html" alt="shop"> </map> given the image map named mainmenu-map, the image which uses it should look something like the following: <img src="menubox.png" usemap="#mainmenu-map"> for a...
HTMLImageElement - Web APIs
modern html should instead simply place an <img> inside an <a> element defining the hyperlink.
HTMLInputElement.webkitdirectory - Web APIs
for example, consider this file system: photoalbums birthdays jamie's 1st birthday pic1000.jpg pic1004.jpg pic1044.jpg don's 40th birthday pic2343.jpg pic2344.jpg pic2355.jpg pic2356.jpg vacations mars pic5533.jpg pic5534.jpg pic5556.jpg pic5684.jpg...
HTMLInputElement - Web APIs
when nothing is selected, this returns the position of the text input cursor (caret) inside of the <input> element.
HTMLLIElement - Web APIs
htmllielement.value is a long indicating the ordinal position of the list element inside a given <ol>.
HTMLMediaElement.srcObject - Web APIs
until other browsers catch up, for mediasource, blob and file, consider falling back to creating a url with url.createobjecturl() and assign it to htmlmediaelement.src.
HTMLOListElement - Web APIs
this property reflects the compact attribute only, it doesn't consider the line-height css property used for that behavior in modern pages.
HTMLScriptElement.referrerPolicy - Web APIs
carefully consider the impact of this setting.
HTMLScriptElement - Web APIs
htmlscriptelement.text is a domstring that joins and returns the contents of all text nodes inside the <script> element (ignoring other nodes like comments) in tree order.
HTMLSelectElement.selectedOptions - Web APIs
an option is considered selected if it has an htmloptionelement.selected attribute.
HTMLSlotElement.assignedNodes() - Web APIs
every time the element inserted in the slot changes, we log a report to the console saying which slot has changed, and what the new node inside the slot is.
HTMLSlotElement: slotchange event - Web APIs
every time the element inserted in the slot changes, we log a report to the console saying which slot has changed, and what the new node inside the slot is.
HTMLSlotElement - Web APIs
every time the element inserted in the slot changes, we log a report to the console saying which slot has changed, and what the new node inside the slot is.
HTMLUListElement - Web APIs
this property reflects the compact attribute only, it doesn't consider the line-height css property used for that behavior in modern pages.
HTMLVideoElement.msIsStereo3D - Web APIs
msisstereo3d is a read-only property which determines whether the system considers the loaded video source to be stereo 3-d or not.
HTMLVideoElement.videoHeight - Web APIs
if the element is currently displaying the poster frame rather than rendered video, the poster frame's intrinsic size is considered to be the size of the <video> element.
HTMLVideoElement.videoWidth - Web APIs
if the element is currently displaying the poster frame rather than rendered video, the poster frame's intrinsic size is considered to be the size of the <video> element.
HTMLVideoElement - Web APIs
htmlvideoelement.msisstereo3d read only determines whether the system considers the loaded video source to be stereo 3-d or not.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
consider code such as this: customelement.prototype.getdata = url => { if (this.cache[url]) { this.data = this.cache[url]; this.dispatchevent(new event("load")); } else { fetch(url).then(result => result.arraybuffer()).then(data => { this.cache[url] = data; this.data = data; this.dispatchevent(new event("load")); }); } }; the problem introduced here is that by u...
Drag Operations - Web APIs
a drop can occur inside the same window or over another application.
Headers.append() - Web APIs
WebAPIHeadersappend
the append() method of the headers interface appends a new value onto an existing header inside a headers object, or adds the header if it does not already exist.
Headers.set() - Web APIs
WebAPIHeadersset
the set() method of the headers interface sets a new value for an existing header inside a headers object, or adds the header if it does not already exist.
HmacImportParams - Web APIs
warning: although you can technically pass sha-1 here, this is strongly discouraged as it is considered vulnerable.
IDBDatabase.onerror - Web APIs
note: consider using idbopendbrequest.onsuccess instead (see idbrequest.onsuccess, where it is inherited from).
IDBIndex.getAll() - Web APIs
WebAPIIDBIndexgetAll
the getall() method of the idbindex interface retrieves all objects that are inside the index.
IDBIndex.getAllKeys() - Web APIs
the getallkeys() method of the idbindex interface instantly retrieves the primary keys of all objects inside the index, setting them as the result of the request object.
IDBKeyRange.bound() - Web APIs
WebAPIIDBKeyRangebound
this means that the cursor will only retrieve records with keys inside that range.
IDBKeyRange.includes() - Web APIs
the includes() method of the idbkeyrange interface returns a boolean indicating whether a specified key is inside the key range.
IDBObjectStore.createIndex() - Web APIs
from inside a idbopendbrequest.onupgradeneeded handler.
IDBObjectStore - Web APIs
example this example shows a variety of different uses of object stores, from updating the data structure with idbobjectstore.createindex inside an onupgradeneeded function, to adding a new item to our object store with idbobjectstore.add.
IDBOpenDBRequest.onupgradeneeded - Web APIs
inside the event handler function you can include code to upgrade the database structure, as shown in the example below.
IDBRequest.onerror - Web APIs
what will be inside of this event?
IDBRequest.transaction - Web APIs
the transaction read-only property of the idbrequest interface returns the transaction for the request, that is, the transaction the request is being made inside.
IDBTransaction.onerror - Web APIs
note: consider using idbtransaction.onabort instead to handle non- successful completion of the transaction.
IDBTransaction - Web APIs
oke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbtransaction</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} transactions are started when the transaction is created, not when the first request is placed; for example consider this: var trans1 = db.transaction("foo", "readwrite"); var trans2 = db.transaction("foo", "readwrite"); var objectstore2 = trans2.objectstore("foo") var objectstore1 = trans1.objectstore("foo") objectstore2.put("2", "key"); objectstore1.put("1", "key"); after the code is executed the object store should contain the value "2", since trans2 should run after trans1.
Browser storage limits and eviction criteria - Web APIs
differ slightly): <profile>/storage — the main top-level directory for storages maintained by the quota manager (see below) <profile>/storage/permanent — persistent data storage repository <profile>/storage/temporary — temporary data storage repository <profile>/storage/default — default data storage repository note: after introducing storage api, the "permanent" folder can be considered obsolete; the "permanent" folder only stores indexeddb persistent-type databases.
InputEvent.inputType - Web APIs
> <li>a sample</li> <li>bulleted</li> <li>list.</li> </ul> <p>another paragraph.</p> </div> javascript const log = document.getelementbyid('log'); const editable = document.queryselector('div[contenteditable]'); editable.addeventlistener('input', loginputtype); function loginputtype(event) { log.textcontent = `input type: ${event.inputtype}`; } result try editing the text inside the <div> and see what happens.
compareVersion - Web APIs
note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry.
IntersectionObserver.root - Web APIs
the intersection of this bounding rectangle, offset by any margins specified in the options passed to the intersectionobserver() constructor, the target element's bounds, minus the bounds of every element or other object which overlaps the target element, is considered to be the visible area of the target element.
IntersectionObserver.rootMargin - Web APIs
this lets you, for example, adjust the bounds outward so that the target element is considered 100% visible even if a certain number of pixels worth of width or height is clipped away, or treat the target as partially hidden if an edge is too close to the edge of the root's bounding box.
KeyboardEvent.code - Web APIs
break; case "keya": case "arrowleft": // handle "turn left" angle -= turnrate; break; case "keyd": case "arrowright": // handle "turn right" angle += turnrate; break; } refresh(); // consume the event so it doesn't get handled twice event.preventdefault(); }, true); try it out to ensure that keystrokes go to the sample code, click inside the black game play field below before pressing keys.
KeyboardEvent.initKeyboardEvent() - Web APIs
modifierslistarg a whitespace-delineated list of modifier keys that should be considered to be active on the event's key.
Key Values - Web APIs
in the specification, they're included in other sets of keys (such as the media keys), but they are more sensibly considered to be their own category.
KeyboardEvent.location - Web APIs
possible values are: constant value description dom_key_location_standard 0 the key has only one version, or can't be distinguished between the left and right versions of the key, and was not pressed on the numeric keypad or a key that is considered to be part of the keypad.
KeyboardEvent.metaKey - Web APIs
at least as of firefox 48, the ⊞ windows key is not considered the "meta" key.
KeyframeEffect.setKeyframes() - Web APIs
for example, consider this simple animation — the keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only specified the end state of the animation, and the beginning state is implied.
LockedFile.getMetadata() - Web APIs
note that if the key is undefined, it is considered as if it were true.
MediaList - Web APIs
WebAPIMediaList
medialist.item() a getter that returns a cssomstring representing a media query as text, given the media query's index value inside the medialist.
MediaRecorder.mimeType - Web APIs
note: the term "mime type" is officially considered to be historical; these strings are now officially known as media types.
active - Web APIs
a stream is considered active if at least one of its mediastreamtracks is not in the mediastreamtrack.ended state.
MediaStreamTrack.enabled - Web APIs
the value of enabled, in essence, represents what a typical user would consider the muting state for a track, whereas the muted property indicates a state in which the track is temporarily unable to output data, such as a scenario in which frames have been lost in transit.
MediaTrackSettings - Web APIs
two devices (as identified by the deviceid) are considered part of the same group if they are from the same physical device.
Metadata.modificationTime - Web APIs
the read-only modificationtime property of the metadata interface is a date object which specifies the date and time the file system entry (or the data referenced by the entry) was last modified.a file system entry is considered to have been modified if the metadata or the contents of the referenced file (or directory, or whatever other kind of file system entry might exist on the platform in use) has changed.
msSetMediaProtectionManager - Web APIs
the mediaprotectionmanager class can be passed as an input to a media playback api or the mediaprotectionmanager property inside the tag's video or audio.
MutationObserverInit.characterData - Web APIs
note that this doesn't monitor content of an htmlelement, even if it only contains text inside, as it only monitors text nodes themselves.
NamedNodeMap - Web APIs
objects inside a namednodemap are not in any particular order, unlike nodelist, although they may be accessed by an index as in an array.
Navigator.cookieEnabled - Web APIs
note: when the browser is configured to block third-party cookies, and navigator.cookieenabled is invoked inside a third-party iframe, it returns true in safari, edge spartan and ie (while trying to set a cookie in such scenario would fail).
Navigator.mozIsLocallyAvailable() - Web APIs
ifoffline allows you to specify whether or not the offline resources cache should be checked; specify true to consider the offline resources cache.
Navigator.requestMediaKeySystemAccess() - Web APIs
consider that when deciding when to call requestmediakeysystemaccess(); you don't want those requests to happen at inconvenient times.
Node.setUserData() - Web APIs
WebAPINodesetUserData
note that such data will not be preserved when imported via node.importnode, as with node.clonenode() and node.renamenode() operations (though node.adoptnode does preserve the information), and equality tests in node.isequalnode() do not consider user data in making the assessment.
NodeList - Web APIs
WebAPINodeList
static nodelists although they are both considered nodelists, there are 2 varieties of nodelist: live and static.
Notification.close() - Web APIs
at the end of the function, it also calls close() inside a addeventlistener() function to remove the notification when the relevant content has been read on the webpage.
OVR_multiview2 - Web APIs
framebuffer_incomplete_view_targets_ovr if baseviewindex is not the same for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete.
OfflineAudioContext.startRendering() - Web APIs
at this point we create another audio context, create an audiobuffersourcenode inside it, and set its buffer to be equal to the promise audiobuffer.
OfflineAudioContext - Web APIs
at this point we create another audio context, create an audiobuffersourcenode inside it, and set its buffer to be equal to the promise audiobuffer.
PageTransitionEvent - Web APIs
the pagetransitionevent event object is available inside handler functions for the pageshow and pagehide events, fired when a document is being loaded or unloaded.
PannerNode.coneInnerAngle - Web APIs
the coneinnerangle property of the pannernode interface is a double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction.
PannerNode.distanceModel - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
PannerNode.maxDistance - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
PannerNode.panningModel - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
PannerNode.setOrientation() - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
PannerNode.setPosition() - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
PannerNode.setVelocity() - Web APIs
you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
PaymentAddress - Web APIs
"success" : "failure"; await response.complete(result); } dopaymentrequest(); once the payment flow has been triggered using paymentrequest.show() and the promise resolves successfully, the paymentresponse object available inside the fulfilled promise (instrumentresponse above) will have a paymentresponse.details property that will contain response details.
Using the Payment Request API - Web APIs
so for example, you could create a new paymentrequest instance like so: var request = new paymentrequest(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); the functions invoked inside the constructor simply return the required object parameters: function buildsupportedpaymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard'], supportedtypes: ['debit', 'credit'] } }]; } function buildshoppingcartdetails() { // hardcoded for demo purposes: return { ...
Payment Request API - Web APIs
note: the api is available inside cross-origin <iframe> elements only if they have had the allowpaymentrequest attribute set on them.
Pbkdf2Params - Web APIs
this may be one of: sha-1 sha-256 sha-384 sha-512 warning: sha-1 is considered vulnerable in most cryptographic applications, but is still considered safe in pbkdf2.
PerformanceTiming.connectEnd - Web APIs
a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated.
PerformanceTiming - Web APIs
a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated.
Performance API - Web APIs
the performance interfaces are considered high resolution because they are accurate to a thousandth of a millisecond (subject to hardware or software constraints).
Permissions API - Web APIs
the permissions property has been made available on the navigator object, both in the standard browsing context and the worker context (workernavigator — so permission checks are available inside workers), and returns a permissions object that provides access to the permissions api functionality.
PointerEvent - Web APIs
typically, this is determined by considering the pointer's location and also the visual layout of elements in a document on screen media.
RTCConfiguration.iceTransportPolicy - Web APIs
relay the ice agent only considers media relay candidates when evaluating candidates.
RTCDataChannel.onmessage - Web APIs
example this code snippet creates a peer connection, adds a data channel to it, and starts creating new <p> (paragraph) elements each time a message arrives, with the message's contents displayed inside it.
RTCDataChannel - Web APIs
the default is "blob".bufferedamount read only the read-only rtcdatachannel property bufferedamount returns the number of bytes of data currently queued to be sent over the data channel.bufferedamountlowthreshold the rtcdatachannel property bufferedamountlowthreshold is used to specify the number of bytes of buffered outgoing data that is considered "low." the default value is 0.id read only the read-only rtcdatachannel property id returns an id number (between 0 and 65,534) which uniquely identifies the rtcdatachannel.label read only the read-only rtcdatachannel property label returns a domstring containing a name describing the data channel.
RTCIceCandidate.address - Web APIs
usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the fifth field, "192.168.0.56" is the ip address in this candidate's a-line string.
RTCIceCandidate.candidate - Web APIs
the new candidate is then passed into rtcpeerconnection.addicecandidate() to add the candidate to the list of candidates for webrtc to consider using for the connection being established.
RTCIceCandidate.component - Web APIs
usage notes consider this sdp attribute line (a-line): a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host this is an ice candidate a-line, whose foundation is 4234997325.
RTCIceCandidate.foundation - Web APIs
usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the field "4234997325" is the foundation.
RTCIceCandidate.port - Web APIs
usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the port number is found in the sixth field, which is "44323".
RTCIceCandidateStats.priority - Web APIs
during ice negotiation while setting up a webrtc peer connection, the priority values reported to the remote peer by a user agent are used to determine which candidates are considered "more desirable".
RTCInboundRtpStreamStats.pliCount - Web APIs
however, the primary purpose of this message is to allow the sender to consider techniques to mitigate network performance issues.
RTCOfferOptions.iceRestart - Web APIs
note: rather than manually creating and submitting an offer with icerestart set to true, you should consider calling the rtcpeerconnection method restartice() instead.
RTCOutboundRtpStreamStats.pliCount - Web APIs
however, the primary purpose of a pli packet is to allow the rtcrtpsender for which this rtcoutboundrtpstreamstats object provides statistics to consider techniques to mitigate network performance issues.
RTCPeerConnection.addIceCandidate() - Web APIs
the specified ufrag doesn't match the ufrag field in any of the remote descriptions being considered.
RTCPeerConnection.addStream() - Web APIs
if the signalingstate is set to stable, the event negotiationneeded is sent on the rtcpeerconnection to indicate that ice negotiation must be repeated to consider the new stream.
RTCPeerConnection.close() - Web APIs
all rtcrtpsender objects are considered to be stopped once this returns (they may still be in the process of stopping, but for all intents and purposes, they're stopped).
RTCRtpEncodingParameters.maxBitrate - Web APIs
this value is computed using the standard transport independent application specific maximum (tias) bandwidth as defined by rfc 3890, section 6.2.2; this is the maximum bandwidth needed without considering protocol overheads from ip, tcp or udp, and so forth.
RTCRtpStreamStats.pliCount - Web APIs
however, the primary purpose of this message is to allow the sender to consider techniques to mitigate network performance issues.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
note: any codecs not included in codecs will not be considered during the process of negotiating a connection.
RTCRtpTransceiver - Web APIs
an rtcrtptransceiver is associated with an m-line if its mid is non-null; otherwise it's considered disassociated.
Range.commonAncestorContainer - Web APIs
to change the ancestor container of a node, consider using the various methods available to set the start and end positions of the range, such as range.setstart() and range.setend().
Range.compareNode() - Web APIs
WebAPIRangecompareNode
the possible values are: node_before (0) node starts before the range node_after (1) node ends after the range node_before_and_after (2) node starts before and ends after the range node_inside (3) node starts after and ends before the range, i.e.
Range.comparePoint() - Web APIs
offset an integer greater than or equal to zero representing the offset inside the referencenode.
Range.getBoundingClientRect() - Web APIs
this method is useful for determining the viewport coordinates of the cursor or selection inside a text box.
ResizeObserver() - Web APIs
observer a reference to the resizeobserver itself, so it will definitely be accessible from inside the callback, should you need it.
Resize Observer API - Web APIs
a callback function set up inside the constructor then runs every time the size changes, providing access to the new dimensions and allowing you to do anything you like in response to those changes.
Response.useFinalURL - Web APIs
example consider a script residing in page index.html: fetch('/test').then((r) => console.log(r.url)) test.html is being controlled by the service worker sw.js: onfetch = (e) => { e.respondwith(fetch('/page2').then((r) => { r.usefinalurl = true; return r; }) } the output will be /page2 and not /test in index.html, since setting the usefinalurl means that the response's url is not set to request's url.
RsaHashedImportParams - Web APIs
warning: although you can technically pass sha-1 here, this is strongly discouraged as it is considered vulnerable.
RsaHashedKeyGenParams - Web APIs
warning: although you can technically pass sha-1 as a value here, this is strongly discouraged as sha-1 is considered vulnerable.
SVGAnimatedString - Web APIs
you need to create svg attribute before doing anything else, everything should be declared inside this.
SVGGeometryElement.isPointInFill() - Web APIs
normal hit testing rules apply; the value of the pointer-events property on the element determines whether a point is considered to be within the fill.
SVGGeometryElement.isPointInStroke() - Web APIs
normal hit testing rules apply; the value of the pointer-events property on the element determines whether a point is considered to be within the stroke.
Using the Screen Capture API - Web APIs
security as is always the case when sharing content over a network, it's important to consider the privacy and safety implications of screen sharing.
Selection.containsNode() - Web APIs
example check for selection this snippet checks whether anything inside the body element is selected.
Selection.modify() - Web APIs
WebAPISelectionmodify
click somewhere inside the example (optionally selecting some text), and then click the button to expand the selection.
Selection.setBaseAndExtent() - Web APIs
exceptions if anchoroffset is larger than the number of child nodes inside anchornode, or if focusoffset is larger than the number of child nodes inside focusnode, an indexsizeerror exception is thrown.
Selection - Web APIs
WebAPISelection
a selection api method is called, causing a new selection to be made with the selection range inside the editing host.
Sensor APIs - Web APIs
additionally you can put object instantiation inside a try...catch block.
Server-sent events - Web APIs
these incoming messages can be treated as events + data inside the web page.
ServiceWorkerGlobalScope.onnotificationclick - Web APIs
note: trying to create a notification inside the serviceworkerglobalscope using the notification() constructor will throw an error.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
consider using another method to synchronize subscription information between your service worker and the app server, or make sure your code using fetch() is robust enough to handle cases where attempts to exchange data fail.
ServiceWorkerMessageEvent.data - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
ServiceWorkerMessageEvent.lastEventId - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
ServiceWorkerMessageEvent.origin - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
ServiceWorkerMessageEvent.ports - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
ServiceWorkerMessageEvent.source - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
ServiceWorkerMessageEvent - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
ShadowRoot.innerHTML - Web APIs
the innerhtml property of the shadowroot interface sets or returns a reference to the dom tree inside the shadowroot.
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.
SharedWorkerGlobalScope.name - Web APIs
example if a shared worker is created using a constructor with a name option: var myworker = new sharedworker("worker.js", { name : "mysharedworker" }); the sharedworkerglobalscope will now have a name of "mysharedworker", returnable by running self.name from inside the shared worker.
Slottable: assignedSlot - Web APIs
when <my-paragraph> is used in the document, the slot is populated by a slottable element by including it inside the element with a slot attribute with the value my-text.
SourceBuffer.audioTracks - Web APIs
the audiotracks read-only property of the sourcebuffer interface returns a list of the audio tracks currently contained inside the sourcebuffer.
SourceBuffer.textTracks - Web APIs
the texttracks read-only property of the sourcebuffer interface returns a list of the text tracks currently contained inside the sourcebuffer.
SourceBuffer.videoTracks - Web APIs
the videotracks read-only property of the sourcebuffer interface returns a list of the video tracks currently contained inside the sourcebuffer.
SpeechSynthesis - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
SpeechSynthesisUtterance - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), use the constructor to create a new utterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
StaticRange.startContainer - Web APIs
syntax var node = staticnode.startcontainer value the dom node inside which the start position of the range is found.
StaticRange - Web APIs
usage notes a dom range specifies a span of content in a document, potentially beginning inside one node (or element) and ending inside another one.
Storage.removeItem() - Web APIs
example the following function creates three data items inside local storage, then removes the image data item.
Storage.setItem() - Web APIs
WebAPIStoragesetItem
example the following function creates three data items inside local storage.
Streams API concepts - Web APIs
the chunks inside the stream are read by a reader — this processes the data one chunk at a time, allowing you to do whatever kind of operation you want to do on it.
Using readable streams - Web APIs
inside this method, you should include code that sets up the stream functionality, e.g.
Streams API - Web APIs
more complicated uses involve creating your own stream using the readablestream() constructor, for example to process data inside a service worker.
StylePropertyMapReadOnly.get() - Web APIs
let's start by creating a link inside a paragraph in our html, and adding a definition list which we will populate with javascript: <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a bit of css, including a custom property and an inhertable property: p { font-weight: bold; } a { --colour: red; color: var(--colour); } we use the element's computedstylemap() to return a stylepropertyma...
SubtleCrypto.digest() - Web APIs
warning: this algorithm is now considered vulnerable and should not be used for cryptographic applications.
SubtleCrypto.importKey() - Web APIs
; const pemcontents = pem.substring(pemheader.length, pem.length - pemfooter.length); // base64 decode the string to get the binary data const binaryderstring = window.atob(pemcontents); // convert from a binary string to an arraybuffer const binaryder = str2ab(binaryderstring); return window.crypto.subtle.importkey( "pkcs8", binaryder, { name: "rsa-pss", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign"] ); } subjectpublickeyinfo import this example imports an rsa public encryption key from a pem-encoded subjectpublickeyinfo object.
UIEvent.layerX - Web APIs
WebAPIUIEventlayerX
this property takes scrolling of the page into account and returns a value relative to the whole of the document unless the event occurs inside a positioned element, where the returned value is relative to the top left of the positioned element.
UIEvent.layerY - Web APIs
WebAPIUIEventlayerY
this property takes scrolling of the page into account, and returns a value relative to the whole of the document, unless the event occurs inside a positioned element, where the returned value is relative to the top left of the positioned element.
sourceCapabilities - Web APIs
a device is considered "responsible" for an event only when that interaction is part of the abstraction provided by the web platform.
ValidityState - Web APIs
valid read only a boolean that is true if the element meets all its validation constraints, and is therefore considered to be valid, or false if it fails any constraint.
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
when using the ovr_multiview2 extension, the following value can be returned additionally: ext.framebuffer_incomplete_view_targets_ovr: if baseviewindex is not the same for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete.
WebGLSampler - Web APIs
the webglsampler interface is part of the webgl 2 api and stores sampling parameters for webgltexture access inside of a shader.
A basic 2D WebGL animation example - Web APIs
this lets webgl consider any optimizations it can apply that may improve performance based on that information.
Clearing by clicking - Web APIs
note how we embed the webgl function calls inside the event handler function.
Clearing with colors - Web APIs
--> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it, // and to not mess up the global scope.
Detect WebGL - Web APIs
<p>[ here would go the result of webgl feature detection ]</p> <button>press here to detect webglrenderingcontext</button> body { text-align : center; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it.
Matrix math for the web - Web APIs
let's begin by considering the identity matrix.
Adding 2D content to a WebGL context - Web APIs
{ const numcomponents = 2; // pull out 2 values per iteration const type = gl.float; // the data in the buffer is 32bit floats const normalize = false; // don't normalize const stride = 0; // how many bytes to get from one set of values to the next // 0 = use type and numcomponents above const offset = 0; // how many bytes inside the buffer to start from gl.bindbuffer(gl.array_buffer, buffers.position); gl.vertexattribpointer( programinfo.attriblocations.vertexposition, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexposition); } // tell webgl to use our program when drawing gl.usepro...
Creating 3D objects using WebGL - Web APIs
consider: each face requires four vertices to define it, but each vertex is shared by three faces.
Using textures in WebGL - Web APIs
lors buffer is gone, replaced with this: // tell webgl how to pull out the texture coordinates from buffer { const num = 2; // every coordinate composed of 2 values const type = gl.float; // the data in the buffer is 32 bit float const normalize = false; // don't normalize const stride = 0; // how many bytes to get from one set to the next const offset = 0; // how many bytes inside the buffer to start from gl.bindbuffer(gl.array_buffer, buffers.texturecoord); gl.vertexattribpointer(programinfo.attriblocations.texturecoord, num, type, normalize, stride, offset); gl.enablevertexattribarray(programinfo.attriblocations.texturecoord); } then add code to specify the texture to map onto the faces, just before draw: // tell webgl we want to affect texture unit 0 ...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
v" offer is received by the remote peer, it calls its holdended() method: async function holdended(offer, micstream) { try { await peerconnection.setremotedescription(offer); await audiotransceiver.sender.replacetrack(micstream.getaudiotracks()[0]); audiotransceiver.direction = "sendrecv"; await sendanswer(); } catch(err) { /* handle the error */ } } the steps taken inside the try block here are: the received offer is stored as the remote description by calling setremotedescription().
Writing WebSocket servers - Web APIs
if it's 0, then the server keeps listening for more parts of the message; otherwise, the server should consider the message delivered.
Web Video Text Tracks Format (WebVTT) - Web APIs
we can also use identifiers inside webvtt file, which can be used for defining a new style for some particular cues in the file.
WebXR application life cycle - Web APIs
if your scene is complex, you should consider creating a worker—or using one that you've previously created for this purpose—to perform the computations needed for each frame to be rendered.
WebXR performance guide - Web APIs
consider the following function drawscene(gl, view, programinfo, buffers, texture, deltatime) { ...
Rendering and the WebXR frame animation callback - Web APIs
for these reasons, unless your renderer is fairly small and lightweight, with little to do, you should consider offloading everything you can to a worker so you can be computing the next frame while the browser handles other things.
Targeting and hit detection - Web APIs
consider these just editor's notes for now.
WebXR Device API - Web APIs
however, there are issues specific to creating augmented and virtual reality settings that need to be considered when writing your lighting code.
Keyframe Formats - Web APIs
for example, consider this simple animation — the keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only specified the end state of the animation, and the beginning state is implied.
Using IIR filters - Web APIs
the downside is that this involves some complex maths.
Using the Web Audio API - Web APIs
the web audio api handles audio operations inside an audio context, and has been designed to allow modular routing.
Web Bluetooth API - Web APIs
bluetoothdevice represents a bluetooth device inside a particular script execution environment.
Functions and classes available to Web Workers - Web APIs
serviceworkerregistration you can register a service worker from inside a standard worker, and use associated functionality.
Window.applicationCache - Web APIs
don't use it to offline websites — consider using service workers instead.
Window: deviceorientation event - Web APIs
this data is gathered from a magnetometer inside the device.
Window.getComputedStyle() - Web APIs
::unsupported is considered valid, even though the pseudo-element itself is not supported.
window.location - Web APIs
WebAPIWindowlocation
location.assign("http://www.mozilla.org"); // or location = "http://www.mozilla.org"; example #2: force reloading the current page from the server location.reload(true); example #3 consider the following example, which will reload the page by using the replace() method to insert the value of location.pathname into the hash: function reloadpagewithhash() { var initialpage = location.pathname; location.replace('http://example.com/#' + initialpage); } example #4: display the properties of the current url in an alert dialog: function showloc() { var olocation = location, alo...
Window.mozInnerScreenX - Web APIs
that means it can be affected by the zoom level; to compute the actual number of physical screen pixels, you should use the nsidomwindowutils.screenpixelspercsspixel property.
Window.mozInnerScreenY - Web APIs
that means it can be affected by the zoom level; to compute the actual number of physical screen pixels, you should use the nsidomwindowutils.screenpixelspercsspixel property.
Window.onbeforeinstallprompt - Web APIs
}); window.onbeforeinstallprompt = function(event) { ...}; example the following example uses the beforeinstallprompt event to make an install button operable, by using the event inside a click handler.
Obsolete features - Web APIs
forcing fullscreen onto other users is also extremely unpopular and is considered an outright rude attempt to impose web author's viewing preferences onto users.
Window.open() - Web APIs
WebAPIWindowopen
opening new windows, even with reduced features, uses considerably a lot of the user's system resources (cpu, ram) and involves considerably a lot of coding in the source code (security management, memory management, various code branchings sometimes quite complex, window frame/chrome/toolbars building, window positioning and sizing, etc.).
Window.openDialog() - Web APIs
WebAPIWindowopenDialog
inside the dialog code, you can set the properties as follows: var retvals = window.arguments[2]; retvals.address = enteredaddress; retvals.delivery = "immediate"; specification this is not part of any specification.
Window.pkcs11 - Web APIs
WebAPIWindowpkcs11
syntax objref = window.pkcs11 example window.pkcs11.addmodule(smod, secpath, 0, 0); notes see nsidompkcs11 for more information about how to manipulate pkcs11 objects.
Window.setImmediate() - Web APIs
messagechannel can be used reliably inside of web workers whereas the semantics of postmessage mean it cannot be used there.
Window.speechSynthesis - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
WindowOrWorkerGlobalScope.btoa() - Web APIs
so if you pass a string into btoa() containing characters that occupy more than one byte, you will get an error, because this is not considered binary data: const ok = "a"; console.log(ok.codepointat(0).tostring(16)); // 61: occupies < 1 byte const notok = "✓" console.log(notok.codepointat(0).tostring(16)); // 2713: occupies > 1 byte console.log(btoa(ok)); // yq== console.log(btoa(notok)); // error if you need to encode unicode text as ascii using btoa(), one option is to convert the string such that each 16-bit unit occup...
WindowOrWorkerGlobalScope.origin - Web APIs
examples executed from inside a worker script, the following snippet will log the worker's global scope's origin to the console each time it receives a message onmessage = function() { console.log(self.origin); }; if the origin is not a scheme/host/port tuple (say you are trying to run it locally, i.e.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
to call a function repeatedly (e.g., every n milliseconds), consider using setinterval().
Worker: messageerror event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessageerror examples create a worker, and listen for message and messageerror events using addeventlistener(): // inside main.js const worker = new worker("static/scripts/worker.js"); worker.addeventlistener("message", (event) => { console.error(`received message from worker: ${event}`); }); worker.addeventlistener("messageerror", (event) => { console.error(`error receiving message from worker: ${event}`); }); the same, but using the onmessageerror event handler property: // inside main.js const worker = new worker("static/scripts/worker.js"); ...
Worker - Web APIs
WebAPIWorker
not all interfaces and functions are available to scripts inside a worker.
WorkerGlobalScope.close() - Web APIs
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.
WorkerGlobalScope.dump() - Web APIs
for example, on mac os x you'd run it using something like this (assuming you are inside the applications folder): ./firefox.app/contents/macos/firefox-bin -profile /tmp -no-remote now go into about:config and enable the browser.dom.window.dump.enabled pref.
WorkerGlobalScope.importScripts() - Web APIs
example if you had some functionality written in a separate script called foo.js that you wanted to use inside worker.js, you could import it using the following line: importscripts('foo.js'); importscripts() and self.importscripts() are effectively equivalent — both represent importscripts() being called from inside the worker's inner scope.
WorkerGlobalScope.navigator - Web APIs
example if you call the following console.log(navigator); inside a worker (which would basically be the equivalent of self.console.log(self.navigator);, as these are being called on the worker scope, which can be referenced with workerglobalscope.self), you will get a workernavigator object written to the console — something like the following: object {online: true, useragent: "mozilla/5.0 (macintosh; intel mac os x 10_10_1) ap…ml, like gecko) chrome/40.0.2214.93 safari/537.
WorkerGlobalScope.onclose - Web APIs
}; example the following code snippet shows an onclose handler set inside a worker: self.onclose = function() { console.log('your worker instance has been closed'); } specifications this feature is no longer defined in any specifications.
WorkerGlobalScope.onerror - Web APIs
}; example the following code snippet shows an onerror handler set inside a worker: self.onerror = function() { console.log('there is an error inside your worker!'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.onerror' in that specification.
WorkerGlobalScope.onlanguagechange - Web APIs
}; example the following code snippet shows an onlanguagechange handler set inside a worker: self.onlanguagechange = function() { console.log('your preferred language settings have been changed'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.onlanguagechange' in that specification.
WorkerGlobalScope.onoffline - Web APIs
}; example the following code snippet shows an onoffline handler set inside a worker: self.onoffline = function() { console.log('your worker is now offline'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.onoffline' in that specification.
WorkerGlobalScope.ononline - Web APIs
}; example the following code snippet shows an ononline handler set inside a worker: self.ononline = function() { console.log('your worker is now online'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.ononline' in that specification.
WorkerGlobalScope.self - Web APIs
example if you called console.log(self); inside a worker, you will get a worker global scope of the same type as that worker object written to the console — something like the following: dedicatedworkerglobalscope { undefined: undefined, infinity: infinity, math: mathconstructor, nan: nan, intl: object…} infinity: infinity array: function array() { [native code] } arguments: null caller: null isarray: function i...
WorkerLocation - Web APIs
this interface is only visible from inside a javascript script executed in the context of a web worker.
WritableStream.WritableStream() - Web APIs
inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStream.getWriter() - Web APIs
inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStream - Web APIs
inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStreamDefaultWriter.close() - Web APIs
inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStreamDefaultWriter.write() - Web APIs
inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
WritableStreamDefaultWriter - Web APIs
inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter.
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
let error = cc["@mozilla.org/dom-error;1"].createinstance(ci.nsidomdomerror); error.wrappedjsobject.init(errname); return error; // xxx: errtype goes unused } function dumpsecurityinfo(xhr, error) { let channel = xhr.channel; try { dump("connection status:\n"); if (!error) { dump("\tsucceeded\n"); } else { dump("\tfailed: " + error.name + "\n"); } let secinfo = channel.securityinfo; // print general connect...
Sending and Receiving Binary Data - Web APIs
note: this non-standard sendasbinary method is considered deprecated as of gecko 31 (firefox 31 / thunderbird 31 / seamonkey 2.28) and will be removed soon.
XMLHttpRequest - Web APIs
if your communication needs to involve receiving event data or message data from a server, consider using server-sent events through the eventsource interface.
XMLHttpRequestResponseType - Web APIs
you shouldn't use this non-standard (and, as of firefox 68, entirely removed) api; instead, consider using the fetch api with readable streams, which offers a standard alternative to accessing the response in a streaming fashion.
XRBoundedReferenceSpace - Web APIs
these bounds are defined using an array of points, each of which defines a vertex in a polygon inside which the user is allowed to move.
XRPose.emulatedPosition - Web APIs
as such, the position is considered to be emulated, so the emulatedposition property is true.
XRReferenceSpace - Web APIs
geometry the native origin of any xrreferencespace is always configured so that +x is considered to be to the right, +y is upward, and +z is "backward" or toward the user.
XRSession.inputSources - Web APIs
keyboards, gamepads, and mice are not considered webxr input sources.
XRViewport.y - Web APIs
WebAPIXRViewporty
note: although other web apis typically consider the y axis to begin at the top and grow larger progressing downward, webgl reverses this, with y growing larger as it goes upward on the screen.
XRWebGLLayer.framebuffer - Web APIs
opaque framebuffers are considered incomplete and are not available for rendering other than while executing the requestanimationframe() callback.
Using the link role - Accessibility
e.target : e.srcelement; if (ref) { window.open(ref.getattribute('data-href'), '_blank'); } } } spanelem.addeventlistener('click', navigatelink); spanelem.addeventlistener('keydown', navigatelink); result notes if pressing the link triggers an action but does not change browser focus or navigate to a new page, you might wish to consider using the button role instead of the link role.
Using the log role - Accessibility
assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce changes inside a log when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted.
ARIA: alert role - Accessibility
<p role="alert" style="display: none;">the alert will trigger when the element becomes visible.</p> while triggering an alert via css alone is possible, it is better to rely on javascript because it has more browser/screen reader support and is often more appropriate as part of a larger user interaction such as inside an event handler or form validation.
ARIA: Comment role - Accessibility
19:29</time></p> </div> <div role="comment" id="thread-2" data-author="chris"> <h3>marcus said</h3> <p class="comment-text">the guitar solo could do with a touch more chorus, and a slightly lower volume.</p> <p><time datetime="2019-03-29t15:35">march 29 2019, 15:35</time></p> </div> nested comments nested comments are also possible with aria annotations — simply nest the comments inside one another, like so: <div role="comment" id="thread-1" data-author="chris"> <h3>chris said</h3> <p class="comment-text">i really think this moment could use more cowbell.</p> <p><time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></p> <div role="comment" data-author="marcus"> <h3>marcus replied</h3> <p class="comment-text">i don't know about that.
ARIA: Region role - Accessibility
<div role="region" aria-labelledby="please-reconsider"> <h3 id="please-reconsider">please reconsider your document structure</h3> <!-- content --> </div> in this example, the region's label is being generated by the aria-labelledby attribute.
ARIA: heading role - Accessibility
instead of using a <div> or <span> with a heading role and aria-level, consider using a native <h1> through <h6> element instead to indicate that this text is a heading, and what part of the structure it represents.
Forms - Accessibility
the following pages provide various techniques for improving the accessibility of web forms: basic form hints: adding hints and descriptions for invalid or required fields alerts: using alerts to provide client-side validation error messages multi-part labels: enabling complex form labels with a control inside each label see also the yahoo!
Accessibility: What users can do to browse more safely - Accessibility
those in the public sector who must accomodate those with special sensitivities, should consider setting aside at least one work station and becoming familiar with its personalization and accessibility settings.
Architecture - Accessibility
in addition, nsiaccessiblehyperlink is implemented on any non-text child inside a container that also has text.
Keyboard - Accessibility
note: one important exception to this rule is if the element has role="document" applied to it, inside an interactive context (such as role="application").
Operable - Accessibility
2.4.8 location within site (aaa) when on a page inside a complex site or set of steps, the user should be given an indicator of where they are in the site, for example a breadcrumb trail, sitemap or text such as "form page 2 of 10".
Understanding the Web Content Accessibility Guidelines - Accessibility
the four principles wcag is broadly broken down into four principles — major things that web content must be to be considered accessible (see understanding the four principles of accessibility for the wcag definitions).
-moz-context-properties - CSS: Cascading Style Sheets
of the fill and stroke properties, for example: <img class="img1" src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'> <rect width='100%' height='100%' stroke-width='30px' fill='context-fill red' stroke='context-stroke' fill-opacity='0.5'/></svg>"> here we've set the image src to a data uri containing a simple svg image; the <rect> inside has been made to take its fill and stroke values from the fill and stroke set on the <img> element by giving them the context-fill/context-stroke keywords in their values, along with a fallback color for the fill (red) which will be used in the case that the svg is loaded standalone in a top-level window (where it will have no context element to provide context values).
-moz-user-focus - CSS: Cascading Style Sheets
instead, xbl creates an anonymous html <input> element inside the textbox, and that element is what receives focus.
::-moz-progress-bar - CSS: Cascading Style Sheets
the ::-moz-progress-bar css pseudo-element is a mozilla extension that represents the progress bar inside a <progress> element.
::-webkit-meter-optimum-value - CSS: Cascading Style Sheets
the ::-webkit-meter-optimum-value css pseudo-element styles the <meter> element when its value is inside the low-high range.
:blank - CSS: Cascading Style Sheets
WebCSS:blank
note: the :blank selector is considered at risk, as the csswg keeps changing it.
:empty - CSS: Cascading Style Sheets
WebCSS:empty
comments, processing instructions, and css content do not affect whether an element is considered empty.
:has() - CSS: Cascading Style Sheets
WebCSS:has
/* selects any <a>, as long as it has an <img> element directly inside it */ /* note that this is not supported in any browser yet */ let test = document.queryselector('a:has(> img)'); syntax :has( <relative-selector-list> )where <relative-selector-list> = <relative-selector>#where <relative-selector> = <combinator>?
:in-range - CSS: Cascading Style Sheets
WebCSS:in-range
/* selects any <input>, but only when it has a range specified, and its value is inside that range */ input:in-range { background-color: rgba(0, 255, 0, 0.25); } this pseudo-class is useful for giving the user a visual indication that a field's current value is within the permitted limits.
:lang() - CSS: Cascading Style Sheets
WebCSS:lang
html <div lang="en"><q>this english quote has a <q>nested</q> quote inside.</q></div> <div lang="fr"><q>this french quote has a <q>nested</q> quote inside.</q></div> <div lang="de"><q>this german quote has a <q>nested</q> quote inside.</q></div> css :lang(en) > q { quotes: '\201c' '\201d' '\2018' '\2019'; } :lang(fr) > q { quotes: '« ' ' »'; } :lang(de) > q { quotes: '»' '«' '\2039' '\203a'; } result specifications specification status comme...
:not() - CSS: Cascading Style Sheets
WebCSS:not
for instance, body :not(table) a will still apply to links inside of a table, since <tr> will match with the :not() part of the selector.
:only-of-type - CSS: Cascading Style Sheets
/* selects each <p>, but only if it is the */ /* only <p> element inside its parent */ p:only-of-type { background-color: lime; } note: as originally defined, the selected element had to have a parent.
:target - CSS: Cascading Style Sheets
WebCSS:target
isn't that delightful?</p> css p:target { background-color: gold; } /* add a pseudo-element inside the target element */ p:target::before { font: 70% sans-serif; content: "►"; color: limegreen; margin-right: .25em; } /* style italic elements within the target element */ p:target i { color: red; } result pure-css lightbox you can use the :target pseudo-class to create a lightbox without using any javascript.
font-style - CSS: Cascading Style Sheets
formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | italic | oblique <angle>{0,2} examples specifying an italic font style as an example, consider the garamond font family, in its normal form, we get the following result: @font-face { font-family: garamond; src: url('garamond.ttf'); } the italicized version of this text uses the same glyphs present in the unstyled version, but they are artificially sloped by a few degrees.
@font-feature-values - CSS: Cascading Style Sheets
the @font-feature-values at-rule may be used either at the top level of your css or inside any css conditional-group at-rule.
@import - CSS: Cascading Style Sheets
WebCSS@import
description imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules.
@keyframes - CSS: Cascading Style Sheets
when a keyframe is defined multiple times if a keyframe is defined multiple times but not all affected properties are in each keyframe, all values specified in these keyframes are considered.
color - CSS: Cascading Style Sheets
WebCSS@mediacolor
for example, if a display uses 5 bits for blue and red and 6 bits for green, then the device is considered to use 5 bits per color component.
overflow-block - CSS: Cascading Style Sheets
optional-paged content that overflows the block axis can be seen by scrolling to it, but page breaks can be manually triggered (such as via break-inside, etc.) to cause the following content to display on the following page.
size - CSS: Cascading Style Sheets
WebCSS@pagesize
formal definition related at-rule@pageinitial valueautocomputed valueas specified, but with relative lengths converted into absolute lengths formal syntax <length>{1,2} | auto | [ <page-size> | [ portrait | landscape ] ] examples specifying size and orientation @page { size: 4in 6in landscape; } nesting inside a @media rule @media print { @page { size: 50mm 150mm; } } specifications specification status comment css paged media module level 3the definition of 'size' in that specification.
@page - CSS: Cascading Style Sheets
WebCSS@page
working draft no change from css level 2 (revision 1), though more css at-rules can be used inside a @page.
max-height - CSS: Cascading Style Sheets
the height will initially be set as close as possible to the initial viewport height considering the maximum height constraint.
max-width - CSS: Cascading Style Sheets
by default, the width is set as close as possible to the initial viewport considering the maximum width constraint.
min-height - CSS: Cascading Style Sheets
the height will initially be set as close as possible to the initial viewport height considering the minimum height constraint.
min-width - CSS: Cascading Style Sheets
by default, min-width is set as close as possible to the initial viewport considering the minimum width constraint.
Border-image generator - CSS: Cascading Style Sheets
ue + 'px'; }; var setpreviewareaheight = function setpreviewareaheight(value) { preview_area.style.height = value + 'px'; }; var updatedragoption = function updatedragoption(value) { if (value === true) subject.setattribute('data-draggable', 'true'); else subject.removeattribute('data-draggable'); }; var createproperty = function createproperty(topic, labelid, optionsid) { var slider = inputslidermanager.createslider(topic, positions[labelid]); var dropdown = dropdownmanager.createdropdown(topic, dropdown_unit_options[optionsid]); inputslidermanager.setsensivity(topic, 3); inputslidermanager.setprecision(topic, 1); var property = document.createelement('div'); var config = document.createelement('div'); property.classname = 'property'; ...
Resizing background images with background-size - CSS: Cascading Style Sheets
tiling a large image let's consider a large image, a 2982x2808 firefox logo image.
Using URL values for the cursor property - CSS: Cascading Style Sheets
javascript, css animation, and declarative smil inside an svg image are ignored; you can't use svg to create an animated cursor, for example.
CSS Multi-column Layout - CSS: Cascading Style Sheets
reference multiple-column layout properties column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns related css fragmentation properties break-after break-before break-inside orphans widows guides basic concepts of multicol an overview of the multiple-column layout specification styling columns how to use column rules and manage the spacing between columns.
CSS Display - CSS: Cascading Style Sheets
reference css properties display css data types <display-outside> <display-inside> <display-listitem> <display-box> <display-internal> <display-legacy> guides css flow layout (display: block, display: inline) block and inline layout in normal flow flow layout and overflow flow layout and writing modes formatting contexts explained in flow and out of flow display: flex basic concepts of flexbox aligning items in a flex container controlling ratios of flex items along the main axis cross-browser flexbox mixins mastering wrapping of flex items ordering flex items relationship of flexbox to other layo...
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
proper gaps only happen on the inside edges of items.
Flow Layout and Overflow - CSS: Cascading Style Sheets
using a value of auto will display the content with no scrollbars if the content fits inside the box.
In Flow and Out of Flow - CSS: Cascading Style Sheets
taking an item out of flow all elements are in-flow apart from: floated items items with position: absolute (including position: fixed which acts in the same way) the root element (html) out of flow items create a new block formatting context (bfc) and therefore everything inside them can be seen as a mini layout, separate from the rest of the page.
OpenType font features guide - CSS: Cascading Style Sheets
the font features there are a number of different features to consider.
Variable fonts guide - CSS: Cascading Style Sheets
working with older browsers variable font support can be checked with css feature queries (see @supports), so it's possible to use variable fonts in production and scope the css calling the variable fonts inside a feature query block.
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
these are created if you have a string of text inside your grid container, that is not wrapped in any other element.
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
inside the feature query, we can then write any css we need to apply our modern layout, and remove anything required for the older layout.
Grid template areas - CSS: Cascading Style Sheets
olor: #ffd8a8; padding: 1em; color: #d9480f; } .header { grid-area: hd; } .footer { grid-area: ft; } .content { grid-area: main; } .sidebar { grid-area: sd; } .wrapper { display: grid; grid-auto-rows: minmax(100px, auto); grid-template-columns: 1fr; grid-template-areas: "hd" "main" "sd" "ft"; } we can then redefine that layout inside media queries to go to our two columns layout, and perhaps take it to a three column layout if the available space is even wider.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
inside our grid container i have four child elements.
Logical properties for floating and positioning - CSS: Cascading Style Sheets
in the below example i have used the inset-block-start and inset-inline-end properties to position the blue box using absolute positioning inside the area with the grey dotted border, which has position: relative.
CSS Paged Media - CSS: Cascading Style Sheets
WebCSSCSS Pages
reference css properties page-break-after page-break-before page-break-inside at-rules @page pseudo-classes :blank :first :left :right specifications specification status comment css paged media module level 3 working draft css fragmentation module level 3 candidate recommendation css level 2 (revision 1) recommendation ...
Stacking context example 1 - CSS: Cascading Style Sheets
inside div #1 there is an absolutely positioned div #2, while in div #3 there is an absolutely positioned div #4, both without z-index properties.
Stacking context example 2 - CSS: Cascading Style Sheets
what can be considered strange is that div #2 (z-index: 2) is above div #4 (z-index: 10), despite their z-index values.
Stacking context example 3 - CSS: Cascading Style Sheets
the second-level menu is absolutely positioned inside the parent element.
Understanding CSS z-index - CSS: Cascading Style Sheets
in the most basic cases, html pages can be considered two-dimensional, because text, images, and other elements are arranged on the page without overlapping.
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
therefore, use of mandatory should be carefully considered and only used in situations where you know how much content is on the screen at any one time.
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
in this article, we consider questions that might arise related to compatibility across browsers and versions of browsers when adding support for scroll-snap to your web site or app.
CSS Scrollbars - CSS: Cascading Style Sheets
accessibility concerns when you customize scrollbars, consider they have enough contrast and that their hit area is large enough for people who use touch input.
Basic Shapes - CSS: Cascading Style Sheets
this type uses functional notation: the type of shape is followed by brackets, inside of which are additional values used to describe the shape.
Shapes from box values - CSS: Cascading Style Sheets
this shape follows all of the normal border radius shaping rules for the inside of the border.
Inline formatting context - CSS: Cascading Style Sheets
in the example below, the two (<div>) elements with the black borders form a block formatting context, inside which each word participates in an inline formatting context.
Column layouts - CSS: Cascading Style Sheets
a single row of items with equal heights — flexbox flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column.
Using media queries - CSS: Cascading Style Sheets
for example, the styles nested inside the following query will never be used, because no speech-only device has a screen aspect ratio: @media speech and (aspect-ratio: 11/5) { ...
Media queries - CSS: Cascading Style Sheets
(this is only valid inside <picture> elements.) in the <style> element's media attribute, they define the media to which the style should be applied.
Selector list - CSS: Cascading Style Sheets
#main, .content, article { font-size: 1.1em; } selector list invalidation a downside to using selector lists is that the following aren't equivalent: h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } h1, h2:maybe-unsupported, h3 { font-family: sans-serif } this is because a single unsupported selector in a selector list invalidates the whole rule.
Shorthand properties - CSS: Cascading Style Sheets
this sets the color of the <a> element nested inside to inherit.
Value definition syntax - CSS: Cascading Style Sheets
a component can be a keyword, some characters considered as a literal, or a value of a given css data type or of another css property.
align-self - CSS: Cascading Style Sheets
in grid, it aligns the item inside the grid area.
<alpha-value> - CSS: Cascading Style Sheets
examples setting text color opacity here an alpha value is used to set partially transparent text: /* <rgba()> */ color: rgba(34, 12, 64, 0.6); color: rgba(34.0 12 64 / 60%); setting shape image threshold here an alpha value is used to determine which parts of an image are considered part of a shape: /* shape-image-threshold */ shape-image-threshold: 70%; shape-image-threshold: 0.7; specifications specification status comment css color module level 4the definition of '<alpha-value>' in that specification.
animation-duration - CSS: Cascading Style Sheets
some early, prefixed, implementations may consider them as identical to 0s.
animation - CSS: Cascading Style Sheets
WebCSSanimation
consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences.
attr() - CSS: Cascading Style Sheets
WebCSSattr
currentcolor url <url> the attribute value is parsed as a string that is used inside a css url() function.
background-clip - CSS: Cascading Style Sheets
it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <box>#where <box> = border-box | padding-box | content-box examples html <p class="border-box">the background extends behind the border.</p> <p class="padding-box">the background extends to the inside edge of the border.</p> <p class="content-box">the background extends only to the edge of the content box.</p> <p class="text">the background is clipped to the foreground text.</p> css p { border: .8em darkviolet; border-style: dotted double; margin: 1em 0; padding: 1.4em; background: linear-gradient(60deg, red, yellow, red, yellow, red); font: 900 1.2em sans-serif; text-decorat...
background-origin - CSS: Cascading Style Sheets
the background-origin css property sets the background's origin: from the border start, inside the border, or inside the padding.
border-collapse - CSS: Cascading Style Sheets
the border-collapse css property sets whether cells inside a <table> have shared or separate borders.
border-image-slice - CSS: Cascading Style Sheets
the sampled image size is scaled to fit inside the border, which means that if the width is bigger than the slice, the image can start to look somewhat pixellated (unless of course you use an svg image).
border-width - CSS: Cascading Style Sheets
recommendation added the constraint that values' meaning must be constant inside a document.
box-ordinal-group - CSS: Cascading Style Sheets
formal definition initial value1applies tochildren of box elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <integer> examples basic usage example in an older version of the spec, box-ordinal-group was included to allow you to change the display order of flex children inside a flex container: article:nth-child(1) { -webkit-box-ordinal-group: 2 -moz-box-ordinal-group: 2 box-ordinal-group: 2 } article:nth-child(2) { -webkit-box-ordinal-group: 1 -moz-box-ordinal-group: 1 box-ordinal-group: 1 } the modern flexbox equivalent is order.
box-sizing - CSS: Cascading Style Sheets
note that padding and border will be inside of the box.
clear - CSS: Cascading Style Sheets
WebCSSclear
if you want it to always be able to resize, so that it contains floating elements inside it, you need to self-clear its children.
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
parts that are inside the region are shown, while those outside are hidden.
direction - CSS: Cascading Style Sheets
WebCSSdirection
unlike the dir attribute in html, the direction property is not inherited from table columns into table cells, since css inheritance follows the document tree, and table cells are inside of rows but not inside of columns.
<display-box> - CSS: Cascading Style Sheets
due to a bug in browsers this will currently remove the element from the accessibility tree — screen readers will not look at what's inside.
<display-legacy> - CSS: Cascading Style Sheets
inside the table box is a block-level context.
<display-outside> - CSS: Cascading Style Sheets
these keywords are used as values of the display property, and can be used for legacy purposes as a single keyword, or as defined in the level 3 specification alongside a value from the <display-inside> keywords.
env() - CSS: Cascading Style Sheets
WebCSSenv
for non-rectangular displays — like a round watch face — the four values set by the user agent form a rectangle such that all content inside the rectangle is visible.
<filter-function> - CSS: Cascading Style Sheets
examples filter function comparison this example provides a simple graphic, along with a select menu to allow you to choose between the different types of filter function, and a slider to allow you to vary the values used inside the filter function.
image-rendering - CSS: Cascading Style Sheets
if system resources are constrained, images with high-quality should be prioritized over those with any other value, when considering which images to degrade the quality of and to what degree.
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
the image-set() function can not be nested inside another image-set() function.
<image> - CSS: Cascading Style Sheets
WebCSSimage
images with multiple intrinsic dimensions, existing in multiple versions inside a single file, like some .ico formats.
initial - CSS: Cascading Style Sheets
WebCSSinitial
you should consider using the inherit, unset, or revert keywords instead.
left - CSS: Cascading Style Sheets
WebCSSleft
n in relation to its siblings.</p> </div> <div id="example_3"> <pre> float: right; position: relative; top: 20px; left: 20px; </pre> <p>relative to its sibling div above, but removed from flow of content.</p> <div id="example_4"> <pre> position: absolute; bottom: 10px; right: 20px; </pre> <p>absolute position inside of a parent with relative position</p> </div> <div id="example_5"> <pre> position: absolute; right: 0; left: 0; top: 200px; </pre> <p>absolute position with both left and right declared</p> </div> </div> </div> css #wrap { width: 700px; margin: 0 auto; background: #5c5c5c; } pre { white-space: pre; white-space: pre-wrap; ...
margin - CSS: Cascading Style Sheets
WebCSSmargin
in order to center an element inside its parent, use margin: 0 auto;.
mask-border-outset - CSS: Cascading Style Sheets
when it eventually starts to be supported, it will serve to move the mask away from the inner edge of the element's border box — you can use it to make the mask start from part way across the border, rather than the inside of it.
offset-anchor - CSS: Cascading Style Sheets
the offset-anchor css property specifies the point inside the box of an element travelling along an offset-path that is actually moving along the path.
outline-color - CSS: Cascading Style Sheets
note that browsers are not required to support this value; if they don't, this keyword is considered invalid.
outline-offset - CSS: Cascading Style Sheets
a negative value places the outline inside the element.
Guide to scroll anchoring - CSS: Cascading Style Sheets
these suppression triggers are changes to the computed value of any of the following properties: top, left, right, or bottom margin or padding any width or height-related properties transform additionally, position changes anywhere inside the scrolling box also disable scroll anchoring.
overflow-block - CSS: Cascading Style Sheets
if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context.
overflow-inline - CSS: Cascading Style Sheets
if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context.
overflow-x - CSS: Cascading Style Sheets
if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context.
overflow-y - CSS: Cascading Style Sheets
if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context.
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
if content fits inside the padding box, it looks the same as visible, but still establishes a new block formatting context.
overscroll-behavior-y - CSS: Cascading Style Sheets
contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
overscroll-behavior - CSS: Cascading Style Sheets
contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
<position> - CSS: Cascading Style Sheets
note: the final position described by the <position> value does not need to be inside the element's box.
scroll-snap-type-x - CSS: Cascading Style Sheets
proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled horizontally considering the user agent's scroll parameters.
scroll-snap-type-y - CSS: Cascading Style Sheets
proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled vertically considering the user agent's scroll parameters.
scroll-snap-type - CSS: Cascading Style Sheets
proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled considering the user agent's scroll parameters.
shape-outside - CSS: Cascading Style Sheets
the shape follows the normal border radius shaping rules for the inside of the border.
<string> - CSS: Cascading Style Sheets
WebCSSstring
these include double quotes when used inside a double-quoted string, single quotes when used inside a single-quoted string, and the backslash itself.
text-combine-upright - CSS: Cascading Style Sheets
/* keyword values */ text-combine-upright: none; text-combine-upright: all; /* digits values */ text-combine-upright: digits; /* fits 2 consecutive digits horizontally inside vertical text */ text-combine-upright: digits 4; /* fits up to 4 consecutive digits horizontally inside vertical text */ /* global values */ text-combine-upright: inherit; text-combine-upright: initial; text-combine-upright: unset; syntax values none there is no special processing.
text-decoration-color - CSS: Cascading Style Sheets
)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples <p>this paragraph has <s>some erroneous text</s> inside it that i want to call attention to.</p> p { text-decoration-line: underline; text-decoration-color: cyan; } s { text-decoration-line: line-through; text-decoration-color: red; text-decoration-style: wavy; } specifications specification status comment css text decoration module level 3the definition of 'text-decoration-color' in that specification.
text-emphasis-position - CSS: Cascading Style Sheets
in html, this can be done with the following pattern: em { text-emphasis: dot; /* set text-emphasis for <em> elements */ } em rt { display: none; /* hide ruby inside <em> elements */ } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
text-orientation - CSS: Cascading Style Sheets
note that this keyword causes all characters to be considered as left-to-right: the used value of direction is forced to be ltr.
scale3d() - CSS: Cascading Style Sheets
when a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks.
translate3d() - CSS: Cascading Style Sheets
it can't be a <percentage> value; in that case the property containing the transform is considered invalid.
transform - CSS: Cascading Style Sheets
WebCSStransform
also, consider making use of the prefers-reduced-motion media feature — use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences.
transition-timing-function - CSS: Cascading Style Sheets
consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences.
url() - CSS: Cascading Style Sheets
WebCSSurl()
double quotes cannot occur inside double quotes and single quotes cannot occur inside single quotes unless escaped.
var() - CSS: Cascading Style Sheets
WebCSSvar
for example, var(--foo, red, blue) defines a fallback of red, blue; that is, anything between the first comma and the end of the function is considered a fallback value.
vertical-align - CSS: Cascading Style Sheets
the vertical-align property can be used in two contexts: to vertically align an inline element's box inside its containing line box.
widows - CSS: Cascading Style Sheets
WebCSSwidows
working draft recommendations to consider widows in relation to columns.
CSS: Cascading Style Sheets
WebCSS
css layout at this point we've already looked at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside.
WAI ARIA Live Regions/API Support - Developer guides
aria-busy on ancestor element container-atomic "true" | "false" "false" is this change inside a region that should always be presented at once.
Ajax - Developer guides
WebGuideAJAX
these incoming messages can be treated as events + data inside the web page.
Adding captions and subtitles to HTML5 video - Developer guides
we actually have our subtitles in three different languages — english, german, and spanish — so we will reference all three of the relevant vtt files by adding <track> elements inside our html5 <video> element: <video id="video" controls preload="metadata"> <source src="video/sintel-short.mp4" type="video/mp4"> <source src="video/sintel-short.webm" type="video/webm"> <track label="english" kind="subtitles" srclang="en" src="captions/vtt/sintel-en.vtt" default> <track label="deutsch" kind="subtitles" srclang="de" src="captions/vtt/sintel-de.vtt"> <track label="...
Cross-browser audio basics - Developer guides
an audio player with feedback consider this snippet of html: <audio id="my-audio"> <source src="https://udn.realityripple.com/samples/6c/d385042de2.mp3" type="audio/mpeg"> <source src="https://udn.realityripple.com/samples/28/191a7bd2a5.ogg" type="audio/ogg"> <!-- place fallback here as <audio> supporting browsers will ignore it --> <a href="audiofile.mp3">audiofile.mp3</a> </audio> <div id="controls"> <span id="loading"...
Live streaming web audio and video - Developer guides
the key consideration when streaming media to a browser is the fact that rather than playing a finite file we are relaying a file that is being created on the fly and has no pre-determined start or end.
Setting up adaptive streaming media sources - Developer guides
let's say you want to set up an adaptive streaming media source on a server, to be consumed inside an html5 media element.
Video player styling basics - Developer guides
the custom video controls and <progress> element are now contained within <div> elements, rather than residing inside unordered list items.
Media buffering, seeking, and time ranges - Developer guides
this will work with <audio> or <video>; for now let's consider a simple audio example: <audio id="my-audio" controls src="music.mp3"> </audio> we can access these attributes like so: var myaudio = document.getelementbyid('my-audio'); var bufferedtimeranges = myaudio.buffered; timeranges object timeranges are a series of non-overlapping ranges of time, with start and stop times.
Creating a cross-browser video player - Developer guides
this list is inserted after the <video> element, but inside the <figure> element (this is important for the fullscreen functionality, which is explained later on).
Challenge solutions - Developer guides
solution the following rule puts borders around only <td> elements that are inside the <tbody> element of the table with id=demo-table: #demo-table tbody td { border:1px solid #7a7; } media separate print style file challenge move the print-specific style rules to a separate css file and import them into your style4.css stylesheet.
Creating and triggering events - Developer guides
, and provide any data you want to pass to the "detail" property const eventawesome = new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } }); // the form element listens for the custom "awesome" event and then consoles the output of the passed text() method form.addeventlistener('awesome', e => console.log(e.detail.text())); // as the user types, the textarea inside the form dispatches/triggers the event to fire, and uses itself as the starting point textarea.addeventlistener('input', e => e.target.dispatchevent(eventawesome)); creating and dispatching events dynamically elements can listen for events that haven't been created yet: <form> <textarea></textarea> </form> const form = document.queryselector('form'); const textarea = document.queryselect...
DOM onevent handlers - Developer guides
when the event handler is invoked, the this keyword inside the handler is set to the dom element on which the handler is registered.
Rich-Text Editing in Mozilla - Developer guides
setting up rich-text editing rich-text editing is initialized by setting the designmode property of a document to "on", such as the document inside an iframe.
Making content editable - Developer guides
for example, even something as simple as what happens when you press enter/return to create a new line of text inside an editable element was handled differently across the major browsers (firefox inserted <br> elements, ie/opera used <p>, chrome/safari used <div>).
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
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.
XHTML - Developer guides
WebGuideHTMLXHTML
the problems are described in more details in the following articles: beware of xhtml by david hammond sending xhtml as text/html considered harmful by ian hickson xhtml's dirty little secret by mark pilgrim xhtml - what's the point?
Index - Developer guides
WebGuideIndex
12 setting up adaptive streaming media sources audio, hls, html5, http live streaming, mpeg-dash, video, adaptive streaming let's say you want to set up an adaptive streaming media source on a server, to be consumed inside an html5 media element.
Localizations and character encodings - Developer guides
note that firefox no longer sends the accept-charset http header, so there is no need to consider what gets advertised in accept-charset when setting the fallback encoding.
Optimization and performance - Developer guides
making web performance a priority by considering web performance throughout the development process is important in ensuring users get the best user experience possible.
Writing forward-compatible websites - Developer guides
for example, if you have tested that your default code path runs properly in firefox aurora but firefox beta and the latest release have a bug that make your default code path fail, it is ok to treat the firefox version number that is in aurora at the moment of testing as "current", and consider the beta version as a "past" version even though it hasn't been released to the general public yet.
HTML attribute: pattern - HTML: Hypertext Markup Language
specifying a pattern you can use the pattern attribute to specify a regular expression that the inputted value must match in order to be considered valid (see validating against a regular expression for a simple crash course on using regular expressions to validate inputs).
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
if not inside the <head> element, the standard doesn't distinguish between a hyperlink applying to a specific part of the document or to the document as a whole.
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
accessibility strong link text the content inside a link should indicate where the link goes, even out of context.
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
WebHTMLElementabbr
grammar considerations in languages with grammatical number (that is, languages where the number of items affects the grammar of a sentence), use the same grammatical number in your title attribute as inside your <abbr> element.
<address>: The Contact Address element - HTML: Hypertext Markup Language
WebHTMLElementaddress
typically an <address> element can be placed inside the <footer> element of the current section, if any.
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
WebHTMLElementapplet
removal is being considered in webkit and edge.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
_parent: show the resource in the parent browsing context of the current one, if the current page is inside a frame.
<aside>: The Aside element - HTML: Hypertext Markup Language
WebHTMLElementaside
usage notes do not use the <aside> element to tag parenthesized text, as this kind of text is considered part of the main flow.
<base>: The Document Base URL element - HTML: Hypertext Markup Language
WebHTMLElementbase
_parent: show the result in the parent browsing context of the current one, if the current page is inside a frame.
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
for example, consider some text like: embedded-text - 1st place if embedded-text is ltr, this works fine.
<body>: The Document Body element - HTML: Hypertext Markup Language
WebHTMLElementbody
tag omission the start tag may be omitted if the first thing inside it is not a space character, comment, <script> element or <style> element.
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
usage notes alternative content you may (and should) provide alternate content inside the <canvas> block.
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcontent
the html <content> element—an obsolete part of the web components suite of technologies—was used inside of shadow dom as an insertion point, and wasn't meant to be used in ordinary html.
<dd>: The Description Details element - HTML: Hypertext Markup Language
WebHTMLElementdd
permitted parents <dl> or (in whatwg html) a <div> that is inside a <dl>.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
WebHTMLElementfigure
a caption can be associated with the <figure> element by inserting a <figcaption> inside it (as the first or the last child).
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
WebHTMLElementhead
tag omission the start tag may be omitted if the first thing inside the <head> element is an element.
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
<hgroup> might be shown in a rendered outline in with a colon character and space (“: ”) or other such punctuation after the primary heading and before the first secondary heading (and with the same or similar punctuation before any other secondary headings an <hgroup> might be shown in a rendered outline in with the primary heading followed by parentheses around the secondary heading(s) consider the following html document: <!doctype html> <title>html standard</title> <body> <hgroup id="document-title"> <h1>html</h1> <h2>living standard — last updated 12 august 2016</h2> </hgroup> <p>some intro to the document.</p> <h2>table of contents</h2> <ol id=toc>...</ol> <h2>first section</h2> <p>some intro to the first section.</p> </body> a rendered outline for that d...
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
WebHTMLElementhtml
tag omission the start tag may be omitted if the first thing inside the <html> element is not a comment.
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
for example, in safari 10.1, you would see something that looks looks like this: the same content looks like this in firefox 55: in this case, clicking on the color well presents the platform's color picker for you to choose a color from (in this case, the macos picker): validation a color input's value is considered to be invalid if the user agent is unable to convert the user's input into seven-character lower-case hexadecimal notation.
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
if you choose to use <button> elements to create the buttons in your form, keep this in mind: if there's only one <button> inside the <form>, that button will be treated as the "submit" button.
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
if the http-equiv is not an encoding declaration, it can also be inside a <noscript> element, itself inside a <head> element.
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnoembed
examples the message inside <noembed> tag will appear only when your browser does not support <embed> tag.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
--> <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!
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
there is no closing tag, since everything after it is considered raw text.
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
WebHTMLElementpre
whitespace inside this element is displayed as written.
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
WebHTMLElementq
implicit aria role no corresponding role permitted aria roles any dom interface htmlquoteelement usage note: most modern browsers will automatically add quotation marks around text inside a <q> element.
<rtc>: The Ruby Text Container element - HTML: Hypertext Markup Language
WebHTMLElementrtc
the html ruby text container (<rtc>) element embraces semantic annotations of characters presented in a ruby of <rb> elements used inside of <ruby> element.
<samp>: The Sample Output element - HTML: Hypertext Markup Language
WebHTMLElementsamp
for example, consider this text presenting a transcript of a linux (or macos) console session: html <pre> <samp><span class="prompt">mike@interwebz:~$</span> <kbd>md5 -s "hello world"</kbd> md5 ("hello world") = 3e25960a79dbc69b674cd4ec67a72c62 <span class="prompt">mike@interwebz:~$</span> <span class="cursor">█</span></samp></pre> note the use of <span> to allow customization of the appearance of specific por...
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
<script src="javascript.js"></script> and the following examples show how to put (an inline) script inside the <script> element.
<section>: The Generic Section element - HTML: Hypertext Markup Language
WebHTMLElementsection
as an example, a navigation menu should be wrapped in a <nav> element, but a list of search results and a map display and its controls don't have specific elements, and could be put inside a <section>.
<slot> - HTML: Hypertext Markup Language
WebHTMLElementslot
the html <slot> element—part of the web components technology suite—is a placeholder inside a web component that you can fill with your own markup, which lets you create separate dom trees and present them together.
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
the value of this attribute is ignored when the <source> element is placed inside a <picture> element.
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
the <style> element must be included inside the <head> of the document.
<sub>: The Subscript element - HTML: Hypertext Markup Language
WebHTMLElementsub
marking up the subscript in mathematical variable numbers (although you may also consider using a mathml formula for this).
<sup>: The Superscript element - HTML: Hypertext Markup Language
WebHTMLElementsup
appropriate use cases for <sup> include (but aren't necessarily limited to): displaying exponents, such as "x3." it may be worth considering the use of mathml for these, especially in more complex cases.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
also note that even if you have a minlength value set (3, for example), an empty <textarea> is still considered valid unless you also have the required attribute set.
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementtt
if none of the semantic elements are appropriate for your use case (for example, if you simply need to show some content in a non-proportional font), you should consider using the <span> element, styling it as desired using css.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
WebHTMLElementu
other elements to consider using in most cases, you should use an element other than <u>, such as: <em> to denote stress emphasis <b> to draw attention to text <mark> to mark key words or phrases <strong> to indicate that text has strong importance <cite> to mark the titles of books or other publications <i> to denote technical terms, transliterations, thoughts, or names of vessels in western texts to provide ...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
m 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!
dir - HTML: Hypertext Markup Language
it uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.
id - HTML: Hypertext Markup Language
consider ticket-18659 versus r45tgfe-freds&$@).
Global attributes - HTML: Hypertext Markup Language
it uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then it applies that directionality to the whole element.
Microdata - HTML: Hypertext Markup Language
due to the implementation of additional marking parameters of schema's vocabulary, the indexation of information in russian-language web-pages became considerably more successful.
HTML: Hypertext Markup Language
WebHTML
the name of an element inside a tag is case insensitive.
Identifying resources on the Web - HTTP
an anchor represents a sort of "bookmark" inside the resource, giving the browser the directions to show the content located at that "bookmarked" spot.
Configuring servers for Ogg media - HTTP
consider using the preload attribute the html <audio> and <video> elements provide the preload attribute, which tells the browser to attempt to download the entire media when the page loads.
Connection management in HTTP/1.x - HTTP
conclusion improved connection management allows considerable boosting of performance in http.
Accept-Encoding - HTTP
this value is always considered as acceptable, even if not present.
Cache-Control - HTTP
expiration max-age=<seconds> the maximum amount of time a resource is considered fresh.
Content-Disposition - HTTP
header type response header (for the main body) general header (for a subpart of a multipart body) forbidden header name no syntax as a response header for the main body the first parameter in the http context is either inline (default value, indicating it can be displayed inside the web page, or as the web page) or attachment (indicating it should be downloaded; most browsers presenting a 'save as' dialog, prefilled with the value of the filename parameters if present).
Content-Location - HTTP
the server could also consider other content negotiation headers, such as accept-language.
CSP: object-src - HTTP
elements controlled by object-src are perhaps coincidentally considered legacy html elements and aren't receiving new standardized features (such as the security attributes sandbox or allow for <iframe>).
CSP: referrer - HTTP
carefully consider the impact of this setting.
Content-Security-Policy - HTTP
elements controlled by object-src are perhaps coincidentally considered legacy html elements and are not receiving new standardized features (such as the security attributes sandbox or allow for <iframe>).
ETag - HTTP
WebHTTPHeadersETag
if a user visits a given url again (that has an etag set), and it is stale (too old to be considered usable), the client will send the value of its etag along in an if-none-match header field: if-none-match: "33a64df551425fcc55e4d42a148795d9f25f89d4" the server compares the client's etag (sent with if-none-match) with the etag for its current version of the resource, and if both values match (that is, the resource has not changed), the server sends back a 304 not modified status, without a...
Expires - HTTP
WebHTTPHeadersExpires
the expires header contains the date/time after which the response is considered stale.
If-Match - HTTP
WebHTTPHeadersIf-Match
the comparison with the stored etag uses the strong comparison algorithm, meaning two files are considered identical byte to byte only.
Index - HTTP
WebHTTPHeadersIndex
62 expires caching, http, response, header the expires header contains the date/time after which the response is considered stale.
Server-Timing - HTTP
consider to control which metrics are returned when and to whom on the server side.
Vary - HTTP
WebHTTPHeadersVary
examples dynamic serving when using the vary: user-agent header, caching servers should consider the user agent when deciding whether to serve the page from cache.
X-Frame-Options - HTTP
examples note: setting x-frame-options inside the <meta> element is useless!
HTTP headers - HTTP
WebHTTPHeaders
expires the date/time after which the response is considered stale.
HTTP Index - HTTP
WebHTTPIndex
121 expires caching, http, response, header the expires header contains the date/time after which the response is considered stale.
PATCH - HTTP
WebHTTPMethodsPATCH
a patch request is considered a set of instructions on how to modify a resource.
Network Error Logging - HTTP
usage web applications opt in to this behaviour with the nel header, which is a json-encoded object: nel: { "report_to": "nel", "max_age": 31556952 } an origin considered secure by the browser is required.
Proxy Auto-Configuration (PAC) file - HTTP
usage of isinnet(), isresolvable() and dnsresolve() functions should be carefully considered, as they require the dns server to be consulted.
416 Range Not Satisfiable - HTTP
WebHTTPStatus416
content-range: bytes */12777 faced with this error, browsers usually either abort the operation (for example, a download will be considered as non-resumable) or ask for the whole document again.
HTTP response status codes - HTTP
WebHTTPStatus
208 already reported (webdav) used inside a <dav:propstat> response element to avoid repeatedly enumerating the internal members of multiple bindings to the same collection.
Introduction - JavaScript
inside a host environment (for example, a web browser), javascript can be connected to the objects of its environment to provide programmatic control over them.
Character classes - JavaScript
inside a character set, the dot loses its special meaning and matches a literal dot.
Unicode property escapes - JavaScript
note: for unicode property escapes to work, a regular expression must use the u flag which indicates a string must be considered as a series of unicode code points.
Inheritance and the prototype chain - JavaScript
while this confusion is often considered to be one of javascript's weaknesses, the prototypal inheritance model itself is, in fact, more powerful than the classic model.
Memory Management - JavaScript
however, the reference-counting algorithm will not consider them reclaimable since each of the two objects has at least one reference pointing to them, resulting in neither of them being marked for garbage collection.
Public class fields - JavaScript
class classwithfancymethods { *generatormethod() { } async asyncmethod() { } async *asyncgeneratormethod() { } } inside instance methods, this refers to the instance itself.
The legacy Iterator protocol - JavaScript
for future-facing usages, consider using for..of loops and the iterator protocol.
Deprecated and obsolete features - JavaScript
instead of the arguments property, you should use the arguments object inside function closures.
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
function test() { let foo = 33; if (true) { let foo = (foo + 55); // referenceerror: can't access lexical // declaration `foo' before initialization } } test(); valid cases to change "foo" inside the if statement, you need to remove the let that causes the redeclaration.
SyntaxError: missing ) after argument list - JavaScript
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 string and ignores it, and it ends up not knowing that you meant the ); to end the function console.log.
InternalError: too much recursion - JavaScript
get name(){ return this.name; // recursive call } to avoid this problem, make sure that the property being assigned to inside the setter function is different from the one that initially triggered the setter.the same goes for the getter.
Arrow function expressions - JavaScript
var func = () => { foo: function() {} }; // syntaxerror: function statement requires a name this is because the code inside braces ({}) is parsed as a sequence of statements (i.e.
Default parameters - JavaScript
it also means that variables declared inside the function body using var will mask parameters of the same name, instead of the usual behavior of duplicate var declarations having no effect.
Array.prototype[@@unscopables] - JavaScript
that means that inside with environments, "keys" would now be the method and not the variable.
Array.prototype.findIndex() - JavaScript
callback is invoked with three arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is passed to findindex(), it will be used as the this inside each invocation of the callback.
Array.isArray() - JavaScript
var iframe = document.createelement('iframe'); document.body.appendchild(iframe); xarray = window.frames[window.frames.length-1].array; var arr = new xarray(1,2,3); // [1,2,3] // correctly checking for array array.isarray(arr); // true // considered harmful, because doesn't work through iframes arr instanceof array; // false specifications specification ecmascript (ecma-262)the definition of 'array.isarray' in that specification.
Array.prototype.map() - JavaScript
consider: ["1", "2", "3"].map(parseint) while one might expect [1, 2, 3], the actual result is [1, nan, nan].
Array.prototype.shift() - JavaScript
console.log('myfish before:', json.stringify(myfish)); // myfish before: ['angel', 'clown', 'mandarin', 'surgeon'] var shifted = myfish.shift(); console.log('myfish after:', myfish); // myfish after: ['clown', 'mandarin', 'surgeon'] console.log('removed this element:', shifted); // removed this element: angel using shift() method in while loop the shift() method is often used in condition inside while loop.
Array.prototype.slice() - JavaScript
the arguments inside a function is an example of an 'array-like object'.
Array - JavaScript
in general, these are convenient characteristics; but if these features are not desirable for your particular use, you might consider using typed arrays.
BigInt - JavaScript
type information when tested against typeof, a bigint will give "bigint": typeof 1n === 'bigint' // true typeof bigint('1') === 'bigint' // true when wrapped in an object, a bigint will be considered as a normal "object" type: typeof object(1n) === 'object' // true operators the following operators may be used with bigints (or object-wrapped bigints): +, *, -, **, %.
Error.prototype.stack - JavaScript
text: error("myerror")@:0 trace()@file:///c:/example.html:9 b(3,4,"\n\n",(void 0),[object object])@file:///c:/example.html:16 a("first call, firstarg")@file:///c:/example.html:19 @file:///c:/example.html:21 stack of eval'ed code starting with firefox 30, the error stack of code in function() and eval() calls, now produces stacks with more detailed information about the line and column numbers inside these calls.
Function.prototype.bind() - JavaScript
when using bind to create a function (supplied as a callback) inside a settimeout, any primitive value passed as thisarg is converted to object.
Function.caller - JavaScript
consider: function f(n) { g(n - 1); } function g(n) { if (n > 0) { f(n); } else { stop(); } } f(2); at the moment stop() is called the call stack will be: f(2) -> g(1) -> f(1) -> g(0) -> stop() the following is true: stop.caller === g && f.caller === g && g.caller === f so if you tried to get the stack trace in the stop() function like this: var f = stop; var stack = 'stack trace:'; while (f) ...
Intl.Collator() constructor - JavaScript
other differences may also be taken into consideration.
Intl.Collator.prototype.compare() - JavaScript
description the compare getter function returns a number indicating how string1 and string2 compare to each other according to the sort order of this collator object: a negative value if string1 comes before string2; a positive value if string1 comes after string2; 0 if they are considered equal.
Intl.Collator.supportedLocalesOf() - JavaScript
the language tags returned are those for which the runtime supports a locale in collation that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale.
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale.
Intl.DisplayNames.supportedLocalesOf() - JavaScript
the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale.
Intl.ListFormat.supportedLocalesOf() - JavaScript
the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale.
Intl.Locale.prototype.numberingSystem - JavaScript
nu is considered a locale string "extension subtag".
Intl.NumberFormat.prototype.format() - JavaScript
this is considered a historical artefact, as part of a convention which is no longer followed for new features, but is preserved to maintain compatibility with existing programs.
Intl.NumberFormat.supportedLocalesOf() - JavaScript
the language tags returned are those for which the runtime supports a locale in number formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale.
Intl.PluralRules.supportedLocalesOf() - JavaScript
the language tags returned are those for which the runtime supports a locale in plural formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale.
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
the language tags returned are those for which the runtime supports a locale in date and time formatting that the locale matching algorithm used considers a match, so that it wouldn't have to fall back to the default locale.
Intl - JavaScript
locales argument the locales argument requests that a particular locale (or a locale from a list of them) be considered for use in a given operation.
JSON.stringify() - JavaScript
the numbers infinity and nan, as well as the value null, are all considered null.
JSON - JavaScript
consider this example where json.parse() parses the string as json and eval executes the string as javascript: let code = '"\u2028\u2029"' json.parse(code) // evaluates to "\u2028\u2029" in all engines eval(code) // throws a syntaxerror in old engines other differences include allowing only double-quoted strings and having no provisions for undefined or comments.
Map.prototype.get() - JavaScript
if the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the map object.
Math.clz32() - JavaScript
consider the following 32-bit word: var a = 32776; // 00000000000000001000000000001000 (16 leading zeros) math.clz32(a); // 16 var b = ~32776; // 11111111111111110111111111110111 (32776 inversed, 0 leading zeros) math.clz32(b); // 0 (this is equal to how many leading one's there are in a) using this logic, a clon function can be created as follows: var clz = math.clz32; function clon(integer)...
Number.MAX_SAFE_INTEGER - JavaScript
for larger integers, consider using bigint.
Number.MIN_SAFE_INTEGER - JavaScript
to represent integers smaller than this, consider using bigint.
Number.isSafeInteger() - JavaScript
for larger integers, consider using the bigint type.
Object.prototype.constructor - JavaScript
let's consider one more case.
Object.prototype.propertyIsEnumerable() - JavaScript
y = 'is enumerable'; o.propertyisenumerable('arbitraryproperty'); // returns true o.propertyisenumerable('method'); // returns true o.propertyisenumerable('property'); // returns false o.property = 'is enumerable'; o.propertyisenumerable('property'); // returns true // these return false as they are on the prototype which // propertyisenumerable does not consider (even though the last two // are iteratable with for-in) o.propertyisenumerable('prototype'); // returns false (as of js 1.8.1/ff3.6) o.propertyisenumerable('constructor'); // returns false o.propertyisenumerable('firstmethod'); // returns false specifications specification ecmascript (ecma-262)the definition of 'object.prototype.propertyisenumerable' in that specific...
Object.setPrototypeOf() - JavaScript
it is generally considered the proper way to set the prototype of an object, vs.
Object - JavaScript
let o = new object() let o = new object(undefined) let o = new object(null) using object to create boolean objects the following examples store boolean objects in o: // equivalent to o = new boolean(true) let o = new object(true) // equivalent to o = new boolean(false) let o = new object(boolean()) object prototypes when altering the behavior of existing object.prototype methods, consider injecting code by wrapping your extension before or after the existing logic.
Promise - JavaScript
if you are looking to lazily evaluate an expression, consider the arrow function with no arguments: f = () => expression to create the lazily-evaluated expression, and f() to evaluate.
RegExp.prototype[@@search]() - JavaScript
return value integer if successful, [@@search]() returns the index of the first match of the regular expression inside the string.
RegExp.prototype.exec() - JavaScript
description consider the following example: // match "quick brown" followed by "jumps", ignoring characters in between // remember "brown" and "jumps" // ignore case let re = /quick\s(brown).+?(jumps)/ig; let result = re.exec('the quick brown fox jumps over the lazy dog'); the following table shows the results for this script: object property/index description example result ...
RegExpInstance.lastIndex - JavaScript
examples using lastindex consider the following sequence of statements: var re = /(hi)?/g; matches the empty string.
Set - JavaScript
nan is considered the same as nan, even though nan !== nan).
String.prototype.lastIndexOf() - JavaScript
fromindex optional the index of the last character in the string to be considered as the beginning of a match.
String.prototype.normalize() - JavaScript
log(string2.length); // 2 string1 = string1.normalize('nfkd'); string2 = string2.normalize('nfkd'); console.log(string1); // ff <- visual appearance changed console.log(string2); // ff console.log(string1 === string2); // true console.log(string1.length); // 2 console.log(string2.length); // 2 when applying compatibility normalization it's important to consider what you intend to do with the strings, since the normalized form may not be appropriate for all applications.
String.prototype.substr() - JavaScript
note: in microsoft jscript, negative values of the start argument are not considered to refer to the end of the string.
String.prototype.substring() - JavaScript
furthermore, substr() is considered a legacy feature in ecmascript and could be removed from future versions, so it is best to avoid using it if possible.
Symbol.iterator - JavaScript
utes of symbol.iterator writable no enumerable no configurable no examples user-defined iterables we can make our own iterables like this: var myiterable = {} myiterable[symbol.iterator] = function* () { yield 1; yield 2; yield 3; }; [...myiterable] // [1, 2, 3] or iterables can be defined directly inside a class or object using a computed property: class foo { *[symbol.iterator] () { yield 1; yield 2; yield 3; } } const someobj = { *[symbol.iterator] () { yield 'a'; yield 'b'; } } [...new foo] // [ 1, 2, 3 ] [...someobj] // [ 'a', 'b' ] non-well-formed iterables if an iterable's @@iterator method does not return an iterator object, then it is a non-well-formed i...
Symbol.unscopables - JavaScript
that means that inside with environment "keys" would now be the method and not the variable.
WeakSet - JavaScript
weaksets are ideal for this purpose: // execute a callback on everything stored inside an object function execrecursively(fn, subject, _refs = null){ if(!_refs) _refs = new weakset(); // avoid infinite recursion if(_refs.has(subject)) return; fn(subject); if("object" === typeof subject){ _refs.add(subject); for(let key in subject) execrecursively(fn, subject[key], _refs); } } const foo = { foo: "foo", bar: { bar: "bar" } }; foo.bar.baz = foo; // circular...
WebAssembly.Module.exports() - JavaScript
when the module is received, we create an instance from it using the webassembly.instantiate() method, invoke an exported function from inside it, then show how we can return information on the available exports on a module using webassembly.module.exports.
WebAssembly.Module - JavaScript
when the module is received, we create an instance from it using the webassembly.instantiate() method and invoke an exported function from inside it.
WebAssembly.Table.prototype.get() - JavaScript
webassembly.instantiatestreaming(fetch('table.wasm')) .then(function(obj) { var tbl = obj.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 }); note how you've got to include a second function invocation operator at the end of the accessor to actually retrieve the value stored inside the reference (e.g.
WebAssembly.instantiate() - JavaScript
when the module is received, we create an instance from it using the webassembly.instantiate() method and invoke an exported function from inside it.
isNaN() - JavaScript
note, coercion inside the isnan function has interesting rules; you may alternatively want to use number.isnan(), as defined in ecmascript 2015.
parseFloat() - JavaScript
consider number(value) for stricter parsing, which converts to nan for arguments with invalid characters anywhere.
Equality (==) - JavaScript
instead, the strict equality operator always considers operands of different types to be different.
Grouping operator ( ) - JavaScript
as it sounds, it groups what's inside of the parentheses.
Inequality (!=) - JavaScript
like the equality operator, the inequality operator will attempt to convert and compare operands of different types: 3 != "3"; // false to prevent this, and require that different types are considered to be different, use the strict inequality operator instead: 3 !== "3"; // true examples comparison with no type conversion 1 != 2; // true "hello" != "hola"; // true 1 != 1; // false "hello" != "hello"; // false comparison with type conversion "1" != 1; // false 1 != "1"; // false 0 != false; // false 0 != null; ...
Logical AND (&&) - JavaScript
even though the && operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive.
Logical NOT (!) - JavaScript
operator can be used with operands that are not boolean values, it can still be considered a boolean operator since its return value can always be converted to a boolean primitive.
Operator precedence - JavaScript
precedence and associativity consider an expression describable by the representation below.
Optional chaining (?.) - JavaScript
for example, consider an object obj which has a nested structure.
async function expression - JavaScript
the async function keyword can be used to define async functions inside expressions.
await - JavaScript
it can only be used inside an async function.
class expression - JavaScript
const foo = class { constructor() {} bar() { return 'hello world!'; } }; const instance = new foo(); instance.bar(); // "hello world!" foo.name; // "foo" named class expressions if you want to refer to the current class inside the class body, you can create a named class expression.
delete operator - JavaScript
however, it is important to consider the following scenarios: if the property which you are trying to delete does not exist, delete will not have any effect and will return true.
function* expression - JavaScript
the function* keyword can be used to define a generator function inside an expression.
const - JavaScript
all the considerations about the "temporal dead zone" apply to both let and const.
export - JavaScript
this can be achieved with the "export from" syntax: export { default as function1, function2 } from 'bar.js'; which is comparable to a combination of import and export: import { default as function1, function2 } from 'bar.js'; export { function1, function2 }; but where function1 and function2 do not become available inside the current module.
for...in - JavaScript
iterating over own properties only if you only want to consider properties attached to the object itself, and not its prototypes, use getownpropertynames() or perform a hasownproperty() check (propertyisenumerable() can also be used).
for...of - JavaScript
examples iterating over an array const iterable = [10, 20, 30]; for (const value of iterable) { console.log(value); } // 10 // 20 // 30 you can use let instead of const too, if you reassign the variable inside the block.
for - JavaScript
indeed, without the semicolon the line that follows the cycle declaration will be considered a statement.
function* - JavaScript
much like a return statement, an error is thrown inside the generator will make the generator finished -- unless caught within the generator's body.
switch - JavaScript
if the expression matches the specified valuen, the statements inside the case clause are executed until either the end of the switch statement or a break.
try...catch - JavaScript
this includes exceptions thrown inside of the catch-block: (function() { try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); throw ex; } finally { console.log('finally'); return; } } catch (ex) { console.error('outer', ex.message); } })(); // output: // "inner" "oops" // "finally" the outer "oops" is not thrown because of the retu...
Transitioning to strict mode - JavaScript
strictness-neutral code a potential "downside" of moving strict code to strict mode is that the semantics may be different in legacy browsers which do not implement strict mode.
Template literals (Template strings) - JavaScript
within a backticked template, it is simple to allow inner backticks simply by using them inside a placeholder ${ } within the template.
scope - Web app manifests
if the user navigates outside the scope, it reverts to a normal web page inside a browser tab or window.
<math> - MathML
WebMathMLElementmath
it can have one of the following values: block, which means that this element will be displayed outside the current span of text, as a block that can be positioned anywhere without changing the meaning of the text; inline, which means that this element will be displayed inside the current span of text, and cannot be moved out of it without changing the meaning of that text.
<menclose> - MathML
the mathml <menclose> element renders its content inside an enclosing notation specified by the notation attribute.
<mtable> - MathML
WebMathMLElementmtable
inside a <mtable> only <mtr> and <mtd> elements may appear.
Using images in HTML - Web media technologies
WebMediaimages
the browser considers each child <source> element and chooses the best match among them.
Critical rendering path - Web Performance
if another set of starttag and endtag tokens come between a set of starttag and endtags, you have a node inside a node, which is how we define the hierarchy of the dom tree.
Recommended Web Performance Timings: How long is too long? - Web Performance
a second should be considered a rule in the maximum amount of time to indicate to a user that the request for new content was made and will load, such as the browser displaying the page title and the background color of the page displaying.
Navigation and resource timings - Web Performance
a connection is considered as opened when all secure connection handshake, or socks authentication, is terminated.
Using dns-prefetch - Web Performance
second, it’s also possible to specify dns-prefetch (and other resources hints) as an http header by using the http link field: link: <https://fonts.gstatic.com/>; rel=dns-prefetch third, consider pairing dns-prefetch with the preconnect hint.
Privacy, permissions, and information security
keeping personal data safe managing site permissions bringing it all together <using feature policy with permissions and so forth; how to use them together, how they interact, etc> permission requests in <iframe> elements things can get tricky when your web app uses the <iframe> element to embed content from another site inside your own, especially if the document you load into the frame has its own permission needs to consider.
Installing and uninstalling web apps - Progressive web apps (PWAs)
firefox for android on an android device using firefox, you'll see a "home" icon with a plus (+) icon inside it—this is the "add to home screen" icon displayed for any site that has the necessary features in place.
Progressive loading - Progressive web apps (PWAs)
is appearing inside the viewport).
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
inside the service worker, a push service subscription mechanism is created.
Media - Progressive web apps (PWAs)
you can control how the content of the document breaks across page boundaries, by using the page-break-before, page-break-after and page-break-inside properties.
Responsive Navigation Patterns - Progressive web apps (PWAs)
therefore, it is necessary to consider the presentation of content and ease of navigation for all screen sizes.
Structural overview of progressive web apps - Progressive web apps (PWAs)
the <body> is split into the <header> (which displays an image) and the body of the app, which is found inside a <main> element.
Web technology reference
if you're new to web development, consider starting with our learning area, which is filled with step-by-step tutorials that will guide you from total webdev newbie to at least semi-pro!
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
example: masking for example, you can make a gradient mask for html content using svg and css code similar to the following, inside your html document: <svg height="0"> <mask id="mask-1"> <lineargradient id="gradient-1" y2="1"> <stop stop-color="white" offset="0"/> <stop stop-opacity="0" offset="1"/> </lineargradient> <circle cx="0.25" cy="0.25" r="0.25" id="circle" fill="white"/> <rect x="0.5" y="0.2" width="300" height="100" fill="url(#gradient-1)"/> </mask> </svg> .target { mask: url(#...
baseProfile - SVG: Scalable Vector Graphics
the attribute does not specify any processing restrictions; it can be considered metadata.
cursor - SVG: Scalable Vector Graphics
WebSVGAttributecursor
as a presentation attribute, it also can be used as a property directly inside a css stylesheet, see css cursor for further information.
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
"skyblue"></rect> <rect x="20" y="20" width="60" height="60" fill="yellow"></rect> <!-- here the yellow rectangle is not displayed --> <rect x="120" y="0" width="100" height="100" fill="skyblue"></rect> <rect x="140" y="20" width="60" height="60" fill="yellow" display="none"></rect> </svg> usage notes default value inline value [ <display-outside> | <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>where <display-outside> = block | inline | run-in<display-inside> = flow | flow-root | table | flex | grid | ruby<display-listitem> = <display-outside>?
in - SVG: Scalable Vector Graphics
WebSVGAttributein
workaround for backgroundimage instead of using in="backgroundimage", we need to import one of the images to blend inside the filter itself, using an <feimage> element.
mask - SVG: Scalable Vector Graphics
WebSVGAttributemask
html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <mask id="mymask" maskcontentunits="objectboundingbox"> <rect fill="white" x="0" y="0" width="100%" height="100%" /> <polygon fill="black" points="0.5,0.2 0.68,0.74 0.21,0.41 0.79,0.41 0.32,0.74" /> </mask> <!-- punch a hole in a shape of a star inside the red circle, revealing the yellow circle underneath --> <circle cx="50" cy="50" r="20" fill="yellow" /> <circle cx="50" cy="50" r="45" fill="red" mask="url(#mymask)"/> </svg> since svg2, the mask attribute is defined as a css property and is a shorthand for many other properties: mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-size, and ma...
maskUnits - SVG: Scalable Vector Graphics
a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox.
patternUnits - SVG: Scalable Vector Graphics
a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox.
points - SVG: Scalable Vector Graphics
WebSVGAttributepoints
olygon> html,body,svg { height:100% } <svg viewbox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg"> <!-- polyline is an open shape --> <polyline stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90"/> <!-- polygon is a closed shape --> <polygon stroke="black" fill="none" transform="translate(100,0)" points="50,0 21,90 98,35 2,35 79,90"/> <!-- it is usualy considered best practices to separate a x and y coordinate with a comma and a group of coordinates by a space.
requiredFeatures - SVG: Scalable Vector Graphics
however, the svg 1.0 feature strings are considered deprecated.
textLength - SVG: Scalable Vector Graphics
html the html is also simple, with only two displayed elements contained inside a grouping <div>: <div class="controls"> <input type="range" id="widthslider" min="80" max="978"> <span id="widthdisplay"></span> </div> the <input> element, of type "range", is used to create the slider control the user will manipulate to change the width of the text.
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
0 100" xmlns="http://www.w3.org/2000/svg"> <!-- a link around a shape --> <a href="/docs/web/svg/element/circle"> <circle cx="50" cy="40" r="35"/> </a> <!-- a link around a text --> <a href="/docs/web/svg/element/text"> <text x="50" y="90" text-anchor="middle"> &lt;circle&gt; </text> </a> </svg> /* as svg does not provide a default visual style for links, it's considered best practice to add some */ @namespace svg url(http://www.w3.org/2000/svg); /* necessary to select only svg <a> elements, and not also html’s.
<animate> - SVG: Scalable Vector Graphics
WebSVGElementanimate
consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences.
<animateMotion> - SVG: Scalable Vector Graphics
note: to reuse an existing path, it will be necessary to use an <mpath> element inside the <animatemotion> element instead of the path attribute.
<clipPath> - SVG: Scalable Vector Graphics
WebSVGElementclipPath
--> <circle cx="40" cy="35" r="35" /> </clippath> <!-- the original black heart, for reference --> <path id="heart" d="m10,30 a20,20,0,0,1,50,30 a20,20,0,0,1,90,30 q90,60,50,90 q10,60,10,30 z" /> <!-- only the portion of the red heart inside the clip circle is visible.
<feDropShadow> - SVG: Scalable Vector Graphics
it can only be used inside a <filter> element.
<linearGradient> - SVG: Scalable Vector Graphics
value type: <url> ; default value: none; animatable: yes spreadmethod this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient.
<radialGradient> - SVG: Scalable Vector Graphics
value type: <length> ; default value: 50%; animatable: yes spreadmethod this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient.
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
if text is included in svg not inside of a <text> element, it is not rendered.
Linking - SVG: Scalable Vector Graphics
WebSVGLinking
you would now have page2.html embedded inside a 100x50 pixel frame inside page1.html).
Basic Transformations - SVG: Scalable Vector Graphics
effects on coordinate systems when using transformations you establish a new coordinate system inside the element the transformations apply to.
Clipping and masking - SVG: Scalable Vector Graphics
for the clipping, every path inside the clippath is inspected and evaluated together with its stroke properties and transformation.
Fills and Strokes - SVG: Scalable Vector Graphics
using fill sets the color inside the object and stroke sets the color of the line drawn around the object.
SVG image element - SVG: Scalable Vector Graphics
in this basic example, a .jpg image referenced by an href attribute will be rendered inside an svg object: <?xml version="1.0" standalone="no"?> <!doctype svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd"> <svg width="5cm" height="4cm" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="firefox.jpg" x="0" y="0" height="50px" width="50px"/> </svg> there are some important things to take note of (referenced from the w3 specs): if you do not set the x or y attributes, they will be set to 0.
Information Security Basics - Web security
confidentiality, integrity, and availability describes the primary security objectives, which are absolutely fundamental to understanding security security controls defines major categories of security controls and discusses their potential disadvantages tcp/ip security an overview of the tcp/ip model, with a focus on the security considerations for ssl threats briefly introduces major threat concepts vulnerabilities defines the major categories of vulnerabilities and discusses the presence of vulnerabilities in all software ...
Same-origin policy - Web security
therefore, https://company.com:81/index.html and https://company.com/index.html are considered the same origin and no restrictions are applied.
Tutorials
intermediate level css layout at this point we've already looked at css fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside.
XPath
if you need a polyfill, you may consider js-xpath or wicked-good-xpath.
<xsl:param> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementparam
when used inside an <xsl:template> element, the parameter is local to that template.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
for example, assume that a variable "image-dir" is defined as follows: <xsl:variable name="image-dir">/images</xsl:variable> the expression to be evaluated is placed inside curly brackets: <img src="{$image-dir}/mygraphic.jpg"/> this would result in the following: <img src="/images/mygraphic.jpg"/> the element annotations that follow include a description, a syntax listing, a list of required and optional attributes, a description of type and position, its source in the w3c recommendation and an explanation of the degree of present gecko support.
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
resources the following reflect the interface of the xsltprocessor object: nsixsltprocessor.idl xsltprocessor.webidl using xsltprocessor from xpcom components instantiating an xsltprocessor from an xpcom component requires a different syntax as the constructor is not defined inside components.
Caching compiled WebAssembly modules - WebAssembly
the function starts off by defining some necessary constants: function instantiatecachedurl(dbversion, url, importobject) { const dbname = 'wasm-cache'; const storename = 'wasm-cache'; setting up the database the first helper function contained inside instantiatecachedurl() — opendatabase() — creates an object store for storing wasm modules, and also handles clearing out the database if the dbversion is updated; it returns a promise resolving to the new database.
Converting WebAssembly text format to wasm - WebAssembly
to start with, make a copy of the above listing inside a text file; call it simple.wat.
Compiling an Existing C Module to WebAssembly - WebAssembly
for that, you need to expose two additional functions — one that allocates memory for the image inside wasm and one that frees it up again: #include <stdlib.h> // required for malloc definition emscripten_keepalive uint8_t* create_buffer(int width, int height) { return malloc(width * height * 4 * sizeof(uint8_t)); } emscripten_keepalive void destroy_buffer(uint8_t* p) { free(p); } the create_buffer() function allocates a buffer for the rgba image — hence 4 bytes per pixel.