Search completed in 0.92 seconds.
HTMLOrForeignElement.dataset - Web APIs
the
dataset read-only property of the htmlorforeignelement interface provides read/write access to all the custom data attributes (data-*) set on the element. this access is available both in html and within the dom. it is a map of domstrings (domstringmap) with one entry for each custom data attribute. note that the
dataset property itself can be read, but not directly written. instead, all writes must be to the individual properties within the
dataset, which in turn represent the data attributes. note also that an html data-attribute and its corresponding dom
dataset.property do not share the same name, but they are always similar: in html, the name of a custom data attribute begins with data-. it must contain only letters, numbers, and the following characters: dash (-), dot (.), colon (:)...
...to a dash, followed by its lowercase counterpart; other characters are left unchanged. the restriction in the rules above ensures that the two transformations are the inverse one of the other. for example, the attribute named data-abc-def corresponds to the key abcdef. accessing values attributes can be set and read by using the camelcase name (the key) like an object property of the
dataset, as in element.
dataset.keyname attributes can also be set and read using the bracket syntax, as in element.
dataset[keyname] the in operator can be used to check whether a given attribute exists. setting values when an attribute is set, its value is always converted into a string. for example: null is converted into the string "null". to remove an attribute, you c...
...ad using the bracket syntax, as in element.
dataset[keyname] the in operator can be used to check whether a given attribute exists. setting values when an attribute is set, its value is always converted into a string. for example: null is converted into the string "null". to remove an attribute, you can use the delete operator. syntax const dataattrmap = element.
dataset value a domstringmap. ...
...And 6 more matches
Timing element visibility with the Intersection Observer API - Web APIs
ch is a different issue entirely), we need to use the page visibility api to detect these tab switches and disable our timers for the duration. ...
...timers for the duration. function handlevisibilitychange() { if (document.hidden) { if (!previouslyvisibleads) { previouslyvisibleads = visibleads; visibleads = []; previouslyvisibleads.foreach(function(adbox) { updateadtimer(adbox); adbox.
dataset.lastviewstarted = 0; }); } } else { previouslyvisibleads.foreach(function(adbox) { adbox.
dataset.lastviewstarted = performance.now(); }); visibleads = previouslyvisibleads; previouslyvisibleads = null; } } since the event itself doesn't state whether the document has switched from visible to invisible or vice-versa, the document.hidden property is checked to see if the document is not currently visible. since it's theoretically possible to get called multiple times, we only pr...
...egin by saving the set of visible ads into a variable known as previouslyvisibleads to be sure we can restore them when the user tabs back into the document, and we then empty the visibleads set so they won't be treated as visible. then, for each of the ads that are being suspended, we call our updateadtimer() function, which handles updating the ad's total visible time counter, then we set their
dataset.lastviewstarted property to 0, which indicates that the tab's timer isn't running. if the document has just become visible, we reverse this process: first we go through previouslyvisibleads and set each one's
dataset.lastviewstarted to the current document's time (in milliseconds since the document was created) using the performance.now() method. then we set visibleads back to previouslyvisiblea...
...And 16 more matches
ARIA: grid role - Accessibility
vascript var selectables = document.queryselectorall('table td[role="gridcell"]'); selectables[0].setattribute('tabindex', 0); var trs = document.queryselectorall('table tbody tr'), row = 0, col = 0, maxrow = trs.length - 1, maxcol = 0; array.prototype.foreach.call(trs, function(gridrow, i){ array.prototype.foreach.call(gridrow.queryselectorall('td'), function(el, i){ el.
dataset.row = row; el.
dataset.col = col; col = col + 1; }); if (col>maxcol) { maxcol = col - 1; } col = 0; row = row + 1; }); function moveto(newrow, newcol) { var tgt = document.queryselector('[data-row="' + newrow + '"][data-col="' + newcol + '"]'); if (tgt && (tgt.getattribute('role')==='gridcell') ) { array.prototype.foreach.call(document.queryselectorall('[role=gridcell]'), ...
...totype.foreach.call(document.queryselectorall('[role=gridcell]'), function(el, i){ el.setattribute('tabindex', '-1'); }); tgt.setattribute('tabindex', '0'); tgt.focus(); return true; } else { return false; } } document.queryselector('table').addeventlistener("keydown", function(event) { switch (event.key) { case "arrowright": moveto(parseint(event.target.
dataset.row, 10), parseint(event.target.
dataset.col, 10) + 1); break; case "arrowleft": moveto(parseint(event.target.
dataset.row, 10), parseint(event.target.
dataset.col, 10) - 1); break; case "arrowdown": moveto(parseint(event.target.
dataset.row, 10) + 1, parseint(event.target.
dataset.col, 10)); break; case "arrowup": moveto(parseint(event.target.
dataset.ro...
...ataset.col, 10) + 1); break; case "arrowleft": moveto(parseint(event.target.
dataset.row, 10), parseint(event.target.
dataset.col, 10) - 1); break; case "arrowdown": moveto(parseint(event.target.
dataset.row, 10) + 1, parseint(event.target.
dataset.col, 10)); break; case "arrowup": moveto(parseint(event.target.
dataset.row, 10) - 1, parseint(event.target.
dataset.col, 10)); break; case "home": if (event.ctrlkey) { var i = 0; var result; do { var j = 0; var result; do { result = moveto(i, j); j++; } while (result == false); i++; } while (result == false); } else { moveto(parseint(event.target.
dataset.row, 10), 0); } ...
...And 7 more matches
Example and tutorial: Simple synth keyboard - Web APIs
to present in the virtual keyboard. it creates the elements that comprise the key and its label, adds some data attributes to the element for later use, and assigns event handlers for the events we care about. ...
...eates the elements that comprise the key and its label, adds some data attributes to the element for later use, and assigns event handlers for the events we care about. ...
...key and its label, adds some data attributes to the element for later use, and assigns event handlers for the events we care about. ...
...And 3 more matches
nsITelemetry
: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/base/telemetry;1 as a service: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t a
dataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t a
dataset, in boolean asubsession, in boolean aclear); void sethistogramrecordingenab...
...bled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(in acstring aname, in jsval avalue); void scalarsetmaximum(in acstring aname, in jsval avalue); jsval snapshotscalars(in uint32_t a
dataset, [optional] in boolean aclear); void keyedscalaradd(in acstring aname, in astring akey, in jsval avalue); void keyedscalarset(in acstring aname, in astring akey, in jsval avalue); void keyedscalarsetmaximum(in acstring aname, in astring akey, in jsval avalue); jsval snapshotkeyedscalars(in uint32_t a
dataset, [optional] in boolean aclear); void clearsca...
... a
dataset, [optional] in boolean aclear); void clearscalars(); test only void flushbatchedchildtelemetry(); void recordevent(in acstring acategory, in acstring amethod, in acstring aobject, [optional] in jsval avalue, [optional] in jsval extra); void seteventrecordingenabled(in acstring acategory, in boolean aenabled); jsval snapshotevents(in uint32_t a
dataset, [optional] in boolean aclear); void registerevents(in acstring acategory, in jsval aeventdata); void registerscalars(in acstring acategoryname, in jsval ascalardata); void clearevents(); test only attributes attribute type description canrecordbase boolean a flag indicating if telemetry can record base data (fhr data). this is tru...
... 4 for storing counter values without bucketing. histogram_categorical 5 for storing enumerated values by label. scalar types constant value description scalar_type_count 0 for storing a numeric value. scalar_type_string 1 for storing a string value. scalar_type_boolean 2 for storing a boolean value.
dataset types constant value description
dataset_release_channel_optout 0 the basic
dataset that is on-by-default on all channels.
dataset_release_channel_optin 1 the extended
dataset that is opt-in on release, opt-out on pre-release channels. methods gethistogrambyid() get an histogram by id for histograms registered in histograms.json. jsval g...
Using data attributes - Learn web development
ion. just use data attributes for that: <article id="electric-cars" data-columns="3" data-index-number="12314" data-parent="cars"> ... </article> javascript access reading the values of these attributes out in javascript is also very simple. you could use getattribute() with their full html name to read them, but the standard defines a simpler way: a domstringmap you can read out via a
dataset property. to get a data attribute through the
dataset object, get the property by the part of the attribute name after data- (note that dashes are converted to camelcase). const article = document.queryselector('#electric-cars'); article.
dataset.columns // "3" article.
dataset.indexnumber // "12314" article.
dataset.parent // "cars" each property is a string and can be read and written. in the ...
... css access note that, as data attributes are plain html attributes, you can even access them from css. ...
...ling to take effect. issues do not store content that should be visible and accessible in data attributes, because assistive technology may not access them. in addition, search crawlers may not index data attributes' values. the main issues to consider are internet explorer support and performance. internet explorer 11+ provides support for the standard, but all earlier versions do not support
dataset. to support ie 10 and under you need to access data attributes with getattribute() instead. also, the performance of reading data-attributes compared to storing this data in a regular js object is poor. that said, though, for custom element-associated metadata, they are a great solution. in firefox 49.0.2 (and perhaps earlier/later versions), the data attributes that exceed 1022 characters will...
SVGElement - Web APIs
svgelement.classname read onl...
... svgelement.classname read only an svganimatedstring that reflects the value of the class attribute on the given element, or the empty string if class is not present. this attribute is deprecated and may be removed in a future version of this specification. ...
...long the x and/or y axes. also available via the onscroll property. unload fired when the dom implementation removes an svg document from a window or frame. also available via the onunload property. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgelement' in that specification. candidate recommendation adds the
dataset property. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgelement' in that specification. recommendation initial definition ...
data-* - HTML: Hypertext Markup Language
n the html and its dom representation by scripts. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. all such custom data are available via the htmlelement interface of the element the attribute is set on. ...
...element the attribute is set on. the htmlelement.
dataset property gives access to them. the * may be replaced by any name following the production rule of xml names with the following restrictions: the name must not start with xml, whatever case is used for these letters; the name must not contain any semicolon (u+003a); the name must not contain capital letters. note that the htmlelement.
dataset property is a domstringmap, and the name of the custom data attribute data-test-value will be accessible via htmlelement.
dataset.testvalue (or by htmlelement.
dataset["testvalue"]) as any dash (u+002d) is replaced by the capitalization of the next letter, converting the name to camelcase. usage by adding data-* attributes, even ordinary html elements can become rather complex and powerful progr...
...ry html elements can become rather complex and powerful program-objects. for example, a space-ship "sprite" in a game could be a simple <img> element with a class attribute and several data-* attributes: <img class="spaceship cruiserx3" src="shipx3.png" data-ship-id="324" data-weapons="laseri laserii" data-shields="72%" data-x="414354" data-y="85160" data-z="31940" onclick="spaceships[this.
dataset.shipid].blasted()"> for a more in-depth tutorial about using html data attributes, see using data attributes. specifications specification status comment html living standardthe definition of 'data-*' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the definition of 'data-*' in that specification. recommenda...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
ght be useful when implementing drag and drop for cells in a tree. you can use the value of a cell, or some resource from an rdf file if the tree is built from a template, as the value of a drag. if you store it as a string, any object that accepts strings dragged onto it can grab the dragged data. ...
... a template, as the value of a drag. if you store it as a string, any object that accepts strings dragged onto it can grab the dragged data. if you want to send more then one data object, (for example multiple files) you must use an transfer
dataset as follows: var textobserver = { ondragstart: function (event) { var txt1 = 'hello'; var txt2 = 'there'; transferdata.data = new transfer
dataset(); var tmp = new transferdata(); tmp.adddataforflavour("text/unicode",txt1); transferdata.data.push(tmp); new transferdata(); tmp.adddataforflavour("text/unicode",txt2); transferdata.data.push(tmp); } } you will need to add an observer to each element that can either start a drag action or can accept dropped objects. you can reuse the same observer for multiple elemen...
Audio for Web games - Game development
nts, grab the correct file for each one and then allow playback by hiding the "loading" text and displaying the play button: trackels.foreach((el, i) => { // get children const anchor = el.queryselector('a'); const loadtext = el.queryselector('p'); const playbutton = el.queryselector('button'); // load file loadfile(anchor.href).then((track) => { // set loading to false el.
dataset.loading = 'false'; // hide loading text loadtext.style.display = 'none'; // show button playbutton.style.display = 'inline-block'; // allow play on click playbutton.addeventlistener('click', function() { // check if context is in suspended state (autoplay policy) if (audioctx.state === 'suspended') { audioctx.resume(); } playtrack(track...
... in the context of your game world you may have loops and samples that are played in different circumstances, and it can be useful to be able to synchronize with other tracks for a more seamless experience. note: this example does not wait for the beat to end before introducing the next...
nsITransferable
nsisupportsarray flavorstransferablecanexport( ); nsisupportsarray flavorstransferablecanimport( ); void getanytransferdata( out string aflavor, out nsisupports adata, out unsigned long adatalen ); void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); void init(in nsiloadcontext acontext); boolean islarge
dataset( ); void removedataflavor( in string adataflavor ); void settransferdata( in string aflavor, in nsisupports adata, in unsigned long adatalen ); attributes attribute type description converter nsiformatconverter an nsiformatconverter instance which implements the code needed to convert data into and out of the transferable given the supported...
...sponds 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. islarge
dataset() returns true if the data is large. boolean islarge
dataset(); parameters none. return value true if the data is large; otherwise, the result is false. removedataflavor() removes the data flavor matching the given one (as determined by a string comparison), along with the corresponding data. void removedataflavor( in string adataflavor ); parameters adataflavor the data flavo...
Element.querySelectorAll() - Web APIs
see escaping special characters for more information. return value a non-live nodelist containing one element object for each descendant node that matches at least one of the specified selectors. note: if the specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. ...
...e a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. ...
HTMLElement - Web APIs
enteditable is a domstring, where a value of true means the element is editable and a value of false means it isn't. htmlelement.iscontenteditable read only returns a boolean that indicates whether or not the content of the element can be edited. htmlelement.contextmenu is a htmlmenuelement representing the contextual menu associated with the element. it may be null. htmlorforeignelement.
dataset read only returns a domstringmap with which script can read and write the element's custom data attributes (data-*) . htmlelement.dir is a domstring, reflecting the dir global attribute, representing the directionality of the element. possible values are "ltr", "rtl", and "auto". htmlelement.draggable is a boolean indicating if the element can be dragged. htmlelement.dropzone read only r...
...ard added the following properties: translate, itemscope, itemtype, itemid, itemref, itemprop, properties, and itemvalue. added the following method: forcespellcheck(). moved the onxyz attributes to the globaleventhandlers interface and added an inheritance from it. html5the definition of 'htmlelement' in that specification. recommendation added the following properties:
dataset, hidden, tabindex, accesskey, accesskeylabel, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, commandtype, commandlabel, commandicon, commandhidden, commanddisabled, commandchecked, style, and all the onxyz properties. moved the id and classname properties to the element interface. document object model (dom) level 2 html specificationthe definition ...
HTMLOrForeignElement - Web APIs
the htmlorforeignelement mixin describes several features common to the htmlelement, svgelement and mathmlelement interfaces. each of these interfaces can, of course, add more features in addition to the ones listed below. note: htmlorforeignelement is a mixin and not an interface; you can't actually create an object of type htmlorforeignelement. ...
... the htmlorforeignelement mixin describes several features common to the htmlelement, svgelement and mathmlelement interfaces. each of these interfaces can, of course, add more features in addition to the ones listed below. note: htmlorforeignelement is a mixin and not an interface; you can't actually create an object of type htmlorforeignelement. ...
Index - Web APIs
, interface, mathml, mathmlelement, mixin, reference, svg, svgelement the htmlorforeignelement mixin describes several features common to the htmlelement, svgelement and mathmlelement interfaces. 1861 htmlelement.blur() api, html dom, htmlelement, method, reference the htmlelement.blur() method removes keyboard focus from the current element. 1862 htmlelement.
dataset api, html dom, htmlelement, htmlorforeignelement, property, read-only, reference,
dataset the
dataset property on the htmlorforeignelement interface provides read/write access to all the custom data attributes (data-*) set on the element. 1863 htmlelement.focus() api, focus, html dom, htmlelement, method, reference, scroll, view, activate the htmlelement.focus() met...
... 3728 svgdescelement api, needsexample, reference, svg, svg dom the svgdescelement interface corresponds to the <desc> element. 3729 svgelement api, interface, needsexample, reference, svg, svg dom, svgelement all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface. 3730 svgelement.
dataset property, reference, svg, svg custom attributes, svg2, svgelement,
dataset the svgelement.
dataset property allows access, both in reading and writing mode, to all the custom data attributes (data-*) set on the element. it is a map of domstrings representing keys to domstrings representing the values for those keys, with one entry for each custom data attribute. each key corresponds to t...
Using IndexedDB - Web APIs
xeddb didn’t handle internationalization of sorting strings at all, and everything was sorted as if it were english text. for example, b, á, z, a would be sorted as: a b z á which is obviously not how users want their data to be sorted — aaron and Áaron for example should go next to one another in a contacts list. ...
...chieving proper international sorting therefore required the entire
dataset to be called into memory, and sorting to be performed by client-side javascript, which is not very efficient. this new functionality enables developers to specify a locale when creating an index using idbobjectstore.createindex() (check out its parameters.) in such cases, when a cursor is then used to iterate through the
dataset, and you want to specify locale-aware sorting, you can use a specialized idblocaleawarekeyrange. idbindex has also had new properties added to it to specify if it has a locale specified, and what it is: locale (returns the locale if any, or null if none is specified) and isautolocale (returns true if the index was created with an auto locale, meaning that the platform's default locale is used, f...
Advanced techniques: Creating and sequencing audio - Web APIs
...
... audioctx.resume(); } currentnote = 0; nextnotetime = audioctx.currenttime; scheduler(); // kick off scheduling requestanimationframe(draw); // start the drawing loop. this.
dataset.playing = 'true'; } else { window.cleartimeout(timerid); this.
dataset.playing = 'false'; } }) }); summary we've now got an instrument inside our browser! keep playing and experimenting — you can expand on any of these techniques to create something much more elaborate. ...
Using IIR filters - Web APIs
soundsource.connect(audiocontext.destination); soundsource.start(); return soundsource; } this function is called when the play button is pressed. the play button html looks like this: <button class="button-play" role="switch" data-playing="false" aria-pressed="false">play</button> and the click event listener starts like so: playbutton.addeventlistener('click', function() { if (this.
dataset.playing === 'false') { srcnode = playsourcenode(audioctx, sample); ... }, false); the toggle that turns the iir filter on and off is set up in the similar way. first, the html: <button class="button-filter" role="switch" data-filteron="false" aria-pressed="false" aria-describedby="label" disabled></button> the filter button's click handler then connects the iirfilter up to the ...
...hat turns the iir filter on and off is set up in the similar way. first, the html: <button class="button-filter" role="switch" data-filteron="false" aria-pressed="false" aria-describedby="label" disabled></button> the filter button's click handler then connects the iirfilter up to the graph, between the source and the detination: filterbutton.addeventlistener('click', function() { if (this.
dataset.filteron === 'false') { srcnode.disconnect(audioctx.destination); srcnode.connect(iirfilter).connect(audioctx.destination); ... }, false); frequency response we only have one method available on iirfilternode instances, getfrequencyresponse(), this allows us to see what is happening to the frequencies of the audio being passed into the filter. let's draw a frequency plo...
Using the Web Audio API - Web APIs
ks like: now we can add the play and pause functionality. // select our play button const playbutton = document.queryselector('button'); playbutton.addeventlistener('click', function() { // check if context is in suspended state (autoplay policy) if (audiocontext.state === 'suspended') { audiocontext.resume(); } // play or pause track depending on state if (this.
dataset.playing === 'false') { audioelement.play(); this.
dataset.playing = 'true'; } else if (this.
dataset.playing === 'true') { audioelement.pause(); this.
dataset.playing = 'false'; } }, false); we also need to take into account what to do when the track finishes playing. our htmlmediaelement fires an ended event once it's finished playing, so we can listen for...
...this is where the web audio api really starts to come in handy. first of all, let's change the volume. this can be done using a gainnode, which represents how big our sound wave is. there are two ways you can create nodes with the web audio api. ...
<p>: The Paragraph element - HTML: Hypertext Markup Language
screen-readers and other assistive technology provide shortcuts to let their users skip to the next or previous paragraph, letting them skim content l...
...screen-readers and other assistive technology provide shortcuts to let their users skip to the next or previous paragraph, letting them skim content like how white space lets visual users skip around. using empty <p> elements to add space between paragraphs is probl...
Enhanced Extension Installation - Archive of obsolete content
ent descriptor of the path where the item lives. the last modified time of that path, used to detect out of process upgrades. optionally, an operation key that tells the startup system that there is an install operation pending that needs to be finalized, e.g. needs-install, needs-upgrade, needs-uninstall, needs-enable, needs-disable, needs-install when the extension manager starts, this
dataset is read into two data structures: the startup cache - a hashtable keyed off install location name and then guid, each entry having persistentdescriptor, mtime and id properties. the pending operations list - a set of entries organized into arrays hashed by operation key, each entry having a locationkey and id properties. the startup cache data structure is used to reflect the extens...
Multiple Queries - Archive of obsolete content
igated may be different for every query, so no optimization can be done. the builder needs to process every condition of every query. if, for example, you have six queries, each with a <member> condition, the builder will need to construct the children six times. you probably won't notice any difference for small amounts of data such as the photos example we've been using, but you might for large
datasets. thus, you will want to use the simple query syntax when possible. if you are only going to be using one query, it doesn't matter, of course. speaking of using a single query, the simple query syntax allows a slight shorthand. you can remove the <rule> element and place the rule's conditions directly on the <template>. there's no performance benefit, but it does save some typing. <hbox id="phot...
RDF in Mozilla FAQ - Archive of obsolete content
n of what rdf does in mozilla. the rdf back-end architecture document describes in more detail how mozilla's rdf implementation works, and gives a quick overview of the interfaces that are involved. where do i find information on open directory ("dmoz")? unfortunately, not here! well, here's a little... start at http://www.dmoz.org/ for more information on the open directory. the open directory
dataset is available as a (huge) rdf/xml dump. it describes thousands of web sites using a mix of the dublin core metadata vocabulary and the dmoz taxonomy. see their rdf pages for more information. if you have problems with the dmoz and chefmoz data, it's best to contact those projects directly. but if you do something interesting with this content (eg. have mozilla use it, eg. by loading chunks of it ...
XPCOM hashtable guide
cally resize the hashtable in memory if extra space is needed, or if too much space has been allocated. when should i use a hashtable? hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or removed. hashtables should not be used for sets that need to be sorted; very small
datasets (less than 12-16 items); data that does not need random access. in these situations, an array, a linked-list, or various tree data structures are more efficient. which hashtable should i use? the appropriate hashtable class to use depends solely on the data type. the template specialization to use depends on the data type and the key type. data type hashtable class no...
Detailed XPCOM hashtable guide
cally resize the hashtable in memory if extra space is needed, or if too much space has been allocated. when should i use a hashtable? hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or removed. hashtables should not be used for sets that need to be sorted; very small
datasets (less than 12-16 items); data that does not need random access. in these situations, an array, a linked-list, or various tree data structures are more efficient. mozilla's hashtable implementations mozilla has several hashtable implementations, which have been tested and, tuned, and hide the inner complexities of hashtable implementations: pldhash - low-level c api; stores keys and data ...
DOMStringMap - Web APIs
the domstringmap interface is used for the htmlelement.
dataset attribute, to represent data for custom attributes added to elements. specifications specification status comment html living standardthe definition of 'domstringmap' in that specification. living standard ...
GlobalEventHandlers.onmousemove - Web APIs
javascript const tooltip = new (function() { const node = document.createelement('div'); node.classname = 'tooltip'; node.setattribute('hidden', ''); document.body.appendchild(node); this.follow = function(event) { node.style.left = event.clientx + 20 + 'px'; node.style.top = event.clienty + 10 + 'px'; }; this.show = function(event) { node.textcontent = event.target.
dataset.tooltip; node.removeattribute('hidden'); }; this.hide = function() { node.setattribute('hidden', ''); }; })(); const links = document.queryselectorall('a'); links.foreach(link => { link.onmouseover = tooltip.show; link.onmousemove = tooltip.follow; link.onmouseout = tooltip.hide; }); result draggable elements we also have an example available showing the use of the onm...
Node.getUserData() - Web APIs
syntax userdata = somenode.getuserdata(userkey); parameters userkey is the key to choose the specific data sought for the given node. more than one key may have been assigned on a given node, containing its own value. ...
Node.setUserData() - Web APIs
ience of associating data with specific nodes without needing to alter the structure of a document and in a standard fashion, but it also means that extra steps may need to be taken if one wishes to serialize the information or include the information upon clone, import, or rename operations. the node.getuserdata and node.setuserdata methods are no longer available from web content. htmlelement.
dataset or weakmap can be used instead. syntax var prevuserdata = somenode.setuserdata(userkey, userdata, handler); parameters userkey is used as the key by which one may subsequently obtain the stored data. more than one key can be set for a given node. handler is a callback which will be called any time the node is being cloned, imported, renamed, as well as if deleted or adopted; a function ca...
SVGAngle - Web APIs
derlying stored value, but reset the stored unit identifier to the given unittype. object attributes unittype, valueinspecifiedunits, and valueasstring might be modified as a result of this method. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgelement' in that specification. candidate recommendation adds the
dataset property. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgelement' in that specification. recommendation initial definition ...
Web audio spatialization basics - Web APIs
ontrols wiring up out control buttons is comparatively simple — now we can listen for a mouse event on our controls and run this function, as well as stop it when the mouse is released: // for each of our controls, move the boombox and change the position values movecontrols.foreach(function(el) { let moving; el.addeventlistener('mousedown', function() { let direction = this.
dataset.control; if (moving && moving.frameid) { window.cancelanimationframe(moving.frameid); } moving = moveboombox(direction); }, false); window.addeventlistener('mouseup', function() { if (moving && moving.frameid) { window.cancelanimationframe(moving.frameid); } }, false) }) summary hopefully, this article has given you...
Creating and triggering events - Developer guides
rer being the exception). for a more verbose approach (which works with internet explorer), see the old-fashioned way below. adding custom data – customevent() to add more data to the event object, the customevent interface exists and the detail property can be used to pass custom data. for example, the event could be created as follows: const event = new customevent('build', { detail: elem.
dataset.time }); this will then allow you to access the additional data in the event listener: function eventhandler(e) { console.log('the time is: ' + e.detail); } the old-fashioned way the older approach to creating events uses apis inspired by java. the following shows an example with document.createevent(): // create the event. const event = document.createevent('event'); // define that the ...
Global attributes - HTML: Hypertext Markup Language
contextmenu the id of a <menu> to use as the contextual menu for this element. data-* forms a class of attributes, called custom data attributes, that allow proprietary information to be exchanged between the html and its dom representation that may be used by scripts. all such custom data are available via the htmlelement interface of the element the attribute is set on. the htmlelement.
dataset property gives access to them. dir an enumerated attribute indicating the directionality of the element's text. it can have the following values: ltr, which means left to right and is to be used for languages that are written from the left to the right (like english); rtl, which means right to left and is to be used for languages that are written from the right to the left (like arabic); ...
data-* - SVG: Scalable Vector Graphics
the data-* svg attributes are called custom data attributes. they let svg markup and its resulting dom share information that standard attributes can't, usually for scripting purposes. their custom data are available via the svgelement interface of the element the attributes belong to, with the svgelement.
dataset property. the * can be replaced by any characters allowed in xml's rules for names, with the following restrictions: can't start with xml. no semicolons (;, u+003a). no capital a to z letters. the svgelement.
dataset property is a domstringmap that provides the attribute data-test-value via svgelement.
dataset.testvalue. hyphen characters (-, u+002d) are removed and the next letter is capitalized, resulting in the camelcase format. specifications specification stat...
SVG documentation index - SVG: Scalable Vector Graphics
the d attribute defines a path to be drawn. 55 data-* attribute, svg the data-* svg attributes are called custom data attributes. they let svg markup and its resulting dom share information that standard attributes can't, usually for scripting purposes. their custom data are available via the svgelement interface of the element the attributes belong to, with the svgelement.
dataset property. 56 descent deprecated, svg, svg attribute the descent attribute defines the maximum unaccented depth of the font. 57 diffuseconstant filters, svg, svg attribute the diffuseconstant attribute represents the kd value in the phong lighting model. in svg, this can be any non-negative number. 58 direction svg, svg attribute the d...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
us unknown svgviewspec removed implementation status unknown svgelement.style removed implementation status unknown svggraphicselement.gettransformtoelement() removed not removed yet svggraphicselement.getctm() on the outermost element implementation status unknown animval attribute alias of baseval implementation status unknown
dataset attribute for svgelement implementation status unknown moved pathlength attribute and gettotallength() and getpointatlength() methods from svgpathelement to svggeometryelement implemented (bug 1239100) document structure change notes svgsvgelement.suspendredraw(), svgsvgelement.unsuspendredraw(), and svgsvgelement.unsuspendredrawall() deprecated ...