Search completed in 1.31 seconds.
StaticRange.StaticRange() - Web APIs
the
staticrange() constructor creates a new
staticrange object representing a span of content within the dom.
... syntax var
staticrange = new
staticrange(rangespec) parameters rangespec the required rangespec parameter is an object adhering to the
staticrangeinit dictionary.
... return value a new
staticrange object initialized with the values given in the rangespec object.
... specifications specification status comment domthe definition of '
staticrange()' in that specification.
StaticRange - Web APIs
the dom
staticrange interface extends abstractrange to provide a method to specify a range of content in the dom whose contents don't update to reflect changes which occur within the dom tree.
... abstractrange and
staticrange are not available from web workers.
..."50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">abstractrange</text></a><polyline points="131,25 141,20 141,30 131,25" stroke="#d4dde4" fill="none"/><line x1="141" y1="25" x2="171" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/
staticrange" target="_top"><rect x="171" y="1" width="110" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">
staticrange</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor
staticrange() ...
...And 11 more matches
Static Content - Archive of obsolete content
instead it will be what is called
static content in a template.
... the
static content is any content that is a sibling of the template element.
...the
static content outside the template will also be created.
...And 9 more matches
static - JavaScript
the
static keyword defines a
static method for a class.
...
static methods aren't called on instances of the class.
... syntax
static methodname() { ...
...And 8 more matches
Static Analysis for Windows Code under Linux - Archive of obsolete content
this document will describe how to run mozilla
static check for windows code under linux platform by creating a cross-compiler with dehydra support for mingw.
... check the build run: make check_treehydra run
static analysis on mozilla windows code
static analysis is hooked into mozilla repository from mozilla 2.
... you can obtain mozilla 2 code by: hg clone http://hg.mozilla.org/mozilla-central/ and compose a .mozconfig file for cross-compiling mozilla with
static analysis hooked: #specify the cross compile cross_compile=1 ac_add_options --enable-application=browser ac_add_options --host=i686-linux ac_add_options --target=i686-mingw32 ac_add_options --enable-default-toolkit=cairo-windows mk_add_options moz_objdir=@topsrcdir@/../mozilla-mingw # mozilla trunk uses many vista only features on windows, so we should disable some components to make it buildable with mingw32.
...And 3 more matches
PR_INIT_STATIC_CLIST
statically initializes a circular list.
... syntax #include <prclist.h> pr_init_
static_clist (prclist *listp); parameter listp a pointer to the anchor of the linked list.
... description pr_init_
static_clist
statically initializes the specified list to be an empty list.
... for example, prclist free_object_list = pr_init_
static_clist(&free_object_list); ...
JS_ClearRegExpStatics
syntax bool js_clearregexp
statics(jscontext *cx, handleobject obj); name type description cx jscontext * the context.
... description js_clearregexp
statics clears the pending input string and flags of the built-in regexp object.
... on successful, js_clearregexp
statics returns true, otherwise returns false.
... see also mxr id search for js_clearregexp
statics js_newregexpobject js_newucregexpobject js_setregexpinput regexp ...
Making it into a static overlay - Archive of obsolete content
static overlays are added to a xul file via a reference at the top of the file (much like stylesheets and javascript scripts).
...we'll first make the file into a
static overlay, then we'll make it into a dynamic overlay.
... to make the file into a
static overlay, we need to move all the code we added to navigator.xul into a new file tinderstatusoverlay.xul in the same directory: <?xml version="1.0"?> <?xml-stylesheet href="chrome://navigator/content/tinderstatus.css" type="text/css"?> <overlay id="tinderstatusoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://navigator/content/tinderstatus.js" /> <statusbar id="status-bar"> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" insertbefore="offline-status" status="none"/> </statusbar> </overlay> tinderstatusoverlay.xul starts with an xml processing instruction that identifies the file as xml (all xul files n...
Static method - MDN Web Docs Glossary: Definitions of Web-related terms
a
static method (or
static function) is a method defined as a member of an object but is accessible directly from an api object's constructor, rather than from an object instance created via the constructor.
... in a web api, a
static method is one which is defined by an interface but can be called without instantiating an object of that type first.
... examples in the notifications api, the notification.requestpermission() method is called on the actual notification constructor itself — it is a
static method: let promise = notification.requestpermission(); the notification.close() method on the other hand, is an instance method — it is called on an specific notification object instance to close the system notification it represents: let mynotification = new notification('this is my notification'); mynotification.close(); ...
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
the read-only parameterdescriptors property of an audioworkletprocessor-derived class is a
static getter, which returns an iterable of audioparamdescriptor-based objects.
... we expand the processor by adding a
static parameterdescriptors getter.
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor {
static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
RTCRtpReceiver.getCapabilities() static function - Web APIs
the
static function rtcrtpreceiver.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by rtcrtpreceivers on the current device.
... you can, similarly, obtain the capabilities of rtcrtpsenders by calling the
static function rtcrtpsender.getcapabilities().
... description as a
static function, this is always called using the form: capabilities = rtcrtpreceiver.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list.
RTCRtpSender.getCapabilities() static function - Web APIs
the
static function rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by the rtcrtpsender.
... you can, similarly, obtain the capabilities of rtcrtpreceivers by calling the
static function rtcrtpreceiver.getcapabilities().
... description as a
static function, this is always called using the form: capabilities = rtcrtpsender.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list.
StaticRange.collapsed - Web APIs
the collapsed read-only property of the
staticrange interface returns true if the range's start position and end position are the same.
... syntax var iscollpased =
staticrange.collapsed value a boolean value which is true if the range is collapsed.
... living standard
static rangethe definition of 'collapsed' in that specification.
StaticRange.endContainer - Web APIs
the endcontainer property of the
staticrange interface returns the end node for the range.
... syntax var node =
staticnode.endcontainer
staticnode.endcontainer = endcontainer value the dom node which contains the final character of the range.
... living standard
static rangethe definition of 'endcontainer' in that specification.
StaticRange.endOffset - Web APIs
the endoffset property of the
staticrange interface returns the offset into the end node of the range's end position.
... syntax var endoffset =
staticrange.endoffset value an integer value indicating the number of characters into the node indicated by endcontainer at which the final character of the range is located.
... living standard
static rangethe definition of 'endoffset' in that specification.
StaticRange.startContainer - Web APIs
the read-only startcontainer property of the
staticrange interface returns the start node for the range.
... syntax var node =
staticnode.startcontainer value the dom node inside which the start position of the range is found.
... living standard
static rangethe definition of 'startcontainer' in that specification.
StaticRange.startOffset - Web APIs
the read-only startoffset property of the
staticrange interface returns the offset into the start node of the range's start position.
... syntax var startoffset =
staticrange.startoffset value an integer value indicating the number of characters into the node indicated by startcontainer at which the first character of the range is located.
... living standard
static rangethe definition of 'startoffset' in that specification.
StaticRange.toRange() - Web APIs
the torange() property of the
staticrange interface converts the
staticrange object to a range object.
... syntax var range =
staticrange.torange() parameters none.
... specifications specification status comment
static rangethe definition of 'torange()' in that specification.
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
the
static method xrwebgllayer.getnativeframebufferscalefactor() returns a floating-point scaling factor by which one can multiply the specified xrsession's resolution to get the native resolution of the webxr device's frame buffer.
...when the returned promise resolves, we proceed by calling xrwebgllayer's getnativeframebufferscalefactor()
static function to get the scale factor needed to reach the native resolution, and we then pass that into the webgllayer() constructor as the value of the framebufferscalefactor property in its layerinit dictionary, which is an xrwebgllayerinit object.
... specifications specification status comment webxr device apithe definition of '
static xrwebgllayer.getnativeframebufferscalefactor()' in that specification.
Square tilemaps implementation: Static maps - Game development
this article covers how to implement
static square tilemaps using the canvas api.
...if (tile !== 0) { // 0 => empty tile context.drawimage( tileatlas, // image (tile - 1) * map.tsize, // source x 0, // source y map.tsize, // source width map.tsize, // source height c * map.tsize, // target x r * map.tsize, // target y map.tsize, // target width map.tsize // target height ); } } } demo our
static tilemap implementation demo pulls the above code together to show what an implementation of this map looks like.
PRStaticLinkTable
a
static link table entry can be created by a client of the runtime so that other clients can access
static or dynamic libraries transparently.
... syntax #include <prlink.h> typedef struct pr
staticlinktable { const char *name; void (*fp)(); } pr
staticlinktable; ...
nsStaticModuleInfo
summary this data structure is used by ns_initxpcom3 to specify
static xpcom modules.
... #include "nsxpcom.h" struct ns
staticmoduleinfo { const char* name; nsgetmoduleproc getmodule; }; members name this member provides the name of the module as a null-terminated, ascii-valued character array.
PR_STATIC_ASSERT
syntax #include <prlog.h> pr_
static_assert ( expression ); parameters the macro has this parameter: expression any valid expression which evaluates at compile-time to true or false.
Clang static analysis
moved to https://firefox-source-docs.mozilla.org/code-quality/
static-analysis.html ...
CSS.paintWorklet (Static property) - Web APIs
paintworklet is a
static, read-only property of the css interface that provides access to the paintworklet, which programmatically generates an image where a css property expects a file.
Index - Web APIs
they are instantiated during creation of the underlying audioworkletprocessor according to its parameterdescriptors
static getter.
... 213 audioworkletprocessor.parameterdescriptors api, audioworkletprocessor, experimental, property, reference, parameterdescriptors the read-only parameterdescriptors property of an audioworkletprocessor-derived class is a
static getter, which returns an iterable of audioparamdescriptor-based objects.
...no object with this interface are implemented: it contains only
static methods and therefore is a utilitarian interface.
...And 27 more matches
Mozilla DOM Hacking Guide
static nsiclassinfo* getclassinfoinstance(nsdomclassinfoid aid): this helper method returns a non-refcounted nsiclassinfo pointer to an instance of the helper class corresponding to the id passed in.
...
static nsiclassinfo* getclassinfoinstance(nsdomclassinfodata* adata);: this helper method returns a non-refcounted nsiclassinfo pointer to an instance of the helper class corresponding to the data passed in.
...
static void shutdown(): releases the interface pointers.
...And 26 more matches
Following the Android Toasts Tutorial from a JNI Perspective
to load the class the following is done: let toast = jni.loadclass(my_jenv, sig.toast.substr(1, sig.toast.length - 2), { // declares of constructors,
static_methods, methods, fields, and
static_fields go here }); the variable name of toast was used, but it does not matter, you can use whatever you want.
... determine
static-ness of methods declare them there are two types of methods, chainable and
static.
... if it is
static, this means that it can be called directly from the class.
...And 17 more matches
WebIDL bindings
non-
static methods that use certain webidl types like any or object will get a jscontext* argument prepended to the argument list.
...
static methods will be passed a const globalobject& for the relevant global and can get a jscontext* by calling context() on it.
...otherinstance); [throws] myinterface dosomethingelse(optional long maybenumber); [throws] void dosomethingelse(myinterface otherinstance); void dotheother(any something); void doyetanotherthing(optional boolean actuallydoit = false);
static void
staticoperation(any arg); }; will require these method declarations: class myclass { void dosomething(int32_t anumber); double dosomething(myclass* aotherinstance); already_addrefed<myinterface> dosomethingelse(optional<int32_t> amaybenumber, errorresult& rv); void dosomethingelse(myclass& aotherinstance, errorresult& rv); void d...
...And 16 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
/ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } headertype; /* * print usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s %s %s %s %s %s %s %s %s %s\n\n", progname, " -<g|a|h|e|ds|v> -d <dbdirpath> ", "[-p <dbpwd> | -f <dbpwdfile>] [-z <noisefilename>] [-a <\"\">]", "-s <subject> -r <csr> | ", "-n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serial...
... "-r <csr>"); fprintf(stderr, "%-30s - generate a self-signed cert [optional]\n\n", "-x"); fprintf(stderr, "%-30s - to enable ascii [optional]\n\n", "-a"); fprintf(stderr, "%-30s - to save certificate to header file as sig verification [optional]\n\n", "-v"); exit(-1); } /* * validate the options used for generate csr command */
static void validategeneratecsrcommand(const char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name:...
... %s -s %s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */
static void validateaddcerttodbcommand(const char *progname, const char *dbdir, const char *nicknamestr, const char *truststr, const char *certfilename, const char *certreqfilename, const char *issuernamestr, ...
...And 11 more matches
sample2
#define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif /* sample 6 commands */ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } headertype; /* * print usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s %s %s %s %s %s %s %s %s %s\n\n", progname, " -<g|a|h|e|ds|v> -d <dbdirpath> ", "[-p <dbpwd> | -f <dbpwdfile>] [-z <noisefilename>] [-a <\"\">]", "-s <subject> -r <csr> | ", "-n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ] | ", "-n <nickname> -b <headerfilename> | ", "-b <headerfilenam...
...kname>"); fprintf(stderr, "%-30s - certificate signing request \n\n", "-r <csr>"); fprintf(stderr, "%-30s - generate a self-signed cert [optional]\n\n", "-x"); fprintf(stderr, "%-30s - to enable ascii [optional]\n\n", "-a"); fprintf(stderr, "%-30s - to save certificate to header file as sig verification [optional]\n\n", "-v"); exit(-1); } /* * validate the options used for generate csr command */
static void validategeneratecsrcommand(const char *progname, const char *dbdir, certname *subject, const char *subjectstr, const char *certreqfilename) { prbool validationfailed = pr_false; if (!subject) { pr_fprintf(pr_stderr, "%s -g -d %s -s: improperly formatted name: \"%s\"\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (!certreqfilename) { pr_fprintf(pr_stderr, "%s -g -d %s -s %...
...s -r: certificate request file name not found\n", progname, dbdir, subjectstr); validationfailed = pr_true; } if (validationfailed) { fprintf(stderr, "\nusage: %s %s \n\n", progname, "-g -d <dbdirpath> -s <subject> -r <csr> \n"); exit(-1); } } /* * validate the options used for add cert to db command */
static void validateaddcerttodbcommand(const char *progname, const char *dbdir, const char *nicknamestr, const char *truststr, const char *certfilename, const char *certreqfilename, const char *issuernamestr, const char *serialnumberstr, prbool selfsign) { prbool validationfailed = pr_false; if (!nicknamestr) { pr_fprintf(pr_stderr, "%s -a -d %s -n : nick name is missing\n", progname, dbdir); validationfailed = pr_true; } if (!truststr) { pr_fprintf(pr_stderr, "%s -a -d %s -n %s -t: trust flag is...
...And 11 more matches
Introduction to client-side frameworks - Learn web development
a brief history when javascript debuted in 1996, it added occasional interactivity and excitement to a web that was, up until then, composed of
static documents.
... alternatives to client-side frameworks if you’re looking for tools to expedite the web development process, and you know your project isn’t going to require intensive client-side javascript, you could reach for one of a handful of other solutions for building the web: a content management system server-side rendering a
static site generator content management systems content-management systems (cmses) are any tools that allow a user to create content for the web without directly writing code themselves.
...
static site generators
static site generators are programs that dynamically generate all the webpages of a multi-page website — including any relevant css or javascript — so that they can be published in any number of places.
...And 10 more matches
filter - CSS: Cascading Style Sheets
filter: blur(5px) <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">
static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td> <div class="svg-container"> <svg id="img3" overflow...
..."/> <fefuncb type="linear" slope="[amount]"/> </fecomponenttransfer> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">
static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3708/test_form.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3708/test_form.jpg" style="width: 100%;" /></td> <td><div class="svg-container"><svg xmlns="http://www.w3.org/2000/svg" id="img...
...e="[amount]" intercept="-(0.5 * [amount]) + 0.5"/> </fecomponenttransfer> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">
static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form_3.jpeg" id="img1" class="internal default" src="/files/3712/test_form_3.jpeg" style="width: 100%;" /></td> <td><img alt="test_form_3.jpg" id="img2" class="internal default" src="/files/3712/test_form_3.jpeg" style="width: 100%;" /></td> <td><div class="svg-container"><svg xmlns="http://www.w3.org/2000/s...
...And 9 more matches
How Mozilla's build system works
make echo-dirs show the list of non-
static source directories to iterate over, as determined by the tier list.
... make echo-variable-
static_dirs show the list of
static source directories to iterate over, as determined by the tier list.
... makefile examples standard makefile header installing headers using exports compiling interfaces using xpidlsrcs installing a javascript component building a component dll building a
static library building a dynamic library makefiles - best practices and suggestions makefile - targets makefile - variables, values makefile - *.mk files & user config building libraries there are three main types of libraries that are built in mozilla: components are shared libraries (except in
static builds), which are installed to dist/bin/components.
...And 8 more matches
Private class fields - JavaScript
syntax class classwithprivatefield { #privatefield } class classwithprivatemethod { #privatemethod() { return 'hello world' } } class classwithprivate
staticfield {
static #private_
static_field } examples private
static fields private fields are accessible on the class constructor from inside the class declaration itself.
... the limitation of
static variables being called by only
static methods still holds.
... class classwithprivate
staticfield {
static #private_
static_field
static public
staticmethod() { classwithprivate
staticfield.#private_
static_field = 42 return classwithprivate
staticfield.#private_
static_field } } console.assert(classwithprivate
staticfield.public
staticmethod() === 42) private
static fields are added to the class constructor at class evaluation time.
...And 8 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
otherwise you will have to link
statically to your module if you use these public headers in other modules.
... personally i would discourage this practice (among other things,
static linking means the same code gets loaded more than once into memory, and the code won't be available from javascript or other non-c++ languages) and encourage the use of xpcom wherever possible.
...topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk is_component = 1 module = myextension library_name = myextension use_
static_libs = 1 xpi_name = myextension cppsrcs = \ myfirstcomponent.cpp \ mysecondcomponent.cpp \ myextension.cpp \ $(null) include $(topsrcdir)/config/rules.mk extra_dso_ldopts += \ $(moz_component_libs) \ $(nspr_libs) \ $(null) in this example, the first two files contain the implementation of the extension's two components.
...And 7 more matches
Client-Server Overview - Learn web development
both
static and dynamic websites (discussed in the following sections) use exactly the same communication protocol/patterns.
...
static sites a
static site is one that returns the same hard coded content from the server whenever a particular resource is requested.
... so for example if you have a page about a product at /
static/myproduct1.html, this same page will be returned to every user.
...And 7 more matches
JSAPI User Guide
static jsclass globalclass = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_resolvestub, js_convertstub, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; // the error reporter callback.
...
static jsfunctionspec myjs_global_functions[] = { js_fs("rand", myjs_rand, 0, 0), js_fs("srand", myjs_srand, 0, 0), js_fs("system", myjs_system, 1, 0), js_fs_end }; ...
...how can a
statically typed language, like c or c++, in which all variables have types, interact with javascript?
...And 7 more matches
Using the CSS Painting API - Web APIs
if set to false, all colours used on the canvas will be fully opaque */
static get contextoptions() { return { alpha: true }; } /* ctx is the 2d drawing context a subset of the html5 canvas api.
... the code to do this looks like so: registerpaint('headerhighlight', class {
static get contextoptions() { return { alpha: true }; } /* ctx is the 2d drawing context size is the paintsize, the dimensions (height and width) of the box being painted */ paint(ctx, size) { ctx.fillstyle = 'hsla(55, 90%, 60%, 1.0)'; ctx.fillrect( 0, size.height / 3, size.width * 0.4, size.height * 0.6 ); } }); this code example has two diffe...
... registerpaint('csspaintfunctionname', class {
static get inputproperties() { return ['propertyname1', '--custompropertyname2']; }
static get inputarguments() { return ['<color>']; }
static get contextoptions() { return {alpha: true}; } paint(drawingcontext, elementsize, stylemap) { // paint code goes here.
...And 7 more matches
Public class fields - JavaScript
both
static and instance public fields are writable, enumerable, and configurable properties.
... syntax class classwithinstancefield { instancefield = 'instance field' } class classwith
staticfield {
static staticfield = '
static field' } class classwithpublicinstancemethod { publicmethod() { return 'hello world' } } examples public
static fields public
static fields are useful when you want a field to exist only once per class, not on every class instance you create.
... public
static fields are declared using the
static keyword.
...And 7 more matches
cfx - Archive of obsolete content
supported options you can point cfx run at a different package.json file using the --pkgdir option, and pass arguments to your add-on using the --
static-args option.
... --
static-args=
static_args pass arguments to your add-on, in json format.
...you can also embed arguments in the xpi using the --
static-args option: if you do this the arguments will be passed to your add-on whenever it is run.
...And 6 more matches
What is a web server? - Learn web development
(if the server doesn't find the requested document, it returns a 404 response instead.) to publish a website, you need either a
static or a dynamic web server.
... a
static web server, or stack, consists of a computer (hardware) with an http server (software).
... we call it "
static" because the server sends its hosted files as-is to your browser.
...And 6 more matches
Theme concepts
these theme options can be implemented as
static themes (although the theme images themselves may be animated) or as dynamic themes created in a browser extension.
...
static themes
static themes are specified using the same resources as a browser extension: a manifest.json file to define the theme components with those components stored in the same folder as the manifest.json file or a sub folder.
... you can also use the theme generator on amo to create a
static theme.
...And 6 more matches
Creating localizable web applications
good: <h1> <?printf("<a href=\"%s\"><img src=\"/
static/img/logo.png\" alt=\"" .
...better: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img src="/
static/img/logo.png" alt="<?= /* l10n: link title attribute */ _("mozilla labs personas"); ?> " /> </a> </h1> ...but don't sacrifice flexibility don't sacrifice flexibility trying to satisfy the rule above.
...if you do, if the
static uri changes, you'll have to regenerate the *.po files to include the new msgids.
...And 6 more matches
Modularization techniques - Archive of obsolete content
a
static object would chose to ignore reference counts altogether.
... class nscomponentmanager { public: // finds a factory for a specific class id
static nsresult findfactory(const nscid &aclass, nsifactory **afactory); // creates a class instance for a specific class id
static nsresult createinstance(const nscid &aclass, const nsiid &aiid, nsisupports *adelegate, void **aresult); // manually registry a factory for...
... a class
static nsresult registerfactory(const nscid &aclass, nsifactory *afactory, prbool areplace); // manually registry a dynamically loaded factory for a class
static nsresult registerfactory(const nscid &aclass, const char *alibrary, prbool areplace, prbool apersist); // manually unregister a factory for a class
static nsresult unregisterfactory(const nscid &aclass, nsifactory *afactory); // manually unregister a dynamically loaded factory for a class
static nsresult unregisterfactory(const nscid &aclass, const char *alibrary); // unload...
...And 5 more matches
How to embed the JavaScript engine
*/
static jsclass global_class = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_resolvestub, js_convertstub, }; int main(int argc, const char *argv[]) { jsruntime *rt = js_newruntime(8l * 1024 * 1024, js_use_helper_threads); if (!rt) return 1; jscontext *cx = js_...
...*/
static jsclass global_class = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_resolvestub, js_convertstub, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; int main(int argc, const char *argv[]) { js_init(); jsruntime *rt = js_newruntime(...
...*/
static jsclass global_class = { "global", jsclass_global_flags, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; int main(int argc, const char *argv[]) { js_init(); jsruntime *rt = js_newruntime(8l * 1024 * 1024); if (!rt) return 1; jscontext *c...
...And 5 more matches
Invariants
some commonly used strings are allocated
statically; see jsstring::is
static().
... "are we in a request on cx?", where cx is any variable of type jscontext *, is a
static yes for most lines of code where such a variable exists.
... occasionally it's a
static no; other times we don't care.
...And 5 more matches
JS_InitClass
syntax jsobject * js_initclass(jscontext *cx, js::handleobject obj, js::handleobject parent_proto, const jsclass *clasp, jsnative constructor, unsigned nargs, const jspropertyspec *ps, const jsfunctionspec *fs, const jspropertyspec *
static_ps, const jsfunctionspec *
static_fs); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...if constructor is null, then
static_ps and
static_fs must also be null.
...(this is the javascript equivalent of public, non-
static methods in c++ or java.)
static_ps jspropertyspec * either null or a pointer to the first element of an array of jspropertyspecs, terminated by the null jspropertyspec.
...And 5 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
is it a link,
static text, editable text, a checkbox, or a table cell, etc.
... role_columnheader role_rowheader role_column role_row role_cell [important] role_link [important] role_helpballoon role_character role_list [important] role_listitem [important] role_outline [important] role_outlineitem [important] role_pagetab [important] role_propertypage [important] role_indicator role_graphic [important] role_
statictext [important] role_text [important] role_pushbutton [important] role_checkbutton [important] role_radiobutton [important] role_combobox [important] role_droplist [important] role_progressbar [important] role_dial role_hotkeyfield role_slider role_spinbutton role_diagram role_animation role_equation role_buttondropdown role_buttonme...
...other problems occur when a piece of
static text which has the same color background, which will cause that text to be repeated each time the focus or highlight moves.
...And 5 more matches
Index - Archive of obsolete content
394 making it into a dynamic overlay and packaging it up for distribution add-ons, extensions now that we have a
static overlay we're in good shape to create a xpi package that installs our extension as a dynamic overlay.
... 395 making it into a
static overlay add-ons, extensions now that we have a working mozilla extension that shows tinderbox status, we need to make it distributable to other users.
... 639
static analysis for windows code under linux this document will describe how to run mozilla
static check for windows code under linux platform by creating a cross-compiler with dehydra support for mingw.
...And 4 more matches
NS_InitXPCOM3
« xpcom api reference summary the ns_initxpcom3 function initiates use of xpcom in the calling process with support for
statically defined xpcom modules.
... #include "nsxpcom.h" nsresult ns_initxpcom3( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider, ns
staticmoduleinfo const* a
staticmodules, pruint32 a
staticmodulecount ); parameters aresult [out] the resulting xpcom service manager.
... a
staticmodules [in] an array of ns
staticmoduleinfo objects.
...And 4 more matches
CSS - Web APIs
no objects with this interface are implemented: it contains only
static methods and is therefore a utilitarian interface.
... properties the css interface is a utility interface and no object of this type can be created: only
static properties are defined on it.
...
static properties css.paintworklet secure context provides access to the worklet responsible for all the classes related to painting.
...And 4 more matches
Classes - JavaScript
class rectangle { constructor(height, width) { this.height = height; this.width = width; } // getter get area() { return this.calcarea(); } // method calcarea() { return this.height * this.width; } } const square = new rectangle(10, 10); console.log(square.area); // 100
static methods the
static keyword defines a
static method for a class.
...
static methods are called without instantiating their class and cannot be called through a class instance.
...
static methods are often used to create utility functions for an application.
...And 4 more matches
Using Dependent Libraries In Extension Components - Archive of obsolete content
lue_s.$(lib_suffix) \ $(xpcom_frozen_ldopts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" extensions/stub/bdsstubloader.cpp // copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include "nsmodule.h" #include "prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscomptr.h"
static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdependent1.so on linux moz_dll_prefix "dependent1" moz_dll_suffix, moz_dll_prefix "dependent2" moz_dll_suffix, nsnull // note: if the dependent libs themselves depend on other libs, the subdependencies // should be listed first.
... }; // component.dll on windows, libcomponent.so on linux
static char krealcomponent[] = moz_dll_prefix "component" moz_dll_suffix; nsresult nsgetmodule(nsicomponentmanager* acompmgr, nsifile* alocation, nsimodule* *aresult) { nsresult rv; // this is not the real component.
...#include <mach-o/loader.h> #include <mach-o/dyld.h>
static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdependent1.so on linux, libdependent1.dylib on mac moz_dll_prefix "dependent1" moz_dll_suffix, moz_dll_prefix "dependent2" moz_dll_suffix, nsnull // note: if the dependent libs themselves depend on other libs, the subdependencies // should be listed first.
...And 3 more matches
Positioning - Learn web development
static positioning
static positioning is the default that every element gets — it just means "put the element into its normal position in the document layout flow — nothing special to see here." to demonstrate this, and get your example set up for future sections, first add a class of positioned to the second <p> in the html: <p class="positioned"> ...
... </p> now add the following rule to the bottom of your css: .positioned { position:
static; background: yellow; } if you now save and refresh, you'll see no difference at all, except for the updated background color of the 2nd paragraph.
... this is fine — as we said before,
static positioning is the default behavior!
...And 3 more matches
Introduction to Network Security Services
shared libraries network security services provides both
static libraries and shared libraries.
... for information on which
static libraries in nss 3.1.1 are replaced by each of the above shared libraries in nss 3.2 , see migration from nss 3.1.1.
...(note that nspr is a separate mozilla project; see netscape portable runtime for details.) figure 1 relationships among core nss libraries and nspr naming conventions and special libraries windows and unix use different naming conventions for
static and dynamic libraries: windows unix
static .lib .a dynamic .dll .so or .sl in addition, windows has "import" libraries that bind to dynamic libraries.
...And 3 more matches
Working with Multiple Versions of Interfaces
nscomptr<nsiaccessible> accnode; rv = refp->getaccessiblefor(node, getter_addrefs(accnode)); if(ns_failed(rv)){ return self; } void *wh = null; nscomptr<nsiaccessibledocument> accdocnode; accdocnode = do_queryinterface(accnode, &rv); if(ns_failed(rv)){ return self; } rv = accdocnode->getwindowhandle(&wh); if(ns_succeeded(rv)){ self =
static_cast<hwnd>(wh); } return self; } this approach worked, as is, for versions as early as firefox 1.5.
...we first dredge out the old interface identifiers from our yea olde firefox 1.5 sdk:
static const nsiid iar_iid_old = { 0x663ca4a8, 0xd219, 0x4000, { 0x92, 0x5d, 0xd8, 0xf6, 0x64, 0x06, 0xb6, 0x26 }};
static const nsiid iad_iid_old = {0x8781fc88, 0x355f, 0x4439, { 0x88, 0x1f, 0x65, 0x04, 0xa0, 0xa1, 0xce, 0xb6 }}; then follow the recipe.
...v)){ return self; } nscomptr<nsiaccessible> accnode; rv = refp->getaccessiblefor(node, getter_addrefs(accnode)); if(ns_failed(rv)){ return self; } void *wh = null; nscomptr<nsiaccessibledocument> accdocnode; rv = accnode->queryinterface(iad_iid_old, getter_addrefs(accdocnode)); if(ns_failed(rv)){ return self; } rv = accdocnode->getwindowhandle(&wh); if(ns_succeeded(rv)){ self =
static_cast<hwnd>(wh); } return self; } there is good news and bad news.
...And 3 more matches
import - JavaScript
the
static import statement is used to import read only live bindings which are exported by another module.
... (async () => { if (somethingistrue) { const { default: mydefault, foo, bar } = await import('/modules/my-module.js'); } })(); dynamic imports the standard import syntax is
static and will always result in all code in the imported module being evaluated at load time.
...the following are some reasons why you might need to use dynamic import: when importing
statically significantly slows the loading of your code and there is a low likelihood that you will need the code you are importing, or you will not need it until a later time.
...And 3 more matches
Performance fundamentals - Web Performance
fully
static content is the exception rather than the rule for rich applications.
... on the same note, notice that locally-cached,
static resources can be loaded much faster than dynamic data fetched over high-latency, low-bandwidth mobile networks.
...use html and css to implement content that's mostly
static, scrolled, and infrequently animated.
...And 3 more matches
requiredFeatures - SVG: Scalable Vector Graphics
http://www.w3.org/tr/svg11/feature#svg at least one of the following feature is supported: http://www.w3.org/tr/svg11/feature#svg-
static http://www.w3.org/tr/svg11/feature#svg-animation http://www.w3.org/tr/svg11/feature#svg-dynamic http://www.w3.org/tr/svg11/feature#svgdom http://www.w3.org/tr/svg11/feature#svgdom at least one of the following feature is supported: http://www.w3.org/tr/svg11/feature#svgdom-
static http://www.w3.org/tr/svg11/feature#svgdom-animation http://www.w3.org/tr/svg11/feature#svgdom-d...
...ynamic http://www.w3.org/tr/svg11/feature#svg-
static the browser supports all the following features: http://www.w3.org/tr/svg11/feature#coreattribute http://www.w3.org/tr/svg11/feature#structure http://www.w3.org/tr/svg11/feature#containerattribute http://www.w3.org/tr/svg11/feature#conditionalprocessing http://www.w3.org/tr/svg11/feature#image http://www.w3.org/tr/svg11/feature#style http://www.w3.org/tr/svg11/feature#viewportattribute http://www.w3.org/tr/svg11/feature#shape http://www.w3.org/tr/svg11/feature#text http://www.w3.org/tr/svg11/feature#paintattribute http://www.w3.org/tr/svg11/feature#opacityattribute http://www.w3.org/tr/svg11/feature#graphicsattribute http://www.w3.org/tr/svg11/feature#marker http://www.w3.org/tr/svg11/feature#colorprofile...
...w.w3.org/tr/svg11/feature#gradient http://www.w3.org/tr/svg11/feature#pattern http://www.w3.org/tr/svg11/feature#clip http://www.w3.org/tr/svg11/feature#mask http://www.w3.org/tr/svg11/feature#filter http://www.w3.org/tr/svg11/feature#xlinkattribute http://www.w3.org/tr/svg11/feature#font http://www.w3.org/tr/svg11/feature#extensibility http://www.w3.org/tr/svg11/feature#svgdom-
static the browser supports all of the dom interfaces and methods that correspond to the language features for http://www.w3.org/tr/svg11/feature#svg-
static.
...And 3 more matches
Tiles and tilemaps overview - Game development
square tiles allow for two perspectives: top-down (like many rpg's or strategy games like warcraft 2 or final fantasy's world view.) side-view (like platformers such as super mario bros.)
static tilemaps a tilemap can either fit into the visible screen area screen or be larger.
... in the first case, the tilemap is
static — it doesn't need to be scrolled to be fully shown.
... rendering
static tilemaps is easy, and can be done with a nested loop iterating over columns and rows.
...And 2 more matches
Implementing QueryInterface
if ( !ainstanceptr ) return ns_error_null_pointer; nsisupports* foundinterface; if ( aiid.equals(nscomtypeinfo<nsix>::getiid()) ) foundinterface = ns_
static_cast(nsix*, this); else if ( aiid.equals(nscomtypeinfo<nsiy>::getiid()) ) foundinterface = ns_
static_cast(nsiy*, this); // ...as many cases as needed...
... else if ( aiid.equals(nscomtypeinfo<nsisupports>::getiid()) ) foundinterface = ns_
static_cast(nsisupports*, ns_
static_cast(nsix*, this)); // i (may) have multiple |nsisupports| in me, // so first i cast to a specific base to avoid ambiguity else foundinterface = 0; nsresult status; if ( !foundinterface ) status = ns_nointerface; else { ns_addref(foundinterface); status = ns_ok; } *ainstanceptr = foundinterface; return status; } what's so good about it?
... it addrefs the resulting interface, not this, thus following the com-correct way (particularly important in aggregation) it uses nscomtypeinfo<t>::getiid() instead of ktiid thus saving a global declaration and global space it uses c 's
static_cast, via ns_
static_cast, which detects errors when you can't really get to the desired interface.
...And 2 more matches
NSS Sample Code Sample_1_Hashing
sample code 1 /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */
static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* * maps a hash name to a secoidtag.
... * returns null if the name is not a supported algorithm */
static secoidtag hashnametooidtag(const char *hashname) { int i, nhashes = sizeof(hash_names); secoidtag hashtag = sec_oid_unknown; for (i = 0; i < nhashes; i++) { if (port_strcasecmp(hashname, hash_names[i].hashname) == 0) { hashtag = hash_names[i].oid; break; } } return hashtag; } /* * newline */
static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* * printashex */ void printashex(prfiledesc* out, unsigned char *data, unsigned int len) { unsigned i; int column; unsigned int limit = 15; unsigned int level = 1; column = level; if (!len) { pr_fprintf(out, "(empty)\n"); return; } for (i = 0; i < len; i++) { ...
... data[i]); column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */
static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprint...
...And 2 more matches
Hashing - sample 1
*/ /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> #include <nss.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */
static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* * maps a hash name to a secoidtag.
... * returns null if the name if not a supported algorithm */
static secoidtag hashnametooidtag(const char *hashname) { int i, nhashes = sizeof(hash_names); secoidtag hashtag = sec_oid_unknown; for (i = 0; i < nhashes; i++) { if (port_strcasecmp(hashname, hash_names[i].hashname) == 0) { hashtag = hash_names[i].oid; break; } } return hashtag; } /* * newline */
static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* * printashex */ void printashex(prfiledesc* out, unsigned char *data, unsigned int len) { unsigned i; int column; unsigned int limit = 15; unsigned int level = 1; column = level; if (!len) { pr_fprintf(out, "(empty)\n"); return; } for (i = 0; i < len; i++...
...data[i]); column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */
static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { fprint...
...And 2 more matches
sample1
/* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> #include <prprf.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */
static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* maps a hash name to a secoidtag.
... * returns null if the name is not a supported algorithm */
static secoidtag hashnametooidtag(const char *hashname) { int i, nhashes = sizeof(hash_names); secoidtag hashtag = sec_oid_unknown; for (i = 0; i < nhashes; i++) { if (port_strcasecmp(hashname, hash_names[i].hashname) == 0) { hashtag = hash_names[i].oid; break; } } return hashtag; } /* newline */
static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* printashex */ void printashex(prfiledesc* out, unsigned char *data, unsigned int len) { unsigned i; int column; unsigned int limit = 15; unsigned int level = 1; column = level; if (!len) { pr_fprintf(out, "(empty)\n"); return; }...
... column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* prints a usage message and exits */
static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htype++) { ...
...And 2 more matches
JS_ExecuteRegExp
syntax bool js_executeregexp(jscontext *cx, js::handleobject obj, js::handleobject reobj, char16_t *chars, size_t length, size_t *indexp, bool test, js::mutablehandlevalue rval); bool js_executeregexpno
statics(jscontext *cx, js::handleobject reobj, char16_t *chars, size_t length, size_t *indexp, bool test, js::mutablehandlevalue rval); name type description cx jscontext * the context.
... description js_executeregexp and js_newregexpobjectno
statics execute the regexp object, reobj, to the specified input string, chars, from *indexp index.
... if test is false, js_executeregexp and js_newregexpobjectno
statics store the match result array to *rval if matches, otherwise stores null to *rval.
...And 2 more matches
Starting WebLock
the two functions look like this:
static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info);
static ns_method weblockunregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *regist...
..._contractid "@dougt/weblock" class weblock: public nsiobserver { public: weblock(); virtual ~weblock(); ns_decl_isupports ns_decl_nsiobserver }; weblock::weblock() { ns_init_isupports(); } weblock::~weblock() { } ns_impl_isupports1(weblock, nsiobserver); ns_imethodimp weblock::observe(nsisupports *asubject, const char *atopic, const prunichar *adata) { return ns_ok; }
static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisu...
...; if (ns_failed(rv)) return rv; char* previous = nsnull; rv = catman->addcategoryentry("xpcom-startup", "weblock", weblock_contractid, pr_true, pr_true, &previous); if (previous) nsmemory::free(previous); return rv; }
static ns_method weblockunregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return ...
...And 2 more matches
Using XPCOM Utilities to Make Things Easier
the four required parts[other-parts] of the structure contain the following information: a human readable class name the class id (cid) the contract id (an optional but recommended argument) a constructor for the given object
static const nsmodulecomponentinfo components[] = { { "pretty class name", cid, contract_id, constructor }, // ...
... #include "nsigenericfactory.h"
static const nsmodulecomponentinfo components[] = { { "pretty class name", sample_cid, "@company.com/sample", sampleconstructor } } ns_impl_nsgetmodule(nssamplemodule, components) most of the components in the mozilla browser client use this approach.
...when an interface is written in xpidl, the headers include
static declarations of their iids.
...And 2 more matches
Index
96 xpcom glue guide, xpcom, xpcom glue the xpcom glue is a
static library which component developers and embedders can link against.
... 134 ns_initxpcom3 functions, functions:frozen, xpcom, xpcom api reference the ns_initxpcom3 function initiates use of xpcom in the calling process with support for
statically defined xpcom modules.
...if there is no base class method with the same signature, a compiler with
static-checking enabled will fail to compile.
...And 2 more matches
WebGLRenderingContext.bufferData() - Web APIs
possible values: gl.
static_draw: the contents are intended to be specified once by the application, and used many times as the source for webgl drawing and image specification commands.
... when using a webgl 2 context, the following values are available additionally: gl.
static_read: the contents are intended to be specified once by reading data from webgl, and queried many times by the application.
... gl.stream_read: the contents are intended to be specified once by reading data from webgl, and queried at most a few times by the application gl.
static_copy: the contents are intended to be specified once by reading data from webgl, and used many times as the source for webgl drawing and image specification commands.
...And 2 more matches
position - CSS: Cascading Style Sheets
values
static the element is positioned according to the normal flow of the document.
...the offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were
static.
...(in other words, it's anything except
static.) a relatively positioned element is an element whose computed position value is relative.
...And 2 more matches
Function.name - JavaScript
however, es2015 specifies the
static keyword such that
static methods will be set as ownproperty of the class constructor function (ecmascript2015, 14.5.14.21.b + 12.2.6.9).
... therefore we can't obtain the class name for virtually any class with a
static method property name(): class foo { constructor() {}
static name() {} } with a
static name() method foo.name no longer holds the actual class name but a reference to the name() function object.
... above class definition in es2015 syntax will behave in chrome or firefox similar to the following snippet in es5 syntax: function foo() {} object.defineproperty(foo, 'name', { writable: true }); foo.name = function() {}; trying to obtain the class of fooinstance via fooinstance.constructor.name won't give us the class name at all but a reference to the
static class method.
...And 2 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
in short, under the gpl,
statically or dynamically linked libraries both could be interpreted as derivative works.
... when a program is linked with a library, whether
statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library.
... 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.
... license revision addition
static link dynamic link gpl y y y y lgpl y y y n mpl y y n n if you release software under the gpl, lgpl, or mpl, any modifications to it must also be released.
JXON - Archive of obsolete content
try: alert(json.stringify(myobject)); note: if you want to freeze the whole object tree (because of the "
static" nature of an xml document), uncomment the string: /* object.freeze(this); */.
...try: alert(json.stringify(myobject)); note: if you want to freeze the whole object tree (because of the "
static" nature of an xml document), uncomment the string: /* object.freeze(this); */.
...try: alert(json.stringify(myobject)); note: if you want to freeze the whole object tree (because of the "
static" nature of an xml document), uncomment the string: /* if (nlength > 0) { object.freeze(vresult); } */.
... note: if you want to freeze the whole object tree (because of the "
static" nature of an xml document), uncomment the string: /* else { object.freeze(vresult); } */.
Dehydra - Archive of obsolete content
dehydra was a lightweight, scriptable, general purpose
static analysis tool capable of application-specific analyses of c++ code.
... dehydra is also useful for generating language bindings and is used to bootstrap treehydra, a heavy-duty
static analysis gcc plugin.
... dehydra faq answers to common questions
static analyses analyses being worked on for mozilla 2 todo steps to dehydra 1.0 release community view dehydra forums...
... mailing list newsgroup rss feed #
static on irc.mozilla.org blogs taras glek david mandelin benjamin smedberg related topics pork c/c++ refactoring tools, mozilla 2, spidermonkey categories interwiki language links ...
Space Manager Detailed Design - Archive of obsolete content
*/ class nsspacemanager { public: nsspacemanager(nsipresshell* apresshell, nsiframe* aframe); ~nsspacemanager(); void* operator new(size_t asize); void operator delete(void* aptr, size_t asize);
static void shutdown(); /* * get the frame that's associated with the space manager.
... amaxsize, nsbanddata& aavailablespace) const; nsiframe* const mframe; // frame associated with the space manager nscoord mx, my; // translation from local to global coordinate space bandlist mbandlist; // header/sentinel for circular linked list of band rects frameinfo* mframeinfomap; nsintervalset mfloatdamage;
static print32 scachedspacemanagercount;
static void* scachedspacemanagers[ns_space_manager_cache_size]; nsspacemanager(const nsspacemanager&); // no implementation void operator=(const nsspacemanager&); // no implementation }; public api life cycle the constructor requires a presentation shell, used for arena allocations mostly, and a frame that this space manager is rooted on.
... void* operator new(size_t asize); void operator delete(void* aptr, size_t asize); a
static method is used to shutdown the space manager recycling.
...
static void shutdown(); origin / coordinate space translation /** * translate the current origin by the specified (dx, dy).
The new nsString class implementation (1999) - Archive of obsolete content
static void ensurecapacity(nsstrimpl& astring,pruint32 anewlength);
static void growcapacity(nsstrimpl& astring,pruint32 anewlength);
static void append(nsstrimpl& adest,const nsstrimpl& asource,pruint32 anoffset,print32 acount);
static void appendcstring(nsstrimpl& adest,const char* asource,pruint32 anoffset,print32 acount);
static void assign(nsstrimpl& adest,const nsstrimpl& asource,pruint3...
...2 anoffset,print32 acount);
static void assigncstring(nsstrimpl& adest,const char* asource,pruint32 anoffset,print32 acount); // assign a char or a substring into the existing string...
...
static void insert(nsstrimpl& adest,pruint32 adestoffset, const nsstrimpl& asource,pruint32 asrcoffset,print32 acount);
static void insertcstring(nsstrimpl& adest,pruint32 adestoffset, const char* asource,pruint32 asrcoffset,print32 acount);
static void insertchar(nsstrimpl& adest,pruint32 adestoffset,char thechar);
static void insertchar(nsstrimpl& adest,pruint32 adestoffset,prunichar theunichar);
static void insertchar(nsstrimpl& adest,pruint32 adestoffset,print32 thequadchar);
static void delete(nsstrimpl& adest,pruint32 adestoffset,pruint32 acount);
static void truncate(nsstrimpl& adest,pruint32 adestoffset);
static print32 compare(const nsstrimpl& adest,const nsstrimpl& asource, print32 acount,prb...
...the nsstring class is very lightweight since it gets its functionality from the nsstrimpl
static library.
Square tilemaps implementation: Scrolling maps - Game development
this article also builds upon implementing
static square tilemaps — you should read that too if you've not done so already.
...
static maps: partial tiles might be shown.
... in
static maps, usually the rendering starts at the top left corner of a tile situated at the top left corner of a viewport.
... var offsetx = -this.camera.x + startcol * map.tsize; var offsety = -this.camera.y + startrow * map.tsize; with these values in place, the loop that renders the map is quite similar to the one used for rendering
static tilemaps.
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
a signature can include: parameters and their types a return value and type exceptions that might be thrown or passed back information about the availability of the method in an object-oriented program (such as the keywords public,
static, or prototype).
... the method is installed on the prototype of myobject (thus it is an instance method) as opposed to being a
static method.
... public
static void main(string[] args) the public keyword is an access modifier and indicates that this method can be called by any object.
... the
static keyword indicates that this method is a class method as opposed to being an instance method.
Introduction to CSS layout - Learn web development
static positioning is the default in normal flow, but you can cause elements to be laid out differently using other values, for example always fixed to the top of the browser viewport.
... there are five types of positioning you should know about:
static positioning is the default that every element gets — it just means "put the element into its normal position in the document layout flow — nothing special to see here".
... sticky positioning is a newer positioning method which makes an element act like position:
static until it hits a defined offset from the viewport, at which point it acts like position: fixed.
...it mixes the default
static positioning with fixed positioning.
Introduction to the server side - Learn web development
static sites the diagram below shows a basic web server architecture for a
static site (a
static site is one that returns the same hard-coded content from the server whenever a particular resource is requested).
...on a dynamic website html pages are normally created by inserting data from a database into placeholders in html templates (this is a much more efficient way of storing large amounts of content than using
static websites).
... requests for
static resources are handled in the same way as for
static sites (
static resources are any files that don't change —typically: css, javascript, images, pre-created pdf files etc).
...creating a separate
static page for each product or post would be completely impractical.
Starting our Svelte Todo list app - Learn web development
in this article we will first have a look at the desired functionality of our app, then we'll create a todos.svelte component and put
static markup and styles in place, leaving everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles.
...to get rid of this, remove the name prop from src/main.js; it should now look like so: import app from './app.svelte' const app = new app({ target: document.body }) export default app now if you check your testing server url you'll see our todos.svelte component being rendered: adding
static markup for the moment we will start with a
static markup representation of our app, so you can see what it will look like.
...being a compiler, svelte can
statically analyze our html templates to provide accessibility warnings when components are being compiled.
... the accessibility rules checked by svelte are taken from eslint-plugin-jsx-a11y, a plugin for eslint that provides
static checks for many accessibility rules on jsx elements.
TypeScript support in Svelte - Learn web development
typescript: optional
static typing for javascript typescript is a superset of javascript that provides features such as optional
static typing, classes, interfaces, and generics.
... readability:
static typing gives the code more structure, making it self-documenting and more readable.
... typescript also has some disadvantages: not true
static typing: types are only checked at compile time, and they are removed from the generated code.
... steep learning curve: even though typescript is a superset of javascript and not a completely new language, there is a considerable learning curve, especially if you have no experience at all with
static languages like java or c#.
Deployment and next steps - Learn web development
all you need is a web server capable of serving
static files, which means you have plenty of options to choose from.
... note: the following section could be applied to any client-side
static web site requiring a build step, not just svelte apps.
...vercel is a cloud platform specifically tailored for
static sites, which has out-of-the-box support for most common front-end tools, svelte being one of them.
... automatic deployment to gitlab pages for hosting
static files there are several online services that allow you to automatically deploy your site whenever you push changes to a git repository.
Dynamic behavior in Svelte: working with variables and props - Learn web development
repl to code along with us using the repl, start at https://svelte.dev/repl/c862d964d48d473ca63ab91709a0a5a0?version=3.23.2 working with todos our todos.svelte component is currently just displaying
static markup; let's start making it a bit more dynamic.
... dynamically generating the todos from the data at the moment, our displayed todo items are all
static.
... we've turned our
static markup into a dynamic template ready to display the tasks from our component's state.
... turning
static markup into a live template.
Getting started with Vue - Learn web development
it is recommended that you specify a version number when including vue on your site so that any framework updates do not break your live site without you knowing.) <script src="/
static/external/29/29296ccacaa9ed35ed168fc51e36f54fd6f8db9c7786bbf38cc59a27229ba5c2.svg"></script> however, this approach has some limitations.
... public: this directory contains
static assets that are published, but not processed by webpack during build (with one exception; index.html gets some processing).
... note: this is not the template for managing the layout of your application — this template is for managing
static html that sits outside of your vue app.
... assets: this directory is for storing
static assets like css and images.
HTML parser threading
pre-interned attribute and element names hold atoms that are actually app-wide ns
staticatoms.
... since ns
staticatoms are valid app-wide, these atoms work right app-wide on the main thread.
...however, when tree ops are executed, every atom has to be tested for being a
static atom (using is
staticatom()).
... if the atom isn't
static, a corresponding normal main-thread dynamically-allocated atom has to be obtained for the same string and used instead of the nshtml5atom.
JNI.jsm
a required object that contains up to five fields of key names: constructors, fields,
static_fields, methods, and
static_methods.
...layoutparams;', view: 'landroid/view/view;', void: 'v', context: 'landroid/content/context;', string: 'ljava/lang/string;', object: 'ljava/lang/object;', geckoappshell: 'lorg/mozilla/gecko/geckoappshell;' }; var geckoappshell = jni.loadclass(my_jenv, fullyqualifiednameofclass(sig.geckoappshell), {
static_methods: [ { name: 'getcontext', sig: '()' + sig.context }] }); var context = jni.loadclass(my_jenv, fullyqualifiednameofclass(sig.context), { methods: [ { /* http://developer.android.com/reference/android/content/context.html#getsystemservice%28java.lang.class%3ct%3e%29 ...
... * public abstract object getsystemservice (string name) */ name: 'getsystemservice', sig: genmethodsig([ sig.string // name ], sig.object // return ) }],
static_fields: [ { name: 'window_service', sig: sig.string } // http://developer.android.com/reference/android/content/context.html#window_service // public
static final string window_service ] }); var windowmanager = jni.loadclass(my_jenv, fullyqualifiednameofclass(sig.windowmanager), { methods: [ { name: 'addview', sig: '(' + sig.view ...
...("resource://gre/modules/osfile.jsm"); // because we use os.path.join in this example var my_jenv = null; try { my_jenv = jni.getforthread(); var sig = { environment: 'landroid/os/environment;', string: 'ljava/lang/string;', file: 'ljava/io/file;' }; var environment = jni.loadclass(my_jenv, sig.environment.substr(1, sig.environment.length - 2), {
static_fields: [ { name: 'directory_pictures', sig: sig.string } ],
static_methods: [ { name:'getexternalstoragedirectory', sig:'()' + sig.file } ] }); jni.loadclass(my_jenv, sig.file.substr(1, sig.file.length - 2), { methods: [ { name:'getpath', sig:'()' + sig.string } ] }); var javafile_dirextstore = environm...
NSS API Guidelines
the preferred format is: "@(#) $rcsfile: nss-guidelines.html, v $ $revision: 48936 $ $date: 2009-08-11 07:45:57 -0700 (tue, 11 aug 2009) $ $name$" you can put the string in a comment or in a
static char array.
... here is an example from lib/base/baset.h: #ifdef debug
static const char baset_cvs_id[] = "@(#) $rcsfile: nss-guidelines.html, v $ $revision: 48936 $ $date: 2009-08-11 07:45:57 -0700 (tue, 11 aug 2009) $ $name$"; #endif /* debug */ the difference, between this and id, is that id has some useless information (every file is "experimental"), and doesn't have name.
... "module" headers are for things used only within a specific subset of nss; things which would have been "
static" if we had combined separate c source files together.
... next we examine global data, including function local
static structures.
Enc Dec MAC Output Public Key as CSR
*/ #ifndef port_errortostring #ifndef sec_error_base #define sec_error_base (-0x2000) #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif #endif /* * print usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -s -r -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'g' for generating rsa keypair for wrapping\n\n", "g"); fprintf(stderr, "%-20s specify 'e' for encrypt operation\n\n", "e"); fprintf(stderr, "%-20s specify 'd' for decrypt...
...t file and produces\n", "note :"); fprintf(stderr, "%-7s .enc and .header as intermediate output files.\n\n", ""); fprintf(stderr, "%-7s for decrypt, it takes .enc and .header\n", ""); fprintf(stderr, "%-7s as input files and produces as a final output file.\n\n", ""); exit(-1); } /* map option letter enumerated commad type */
static commandtype option2command(const char* c) { switch (*c) { case 'g': return gen_csr; case 'e': return encrypt; case 'd': return decrypt; default: return unknown; } } /* * wrap the symkey using public key */ secstatus wrapkey(pk11symkey* key, seckeypublickey *pubkey, secitem **wrappedkey) { secstatus rv; secitem *data = (secitem *)port_zalloc(sizeof(secitem)); ...
...ot, pr_true, pwdata) != secsuccess) { fprintf(stderr, "could not authenticate to token %s.", pk11_gettokenname(slot)); goto cleanup; } cka_id = &pubkey->u.rsa.modulus; cka_id = pk11_makeidfrompubkey(cka_id); privkey = pk11_findkeybykeyid(slot, cka_id, pwdata); cleanup: return privkey; } /* * generate the certificate request with subject */
static secstatus certreq(seckeyprivatekey *privk, seckeypublickey *pubk, keytype keytype, secoidtag hashalgtag, certname *subject, prbool ascii, const char *certreqfilename) { certsubjectpublickeyinfo *spki = null; certcertificaterequest *cr = null; secitem *encoding = null; secoidtag signalgtag; secitem ...
...gned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength = 0;
static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); ...
Bytecode Descriptions
homeobject must be a plain object or (for
static methods) a constructor.
...we always know
statically which binding we're initializing.
...optimized cases don't need a bind instruction because the "finding" is done
statically.
...format: jof_scope enterwith operands: (uint32_t
staticwithindex) stack: val ⇒ push a withenvironmentobject wrapping toobject(val) to the environment chain.
Using RAII classes in Mozilla
we have two techniques for avoiding this problem:
static analysis and runtime assertions.
...
static analysis
static analysis passes are run on our testing infrastructure using our clang plugin, you can also run them locally marking a raii class for the
static analysis is very simple, and performing this marking causes the
static analysis to produce a build-time error whenever a raii class is allocated as a temporary, on the heap, or in
static storage.
... assertions runtime assertions offer two benefits - firstly, they run on windows, which the
static analysis currently does not, and secondly they will run locally, even if the developer did not choose to run
static analysis locally.
... the
static analys runtime assertions are often better at catching bugs in code that a developer is currently working on than
static analysis, which he might not think to run.
Generic factory
*/ class nsigenericfactory : public nsifactory { public:
static const nsiid& iid() {
static nsiid iid = ns_igenericfactory_iid; return iid; } typedef ns_callback(constructorprocptr) (nsisupports *aouter, refnsiid aiid, void **aresult); /** * establishes the generic factory's constructor function, which will be called * by createinstance.
... examples class nsicomponent : public nsisupports { public: ns_imethod dosomething() = 0; }; class mycomponent : public nsicomponent { public: mycomponent(); virtual ~mycomponent();
static ns_method create(nsisupports *aouter, refnsiid aiid, void **aresult); ns_impl_isupports ns_imethod dosomething(); }; to create a factory for this class, simply write the following: nsifactory* newcomponentfactory(nsirepository* repository) { nsigenericfactory* factory = null; nscid kgenericfactorycid = ns_genericfactory_cid; nsresult res = repository->createinstance(kgenericf...
...ptr creator); virtual ~nsgenericfactory(); ns_decl_isupports ns_imethod createinstance(nsisupports *aouter, refnsiid aiid, void **aresult); ns_imethod lockfactory(prbool alock); private: creatorprocptr mcreator; }; nsgenericfactory::nsgenericfactory(creatorprocptr creator) : mcreator(creator) { ns_init_refcnt(); } nsgenericfactory::~nsgenericfactory() {}
static ns_define_iid(kifactoryiid, ns_ifactory_iid); ns_impl_isupports(nsgenericfactory, kifactoryiid) ns_imethodimp nsgenericfactory::createinstance(nsisupports *aouter, refnsiid aiid, void **aresult) { return mcreator(aouter, aiid, aresult); } ns_imethodimp nsgenericfactory::lockfactory(prbool alock) { return ns_ok; } many of our clas...
...ses already have a
static entry point that serves as the creator function, so in most cases, creating a new factory for a class is just: nsifactory* newmallocfactory() { nsifactory* factory = new nsgenericfactory(&nsmalloc::create); factory->addref(); return factory; } talking to warren, he suggests that we even provide a shorthand for this, we should be able to register a factory with just a function pointer.
Web accessibility for seizures and physical reactions - Accessibility
the fact that
static images may cause seizures and other disorders is documented in such articles as “gamma oscillations and photosensitive epilepsy”, where it is noted “certain visual images, even in the absence of motion or flicker, can trigger seizures in patients with photosensitive epilepsy” the epilepsy foundation, in its article, "shedding light on photosensitivity, one of epilepsy's most complex condi...
...tions" talks about
static images and patterns.
... "
static or moving patterns of discernable light and dark stripes have the same effect as flashing lights because of the alternation of dark and bright areas." the epilepsy foundation of america working group is able to "quantify" the problem a little.
... although
static images are possible as triggers, they are less consistent.
Object.prototype.constructor - JavaScript
function parentwith
static() {} parentwith
static.startposition = { x: 0, y:0 } //
static member property parentwith
static.getstartposition = function getstartposition() { return this.startposition } function child(x, y) { this.position = { x: x, y: y } } child = object.assign(parentwith
static) child.prototype = object.create(parentwith
static.prototype) child.prototype.constructor = child child.prototype.g...
...tion getoffsetbyinitialposition() { let position = this.position let startposition = this.constructor.getstartposition() // error undefined is not a function, since the constructor is child return { offsetx: startposition.x - position.x, offsety: startposition.y - position.y } }; for this example we need either to stay parent constructor to continue to work properly or reassign
static properties to child's constructor: ...
... child = object.assign(parentwith
static) // notice that we assign it before we create(...) a prototype below child.prototype = object.create(parentwith
static.prototype) ...
...child.parentconstructor = parentwith
static child.prototype = object.create(parentwith
static.prototype) ...
Creating a status bar extension - Archive of obsolete content
note: the extension created by this tutorial won't work in firefox that don't have a
static status bar (that is, firefox 4 and up).
...this sample will add a
static text string to the status bar at the bottom of firefox browser windows.
... <?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>status-bar-sample-1@example.com</em:id> <em:version>1.0</em:version> <em:type>2</em:type> <!-- front end metadata --> <em:name>status bar sample 1</em:name> <em:description>sample
static status bar panel</em:description> <em:creator>my name</em:creator> <em:homepageurl>http://developer.mozilla.org/en/docs/creating_a_status_bar_extension</em:homepageurl> <!-- describe the firefox versions we support --> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minversion>1.5</em:minversion> <em:maxversion>2.0.0...
Dehydra Object Reference - Archive of obsolete content
.is
static boolean flag .isreturn boolean flag the variable is being returned.
...applicable when accessing member variables or non
static member functions of aggregate types, e.g.
...note: the .members will not include
static member functions.
SpiderMonkey coding conventions - Archive of obsolete content
most
static function names have unprefixed, mixed-case names: getchar.
... but
static native methods of js objects have lowercase, underscore-separated or intercaps names, e.g., str_indexof.
... and library-private and
static data use underscores, not intercaps (but library-private data do use a js_ prefix).
Treehydra - Archive of obsolete content
treehydra is intended for precise
static analyses.
... documentation treehydra build instructions how to build treehydra treehydra manual usage instructions
static analyses analyses being worked on for mozilla 2(many use treehydra) interesting papers esp path-sensitive program verification in polynomial time community view treehydra forums...
... mailing list newsgroup rss feed #
static on irc.mozilla.org blogs taras glek david mandelin related topics pork c/c++ refactoring tools, mozilla 2, spidermonkey categories interwiki language links ...
Building Trees - Archive of obsolete content
lex="1"/> </treecols> <template> <treechildren> <treeitem uri="rdf:*"> <treerow> <treecell label="rdf:http://purl.org/dc/elements/1.1/title"/> <treecell label="rdf:http://purl.org/dc/elements/1.1/date"/> </treerow> </treeitem> </treechildren> </template> </tree> note: the tree columns (treecols) are declared outside the template as
static content, since they only need to be declared once.
... however, it could be any other variable, a
static value, or a combination of both.
...alternatively, you could also use
static values (in addition to variables) in the properties attribute.
Using the W3C DOM - Archive of obsolete content
yle.pixeltop dom level 2: parseint(elemref.style.top, 10) ie5+: elemref.style.pixelleft = x; elemref.style.pixeltop = y; dom level 2: elemref.style.left = x + "px"; elemref.style.top = y + "px"; w3c dom2 reflection of an element's css properties keep in mind that according to the w3c recommendation, the values returned by the style property of an element reflect
static settings in the element's style attribute only, not the total "computed style" that includes any inherited style settings from parent elements.
... therefore, if you wish to read and write these properties from javascript through the dom2, use one of these two approaches: place all of the element's
static css declarations (if it has any) in the element's style attribute.
... use no
static css declarations for the element and initialize its css properties from javascript through the dom.
JSObject - Archive of obsolete content
the netscape.javascript.jsobject class has the following
static method: getwindow gets a jsobject for the window containing the given applet.
... declaration public object getslot(int index) getwindow
static method.
... declaration public
static jsobject getwindow(applet applet) removemember method.
JavaClass - Archive of obsolete content
properties the properties of a javaclass object are the
static fields of the java class.
... methods the methods of a javaclass object are the
static methods of the java class.
...because bold is a
static field in the font class, it is also a property of the javaclass object.
CDN - MDN Web Docs Glossary: Definitions of Web-related terms
cdns are used widely for delivering stylesheets and javascript files (
static assets) of libraries like bootstrap, jquery etc.
... using cdn for those library files is preferable for a number of reasons: serving libraries'
static assets over cdn lowers the request burden on an organization's own servers.
...using a cdn saves further configuration for
static assets on your own servers.
Index - MDN Web Docs Glossary: Definitions of Web-related terms
there are two kind of methods: instance methods which are built-in tasks performed by an object instance, or
static methods which are tasks that are called directly on an object constructor.
... 434
static method codingscripting, glossary, javascript, method,
static,
static method a
static method (or
static function) is a method defined as a member of an object but is accessible directly from an api object's constructor, rather than from an object instance created via the constructor.
... 435
static typing codingscripting, glossary, type a
statically-typed language is a language (such as java, c, or c++) where variable types are known at compile time.
What’s in the head? Metadata in HTML - Learn web development
in the mdn web docs sourcecode, you'll find this: <meta property="og:image" content="https://developer.cdn.mozilla.net/
static/img/opengraph-logo.dc4e08e2f6af.png"> <meta property="og:description" content="the mozilla developer network (mdn) provides information about open web technologies including html, css, and apis for both web sites and html5 apps.
...for example, you'll find this in the source code of the mdn web docs homepage: <!-- third-generation ipad with high-resolution retina display: --> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://developer.cdn.mozilla.net/
static/img/favicon144.a6e4162070f4.png"> <!-- iphone with high-resolution retina display: --> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://developer.cdn.mozilla.net/
static/img/favicon114.0e9fabd44f85.png"> <!-- first- and second-generation ipad: --> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://developer.cdn.mozilla.net/
static/img/favicon72.8ff9d87c82a0.p...
...ng"> <!-- non-retina iphone, ipod touch, and android 2.1+ devices: --> <link rel="apple-touch-icon-precomposed" href="https://developer.cdn.mozilla.net/
static/img/favicon57.a2490b9a2d76.png"> <!-- basic favicon --> <link rel="shortcut icon" href="https://developer.cdn.mozilla.net/
static/img/favicon32.e02854fdcf73.png"> the comments explain what each icon is used for — these elements cover things like providing a nice high resolution icon to use when the website is saved to an ipad's home screen.
What is JavaScript? - Learn web development
a high-level definition javascript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display
static information for you to look at — displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, etc.
... dynamic versus
static code the word dynamic is used to describe both client-side javascript, and server-side languages — it refers to the ability to update the display of a web page/app to show different things in different circumstances, generating new content as required.
... a web page with no dynamically updating content is referred to as
static — it just shows the same content all the time.
Accessible Toolkit Checklist
the system should require these labels to be created/associated with each widget, not as a separate
static text with no tie to the widget.
...is it a link,
static text, editable text, a checkbox, or a table cell, etc.
... support including accessible name, value, name and value change events grouped navigation widgets menus arrow keys, enter, escape alt alone enters main menu after leaving menus, focus is restored to where it was modified and unmodified mnemonics msaa support (including focus events, menu start and end events, radio and checkbox menu items)
static text and group boxes msaa support radio groups only the selected radio button is in the tab order the other radio buttons can be selected and focused with up/down arrow.
Roll your own browser: An embedding how-to
all of this is somewhat generic and has been isolated into a
static library that you can simply call on.
... if you build mozilla/embedding/base/, a
static library (on windows) called baseembed_s.lib is built.
... activex control: an activex control allowing for embedding the gecko layout engine.obsolete since gecko 7.0 llmozlib & ubrowser: a
static library that allows you to embed gecko and render pages to memory.
Index
the crmf library, which is used to produce certain kinds of certificate requests, is available as a library for
static linking only.
... /* nspr headers */ #include <prprf.h> #include <prtypes.h> #include <plgetopt.h> #include <prio.h> #include <prprf.h> /* nss headers */ #include <secoid.h> #include <secmodt.h> #include <sechash.h> typedef struct { const char *hashname; secoidtag oid; } nametagpair; /* the hash algorithms supported */
static const nametagpair hash_names[] = { { "md2", sec_oid_md2 }, { "md5", sec_oid_md5 }, { "sha1", sec_oid_sha1 }, { "sha256", sec_oid_sha256 }, { "sha384", sec_oid_sha384 }, { "sha512", sec_oid_sha512 } }; /* maps a hash name to a secoidtag.
... * returns null if the name is not a supported algorithm */
static secoidtag hashnametooidtag(const char *hashname) { int i, nhashes = sizeof(hash_names); secoidtag hashtag = sec_oid_unknown; for (i = 0; i < nhashes; i++) { if (port_strcasecmp(hashname, hash_names[i].hashname) == 0) { hashtag = hash_names[i].oid; break; } } return hashtag; } /* newline */
static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* printashex */ void printashex(prfiledesc* out, unsigned char *data, unsigned int len) { unsigned i; int column; unsigned int limit = 15; unsigned int level = 1; column = level; if (!len) { pr_fprintf(out, "(empty)\n"); return; }...
SpiderMonkey Build Documentation
for a list of other available build options, type (assuming the current working directory is one of the above-created build directories): /bin/sh ../configure.in --help generating a compilation database some tools (like ides,
static analyzers and refactoring tools) consume a file called compile_commands.json which contains a description of all the pieces required to build a piece of software so that tools don't have to also understand a build system.
... building spidermonkey as a
static library by default, spidermonkey builds as a shared library.
... however, you can build spidermonkey as a
static library by specifying the --disable-shared-js flag when you run configure.
JIT Optimization Strategies
the different success and failure conditions are documented below: getprop_
staticname attempts to optimize a property access on window which refers to a property on the global object.
... getelem_typed
static attempts to optimize element accesses on a typed array that can be determined to always refer to the same array object.
... setelem_typed
static attempts to optimize element writes on a typed array that can be determined to always refer to the same array object.
JS::PersistentRooted
// js::persistentrootedvalue persistentval;
static bool setpersistent(jscontext* cx, unsigned argc, js::value* vp) { js::callargs args = callargsfromvp(argc, vp); // set persistent value.
... persistentval.ref() = args.get(0); // or // *persistentval = args.get(0); // [spidermonkey 38] // persistentval = args.get(0); args.rval().setundefined(); return true; }
static bool getpersistent(jscontext* cx, unsigned argc, js::value* vp) { js::callargs args = callargsfromvp(argc, vp); // get persistent value.
... js::rootedvalue val(cx, persistentval.ref()); // or // js::rootedvalue val(cx, *persistentval); // [spidermonkey 38] // js::rootedvalue val(cx, persistentval); args.rval().set(val); return true; }
static const jsfunctionspec functions[] = { js_fn("getpersistent", getpersistent, 1, 0), js_fn("setpersistent", setpersistent, 0, 0), js_fs_end }; int main(int argc, const char* argv[]) { // initialize runtime // ...
JS_NewRegExpObject
syntax jsobject * js_newregexpobject(jscontext *cx, js::handleobject obj, const char *bytes, size_t length, unsigned flags); jsobject * js_newucregexpobject(jscontext *cx, js::handleobject obj, const char16_t *chars, size_t length, unsigned flags); jsobject * js_newregexpobjectno
statics(jscontext *cx, char *bytes, size_t length, unsigned flags); jsobject * js_newucregexpobjectno
statics(jscontext *cx, char16_t *chars, size_t length, unsigned flags); name type description cx jscontext * the context in which to create the new object.
... js_newregexpobjectno
statics and js_newucregexpobjectno
statics create a new regexp instance.
... see also mxr id search for js_newregexpobject mxr id search for js_newucregexpobject mxr id search for js_newregexpobjectno
statics mxr id search for js_newucregexpobjectno
statics regexp bug 571355 - added no
statics functions ...
SpiderMonkey 1.8.5
in future releases, replaced with js_parsejson) js_decompilescriptobject js_deepfreezeobject js_definefunctionbyid js_defineownproperty js_definepropertybyid js_deletepropertybyid js_deletepropertybyid2 js_doubleisint32 js_encodestringtobuffer js_entercrosscompartmentcall js_evaluatescriptforprincipalsversion js_evaluateucscriptforprincipalsversion js_executeregexp js_executeregexpno
statics js_executescriptversion js_forget_string_flatness js_fileescapedstring js_finishjsonparse (removed in future releases, replaced with js_parsejson) js_flatstringequalsascii js_flattenstring js_flushcaches js_freezeobject js_getcompartmentprivate js_getemptystring js_getflatstringchars js_getgcparameter js_getgcparameterforthread js_getglobalforscopechain js_getinternedstringchars ...
...regexp apis js_clearregexp
statics, js_newregexpobject, js_newregucexpobject, and js_setregexpinput now receive a pointer to the global object.
... this change was made in bug 571355 to move the regexp
statics out of the context, to simplify cross compartment wrappers.
SpiderMonkey 1.8.7
in future releases, replaced with js_parsejson) js_decompilescriptobject js_deepfreezeobject js_definefunctionbyid js_defineownproperty js_definepropertybyid js_deletepropertybyid js_deletepropertybyid2 js_doubleisint32 js_encodestringtobuffer js_entercrosscompartmentcall js_evaluatescriptforprincipalsversion js_evaluateucscriptforprincipalsversion js_executeregexp js_executeregexpno
statics js_executescriptversion js_forget_string_flatness js_fileescapedstring js_finishjsonparse (removed in future releases, replaced with js_parsejson) js_flatstringequalsascii js_flattenstring js_flushcaches js_freezeobject js_getcompartmentprivate js_getemptystring js_getflatstringchars js_getgcparameter js_getgcparameterforthread js_getglobalforscopechain js_getinternedstringchars ...
...regexp apis js_clearregexp
statics, js_newregexpobject, js_newregucexpobject, and js_setregexpinput now receive a pointer to the global object.
... this change was made in bug 571355 to move the regexp
statics out of the context, to simplify cross compartment wrappers.
Introduction to XPCOM for the DOM
the first technique is to use a "getter", the second is to use a
static cast on the "this" pointer.
...you can thus simply cast "this"
statically to the desired interface.
...i had to use the second solution: nscomptr<nsicontent> content = getter_addrefs(ns_
static_cast(nsicontent*, this)); // or, if you want to do the refcounting yourself, nsicontent *content = ns_
static_cast(nsicontent*, this); the second form should be used with care, and is recommended only for advanced xpcom'ers.
imgIRequest
inherits from: nsirequest last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void cancelandforgetobserver(in nsresult astatus); imgirequest clone(in imgidecoderobserver aobserver); void decrementanimationconsumers(); imgirequest get
staticrequest(); void incrementanimationconsumers(); void lockimage(); void requestdecode(); void unlockimage(); attributes attribute type description corsmode long the cors mode that this image was loaded with.
...get
staticrequest() if this request is for an animated image, the method creates a new request which contains the current frame of the image.
...imgirequest get
staticrequest(); parameters none.
The libmime module
they can generally all be
static, since nobody outside of this file needs to reference them by name; all references to these routines should be through the class object.
...
static int foobarclassinitialize(foobarclass *class) { class->method = foobarmethod.
...
static void foobar_finalize (mimeobject *object) { ((mimeobjectclass*)&mime_superclass)->finalize(object); // right parentclass.whatnot.object.finalize(object); // (works...) object->class->superclass->finalize(object); // wrong!!
AudioParamDescriptor - Web APIs
if the underlying audioworkletprocessor has a parameterdescriptors
static getter, then the returned array of objects based on this dictionary is used internally by audioworkletnode constructor to populate its parameters property accordingly.
... we expand the processor by adding a
static parameterdescriptors getter.
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor {
static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
AudioWorkletNode.parameters - Web APIs
they are instantiated during creation of the underlying audioworkletprocessor according to its parameterdescriptors
static getter.
... we expand the processor by adding a
static parameterdescriptors getter.
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor {
static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
Optimizing canvas - Web APIs
use multiple layered canvases for complex scenes in your application, you may find that some objects need to move or change frequently, while others remain relatively
static.
... for example, let's say you have a game with a ui on top, the gameplay action in the middle, and a
static background on the bottom.
..."320"></canvas> <canvas id="background-layer" width="480" height="320"></canvas> </div> <style> #stage { width: 480px; height: 320px; position: relative; border: 2px solid black; } canvas { position: absolute; } #ui-layer { z-index: 3; } #game-layer { z-index: 2; } #background-layer { z-index: 1; } </style> use plain css for large background images if you have a
static background image, you can draw it onto a plain <div> element using the css background property and position it under the canvas.
EventTarget.addEventListener() - Web APIs
actually, regarding memory consumption, the lack of keeping a function reference is not the real issue; rather it is the lack of keeping a
static function reference.
... in both problem-cases below, a function reference is kept, but since it is redefined on each iteration, it is not
static.
...in the fourth case, the entire function definition is unchanging, but it is still being repeatedly defined as if new (unless it was [[promoted]] by the compiler) and so is not
static.
InputEvent.getTargetRanges() - Web APIs
the gettargetranges() property of the inputevent interface returns an array of
static ranges that will be affected by a change to the dom if the input event is not canceled.
... syntax var
staticranges[] = inputevent.gettargetranges() parameters none.
... return value an array of
staticrange objects.
NodeList - Web APIs
static nodelists although they are both considered nodelists, there are 2 varieties of nodelist: live and
static.
... for example, node.childnodes is live: const parent = document.getelementbyid('parent'); let child_nodes = parent.childnodes; console.log(child_nodes.length); // let's assume "2" parent.appendchild(document.createelement('div')); console.log(child_nodes.length); // outputs "3"
static nodelists in other cases, the nodelist is
static, where any changes in the dom does not affect the content of the collection.
... the ubiquitous document.queryselectorall() method returns a
static nodelist.
WebGLRenderingContext.getBufferParameter() - Web APIs
this is either: gl.
static_draw, gl.dynamic_draw, gl.stream_draw.
... when using a webgl 2 context, the following values are available additionally: gl.
static_read, gl.dynamic_read, gl.stream_read, gl.
static_copy, gl.dynamic_copy, gl.stream_copy.
... adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_buffer, gl.uniform_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer adds new usage hints: gl.
static_read, gl.dynamic_read, gl.stream_read, gl.
static_copy, gl.dynamic_copy, gl.stream_copy.
Writing a WebSocket server in C# - Web APIs
to create an ipaddress object from a string, use the parse
static method of ipaddress.
... here's a barebones server implementation: ​using system.net.sockets; using system.net; using system; class server { public
static void main() { tcplistener server = new tcplistener(ipaddress.parse("127.0.0.1"), 80); server.start(); console.writeline("server has started on 127.0.0.1:80.{0}waiting for a connection...", environment.newline); tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); } } tcpclient methods: system.net.sockets.networkstream getstream() gets the stream which is the communication channel.
...e[3]; byte[] encoded = new byte[3] {112, 16, 109}; byte[] mask = new byte[4] {61, 84, 35, 6}; for (int i = 0; i < encoded.length; i++) { decoded[i] = (byte)(encoded[i] ^ mask[i % 4]); } put together wsserver.cs // // csc wsserver.cs // wsserver.exe using system; using system.net; using system.net.sockets; using system.text; using system.text.regularexpressions; class server { public
static void main() { string ip = "127.0.0.1"; int port = 80; var server = new tcplistener(ipaddress.parse(ip), port); server.start(); console.writeline("server has started on {0}:{1}, waiting for a connection...", ip, port); tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); networkstream stream = clie...
Layout and the containing block - CSS: Cascading Style Sheets
identifying the containing block the process for identifying the containing block depends entirely on the value of the element's position property: if the position property is
static, relative, or sticky, the containing block is formed by the edge of the content box of the nearest ancestor element that is either a block container (such as an inline-block, block, or list-item element) or establishes a formatting context (such as a table container, flex container, grid container, or the block container itself).
... if the position property is absolute, the containing block is formed by the edge of the padding box of the nearest ancestor element that has a position value other than
static (fixed, absolute, relative, or sticky).
... example 1 in this example, the paragraph is
statically positioned, so its containing block is <section> because it's the nearest ancestor that is a block container.
Live streaming web audio and video - Developer guides
key differences between streamed and
static media in this case, we are using
static media to describe media that is represented by a file, whether it be an mp3 or webm file.
... live streamed media lacks a finite start and end time as rather than a
static file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below).
...it can also be used instead of the traditional progressive download method for audio and video on demand: there are several advantages to this: latency is generally lower so media will start playing more quickly adaptive streaming makes for better experiences on a variety of devices media is downloaded just in time which makes bandwidth usage more efficient streaming protocols while
static media is usually served over http, there are several protocols for serving adaptive streams; let's take a look at the options.
<input type="image"> - HTML: Hypertext Markup Language
essential image input features let's look at a basic example that includes all the essential features you'd need to use (these work exactly the same as they do on the <img> element.): <input id="image" type="image" width="100" height="30" alt="login" src="/
static/external/62/62ac2ecddbec0e0b540098c28451e57203e5cab46dfed7ab0115d5a659fcfb7b.png"> the src attribute is used to specify the path to the image you want to display in the button.
... html <form> <p>login to your account</p> <div> <label for="userid">user id</label> <input type="text" id="userid" name="userid"> </div> <div> <label for="pwd">password</label> <input type="password" id="pwd" name="pwd"> </div> <div> <input id="image" type="image" src="/
static/external/62/62ac2ecddbec0e0b540098c28451e57203e5cab46dfed7ab0115d5a659fcfb7b.png" alt="login" width="100"> </div> </form> css and now some simple css to make the basic elements sit more neatly: div { margin-bottom: 10px; } label { display: inline-block; width: 70px; text-align: right; padding-right: 10px; } adjusting the image position and scaling in this example, we adapt the p...
... html <form> <p>login to your account</p> <div> <label for="userid">user id</label> <input type="text" id="userid" name="userid"> </div> <div> <label for="pwd">password</label> <input type="password" id="pwd" name="pwd"> </div> <div> <input id="image" type="image" src="/
static/external/62/62ac2ecddbec0e0b540098c28451e57203e5cab46dfed7ab0115d5a659fcfb7b.png" alt="login" width="200" height="100"> </div> </form> css div { margin-bottom: 10px; } label { display: inline-block; width: 70px; text-align: right; padding-right: 10px; } #image { object-position: right top; object-fit: contain; background-color: #ddd; } here, object-position is config...
Array - JavaScript
static properties get array[@@species] the constructor function is used to create derived objects.
...
static methods array.from() creates a new array instance from an array-like or iterable object.
... array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Atomics - JavaScript
the atomics object provides atomic operations as
static methods.
...all properties and methods of atomics are
static (as is the case with the math object, for example).
...
static methods atomics.add() adds the provided value to the existing value at the specified index of the array.
BigInt64Array - JavaScript
static properties bigint64array.bytes_per_element returns a number value of the element size.
...
static methods bigint64array.from() creates a new bigint64array from an array-like or iterable object.
... bigint64array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
BigUint64Array - JavaScript
static properties biguint64array.bytes_per_element returns a number value of the element size.
...
static methods biguint64array.from() creates a new biguint64array from an array-like or iterable object.
... biguint64array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Float32Array - JavaScript
static properties float32array.bytes_per_element returns a number value of the element size.
...
static methods float32array.from() creates a new float32array from an array-like or iterable object.
... float32array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Float64Array - JavaScript
static properties float64array.bytes_per_element returns a number value of the element size.
...
static methods float64array.from() creates a new float64array from an array-like or iterable object.
... float64array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Int16Array - JavaScript
static properties int16array.bytes_per_element returns a number value of the element size.
...
static methods int16array.from() creates a new int16array from an array-like or iterable object.
... int16array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Int32Array - JavaScript
static properties int32array.bytes_per_element returns a number value of the element size.
...
static methods int32array.from() creates a new int32array from an array-like or iterable object.
... int32array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Int8Array - JavaScript
static properties int8array.bytes_per_element returns a number value of the element size.
...
static methods int8array.from() creates a new int8array from an array-like or iterable object.
... int8array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Math - JavaScript
all properties and methods of math are
static.
...
static properties math.e euler's constant and the base of natural logarithms; approximately 2.718.
...
static methods math.abs(x) returns the absolute value of x.
Object.defineProperty() - JavaScript
the
static method object.defineproperty() defines a new property directly on an object, or modifies an existing property on an object, and returns the object.
... // using __proto__ var obj = {}; var descriptor = object.create(null); // no inherited properties descriptor.value = '
static'; // not enumerable, not configurable, not writable as defaults object.defineproperty(obj, 'key', descriptor); // being explicit object.defineproperty(obj, 'key', { enumerable: false, configurable: false, writable: false, value: '
static' }); // recycling same object function withvalue(value) { var d = withvalue.d || ( withvalue.d = { enumerable: false, writable: false...
...object.defineproperty(obj, 'key', withvalue('
static')); // if freeze is available, prevents adding or // removing the object prototype properties // (value, get, set, enumerable, writable, configurable) (object.freeze || object)(object.prototype); examples if you want to see how to use the object.defineproperty method with a binary-flags-like syntax, see additional examples.
Reflect - JavaScript
all properties and methods of reflect are
static (just like the math object).
... the reflect object provides the following
static functions which have the same names as the proxy handler methods.
...
static methods reflect.apply(target, thisargument, argumentslist) calls a target function with arguments as specified by the argumentslist parameter.
Symbol - JavaScript
the symbol() function returns a value of type symbol, has
static properties that expose several members of built-in objects, has
static methods that expose the global symbol registry, and resembles a built-in object class, but is incomplete as a constructor because it does not support the syntax "new symbol()".
...
static properties symbol.asynciterator a method that returns the default asynciterator for an object.
...
static methods symbol.for(key) searches for existing symbols with the given key and returns it if found.
TypedArray - JavaScript
static properties typedarray.bytes_per_element returns a number value of the element size for the different typedarray objects.
...
static methods typedarray.from() creates a new typedarray from an array-like or iterable object.
... typedarray.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Uint16Array - JavaScript
static properties uint16array.bytes_per_element returns a number value of the element size.
...
static methods uint16array.from() creates a new uint16array from an array-like or iterable object.
... uint16array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Uint32Array - JavaScript
static properties uint32array.bytes_per_element returns a number value of the element size.
...
static methods uint32array.from() creates a new uint32array from an array-like or iterable object.
... uint32array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Uint8Array - JavaScript
static properties uint8array.bytes_per_element returns a number value of the element size.
...
static methods uint8array.from() creates a new uint8array from an array-like or iterable object.
... uint8array.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Uint8ClampedArray - JavaScript
static properties uint8clampedarray.bytes_per_element returns a number value of the element size.
...
static methods uint8clampedarray.from() creates a new uint8clampedarray from an array-like or iterable object.
... uint8clampedarray.prototype.fill() fills all the elements of an array from a start index to an end index with a
static value.
Codecs used by WebRTC - Web media technologies
max-smbps if specified and supported by the software, this specifies an integer stating the maximum
static macroblock processing rate in
static macroblocks per second (using the hypothetical assumption that all macroblocks are
static macroblocks).
...the most efficient way is to use the
static method rtcrtpsender.getcapabilities() (or the equivalent rtcrtpreceiver.getcapabilities() for a receiver), specifying the type of media as the input parameter.
...we also get the lists of all codecs supported by the browser for both sending and receiving video, using the getcapabilities()
static method of both rtcrtpsender and rtcrtpreceiver.
Using dns-prefetch - Web Performance
the cross-origin domain is then specified in the href attribute: syntax <link rel="dns-prefetch" href="https://fonts.g
static.com/" > examples <html> <head> <link rel="dns-prefetch" href="https://fonts.g
static.com/"> <!-- and all other head elements --> </head> <body> <!-- your page content --> </body> </html> you should place dns-prefetch hints in the <head> element any time your site references resources on cross-origin domains, but there are some things to keep in mind.
... 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.g
static.com/>; rel=dns-prefetch third, consider pairing dns-prefetch with the preconnect hint.
...you can safely use them together like so: <link rel="preconnect" href="https://fonts.g
static.com/" crossorigin> <link rel="dns-prefetch" href="https://fonts.g
static.com/"> note: if a page needs to make connections to many third-party domains, preconnecting them all is counterproductive.
Content Scripts - Archive of obsolete content
so you can rewrite the above main.js code like this: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: "./content-script.js" }); unless your content script is extremely simple and consists only of a
static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
...inline that can use jquery: // main.js var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); var contentscriptstring = '$("body").html("<h1>page matches ruleset</h1>");'; pagemod.pagemod({ include: "*.mozilla.org", contentscript: contentscriptstring, contentscriptfile: data.url("jquery.js") }); unless your content script is extremely simple and consists only of a
static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
page-mod - Archive of obsolete content
so you can rewrite the above code like this: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: "./my-script.js" }); unless your content script is extremely simple and consists only of a
static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
... unless your content script is extremely simple and consists only of a
static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
unicharutils has been modified to provide a frozen-linkage comparator: nsstring mystring = somestring; - if (mystring.equals(otherstring, nscaseinsensitivestringcomparator())) + if (mystring.equals(otherstring, caseinsensitivecompare)) return ns_ok; // woot, we're equal in all things but case when using unicharutils from frozen-linkage code, link against the unicharutil_external_s
static library.
...#define compare(str1, str2, comp) (str1).compare(str2, comp) #define last() endreading()[-1] #define setcharat(c, i) replace(i, 1, ch) #define ns_newisupportsarray(result) callcreateinstance(ns_supportsarray_contractid,
static_cast<nsisupportsarray**>(result)); ideally we would switch to nsimutablearray, but in the mean time there's no point changing the same code twice.
XPCOM Objects - Archive of obsolete content
this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); the cc object (components.classes) is an index to
static objects and class definitions available through xpcom.
... components are either services (
static objects) or instances of classes, just like the objects we handle in js.
Creating a dynamic status bar extension - Archive of obsolete content
« previousnext » this article builds upon the article creating a status bar extension, which creates a
static status bar panel in the firefox status bar, by dynamically updating its content with information fetched from the web every few minutes.
...the string is built from a combination of
static strings and various elements from the fieldarray array.
Index of archived content - Archive of obsolete content
eving tinderbox status enabling the behavior - updating the status bar panel enabling the behavior - updating the status periodically finding the code to modify finding the file to modify making a mozilla installation modifiable making it into a dynamic overlay and packaging it up for distribution making it into a
static overlay prerequisites specifying the appearance tinderbox creating a release tag creating a skin for firefox/getting started creating a skin for mozilla faq getting started in-depth links contents.rdf toolbarbindin...
...epository running windows debug builds downloaded from tinderbox sxsw 2007 presentations safe browsing safe browsing: design documentation safely loading uris same origin policy for xbl space manager detailed design space manager high level design standalone xpcom standard makefile header
static analysis for windows code under linux stress testing string quick reference string rosetta stone structure of an installable bundle supporting per-window private browsing supporting private browsing mode table cellmap table cellmap - border collapse table layout regression tests table layout strate...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
erbird prepare compile options [root@b008-02 commsrc]# cp ./mozilla/browser/config/mozconfig .mozconfig [root@b008-02 commsrc]# cat .mozconfig mk_add_options autoconf=autoconf-2.13 ac_add_options --enable-application=mail ac_add_options --prefix="/usr/local/thunderbirddebug" ac_add_options --libdir="/usr/local/thunderbirddebuglibs" ac_add_options --enable-extensions=pref ac_add_options --enable-
static ac_add_options --disable-shared ac_add_options --disable-crashreporter the option --disable-crashreporter is necessary if you get compile error at this stage of the build gmake[7]: entering directory `/usr/local/moz2/commsrc/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux' dump_symbols.cc build then start building [root@b008-02 commsrc]# time make -f client.mk build rm -f .
...l/moz/commsrc/mail/app » gmake[4]: quittant le répertoire « /usr/local/moz/commsrc/mail » gmake[3]: quittant le répertoire « /usr/local/moz/commsrc » gmake[2]: quittant le répertoire « /usr/local/moz/commsrc » make[1]: quittant le répertoire « /usr/local/moz/commsrc » real 23m33.845s user 20m34.356s sys 1m49.752s install then install (--enable-
static and --disable-shared necessary in .mozconfig !) [root@b008-02 commsrc]# make install -n /usr/bin/gmake -c mail/installer install gmake[1]: entrant dans le répertoire « /usr/local/moz/commsrc/mail/installer » rm -rf ../../mozilla/dist/thunderbird ../../mozilla/dist/thunderbird-3.0b3pre.en-us.linux-i686.tar ../../mozilla/dist/thunderbird-3.0b3pre.en-us.linux-i686.dmg stage-package echo "creatin...
Nanojit - Archive of obsolete content
-i ../nanojit -o jittest ../jittest.cpp libjs_
static.a note: remove the -ddebug if you have not compiled spidermonkey with --enable-debug, and use whatever you called the sample source file in place of jittest.cpp.
... #include <stdio.h> #include <stdint.h> #include "jsapi.h" #include "jstracer.h" #include "nanojit.h" using namespace nanojit; const uint32_t cache_size_log2 = 20;
static avmplus::gc gc = avmplus::gc();
static avmplus::avmcore core = avmplus::avmcore(); int main() { logcontrol lc; #ifdef debug lc.lcbits = lc_readlir | lc_assembly; #else lc.lcbits = 0; #endif // set up the basic nanojit objects.
Tamarin build documentation - Archive of obsolete content
- in a terminal window change to your /openssl folder and run make build_libs to create the necessary 'libcrypto.a' and 'libssl.a'
static libraries.
...the necessary
static files 'libcrypto.a' and 'libssl.a' are made correctly and are present in the /openssl folder.
Archived JavaScript Reference - Archive of obsolete content
you can use the more general proxy object instead.arraybuffer.transfer()the
static arraybuffer.transfer() method returns a new arraybuffer whose contents have been taken from the oldbuffer's data and then is either truncated or zero-extended by newbytelength.
...you can use the more general proxy object instead.reflect.enumerate()the
static reflect.enumerate() method used to return an iterator with the enumerable own and inherited properties of the target object, but has been removed in ecmascript 2016 and is deprecated in browsers.string.prototype.quote()the non-standard quote() method returns a copy of the string, replacing various special characters in the string with their escape sequences and wrapping the result in double-quote...
LiveConnect Overview - Archive of obsolete content
these java methods are available in javascript as methods of the javaobject, and you can call them as follows: mystring.length(); // returns 11
static members can be called directly on the javaclass object.
...you can respond to either type of run-time error the evaluation causes by implementing an exception handler such as the following: import netscape.javascript.jsobject; import netscape.javascript.jsexception; public class etest { public
static object doit(jsobject obj, string jscode) { try { obj.eval(jscode); } catch (jsexception e) { if (e.getwrappedexception() == null) return e; return e.getwrappedexception(); } return null; } } in this example, the code in the try block attempts to evaluate the string jscode that you pass to it.
Index - Game development
35 tiles and tilemaps overview 2d, canvas, games, javascript,
static, webgl, tilemap, tiles tilemaps are a very popular technique in 2d game development, consisting of building the game world or level map out of small, regular-shaped images called tiles.
... 37 square tilemaps implementation:
static maps canvas, games, javascript,
static, atlas, spritesheet, tilemap, tilemaps, tiles this article covers how to implement
static square tilemaps using the canvas api.
WAI-ARIA basics - Learn web development
traditional
static websites with largely text content are therefore easy to make accessible for people with visual impairments.
... the problem is that modern web apps are often not just
static text — they tend to have a lot of dynamically updating content, i.e.
How do you host your website on Google App Engine? - Learn web development
google app engine is a powerful platform that lets you build and run applications on google’s infrastructure — whether you need to build a multi-tiered web application from scratch or host a
static website.
... the app.yaml file is a configuration file that tells app engine how to map urls to your
static files.
Publishing your website - Learn web development
google app engine is a powerful platform that lets you build and run applications on google’s infrastructure — whether you need to build a multi-tiered web application from scratch or host a
static website.
... cheap or free
static website hosting by scott murray has some useful ideas on available services.
Index - Learn web development
beginner, google app engine, google cloud platform, guide, host, learn, web, publish, website google app engine is a powerful platform that lets you build and run applications on google’s infrastructure — whether you need to build a multi-tiered web application from scratch or host a
static website.
...every time a web page does more than just sit there and display
static information for you to look at—displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, or more—you can bet that javascript is probably involved.
Client-side storage - Learn web development
elsewhere in the mdn learning area we talked about the difference between
static sites and dynamic sites.
... most major modern web sites are dynamic — they store data on the server using some kind of database (server-side storage), then run server-side code to retrieve needed data, insert it into
static page templates, and serve the resulting html to the client to be displayed by the user's browser.
Drawing graphics - Learn web development
for example, if you were rendering a constantly updating graph of stock prices, the fallback content could be a
static image of the latest stock graph, with alt text saying what the prices are in text.
...if you aren't going to change anything, then you might as well just use
static images and save yourself all the work.
Ember interactivity: Events, classes and state - Learn web development
using the ember inspector however, we can see that our todo was added: displaying our todos now that we know that we can create todos, there needs to be a way to swap out our
static "buy movie tickets" todos with the todos we're actually creating.
...to put this in action, go to your todo-list.hbs component, and replace the
static component calls: <todo /> <todo /> with a dynamic #each block (which is basically syntactic sugar over the top of javascript's foreach()) that creates a <todo /> component for each todo available in the list of todos returned by the service’s all() getter: {{#each this.todos.all as |todo|}} <todo @todo={{todo}} /> {{/each}} another way to look at this: this — the rendering context /...
Routing in Ember - Learn web development
since our data is
static, we won't get to any of those fancy features, but we'll still make sure that the route provides the minimally required data to view a page.
... in this file, change <todolist /> to <todolist @todos={{ @model.activetodos }}/> note that, in each of the route model hooks, we are returning an object with a getter instead of a
static object, or more simply just the
static list of todos (for example, this.todos.completed).
Understanding client-side JavaScript frameworks - Learn web development
react interactivity: events and state with our component plan worked out, it's now time to start updating our app from a completely
static ui to one that actually allows us to interact and change things.
...in this article we will first have a look at the desired functionality of our app, then we'll create a todos.svelte component and put
static markup and styles in place, leaving everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles.
Deploying our app - Learn web development
for this project, we're going to use netlify's wonderful
static hosting offering to host our project.
... using netlify for deployment deploying from github to netlify is surprisingly simple once you know the steps, particularly with "
static websites" such as this project.
Accessibility API cross-reference
dialog dialog dialog dialog <dialog> a list of references to members of a group, such as a
static table of contents.
...see also div n/a n/a n/a <span> span kind of like a dial, but controls the value in a related field spinbutton n/a n/a spinbutton uneditable text
statictext label label see aria-readonly the text nodes of html elements are uneditable by default, apart from <input type=text>, or those with a contenteditable attribute entire status bar.
Multiprocess on Windows
you should
statically define this array in your code, as const.
... for example:
static const mozilla::mscom::arraydata kmyarraydata[] { { // first arraydata definition }, { // second arraydata definition } }; mozilla::mscom::registerarraydata(kmyarraydata); each arraydata struct corresponds to one function; with length_is and/or size_is annotations.
Simple SeaMonkey build
-dev libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libasound2-dev libcurl4-openssl-dev libnotify-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libiw-dev libxt-dev mesa-common-dev libpulse-dev fedora linux centos rhel: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-
static libstdc++-
static yasm wireless-tools-devel mesa-libgl-devel alsa-lib-devel libxt-devel gstreamer-devel gstreamer-plugins-base-devel pulseaudio-libs-devel # 'development tools' is defunct in fedora 19 and above use the following sudo yum groupinstall 'c development tools and libraries' sudo yum group mark install "x software development" mac: install xcode tools.
... mk_add_options moz_objdir=/path/to/comm-central/obj-sm-debug ac_add_options --enable-application=suite ac_add_options --enable-debug ac_add_options --disable-optimize normally a shared build suffices for debugging purposes but current nightly releases are actually
static builds which require even more memory to link.
Gecko Logging
#include "mozilla/logging.h"
static mozilla::lazylogmodule sfoolog("foo"); logging interface a basic interface is provided in the form of 2 macros and an enum class.
... example usage code sample #include "mozilla/logging.h" using mozilla::loglevel;
static mozilla::lazylogmodule slogger("example_logger");
static void dostuff() { moz_log(slogger, loglevel::info, ("doing stuff.")); int i = 0; int start = time::nowms(); moz_log(slogger, loglevel::debug, ("starting loop.")); while (i++ < 10) { moz_log(slogger, loglevel::verbose, ("i = %d", i)); } // only calculate the elapsed time if the warning level is enabled.
Gecko SDK
contents of the sdk the sdk contains the following: 1.9.2 idl files for frozen interfaces (under idl/) header files for frozen interfaces, xpcom functions, and nspr functions (under include/) import libraries or shared libraries (under lib/)
static utility libraries (under lib/) various tools (under bin/) for more information about safely linking xpcom components using the xpcom "glue" library, see xpcom glue.
... resources
static xpidl.exe (non-official) if you are looking for a
static linked xpidl.exe, you can download here.
IME handling guide
this class has only
static members, i.e., never created its instance.
...and similarly, there is a singleton class, tsf
staticsink, to observe active tip changes.
IPDL Type Serialization
each type specializes ipc::paramtraits as follows: namespace ipc { template <> struct paramtraits<mytype> { typedef mytype paramtype;
static void write(message* amsg, const paramtype& aparam) { // implement serialization here }
static bool read(const message* amsg, void** aiter, paramtype* aresult) { // implement deserialization here.
...most structures can be serialized in this manner: struct examplestruct { int i; nscstring j; int k[4]; }; namespace ipc { template <> struct paramtraits<examplestruct> { typedef examplestruct paramtype;
static void write(message* amsg, const paramtype& aparam) { writeparam(amsg, aparam.i); writeparam(amsg, aparam.j); for (int i = 0; i < 4; ++i) writeparam(amsg, aparam.k[i]); }
static bool read(const message* amsg, void** aiter, paramtype* aresult) { if (!readparam(amsg, aiter, &(aresult->i)) || !readparam(amsg, aiter, &(aresult->j))) return false; for (...
CustomizableUI.jsm
otherwise, conflicting
static xul overlay button and dynamic customizableui buttons might cause the created button to be unstable or create a double button.
...for example, if there is a need to create a button with dynamically assignable tooltip, the node for
static tooltip should be deleted as soon as the widget will be created, and node-reference to popup tooltip element has to be added.
PerfMeasurement.jsm
method overview
static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables provide access to the recorded data.
...
static bool canmeasuresomething(); parameters none.
Build Metrics
num_constructors number of
static constructors found by the compiler in the firefox c++ codebase.
...
static constructors are undesirable because their initialization imposes an unavoidable time penalty every time firefox is started.
JSHydra
jshydra is a
static analysis tool that is capable of performing analysis of general javascript code.
... mailing list newsgroup rss feed #
static on irc.mozilla.org blogs joshua cranmer related topics dehydra, treehydra, spidermonkey categories interwiki language links ...
Dynamic Library Linking
it also provides a method by which to condition symbols of
statically linked code so that to other clients it appears as though they are dynamically loaded.
... library linking types these data types are defined for dynamic library linking: prlibrary pr
staticlinktable library linking functions the library linking functions are: pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program pr_loadlibrary cannot open a handle that references the main executable program.
Logging
supporting nspr logging are exposed in the api: prlogmoduleinfo prlogmodulelevel two environment variables control the behavior of logging at execution time: nspr_log_modules nspr_log_file logging functions and macros the functions and macros for logging are: pr_newlogmodule pr_setlogfile pr_setlogbuffering pr_logprint pr_logflush pr_log_test pr_log pr_assert pr_assert pr_
static_assert (new in nspr 4.6.6xxx this hasn't been released yet; the number is a logical guess) pr_not_reached use example the following sample code fragment demonstrates use of the logging and debugging aids.
... before running the compiled program, set the environment variable nspr_log_modules to userstuff:5
static void userlogstuff( void ) { prlogmoduleinfo *mylm; printn i; pr_
static_assert(5 > 4); /* nspr 4.6.6 or newer */ mylm = pr_newlogmodule( "userstuff" ); pr_assert( mylm ); pr_log( mylm, pr_log_notice, ("log a notice %d\n", 999 )); for (i = 0; i < 10 ; i++ ) { pr_log( mylm, pr_log_debug, ("log debug number: %d\n", i)); pr_sleep( 500 ); } pr_log( mylm, pr_log_notice, "that's all folks\n"); } /* end userlogstuff() */ see also nspr logging reference ...
Encrypt Decrypt MAC Keys As Session Objects
"-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " "); fprintf(stderr, "%-20s specify db directory path\n\n", "-d...
...unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength;
static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); ...
Encrypt and decrypt MAC using token
"-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " "); fprintf(stderr, "%-20s specify db directory path\n\n", "-d...
...unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength;
static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); ...
NSS_3.12.1_release_notes.html
roots bug 434860: coverity 1150 - dead code in ocsp_createcertid bug 436428: remove unneeded assert from sec_pkcs7encryptlength bug 436430: make nss public headers compilable with no_nspr_10_support defined bug 436577: uninitialized variable in sec_pkcs5createalgorithmid bug 438685: libpkix doesn't try all the issuers in a bridge with multiple certs bug 438876: signtool is still using
static libraries.
... bug 439123: assertion failure in libpkix at shutdown bug 440062: incorrect list element count in pkix_list_appenditem function bug 442618: eliminate dead function cert_certpackagetype bug 443755: extra semicolon in pkm_tlskeyandmacderive makes conditional code unconditional bug 443760: extra semicolon in seqdatabase makes
static analysis tool suspicious bug 448323: certutil -k doesn't report the token and slot names for found keys bug 448324: ocsp checker returns incorrect error code on request with invalid signing cert bug 449146: remove dead libsec function declarations bug 453227: installation of pem-encoded certificate without trailing newline fails documentation for a list of the primary nss documentation pages on mozilla.org, see nss documentation.
NSS_3.12_release_notes.html
bug 287061: crl number should be a big integer, not ulong bug 301213: combine internal libpkix function tests into a single
statically linked program bug 324740: add generation of sia and aia extensions to certutil bug 339737: libpkix ocsp checking calls cert_verifycert bug 358785: merge nss_libpkix_branch back to trunk bug 365966: infinite recursive call in vfy_verifydigestdirect bug 382078: pkix default http client returns error when try to get an ocsp response.
...bug 403680: cert_pkixverifycert fails if crls are missing, implement cert_pi_revocationflags bug 427706: nss_3_12_rc1 crashes in passwordmgr tests bug 426245: assertion failure went undetected by tinderbox bug 158242: pk11_putcrl is very memory inefficient bug 287563: please make cert_comparenamewithconstraints a non-
static function bug 301496: nss_shutdown failure in p7sign bug 324878: crlutil -l outputs false crl names bug 337010: oom crash [[@ nsc_digestkey] dereferencing possibly null att bug 343231: certutil issues certs for invalid requests bug 353371: klocwork 91117 - null pointer dereference in cert_certchainfromcert bug 353374: klocwork 76494 - null ptr derefs in cert_formatname bug 353375: klocwork 76513 -...
NSS 3.44 release notes
notable changes in nss 3.44 it is now possible to build nss as a
static library (bug 1543545) initial support for building for ios.
... separation 1521578 - x25519 support in pk11pars.c 1540205 - freebl build fails with -dnss_disable_chachapoly 1532312 - post-handshake auth doesn't interoperate with openssl 1542741 - certutil -f crashes with segmentation fault 1546925 - allow preceding text in try comment 1534468 - expose chacha20 primitive 1418944 - quote cc/cxx variables passed to nspr 1543545 - allow to build nss as a
static library 1487597 - early data that arrives before the handshake completes can be read afterwards 1548398 - freebl_gtest not building on linux/mac 1548722 - fix some coverity warnings 1540652 - softoken/sdb.c: logically dead code 1549413 - android log lib is not included in build 1537927 - ipsec usage is too restrictive for existing deployments 1549608 - signature fails with dbm disabled 15...
NSS 3.45 release notes
bug 1550579 - replace arm32 curve25519 implementation with one from fiat-crypto bug 1551129 - support
static linking on windows bug 1552262 - expose a function pk11_findrawcertswithsubject for finding certificates with a given subject on a given slot bug 1546229 - add ipsec ike support to softoken bug 1554616 - add support for the elbrus lcc compiler (<=1.23) bug 1543874 - expose an external clock for ssl this adds new experimental functions: ssl_settimefunc, ssl_createantireplaycontext, ssl_s...
...f4158 bugs fixed in nss 3.45 bug 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11 import (cve-2019-11719) bug 1515342 - more thorough input checking (cve-2019-11729) bug 1552208 - prohibit use of rsassa-pkcs1-v1_5 algorithms in tls 1.3 (cve-2019-11727) bug 1227090 - fix a potential divide-by-zero in makepfromqandseed from lib/freebl/pqg.c (
static analysis) bug 1227096 - fix a potential divide-by-zero in pqg_verifyparams from lib/freebl/pqg.c (
static analysis) bug 1509432 - de-duplicate code between mp_set_long and mp_set_ulong bug 1515011 - fix a mistake with chacha20-poly1305 test code where tags could be faked.
Encrypt Decrypt_MAC_Using Token
*/
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " "); fprintf(stderr, "%-20s specify db directory path\n\n", "-d...
...unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength;
static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); ...
NSS Sample Code Sample_3_Basic Encryption and MACing
er "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* print a usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c <a|b> -d <dbdirpath> [-z <noisefilename>] " "[-p <dbpwd> | -f <dbpwdfile>] -i <ipfilename> -o <opfilename>\n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c <a|b>"); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " ")...
...unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength;
static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); ...
NSS Sample Code Utilities_1
*/ /* * newline */
static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* * printasascii */ void printasascii(prfiledesc* out, const unsigned char *data, unsigned int len) { char *b64data = null; b64data = btoa_datatoascii(data, len); pr_fprintf(out, "%s", b64data); pr_fprintf(out, "\n"); if (b64data) { port_free(b64data); } } /* * printashex */ void printashex(prfile...
...einfo(src, &info); if (prstatus != pr_success) { return secfailure; } dst->data = 0; if (secitem_allocitem(null, dst, info.size)) { numbytes = pr_read(src, dst->data, info.size); if (numbytes == info.size) { return secsuccess; } } secitem_freeitem(dst, pr_false); dst->data = null; return secfailure; } /* * echooff */
static void echooff(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag &= ~echo; tcsetattr(fd, tcsaflush, &tio); } } /* * echoon */
static void echoon(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag |= echo; tcsetattr(fd, tcsaflush, &tio); } } /* * checkpassword */ prb...
EncDecMAC using token object - sample 3
_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " "); fprintf(stderr, "%-20s specify db directory path\n\n", "-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p "); fprintf(stderr...
...nsigned int ivlen, prbool ascii) { secstatus rv; unsigned char ptext[blocksize]; unsigned int ptextlen; unsigned char mac[digestsize]; unsigned int maclen; unsigned int nwritten; unsigned char encbuf[blocksize]; unsigned int encbuflen; secitem noparams = { sibuffer, null, 0 }; pk11context *ctxmac = null; pk11context *ctxenc = null; unsigned int pad[1]; secitem paditem; unsigned int paddinglength;
static unsigned int firsttime = 1; int j; ctxmac = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); /* read a buffer of plaintext from input file */ while ((ptextlen = ...
Utilities for nss samples
*/ /* * newline */
static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* * printasascii */ void printasascii(prfiledesc* out, const unsigned char *data, unsigned int len) { char *b64data = null; b64data = btoa_datatoascii(data, len); pr_fprintf(out, "%s", b64data); pr_fprintf(out, "\n"); if (b64data) { port_free(b64data); } } /* * printashex */ void printashex(prfile...
...einfo(src, &info); if (prstatus != pr_success) { return secfailure; } dst->data = 0; if (secitem_allocitem(null, dst, info.size)) { numbytes = pr_read(src, dst->data, info.size); if (numbytes == info.size) { return secsuccess; } } secitem_freeitem(dst, pr_false); dst->data = null; return secfailure; } /* * echooff */
static void echooff(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag &= ~echo; tcsetattr(fd, tcsaflush, &tio); } } /* * echoon */
static void echoon(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag |= echo; tcsetattr(fd, tcsaflush, &tio); } } /* * checkpassword */ prb...
nss tech note4
string, offsetof( mycertextdata, phonenum ) }, { sec_asn1_octet_string, offsetof( mycertextdata, rfc822name ) }, { sec_asn1_octet_string, offsetof( mycertextdata, id ) }, { sec_asn1_integer, offsetof(mycertextdata, maxusers ) }, { 0 } }; /* oid for my cert extension - replace 0xff with appropriate values*/
static const unsigned char myoid[] = { 0xff, 0xff, 0xff, 0xff, ....
... };
static const secitem myoiditem = { (secitemtype) 0, (unsigned char *)myoid, sizeof(myoid) }; secitem myextvalue; mycertextdata data; secstatus rv = cert_findcertextensionbyoid(cert, &myoiditem, &myextvalue); if (rv == secsuccess) { sec_asn1decodercontext * context = sec_asn1decoderstart(null, &data, mycertexttemplate); rv = sec_asn1decoderupdate( context, (const char *)(myextvalue.data), myextvalue.len); if (rv == secsuccess) { /* now you can extract info from secitem fields of your extension data structure */ /* see "misc helper functions" below */ .......
Scripting Java
this works just as in java, with the use of the new operator: js> new java.util.date() thu jan 24 16:18:17 est 2002 if we store the new object in a javascript variable, we can then call methods on it: js> f = new java.io.file("test.txt") test.txt js> f.exists() true js> f.getname() test.txt
static methods and fields can be accessed from the class object itself: js> java.lang.math.pi 3.141592653589793 js> java.lang.math.cos(0) 1 in javascript, unlike java, the method by itself is an object and can be evaluated as well as being called.
... public class overload { public string f(object o) { return "f(object)"; } public string f(string s) { return "f(string)"; } public string f(int i) { return "f(int)"; } public string g(string s, int i) { return "g(string,int)"; } public string g(int i, string s) { return "g(int,string)"; } public
static void main(string[] args) { overload o = new overload(); object[] a = new object[] { new integer(3), "hi", overload.class }; for (int i = 0; i != a.length; ++i) system.out.println(o.f(a[i])); } } when we compile and execute the program, it produces the output f(object) f(object) f(object) however, if we write a similar script var o = new packages.overl...
GC Rooting Guide
this scenario is rare but very difficult to notice manually, and will probably be caught by the
static rooting hazard analysis.
...
static void trace(jstracer* trc, jsobject* obj) { myclass* mine =
static_cast<myclass*>(obj->getprivate()); mine->trace(trc, "myclass private field"); } } class myclass { heap<jsstring*> str; public: void trace(jstracer* trc, const char* name) { js::traceedge(trc, &str, "my string"); } } if a pointer to your structure is stored in some other structure, then i...
Index
(there is a pending exception if the most recently thrown exception in cx has not yet been caught or cleared.) 203 js_clearregexp
statics jsapi reference, reference, référence(2), spidermonkey js_clearregexp
statics clears the pending input string and flags of the built-in regexp object.
... 263 js_executeregexp jsapi reference, spidermonkey js_executeregexp and js_newregexpobjectno
statics execute the regexp object, reobj, to the specified input string, chars, from *indexp index.
Exact Stack Rooting
there is also a
static constructor method frommarkedlocation() that creates a handle from an arbitrary location.
...there are moz_stack_class annotations that will cause a separate
static analysis to fail if these are detected.
JSClass
the code for such a class is simple: /* spidermonkey 38 */
static jsclass robot_class = { "robot", /* name */ 0 /* flags */ }; /* spidermonkey 31 or older */
static jsclass robot_class = { "robot", /* name */ 0, /* flags */ js_propertystub, js_propertystub, js_propertystub, js_propertystub, js_enumeratestub, js_resolvestub, js_convertstub, null, jsclass_no_optional_members }; to expose this class to scripts, and t...
...the javascript engine never touches the private data; it is for the application's use only.) void printer_finalize(jscontext *cx, jsobject *obj) { myprinter *p = (myprinter *) js_getprivate(cx, obj); delete p; }
static jsclass printer_class = { "printer", jsclass_has_private, null, null, null, null, null, null, null, printer_finalize }; /* spidermonkey 31 or older *
static jsclass printer_class = { * "printer", * jsclass_has_private, * js_propertystub, js_propertystub, js_propertystub, js_strictpropertystub, * js_enumeratestub, js_resolvestub, js_convertstub, printer_finali...
Parser API
this makes it easier to write tools in javascript that manipulate javascript source programs, such as syntax highlighters,
static analyses, translators, compilers, obfuscators, etc.
...if computed === false, the node corresponds to a
static e1.x expression and property is an identifier.
WebReplayRoadmap
static type integration (not yet implemented)
static type systems like flow and typescript are great and really useful for managing an app's codebase, but they are unsound by design, and it is pretty easy to satisfy the type system and yet have different types in practice.
... these are good candidates for optimization, and as with
static type integration above, points where unexpected types appear can be seeked to in the debugger for investigation.
Gecko Roles
role_
statictext represents read-only text, such as labels for other controls or instructions in a dialog box.
...
static text cannot be modified or selected.
XPCOM array guide
example: an array of error message
static const char* pointers.
...for instance: pr_callback prbool getfirstvisible(nsielement* element, void* closure) { prbool isvisible; element->isvisible(&isvisible); // stop at first object if (isvisible) { ns_
static_cast(closureobject*,closure)->element = element; return pr_false; } return pr_true; } ...
An Overview of XPCOM
this simple macro declares a constant with the value of the cid:
static ns_define_cid(kwebshellcid, ns_web_shell_cid); a cid is sometimes also referred to as a class identifier.
...face abstract class, is contained within the new_someinterface function, which follows the factory design pattern: encapsulating the constructor int new_someinterface(someinterface** ret) { // create the object someclass* out = new someclass(); if (!out) return -1; // init the object if (out->init() == false) { delete out; return -1; } // cast to the interface *ret =
static_cast<someinterface*>(out); return 0; } the factory is the class that actually manages the creation of separate instances of a component for use.
Creating the Component Code
static const nsiid kimoduleiid = ns_imodule_iid;
static const nsiid kifactoryiid = ns_ifactory_iid;
static const nsiid kisupportsiid = ns_isupports_iid;
static const nsiid kicomponentregistrariid = ns_icomponentregistrar_iid; // generate unique id here with uuidgen #define sample_cid \ { 0x777f7150, 0x4a2b, 0x4301, \ { 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}}
static const nscid ksamplecid...
... #include <stdio.h> #define mozilla_strict_api #include "nsimodule.h" #include "nsifactory.h" #include "nsicomponentmanager.h" #include "nsicomponentregistrar.h"
static const nsiid kimoduleiid = ns_imodule_iid;
static const nsiid kifactoryiid = ns_ifactory_iid;
static const nsiid kisupportsiid = ns_isupports_iid;
static const nsiid kicomponentregistrariid = ns_icomponentregistrar_iid; #define sample_cid \ { 0x777f7150, 0x4a2b, 0x4301, \ { 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}}
static const nscid ksamplecid = sample_cid; class sample: public nsisupp...
Setting up the Gecko SDK
each module directory is divided into three subdirectories: module subdirectories the bin directory contains
static libraries, dynamic libraries, and in some cases tools that may be useful in development.
... #include "nsigenericfactory.h" #include "cspecialthing.h" ns_generic_factory_constructor(cspecialthing)
static nsmodulecomponentinfo components[] = { { specialthing_classname, specialthing_cid, specialthing_contractid, cspecialthingconstructor, } }; ns_impl_nsgetmodule("specialthingsmodule", components) next step is a makefile for gmake.
NS_OVERRIDE
if there is no base class method with the same signature, a compiler with
static-checking enabled will fail to compile.
...a compiler with
static-checking enabled will issue the following error: test.cpp:8: error: ns_override function b::getfoo(nsifoo**) does not override a base class method with the same name and signature.
nsAutoRefTraits
when the handle to the resource is a pointer to t the specialization may be derived from nspointerreftraits<t>, so that only definitions of the release(t*)
static method and possibly the addref(t*)
static method need to be added.
...for example: ns_specialize_template class nsautoreftraits<prfiledesc> : public nspointerreftraits<prfiledesc> { public:
static void release(prfiledesc *ptr) { pr_close(ptr); } }; or ns_specialize_template class nsautoreftraits<fcpattern> : public nspointerreftraits<fcpattern> { public:
static void release(fcpattern *ptr) { fcpatterndestroy(ptr); }
static void addref(fcpattern *ptr) { fcpatternreference(ptr); } }; nsautoreftraits is described in xpcom/base/nsautoref.h.
nsMemory
« xpcom api reference summary the nsmemory class provides
static helper routines to manage memory.
...the
static methods defined on this class are not frozen.
XPCOM glue classes
if there is no base class method with the same signature, a compiler with
static-checking enabled will fail to compile.ns_postconditionmacrons_preconditionmacronsacstringthe nsacstring abstract class represents a character string composed of single-byte storage units.
...vides a way to construct a nsacstring object that allocates null-terminated storage.nsembedstringthe nsembedstring concrete class provides a way to construct a nsastring object that allocates null-terminated storage.nsfixedcstringclass declarationnsfixedstringclass declarationnsliteralcstring (external)class declarationnsliteralstring (external)class declarationnsmemorythe nsmemory class provides
static helper routines to manage memory.
nsIAccessibleRole
role_
statictext 41 represents read-only text, such as labels for other controls or instructions in a dialog box.
...
static text cannot be modified or selected.
Using nsIDirectoryService
bear in mind that this list is not
static.
...it does not need to be a component - it can be a
static lib, a source file in your project - whatever.
Testing Mozilla code
asan nightly projectthe asan nightly project involves building a firefox nightly browser with the popular addresssanitizer tool and enhancing it with remote crash reporting capabilities for any errors detected.clang
static analysisthis document is split in two parts.
... the first part will focus on the modern and robust way of
static-analysis and the second part will present the build-time
static-analysis.debugging mozilla with valgrindthis page describes how to use valgrind (specifically, its memcheck tool) to find memory errors.firefox and address sanitizeraddress sanitizer (asan) is a fast memory error detector that detects use-after-free and out-of-bound bugs in c/c++ programs.
AbstractRange - Web APIs
instead, you will use the range or
staticrange interfaces.
...
staticrange a
staticrange is a basic range which cannot be changed once it's been created.
DOMPoint - Web APIs
you can also use an existing dompoint or dompointreadonly or a dompointinit dictionary to create a new point by calling the dompoint.frompoint()
static method.
...
static methods dompoint.frompoint() creates a new mutable dompoint object given an existing point (or a dompointinit dictionary) which provides the values for its properties.
DOMPointReadOnly - Web APIs
first, you can use its constructor, passing in the values of the parameters for each dimension and, optionally, the perspective: /* 2d */ const point = new dompointreadonly(50, 50); /* 3d */ const point = new dompointreadonly(50, 50, 25); /* 3d with perspective */ const point = new dompointreadonly(100, 100, 100, 1.0); the other option is to use the
static dompointreadonly.frompoint() method: const point = dompointreadonly.frompoint({x: 100, y: 100, z: 50; w: 1.0}); constructor dompointreadonly() creates a new dompointreadonly object given the values of its coordinates and perspective.
...
static methods dompointreadonly.frompoint() a
static method that creates a new dompointreadonly object given the coordinates provided in the specified dompointinit object.
DedicatedWorkerGlobalScope: message event - Web APIs
bubbles no cancelable no interface 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 o...
...nmessage event handler property: //
static/scripts/worker.js self.onmessage = (event) => { console.log(`received message from parent: ${event.data}`); }; specifications specification status html living standard living standard ...
EffectTiming.easing - Web APIs
the browser flips to a different
static frame when each interval is reached, rather than animating smoothly.
...the browser flips to a different
static frame when each interval is reached, rather than animating smoothly.
MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN - Web APIs
mouseevent.webkit_force_at_force_mouse_down is a proprietary, webkit-specific,
static numeric property whose value is the minimum force necessary for a force click.
... because webkit_force_at_force_mouse_down is a
static property of mouseevent, you always use it as mouseevent.webkit_force_at_force_mouse_down, rather than as a property of a mouseevent instance.
MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN - Web APIs
mouseevent.webkit_force_at_mouse_down is a proprietary, webkit-specific,
static numeric property whose value is the minimum force necessary for a normal click.
... because webkit_force_at_mouse_down is a
static property of mouseevent, you always use it as mouseevent.webkit_force_at_mouse_down, rather than as a property of a mouseevent instance.
Notification - Web APIs
properties
static properties these properties are available only on the notification object itself.
... methods
static methods these methods are available only on the notification object itself.
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() - Web APIs
isuserverifyingplatformauthenticatoravailable() is a
static method of the publickeycredential interface that returns a promise which resolves to true if a user-verifying platform authenticator is available.
... note: this is a
static method which is directly called on the publickeycredential interface and not on an instance.
SVGAnimatedPathData - Web APIs
normalizedpathseglist svgpathseglist provides access to the base (i.e.,
static) contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z).
... pathseglist svgpathseglist provides access to the base (i.e.,
static) contents of the 'd' attribute in a form which matches one-for-one with svg's syntax.
URL - Web APIs
static methods createobjecturl() returns a domstring containing a unique blob url, that is a url with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser.
... working draft added the
static methods url.createobjecturl() and url.revokeobjecturl().
A basic 2D WebGL animation example - Web APIs
= buildshaderprogram(shaderset); aspectratio = glcanvas.width/glcanvas.height; currentrotation = [0, 1]; currentscale = [1.0, aspectratio]; vertexarray = new float32array([ -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5 ]); vertexbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, vertexbuffer); gl.bufferdata(gl.array_buffer, vertexarray, gl.
static_draw); vertexnumcomponents = 2; vertexcount = vertexarray.length/vertexnumcomponents; currentangle = 0.0; rotationrate = 6; animatescene(); } after getting the webgl context, gl, we need to begin by building the shader program.
...the usage hint gl.
static_draw is specified, telling webgl that the data will be set only one time and never modified, but will be used repeatedly.
WebGL constants - Web APIs
constant name value description
static_draw 0x88e4 passed to bufferdata as a hint about whether the contents of the buffer are likely to be used often and not change often.
... sync_flush_commands_bit 0x00000001 miscellaneous constants constant name value description color 0x1800 depth 0x1801 stencil 0x1802 min 0x8007 max 0x8008 depth_component24 0x81a6 stream_read 0x88e1 stream_copy 0x88e2
static_read 0x88e5
static_copy 0x88e6 dynamic_read 0x88e9 dynamic_copy 0x88ea depth_component32f 0x8cac depth32f_stencil8 0x8cad invalid_index 0xffffffff timeout_ignored -1 max_client_wait_timeout_webgl 0x9247 constants defined in webgl extensions angle_...
Creating 3D objects using WebGL - Web APIs
var colors = []; for (var j = 0; j < facecolors.length; ++j) { const c = facecolors[j]; // repeat each color four times for the four vertices of the face colors = colors.concat(c, c, c, c); } const colorbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, colorbuffer); gl.bufferdata(gl.array_buffer, new float32array(colors), gl.
static_draw); define the element array once the vertex arrays are generated, we need to build the element array.
... const indices = [ 0, 1, 2, 0, 2, 3, // front 4, 5, 6, 4, 6, 7, // back 8, 9, 10, 8, 10, 11, // top 12, 13, 14, 12, 14, 15, // bottom 16, 17, 18, 16, 18, 19, // right 20, 21, 22, 20, 22, 23, // left ]; // now send the element array to gl gl.bufferdata(gl.element_array_buffer, new uint16array(indices), gl.
static_draw); return { position: positionbuffer, color: colorbuffer, indices: indexbuffer, }; } the indices array defines each face like a pair of triangles, specifying each triangle's vertices as an index into the cube's vertex arrays.
Background audio processing using AudioWorklet - Web APIs
this is done by adding the
static getter parameterdescriptors to your class.
...
static get parameterdescriptors() { return [ { name: "gain", defaultvalue: 0.5, minvalue: 0, maxvalue: 1 }, { name: "frequency", defaultvalue: 440.0; minvalue: 27.5, maxvalue: 4186.009 } ]; } accessing your processor node's parameters is as simple as looking them up in the parameters object passed into your implementation of process().
Worker: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage examples this code creates a new worker and listens to messages from it using addeventlistener(): const worker = new worker("
static/scripts/worker.js"); worker.addeventlistener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); alternatively, it could listen using the onmessage event handler property: const worker = new worker("
static/scripts/worker.js"); worker.onmessage = (event) => { console.log(`received message from worker: ${event.data}`) }; the worker posts messages usin...
...g self.postmessage(): //
static/scripts/worker.js self.postmessage('i\'m alive!'); specifications specification status html living standard living standard ...
XRSpace - Web APIs
xrreferencespace represents a reference space which is typically expected to remain
static for the duration of the xrsession.
...there are exceptions to this
static nature; most commonly, an xrreferencespace may move in order to adjust based on reconfiguration of the user's headset or other motion-sensitive device.
ARIA Test Cases - Accessibility
ws 10 - - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - list simple list expected at behavior: (mz) screen reader should indicate an aria list like any other
static html list.
... markup used: role="listbox", "option" (listitem should only be used with list, which is for
static document structures, could someone please make sure our examples follow this rule) aria-activedescendant notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 - - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (...
ARIA: listbox role - Accessibility
the listbox role is used for lists from which a user may select one or more items which are
static and, unlike html <select> elements, may contain images.
... description the listbox role is used to identify an element that creates a list from which a user may select one or more
static items, similar to the html <select> element.
Stacking without the z-index property - CSS: Cascading Style Sheets
element #5 is
static, and so is drawn below the other four elements, even though it comes later in the html markup.
... source code for the example html <div id="abs1" class="absolute"> <b>div #1</b><br />position: absolute;</div> <div id="rel1" class="relative"> <b>div #2</b><br />position: relative;</div> <div id="rel2" class="relative"> <b>div #3</b><br />position: relative;</div> <div id="abs2" class="absolute"> <b>div #4</b><br />position: absolute;</div> <div id="sta1" class="
static"> <b>div #5</b><br />position:
static;</div> css b { font-family: sans-serif; } div { padding: 10px; border: 1px dashed; text-align: center; } .
static { position:
static; height: 80px; background-color: #ffc; border-color: #996; } .absolute { position: absolute; width: 150px; height: 350px; background-color: #fdd; border-color: #900; opacity: 0.7; } .relative { position: relat...
bottom - CSS: Cascading Style Sheets
when position is set to
static, the bottom property has no effect.
... auto specifies that: for absolutely positioned elements, the position of the element is based on the top property, while height: auto is treated as a height based on the content; or if top is also auto, the element is positioned where it should vertically be positioned if it were a
static element.
left - CSS: Cascading Style Sheets
auto specifies that: for absolutely positioned elements, the position of the element is based on the right property, while width: auto is treated as a width based on the content; or if right is also auto, the element is positioned where it should horizontally be positioned if it were a
static element.
... when position is set to
static, the left property has no effect.
margin-left - CSS: Cascading Style Sheets
this table summarizes the different cases: value of display value of float value of position computed value of auto comment inline, inline-block, inline-table any
static or relative 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption any
static or relative 0, except if both margin-left and margin-right are set to auto.
... block layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption left or right
static or relative 0 block layout mode (floating element) any table-*, except table-caption any any 0 internal table-* elements don't have margins, use border-spacing instead any, except flex, inline-flex, or table-* any fixed or absolute 0, except if both margin-left and margin-right are set to auto.
margin-right - CSS: Cascading Style Sheets
this table summarizes the different cases: value of display value of float value of position computed value of auto comment inline, inline-block, inline-table any
static or relative 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption any
static or relative 0, except if both margin-left and margin-right are set to auto.
... block layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption left or right
static or relative 0 block layout mode (floating element) any table-*, except table-caption any any 0 internal table-* elements don't have margins, use border-spacing instead any, except flex, inline-flex, or table-* any fixed or absolute 0, except if both margin-left and margin-right are set to auto.
right - CSS: Cascading Style Sheets
auto specifies that: for absolutely positioned elements, the position of the element is based on the left property, while width: auto is treated as a width based on the content; or if left is also auto, the element is positioned where it should horizontally be positioned if it were a
static element.
... when position is set to
static, the right property has no effect.
top - CSS: Cascading Style Sheets
when position is set to
static, the top property has no effect.
... auto specifies that: for absolutely positioned elements, the position of the element is based on the bottom property, while height: auto is treated as a height based on the content; or if bottom is also auto, the element is positioned where it should vertically be positioned if it were a
static element.
Setting up adaptive streaming media sources - Developer guides
<?xml version="1.0" encoding="utf-8"?> <mpd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011 dash-mpd.xsd" type="
static" mediapresentationduration="pt654s" minbuffertime="pt2s" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"> <baseurl>http://example.com/ondemand/</baseurl> <period> <!-- english audio --> <adaptationset mimetype="audio/mp4" codecs="mp4a.40.5" lang="en" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="1" bandwidth="64000"> <baseurl>el...
... <?xml version="1.0"?> <mpd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-main:2011" type="
static" mediapresentationduration="pt0h9m56.46s"> <baseurl> http://example.com/segments </baseurl> <period start="pt0s"> <adaptationset bitstreamswitching="true"> <representation id="0" codecs="avc1" mimetype="video/mp4" width="320" height="240" startwithsap="1" bandwidth="46986"> <segmentbase> <initialization sourceurl="main/news100/1.m4s" range="0...
<script>: The Script element - HTML: Hypertext Markup Language
to allow error logging for sites which use a separate domain for
static media, use this attribute.
... <!-- generated by the server --> <script id="data" type="application/json">{"userid":1234,"username":"john doe","membersince":"2000-01-01t00:00:00.000z"}</script> <!--
static --> <script> const userinfo = json.parse(document.getelementbyid("data").text); console.log("user information: %o", userinfo); </script> specifications specification status comments html living standardthe definition of '<script>' in that specification.
Cache-Control - HTTP
examples preventing caching to disable caching of a resource, you can send the following response header: good: cache-control: no-store bad: cache-control: private,no-cache,no-store,max-age=0,must-revalidate,pre-check=0,post-check=0 caching
static assets for the files in the application that will not change, you can usually add aggressive caching by sending the response header below.
... this includes
static files that are served by the application such as images, css files and javascript files, for example.
Introduction - JavaScript
the javascript language resembles java but does not have java's
static typing and strong type checking.
... variable data types must be declared (
static typing, strongly typed).
TypeError: "x" is not a constructor - JavaScript
however, some global objects are not and their properties and methods are
static.
... this is not legal (the promise constructor is not being called correctly) and will throw a typeerror: this is not a constructor exception: return new promise.resolve(true); instead, use the promise.resolve() or promise.reject()
static methods: // this is legal, but unnecessarily long: return new promise((resolve, reject) => { resolve(true); }) // instead, return the
static method: return promise.resolve(true); return promise.reject(false); ...
Array.from() - JavaScript
the array.from()
static method creates a new, shallow-copied array instance from an array-like or iterable object.
...as a result,
static methods such as array.from() are "inherited" by subclasses of array, and create new instances of the subclass, not array.
ArrayBuffer - JavaScript
static properties get arraybuffer[@@species] the constructor function that is used to create derived objects.
...
static methods arraybuffer.isview(arg) returns true if arg is one of the arraybuffer views, such as typed array objects or a dataview.
Date.prototype.toLocaleString() - JavaScript
2012" // an application may want to use utc and make that visible options.timezone = 'utc'; options.timezonename = 'short'; console.log(date.tolocalestring('en-us', options)); // → "thursday, december 20, 2012, gmt" // sometimes even the us needs 24-hour time console.log(date.tolocalestring('en-us', { hour12: false })); // → "12/19/2012, 19:00:00" avoid comparing formatted date values to
static values most of the time, the formatting returned by tolocalestring() is consistent.
... for this reason, you cannot expect to be able to compare the results of tolocalestring() to a
static value: "1/1/2019, 01:00:00" === new date("2019-01-01t01:00:00z").tolocalestring("en-us"); // true in firefox and others // false in ie and edge note: see also this stackoverflow thread for more details and examples.
Intl.DateTimeFormat.prototype.format() - JavaScript
var a = [new date(2012, 08), new date(2012, 11), new date(2012, 03)]; var options = { year: 'numeric', month: 'long' }; var datetimeformat = new intl.datetimeformat('pt-br', options); var formatted = a.map(datetimeformat.format); console.log(formatted.join('; ')); // → "setembro de 2012; dezembro de 2012; abril de 2012" avoid comparing formatted date values to
static values most of the time, the formatting returned by format() is consistent.
... for this reason you cannot expect to be able to compare the results of format() to a
static value: let d = new date("2019-01-01t00:00:00.000000z"); let formatteddate = intl.datetimeformat(undefined, { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' }).format(d); "1.1.2019, 01:00:00" === formatteddate; // true in firefox and others // false in ie and edge note: see also this stackoverflow thread for more details an...
Math.cos() - JavaScript
the math.cos()
static function returns the cosine of the specified angle, which must be specified in radians.
... because cos() is a
static method of math, you always use it as math.cos(), rather than as a method of a math object you created (math is not a constructor).
Math.min() - JavaScript
the
static function math.min() returns the lowest-valued number passed into it, or nan if any parameter isn't a number and can't be converted into one.
... description because min() is a
static method of math, you always use it as math.min(), rather than as a method of a math object you created (math is not a constructor).
Number - JavaScript
static properties number.epsilon the smallest interval between two representable numbers.
...
static methods number.isnan() determine whether the passed value is nan.
Promise.reject() - JavaScript
description the
static promise.reject function returns a promise that is rejected.
... examples using the
static promise.reject() method promise.reject(new error('fail')).then(function() { // not called }, function(error) { console.error(error); // stacktrace }); specifications specification ecmascript (ecma-262)the definition of 'promise.reject' in that specification.
Promise.resolve() - JavaScript
description the
static promise.resolve function returns a promise that is resolved.
... examples using the
static promise.resolve method promise.resolve('success').then(function(value) { console.log(value); // "success" }, function(value) { // not called }); resolving an array var p = promise.resolve([1,2,3]); p.then(function(v) { console.log(v[0]); // 1 }); resolving another promise var original = promise.resolve(33); var cast = promise.resolve(original); cast.then(function(value) { console.log('value: ' + value); }); console.log('original === cast ?
RegExp.input ($_) - JavaScript
the non-standard input property is a
static property of regular expressions that contains the string against which a regular expression is matched.
... description the input property is
static, it is not a property of an individual regular expression object.
RegExp.lastMatch ($&) - JavaScript
the non-standard lastmatch property is a
static and read-only property of regular expressions that contains the last matched characters.
... description the lastmatch property is
static, it is not a property of an individual regular expression object.
RegExp.lastParen ($+) - JavaScript
the non-standard lastparen property is a
static and read-only property of regular expressions that contains the last parenthesized substring match, if any.
... description the lastparen property is
static, it is not a property of an individual regular expression object.
RegExp.leftContext ($`) - JavaScript
the non-standard leftcontext property is a
static and read-only property of regular expressions that contains the substring preceding the most recent match.
... description the leftcontext property is
static, it is not a property of an individual regular expression object.
RegExp.$1-$9 - JavaScript
the legacy regexp $1, $2, $3, $4, $5, $6, $7, $8, $9 properties are
static and read-only properties of regular expressions that contain parenthesized substring matches.
... description the $1, ..., $9 properties are
static, they are not a property of an individual regular expression object.
RegExp.rightContext ($') - JavaScript
the non-standard rightcontext property is a
static and read-only property of regular expressions that contains the substring following the most recent match.
... description the rightcontext property is
static, it is not a property of an individual regular expression object.
String.fromCharCode() - JavaScript
the
static string.fromcharcode() method returns a string created from the specified sequence of utf-16 code units.
... because fromcharcode() is a
static method of string, you always use it as string.fromcharcode(), rather than as a method of a string object you created.
String.fromCodePoint() - JavaScript
the
static string.fromcodepoint() method returns a string created by using the specified sequence of code points.
... because fromcodepoint() is a
static method of string, you must call it as string.fromcodepoint(), rather than as a method of a string object you created.
super - JavaScript
this.name = 'square'; } } super-calling
static methods you are also able to call super on
static methods.
... class rectangle { constructor() {}
static lognbsides() { return 'i have 4 sides'; } } class square extends rectangle { constructor() {}
static logdescription() { return super.lognbsides() + ' which are all equal'; } } square.logdescription(); // 'i have 4 sides which are all equal' deleting super properties will throw an error you cannot use the delete operator and super.prop or super[expr] to delete a parent class' property, it will throw a referenceerror.
Strict mode - JavaScript
these words are implements, interface, let, package, private, protected, public,
static, and yield.
...} function fun(
static) { 'use strict'; } // !!!
Authoring MathML - MathML
that is, you use command-line programs to generate them and publish these
static pages on your server.
... pros: you get
static web pages: the latex source don't need to be parsed at each page load, the mathml code is exposed to web crawlers and you can put them easily on any web server.
Using custom elements - Web Components
which attributes to notice change for is specified in a
static get observedattributes method let's look at an example of these in use.
...this is done by specifying a
static get observedattributes() method inside custom element class - this should return an array containing the names of the attributes you want to observe:
static get observedattributes() { return ['c', 'l']; } this is placed right at the top of the constructor, in our example.
Understanding WebAssembly text format - WebAssembly
imported functions are just like normal functions: they have a signature that webassembly validation checks
statically, and they are given an index and can be named and called.
... to see why tables are needed, we need to first observe that the call instruction we saw earlier (see calling functions from other functions in the same module) takes a
static function index and thus can only ever call one function — but what if the callee is a runtime value?
context-menu - Archive of obsolete content
warning: unless your content script is extremely simple and consists only of a
static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
page-worker - Archive of obsolete content
unless your content script is extremely simple and consists only of a
static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
panel - Archive of obsolete content
warning: unless your content script is extremely simple and consists only of a
static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
widget - Archive of obsolete content
unless your content script is extremely simple and consists only of a
static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
cfx to jpm - Archive of obsolete content
permanently removed options jpm has dropped support for: --extra-packages --use-config --package-path --pkgdir --no-strip-xpi --harness-option --manifest-overload --output-file --templatedir --keydir --profiledir --overload-modules --
static-args --app --no-run --addons --e10s --logfile --dependencies --force-mobile --test-runner-pkg instead of --profiledir and --overload-modules, use --profile and --overload.
Forms related code snippets - Archive of obsolete content
dp-active-cell">31</td> <td class="zdp-empty-cell"> </td> <td class="zdp-empty-cell"> </td> <td class="zdp-empty-cell"> </td> <td class="zdp-empty-cell"> </td> <td class="zdp-empty-cell"> </td> <td class="zdp-empty-cell"> </td> </tr> </tbody> </table> editable <select> fields the content of the <select> element is actually
static and not editable.
Custom about: URLs - Archive of obsolete content
stom about page'; const aboutpage_id = 'aa132730-2278-11e5-867f-0800200c9a66'; // make sure you generate a unique id from https://www.famkruithof.net/uuid/uuidgen const aboutpage_word = 'myaboutpage' const aboutpage_uri = 'data:text/html,hi this is the page that is shown when navigate to about:myaboutpage'; // const aboutpage_uri = 'chrome://myaboutaddon/content/index.html'; class aboutpage {
static get classid() { return components.id(`{${aboutpage_id}}`); }
static get classdescription() { return aboutpage_description; }
static get contractid() { return `@mozilla.org/network/protocol/about;1?what=${aboutpage_word}`; }
static get queryinterface() { return xpcomutils.generateqi([ci.nsiaboutmodule]); } constructor() { object.freeze(this); } geturiflags(auri) { return ci.n...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
['html:label', {for:'mycheck'}, 'here is text of label, click this text will check the box' ] ] ] ]; document.body.appendchild(jsontodom(json, document, {})); jquery templating for extensions which already use jquery, it is possible to use its builtin dom building functions for templating, though care must be taken when passing non-
static strings to methods such as .append() and .html().
Makefile - .mk files - Archive of obsolete content
makefile description client.mk top level makefile which controls the overall build config/android-common.m config/autoconf.mk config/rules.mk targets (export, deps, libs, tools) and generic build rules config/
static-checking-config.mk config/version.mk makefile description config/myconfig.mk user defined build configuration values config/myrules.mk user defined makefile rules for building $(topsrcdir)/$(moz_build_app)/app-config.mk application specific build configuration ...
Creating a Mozilla Extension - Archive of obsolete content
contents prerequisites tinderbox making a mozilla installation modifiable finding the file to modify finding the code to modify adding the structure specifying the appearance enabling the behavior - retrieving tinderbox status enabling the behavior - updating the status bar panel enabling the behavior - updating the status periodically making it into a
static overlay making it into a dynamic overlay and packaging it up for distribution conclusion next » original document information author(s): myk melez last updated date: september 19, 2006 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Embedding FAQ - Archive of obsolete content
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 even...
GRE - Archive of obsolete content
statically link to xpcomglue.lib (the "standalone glue") the solution is to
statically link against xpcomglue.lib, also known as the "standalone glue" (see xpcom glue).
Java in Firefox Extensions - Archive of obsolete content
var aclass = java.lang.class.forname("org.mozilla.developer.helloworld", true, cl); var a
staticmethod = aclass.getmethod("getgreeting", []); var greeting = a
staticmethod.invoke(null, []); alert(greeting); another, perhaps simpler approach is as follows: var myclass = loader.loadclass('com.example.myclass'); // use the same loader from above var myobj = myclass.newinstance(); var binval = myobj.mymethod(arg1, arg2); // pass whatever arguments you need (they'll be auto-converted to java for...
Menu - Archive of obsolete content
examples before running any examples, import the api from the future: jetpack.future.import("menu"); snippets add a single,
static menuitem to the jetpack menu that doesn't do anything: jetpack.menu.add("two drink holders and a captain's chair"); add a menuitem to the jetpack menu that displays the current date and time each time it's opened: jetpack.menu.add(function () new date().tostring()); click an item in the jetpack menu to be notified of the current date and time: jetpack.menu.add({ label: "show current date and ...
jspage - Archive of obsolete content
scroll:function(){if(b(this)){return this.getwindow().getscroll(); }return{x:this.scrollleft,y:this.scrolltop};},getscrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollleft;h.y+=i.scrolltop;i=i.parentnode; }return h;},getoffsetparent:function(){var h=this;if(b(h)){return null;}if(!browser.engine.trident){return h.offsetparent;}while((h=h.parentnode)&&!b(h)){if(d(h,"position")!="
static"){return h; }}return null;},getoffsets:function(){if(this.getboundingclientrect){var j=this.getboundingclientrect(),m=document.id(this.getdocument().documentelement),p=m.getscroll(),k=this.getscrolls(),i=this.getscroll(),h=(d(this,"position")=="fixed"); return{x:j.left.toint()+k.x-i.x+((h)?0:p.x)-m.clientleft,y:j.top.toint()+k.y-i.y+((h)?0:p.y)-m.clienttop};}var l=this,n={x:0,y:0};if(b(this)){ret...
Monitoring downloads - Archive of obsolete content
if you're learning to use the download manager or storage apis, they're things you might look into doing for practice: add code to update the download log window on the fly, instead of generating a
static list when it's first opened.
Plug-n-Hack Phase1 - Archive of obsolete content
ions/source/browse/branches/beta/src/org/zaproxy/zap/extension/plugnhack/resource/service.json firefox ui in firefox the tool commands will be made available via the developer toolbar (gcli) https://developer.mozilla.org/docs/tools/gcli a example of how the zap commands are currently displayed is: note that user specified parameters can be specified for commands, which can either be free text, a
static pull down list of options or a dynamic list of options obtained from the tool on demand.
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
the simplest demonstration of the problem is as follows: typedef struct shareddata { prlock *ml; prcondvar *cv; print32 counter; } shareddata;
static void forkedthread(void *arg) { shareddata *shared = (shareddata*)arg; while (--shared->counter > 0) pr_waitcondvar(shared->cv, pr_interval_no_timeout); return; } /* forkedthread */ printn main(printn argc, char **argv) { prthread *thread; shareddata shared; shared.ml = pr_newlock(); shared.cv = pr_newcondvar(shared.ml); shared.counter = 10; thread = p...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
ages to install.) the stub installer code includes: the logic to display the install wizard widgets and dialogs the code that reads in the configuration file (config.ini) and dynamically installs from the net or from local xpi modules found next to the installer binary the code that processes user selections the code that calls the xpinstall engine through xpistub the libxpnet code that is
statically linked in the stub installers are written in code native to the platform using native widget toolkits including the windows api for windows, the mac toolbox for the mac, and gtk for the unix version.
Additional Navigation - Archive of obsolete content
here is an example triple that we could use in the photos example: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> this new triple has a
static value for the object attribute instead of a variable reference.
Template Guide - Archive of obsolete content
basics of xul templates introduction rule compilation rdf template syntax result generation rdf query syntax actions recursive generation simple example bindings additional navigation filtering
static content simple query syntax containment properties xml template syntax xml templates xml assignments sql template syntax sqlite templates common template syntax attribute substitution multiple rules using recursive templates building menus with templates special condition tests multiple queries using multiple queries to generate more results building trees with templates building trees building hierarchical trees template modifications template builder interface template and tree listeners rdf modifications additional topics sorting...
Using LDAP XPCOM with XULRunner - Archive of obsolete content
prefix)xpcomglue_s.$(lib_suffix) \ $(xpcom_frozen_ldopts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" ldapstubloader.cpp: // copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include "nsmodule.h" #include "prlink.h" #include "nsilocalfile.h" #include "nsstringapi.h" #include "nscomptr.h"
static char const *const kdependentlibraries[] = { #ifdef ns_win32 moz_dll_prefix "nsldap32v50" moz_dll_suffix, moz_dll_prefix "nsldappr32v50" moz_dll_suffix, #endif //ns_win32 #ifdef ns_unix moz_dll_prefix "ldap50" moz_dll_suffix, moz_dll_prefix "prldap50" moz_dll_suffix, #endif //ns_unix nsnull }; // component.dll on windows, libcomponent.dll on linux
static char krealcomponent[] = moz_dll_...
2006-10-20 - Archive of obsolete content
in jan vávra's case he is modifying the thunderbird installer so he needs to modify "mail/installer/windows/packages-
static" announcements decommissioning sparky on friday on october 17th j.
2006-10-27 - Archive of obsolete content
./configure --prefix=/export/home/alex/thunderbird --enable-application=browser --disable-tests --disable-debug -disable-auto-deps --disable-freetype2 -enable-official-branding --enable-default-toolkit=gtk2 --enable-optimize=-xo5 --enable-
static --disable-shared --enable-xft --enable-svg the build tools that he used to build firefox 2 are listed in his posting along with the error that he receives when he tries to build it.
Processing XML with E4X - Archive of obsolete content
reate an xmllist using xml literal syntax without needing to create a well-formed xml document, using the following syntax: var xmllist = <> <lang>javascript</lang> <lang>python</lang> </>; the += operator can be used to append new elements to an xmllist within a document: languages.lang += <lang>ruby</lang>; note that unlike node lists returned by regular dom methods, xmllists are
static and are not automatically updated to reflect changes in the dom.
Reflect.enumerate() - Archive of obsolete content
the
static reflect.enumerate() method used to return an iterator with the enumerable own and inherited properties of the target object, but has been removed in ecmascript 2016 and is deprecated in browsers.
JSException - Archive of obsolete content
declaration public int getwrappedexceptiontype() description getwrappedexceptiontype() returns an int that matches one of the following
static ints declared by the jsexception class: exception_type_empty exception_type_void exception_type_object exception_type_function exception_type_string exception_type_number exception_type_boolean ...
JavaArray - Archive of obsolete content
in addition, you can create a javaarray with an arbitrary data type using the newinstance method of the array class: public
static object newinstance(class componenttype, int length) throws negativearraysizeexception description the javaarray object is an instance of a java array that is created in or passed to javascript.
XForms Output Element - Archive of obsolete content
representations the xforms output element can be represented by the following widgets for the specified data types (or types derived from these data types): text - default representation for instance data of most types, especially
static text (xhtml/xul).
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
pdata with null for the purpose of this example // it will be assigned to the scriptable interface later to keep its // association with the specific plugin instance instance->pdata = null; return rv; } nperror npp_getvalue(npp instance, nppvariable variable, void *value) { if(instance == null) return nperr_invalid_instance_error; nperror rv = nperr_no_error;
static nsiid scriptableiid = ns_itestplugin_iid; if (variable == nppvpluginscriptableinstance) { // nsitestplugin interface object should be associated with the plugin // instance itself.
Archive of obsolete content
it is a
static library that is linked into the flash player but kept separate, and can be incorporated into other programs.
2D collision detection - Game development
green means collision, blue means no collision.</p> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crafty/0.5.4/crafty-min.js"></script> #cr-stage { position:
static !important; height: 200px !important; } crafty.init(200, 200); var dim1 = {x: 5, y: 5} var dim2 = {x: 20, y: 20} crafty.c("circle", { circle: function(radius, color) { this.radius = radius; this.w = this.h = radius * 2; this.color = color || "#000000"; this.bind("move", crafty.drawmanager.drawall) return this; }, draw: function() { ...
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
safe methods don't need to serve
static files only; a server can generate an answer to a safe method on-the-fly, as long as the generating script guarantees safety: it should not trigger external effects, like triggering an order in an e-commerce web site.
MDN Web Docs Glossary: Definitions of Web-related terms
py mode slug smoke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification speculative parsing speed index sql sql injection sri stacking context state machine statement
static method
static typing strict mode string stun style origin stylesheet svg svn symbol symmetric-key cryptography synchronous syntax syntax error synthetic monitoring t tag tcp tcp handshake tcp slow start telnet ...
Debugging CSS - Learn web development
to create a reduced test case: if your markup is dynamically generated — for example via a cms — make a
static version of the output that shows the problem.
JavaScript — Dynamic client-side scripting - Learn web development
every time a web page does more than just sit there and display
static information for you to look at—displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, or more—you can bet that javascript is probably involved.
Server-side web frameworks - Learn web development
restful routes, plugins, commands, perl-ish templates, content negotiation, session management, form validation, testing framework,
static file server, cgi/psgi detection, and first-class unicode support.
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 app structure and componentization - Learn web development
g> todos left </span> <ul class="filters"> <li> <a href="#">all</a> <a href="#">active</a> <a href="#">completed</a> </li> </ul> <button type="button" class="clear-completed"> clear completed </button> </footer> </section> the rendered output should now be as follows: this looks pretty complete, but remember that this is only a
static prototype.
Implementing feature detection - Learn web development
therefore, you can detect whether the browser supports geolocation or not by using something like the following: if ("geolocation" in navigator) { navigator.geolocation.getcurrentposition(function(position) { // show the location on a map, perhaps using the google maps api }); } else { // give the user a choice of
static maps instead perhaps } it is probably better to use an established feature detection library however, rather than writing your own all the time.
Handling common JavaScript problems - Learn web development
therefore, you can detect whether the browser supports geolocation or not by using something like the following: if("geolocation" in navigator) { navigator.geolocation.getcurrentposition(function(position) { // show the location on a map, perhaps using the google maps api }); } else { // give the user a choice of
static maps instead perhaps } you could also write such a test for a css feature, for example by testing for the existence of element.style.property (e.g.
Gecko info for Windows accessibility vendors
role_
statictext xul: <label> or <description> html: <label> dhtml: role="wairole:label" or role="wairole:description" supports navrelation_label_for and navrelation_description_for via accnavigate().
Adding a new event
this method is used for retrieving sub class pointer avoiding to use
static_cast.
Continuous Integration
hf -
static rooting hazard analysis s -
static analysis v - valgrind build and test jobs; these jobs create valgrind-compatible builds and run a small set of valgrind tests on them.
Debugging OpenGL
if you start up firefox with this variable defined, the following behavior changes occur: each time you issue an opengl call, a check is performed to ensure that the gl context is current, using a thread-local
static variable to keep track of this.
Debugging on Windows
here are some entries that will make your life easier: ;; mozilla (1.7beta and later) nsautostring=<mdata,su> nsstring=<mdata,su> nscstring=<mdata,s> nscautostring=<mdata,s> nsrect=x=<x,d> y=<y,d> width=<width,d>; height=<height,d> ns
staticatomwrapper=<m
staticatom->mstring,s> nsiatom=<mstring,su> ; the following are not necessary in vc8 nscomptr<*>=<mrawptr,x> nsrefptr=<mrawptr,x> nsautoptr=<mrawptr,x> after you have made the changes and saved the file, you will need to restart visual c++ for the changes to take effect.
Debugging
detecting defects in firefox with coverity coverity is a
static analysis system that can detect defects in firefox.
Makefile - variables
static_dirs subdirectories containing
static makefiles that are not autogenerated.
Simple Sunbird build
ubuntu linux: sudo apt-get build-dep sunbird sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libiw-dev autoconf2.13 cvs fedora linux: sudo yum groupinstall 'development tools' 'development libraries' 'gnome software development' sudo yum install mercurial autoconf213 glibc-
static libstdc++-
static yasm wireless-tools-devel mesa-libgl-devel mac: install xcode tools.
Updating NSPR or NSS in mozilla-central
(because some developers might not be aware that nspr/nss are separately maintained and released, the mozilla hg server rejects accidental changes/forking, if the required keywords are missing in the commit comment.) if nspr or nss must be upgraded to a new
static tag, follow this procedure: before starting, make sure your local repository is updated to mozilla-central tip and that there are no local changes: $ hg status -mard pull the new sources $ python client.py update_nspr nspr_tag_name or $ python client.py update_nss nss_tag_name if you update a branch older than mozilla 17 (without the change from bug 782784), you must manually a...
Callgraph
this can be used for performing
static analysis based on the relationship between functions and methods.
Eclipse CDT Manual Setup
to be able to provide really good code assistance for a project's source code, ides like eclipse need to carry out a thorough
static analysis of the project's source files, to build up a picture of the code (what eclipse is trying to do when it "indexes" the source.)
static analysis involves parsing the source files, so naturally it can only produce good results if it has a sensible set of preprocessor defines, include paths and pre-include files for each source file.
Contributing to the Mozilla code base
er resources to help: ask for help in a comment on the bug, or in #introduction:mozilla.org or #developers:mozilla.org check out https://developer.mozilla.org/docs/developer_guide and its parent document, https://developer.mozilla.org/docs/mozilla our reviewer checklist is very useful, if you have a patch near completion, and seek a favorable review utilize our build tool mach, its linting,
static analysis, and other code checking features step 3: get your code reviewed once you fix the bug, you can advance to having your code reviewed.
mach
check out the linting and analysis tools: $ ./mach lint $ ./mach
static-analysis mach and mozconfigs it's possible to use mach with multiple mozconfig files.
Developer guide
callgraph a tool to help perform
static analysis of the mozilla code by generating callgraphs automatically.
Error codes returned by Mozilla APIs
method_info (0x80570007) ns_error_xpc_unexpected (0x80570008) ns_error_xpc_bad_convert_js (0x80570009) ns_error_xpc_bad_convert_native (0x8057000a) ns_error_xpc_bad_convert_js_null_ref (0x8057000b) ns_error_xpc_bad_op_on_wn_proto (0x8057000c) ns_error_xpc_cant_convert_wn_to_fun (0x8057000d) ns_error_xpc_cant_define_prop_on_wn (0x8057000e) ns_error_xpc_cant_watch_wn_
static (0x8057000f) ns_error_xpc_cant_export_wn_
static (0x80570010) ns_error_xpc_scriptable_call_failed (0x80570011) ns_error_xpc_scriptable_ctor_failed (0x80570012) ns_error_xpc_cant_call_wo_scriptable (0x80570013) ns_error_xpc_cant_ctor_wo_scriptable (0x80570014) ns_error_xpc_ci_returned_failure (0x80570015) ns_error_xpc_gs_returned_failure (0x80570016) ns_error_xpc_bad...
Limitations of chrome scripts
however, this "dummy" object is completely
static and only exposes a few of the normal properties that windows and documents have.
Script security
because the wrapper we choose is specific to the relationship between the two compartments, the security policy it implements can be
static: when the caller uses the wrapper, there's no need to check who is making the call or where it is going.
Extending a Protocol
ement: allocpechoparent() deallocpechoparent(pechoparent* aactor) so, let's add: already_addrefed<echoparent> windowglobalparent::allocpechoparent() { puts("windowglobalparent::allocpechoparent was called"); refptr<echoparent> actor = new echoparent(); return actor.forget(); } bool windowglobalparent::deallocpechoparent( pechoparent* aactor) { refptr actor = dont_addref(
static_cast(aactor)); return true; } the "puts()" there will help us see what's going on once we get things going.
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 {...
Mozilla Style System Documentation
the fundamental way to get a style struct from a style context looks like this: const nsstyledisplay *display = ns_
static_cast(const nsstyledisplay*, sc->getstyledata(estylestruct_display)); there is also a (non-virtual) method on nsiframe to get the style data from a frame's style context (saving the refcounting needed to get the style context): const nsstyledisplay *display; frame->getstyledata(estylestruct_display, (const nsstylestruct*&)display); however, there are simila...
GPU performance
amd gpu shaderanalyzer - will compile a shader and show the machine code and give
static pipeline estimations.
JS::PerfMeasurement
static bool perfmeasurement::canmeasuresomething() this class method returns true if and only if some -- not necessarily all -- events can be measured by the current build of spidermonkey, running on the current os.
TimerFirings logging
ntent] http://widgets.outbrain.com/outbrain.js:20:330 135 -495057024[7f74e105ba00]: [7108] fn timer (one_shot 4 ms): [content] https://self-repair.mozilla.org/repair/:7:13669 118 801266240[7f7c1f248000]: [7163] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 103 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] http://
static.dynamicyield.com/scripts/12086/dy-min.js?v=12086:3:3389 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] https://ad.doubleclick.net/ddm/adi/n7921.1283839cadreon.com.au/b9038144.122190976;sz=300x600;click=http://pixel.mathtag.com/click/img?mt_aid=2744535504761193354&mt_id=1895890&mt_adid=148611&mt_sid=973379&mt_exid=9&mt_inapp=0&mt_uuid=353d5460-19f6-4400-9bbd-d0f...
Performance
lsan) is similar to valgrind, but it runs faster because it uses
static source code instrumentation.
A brief guide to Mozilla preferences
programmatic changes to preferences can be made using the preferences.jsm module from js code, or the mozilla::preferences
static class methods from c++ code.
Preferences
using preferences from application code firefox 6 introduced
static functions for accessing preferences efficiently from within application code.
Condition Variables
in addition, a
static association exists between the condition and some data within the monitor.
Introduction to NSPR
in addition, a
static association exists between the condition and some data within the monitor.
Linked Lists
linked list macros macros that create and operate on linked lists are: pr_init_clist pr_init_
static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_remove_link pr_remove_and_init_link pr_insert_before pr_insert_after pr_clist_is_empty pr_list_head pr_list_tail ...
NSPR Types
here are some simple examples of the use of these types: in dowhim.h: pr_extern( void ) dowhatimean( void );
static void pr_callback rootfunction(void *arg); in dowhim.c: pr_implement( void ) dowhatimean( void ) { return; }; prthread *thread = pr_createthread(..., rootfunction, ...); algebraic types nspr provides the following type definitions with unambiguous bit widths for algebraic operations: 8-, 16-, and 32-bit integer types 64-bit integer types floating-point number type for convenience,...
NSPR API Reference
ns memory management operations memory allocation functions memory allocation macros string operations pl_strlen pl_strcpy pl_strdup pl_strfree floating point number to string conversion pr_strtod pr_dtoa pr_cnvtf long long (64-bit) integers bitmaps formatted printing linked lists linked list types prclist linked list macros pr_init_clist pr_init_
static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_remove_link pr_remove_and_init_link pr_insert_before pr_insert_after dynamic library linking library linking types prlibrary pr
staticlinktable library linking functions pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unl...
An overview of NSS Internals
the crmf library, which is used to produce certain kinds of certificate requests, is available as a library for
static linking only.
Cryptography functions
sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_lookupcrls mxr 3.2 and later sec_newcrl mxr 3.2 and later sec_quickderdecodeitem mxr 3.6 and later seckey_cache
staticflags mxr 3.10 and later seckey_converttopublickey mxr 3.2 and later seckey_copyprivatekey mxr 3.2 and later seckey_copypublickey mxr 3.6 and later seckey_copysubjectpublickeyinfo mxr 3.4 and later seckey_createdhprivatekey mxr 3.3 and later ...
Using JSS
jss version 3.0 linked
statically with nss, so it only required nspr.
NSS_3.12.2_release_notes.html
bug 444974: crash upon reinsertion of e-identity smartcard bug 447563: modutil -add prints no error explanation on failure bug 448431: pk11_createmergelog() declaration causes gcc warning when compiling with -wstrict-prototypes bug 449334: pk12util has duplicate options letters bug 449725: signver is still using
static libraries.
NSS 3.17 release notes
on windows, the new build variable use_
static_rtl can be used to specify the
static c runtime library should be used.
NSS Sample Code Sample1
// utility function to print hex data
static void printbuffer(unsigned char *digest, unsigned int len) { int i; cout << "length: " << len << endl; for(i = 0;i < len;i++) printf("%02x ", digest[i]); cout << endl; } // xxx data protection // - takes an input buffer, applies the encryption // and mac, and generates a buffer with the result.
NSS Sample Code Sample_2_Initialization of NSS
sample code 1 /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <prprf.h> /* nss headers */ #include <nss.h> #include <pk11func.h> #include "util.h" /* print a usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -d <dbdirpath> [-p <plainpasswc>]" " [-f <passwdffile>]\n\n", progname); fprintf(stderr, "%-15s specify a db directory path\n\n", "-d <dbdirpath>"); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p <plainpasswc>"); fprintf(stderr, "%-15s specify a password file\n\n"...
NSS Sample Code sample3
sample code 3: hashing, mac /* * demonstration program for hashing and macs */ #include <iostream.h> #include "pk11pub.h" #include "nss.h"
static void printdigest(unsigned char *digest, unsigned int len) { int i; cout << "length: " << len << endl; for(i = 0;i < len;i++) printf("%02x ", digest[i]); cout << endl; } /* * main */ int main(int argc, const char *argv[]) { int status = 0; pk11slotinfo *slot = 0; pk11symkey *key = 0; pk11context *context = 0; unsigned char data[80]; unsigned char digest[20]; /*is there a way to tell how large the output is?*/ unsigned int len; secstatus s; /* initialize nss * if your application code has already initialized nss, you can skip it * here.
Initialize NSS database - sample 2
/* * print a usage message and exit */
static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -d [-p ]" " [-f ]\n\n", progname); fprintf(stderr, "%-15s specify a db directory path\n\n", "-d "); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p "); fprintf(stderr, "%-15s specify a password file\n\n", "-f "); exit(-1); } /* * initslotpassword */ char * initslotpassword(pk11slotinfo *slot, prbool retry, void *arg) { file *input; file *output; char *p0 = null; char *p1 = null; ...
PKCS11 Implement
the slots are expected to remain
static: that is, the module never has more slots or fewer slots than the number on the original list.
Python binding for NSS
review all ref counting, numerous ref counting fixes implement cyclic garbage collection support by adding object traversal and clear methods identify
static variables, move to thread local storage remove python-nss specific httplib.py, no longer needed python-nss now compatible with standard library rewrite httplib_example.py to use standard library and illustrate ssl, non-ssl, connection class, http class usage the following classes were added: authkeyid basicconstraints crldistributionpoint crldistribut...
NSS functions
sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_lookupcrls mxr 3.2 and later sec_newcrl mxr 3.2 and later sec_quickderdecodeitem mxr 3.6 and later seckey_cache
staticflags mxr 3.10 and later seckey_converttopublickey mxr 3.2 and later seckey_copyprivatekey mxr 3.2 and later seckey_copypublickey mxr 3.6 and later seckey_copysubjectpublickeyinfo mxr 3.4 and later seckey_createdhprivatekey mxr 3.3 and later ...
Pork Tool Development
notes the #
static channel on irc.mozilla.org is for discussion of pork, dehydra, and other
static analysis tools.
Pork
mailing list newsgroup rss feed #
static on irc.mozilla.org related topics dehydra, treehydra, mozilla 2, spidermonkey ...
The JavaScript Runtime
since javascript is a dynamically typed language, the
static java type of a javascript value is java.lang.object.
Rhino scopes and contexts
calls to functions in javascript use
static scope, which means that variables are first looked up in the function and then, if not found there, in the lexically enclosing scope.
Rebranding SpiderMonkey (1.8.5)
find ./ -type f -exec sed -i "s/$brand.pc/mozjs185.pc/" {} \; the last recursive search and replace, changes the file name of the
static library: find ./ -type f -exec sed -i "s/js_
static/$brand_
static/" {} \; allright, almost there.
Hacking Tips
once the breakpoint is on codegenerator function of the lir instruction, add a command to generate a
static breakpoint in the generated code.
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.
JIT Optimization Outcomes
accessnottypedarray accessnotstring
statictypedarrayuint32
statictypedarraycantcomputemask outofbounds getelemstringnotcached nonnativereceiver indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled.
JS::Add*Root
typically name is a
static string constant, identifying the source location of the call to js::addnamed*root for debugging purposes.
JS::CallArgs
the principal way to create a callargs is like so, using js::callargsfromvp:
static bool functionreturningargctimesarg0(jscontext *cx, unsigned argc, js::value *vp) { js::callargs args = js::callargsfromvp(argc, vp); // guard against no arguments or a non-numeric arg0.
JS::CompileOptions
introductiontype const char a
statically allocated c string: one of following in general: "eval" - code passed to eval "function" - code passed to the function constructor.
JS::DeflateStringToUTF8Buffer
examples char16_t uchars[] = { 0xd83e, 0xdd8a, 0 }; js::rootedstring str(cx, js_newucstringcopyn(cx, uchars, 2)); if (!str) return false; js::rooted<jsflatstring*> flatstr(cx, js_flattenstring(cx, str)); if (!flatstr) return false; size_t length = js::getdeflatedutf8stringlength(flatstr); char* buffer =
static_cast<char*>(js_malloc(cx, length + 1)); if (!buffer) return false; js::deflatestringtoutf8buffer(flatstr, mozilla::rangedptr<char>(buffer, length)); buffer[length] = '\0'; printf("utf8: [%s]\n", buffer); js_free(cx, buffer); see also js::getdeflatedutf8stringlength bug 1034627 bug 1271014 -- added dstlenp and numcharsp ...
JS::SourceBufferHolder
example size_t length = 512; char16_t* chars =
static_cast<char16_t*>(js_malloc(sizeof(char16_t) * length)); js::sourcebufferholder srcbuf(chars, length, js::sourcebufferholder::giveownership); js::compile(cx, obj, options, srcbuf); see also mxr id search for js::sourcebufferholder js::compile js::compilefunction js::evaluate bug 987556 ...
JS_ASSERT_STRING_IS_FLAT
syntax
static moz_always_inline jsflatstring * js_assert_string_is_flat(jsstring *str) { moz_assert(js_stringisflat(str)); return (jsflatstring *)str; } name type description str jsstring * string to examine.
JS_Add*Root
typically name is a
static string constant, identifying the source location of the call to js_addnamedroot for debugging purposes.
JS_DefineFunctions
this array is usually defined as a
static global, with each record initialized using js_fs or js_fn.
JS_DumpHeap
the "trace kind" is a
static map which tells which layout a gc thing has.
JS_DumpNamedRoots
example
static void dumproot(const char *name, void *addr, void *data) { /* the application may use `data` for anything.
JS_FORGET_STRING_FLATNESS
syntax
static moz_always_inline jsstring * js_forget_string_flatness(jsflatstring *fstr) { return (jsstring *)fstr; } name type description fstr jsflatstring * a string to convert description js_forget_string_flatness converts jsflatstring * to jsstring *.
JS_NewObject
the usual way to do this is to make jsclasses global or
static.
JS_SetErrorReporter
example code with error handling omitted: class myrequest { public: void execute() { auto rt = js_newruntime(memlimit); js_setruntimeprivate(rt, this); js_seterrorreporter(rt, &myrequest::dispatcherror); // execute js } void onerror(const std::string& error) { // handle error }
static void dispatcherror( jscontext* ctx, const char* message, jserrorreport* report) { auto rt = js_getruntime(ctx); auto rt_userdata = js_getruntimeprivate(rt); if (rt_userdata) { auto req =
static_cast<myrequest*>(rt_userdata); req->onerror(message); } } }; see also mxr id search for js_geterrorreport...
JS_SetRegExpInput
see also mxr id search for js_setregexpinput js_newregexpobject js_newucregexpobject jsreg_multiline js_clearregexp
statics regexp ...
JSAPI reference
dded in spidermonkey 38 js_newfunction js::getselfhostedfunction added in jsapi 31 js::newfunctionfromspec added in jsapi 45 js_newfunctionbyid added in spidermonkey 17 obsolete since jsapi 44 js_clonefunctionobject obsolete since jsapi 36 regexps js_newregexpobject jsreg_fold jsreg_glob jsreg_multiline jsreg_sticky js_newucregexpobject js_newregexpobjectno
statics js_newucregexpobjectno
statics js_setregexpinput js_clearregexp
statics js_objectisregexp added in spidermonkey 17 js_getregexpflags added in spidermonkey 17 js_getregexpsource added in spidermonkey 17 js_executeregexp js_executeregexpno
statics js_clearregexproots obsolete since javascript 1.8.5 serialization struct jsstructuredclonecallbacks js_setstructuredclonecallbacks js_re...
Profiling SpiderMonkey
here are some instrumented tests to work from: media:profiling-ammo.zip 3.) once you have some changes you'd like to try, you can just rebuild the js/src directory, since it produces its own shared library, even in libxul and
static builds.
TPS Tab Lists
there are a handful of
static pages at http://hg.mozilla.org/services/tps/file/tip/pages which can be used for tab testing, and data: url's can be used as well.
Web Replay
each subsequent snapshot includes copies of thread stacks/registers as well as a diff containing the original contents of all pages of heap and
static memory that were modified since the previous snapshot.
Mozilla Projects
jshydra jshydra is a
static analysis tool that is capable of performing analysis of general javascript code.
Secure Development Guidelines
ace if instances of fh are shared between threads fh inheritence: default in unix, needs to be set in windows int main(int argc, char **argv, char **envp) { int fd = open("/etc/shadow", o_rdwr); setreuid(getuid(), getuid()); excve("/bin/sh", argv, envp); } suid root applications file i/o: file descriptors and handles potential overflows when using select fd_set struct,
static length, holds a bitmask of fds manipulated with fd_set, fd_isset, fd_clr and fd_zero macros fd_set’s size depends on the operating system if the os allows opening more fds, then fd_set can hold could overflow fd_set file i/o: file descriptors and handles good solution: dynamically allocate fd_set structs int main(void) { int i, fd; fd_set fdset; for( i = 0; i < 2000; i++)...
Mork
morkreader usage morkreader has both internal and external linkage
static libraries that can be used.
History Service Design
in case the database has been created for the first time history service will create all tables, indexes and triggers, calling related inittables
static methods of other dependant services.
Aggregating the In-Memory Datasource
aresult) return ns_error_null_pointer; if (aiid.equals(nscomtypeinfo<nsimyinterface>::getiid()) || aiid.equals(nscomtypeinfo<nsisupports>::getiid())) { *aresult = ns_
static_cast(nsiglobalhistory*, this); } else if (aiid.equals(nscomtypeinfo<nsirdfdatasource>::getiid())) { return minner->queryinterface(aiid, aresult); } else { *aresult = nsnull; return ns_nointerface; } ns_addref(ns_
static_cast(nsisupports*, aresult)); return ns_ok; } the only other thing that you'll need to be aware of is that you'll need to queryinterface() from nsisupp...
XPCOM glue
the xpcom glue is a
static library which component developers and embedders can link against.
XPCOM changes in Gecko 2.0
therefore the following categories have changed: old name new name javascript global constructor javascript-global-constructor javascript global constructor prototype alias javascript-global-constructor-prototype-alias javascript global property javascript-global-property javascript global privileged property javascript-global-privileged-property javascript global
static nameset javascript-global-
static-nameset javascript global dynamic nameset javascript-global-dynamic-nameset javascript dom class javascript-dom-class javascript dom interface javascript-dom-interface xslt extension functions xslt-extension-functions but why?
Finishing the Component
to add the weblock component to this category, modify the weblockregistration callback function so that it looks like this:
static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info) { nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisup...
Mozilla internal string guide
nsliteral[c]string is trivially constructible and destructible, and therefore does not emit construction/destruction code when stored in
statics, as opposed to the other string classes.
How to build a binary XPCOM component using Visual Studio
i put this together from some samples i found on the mdc site: #include "nsigenericfactory.h" #include "comp-impl.h" ns_generic_factory_constructor(cspecialthing)
static nsmodulecomponentinfo components[] = { { specialthing_classname, specialthing_cid, specialthing_contractid, cspecialthingconstructor, } }; ns_impl_nsgetmodule("specialthingsmodule", components) assuming you have the right sdk and setup the include and lib folders correctly, the project should build your xpcom component.
NS_InitXPCOM2
some of the possible errors are documented below: ns_error_not_initialized indicates that
static globals were not yet initialized, which may happen if this method is called before xpcom's
static initialization code executes.
Core XPCOM functions
gistrar.ns_getmemorymanagerthe ns_getmemorymanager function returns a reference to the xpcom memory manager.ns_getservicemanagerthe ns_getservicemanager function returns a reference to the xpcom service manager.ns_initxpcom2the ns_initxpcom2 function initiates use of xpcom in the calling process.ns_initxpcom3the ns_initxpcom3 function initiates use of xpcom in the calling process with support for
statically defined xpcom modules.
Realloc
static void* realloc( void* aptr, size_t asize ); parameters aptr [in] the address of the memory block to reallocate.
mozIRegistry
open issues we have identified two open issues, neither of which appear to be so hard that it we won't be able to solve them in a timely fashion: if and when we remove what is currently a
static binding of clsids, there will be the risk that required clsids won't be present.
nsIComponentRegistrar
xpcom >= 1.9: if aspec is null,
static components, gre components, and the the application's component directories will be registered.
nsIInputStream
static ns_method appendsegment(nsiinputstream* astream, void* aclosure, const char* afromsegment, uint32_t atooffset, uint32_t acount, uint32_t* awritecount) { // afromsegment now contains acount bytes of data.
nsIJumpListBuilder
task lists should generally be
static lists that do not change often, if at all - similar to an application menu.
nsIOutputStream
example writesegments() example // copy data from a string to a stream
static ns_method copysegment(nsiinputstream* astream, void* aclosure, char* atosegment, pruint32 afromoffset, pruint32 acount, pruint32* areadcount) { // afromsegment now contains acount bytes of data.
nsITelemetry
static - true for histograms defined in histograms.json, false for ones defined with newhistogram().
nsIXPCScriptable
want_convert 1 << 10 want_finalize 1 << 11 want_checkaccess 1 << 12 want_call 1 << 13 want_construct 1 << 14 want_hasinstance 1 << 15 want_trace 1 << 16 use_jsstub_for_addproperty 1 << 17 use_jsstub_for_delproperty 1 << 18 use_jsstub_for_setproperty 1 << 19 dont_enum_
static_props 1 << 20 dont_enum_query_interface 1 << 21 dont_ask_instance_for_scriptable 1 << 22 classinfo_interfaces_only 1 << 23 allow_prop_mods_during_resolve 1 << 24 allow_prop_mods_to_prototype 1 << 25 dont_share_prototype 1 << 26 dont_reflect_interface_names 1 << 27 want_equality 1 << 28 want_outer_object 1 << 29 want_inner_object 1 << 30 reserved 1 << 31...
XPCOM reference
for example, to request the 'show all threads' view use the constant:ns
staticmoduleinfothis data structure is used by ns_initxpcom3 to specify
static xpcom modules.standard xpcom componentsthere are a number of components provided in the standard implementation of xpcom; these are as follows.xpcom glue classesthese "glue" classes are provided to make it easier to use xpcom from c++ code.xpcom interface referencethis is a reference to the xpcom interfaces provided by the mo...
Getting Started Guide
they reference it only through a pointer to an `interface', i.e., the
static type of the pointer is a pointer to an abstract base class, the actual object pointed to is a class derived from that abstract base class.
Using the Gecko SDK
when those classes or functions are used, the component must link with the corresponding
static library.
Weak reference
else if ( aiid.equals(nscomtypeinfo<nsisupportsweakreference>::getiid()) ) *ainstancepr = ns_
static_cast(nsisupportsweakreference*, this); // ...
nsCOMPtr versus RefPtr
however, when the destination type is an xpcom interface, it's probably better to
static_cast to a class that unambiguously inherits from nsisupports and use do_queryinterface in such cases.
XPCOM
however, such decoders relied on servers sending correct mime types; images sent with incorrect mime types would not be correctly displayed.xpcom gluethe xpcom glue is a
static library which component developers and embedders can link against.
Address book sync client design
the
static information that is held on the client for address book sync operations is stored in a file called absync.dat which is located in the root directory of the users profile information.
Autoconfiguration in Thunderbird
configuration server at isp isps have the option to provide their configuration information themselves directly to users, by setting up a web server at autoconfig.<domain>, which simply returns a
static xml file with the configuration, as described below.
libmime content type handlers
t { prbool force_inline_display; } contenttypehandlerinitstruct; #include "prtypes.h" #include "nsisupports.h" #include "mimecth.h" // {20dabd99-f8b5-11d2-8ee0-00a024a7d144} #define ns_imime_content_type_handler_iid \ { 0x20dabd99, 0xf8b5, 0x11d2, \ { 0x8e, 0xe0, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } } class nsimimecontenttypehandler : public nsisupports { public:
static const nsiid& getiid() {
static nsiid iid = ns_imime_content_type_handler_iid; return iid; } ns_imethod getcontenttype(char **contenttype) = 0; ns_imethod createcontenttypehandlerclass(const char *content_type, contenttypehandlerinitstruct *initstruct, mimeobjectclass **objclass) = 0; }; #en...
Zombie compartments
compartment(http://techcrunch.com/) compartment(http://www.facebook.com/plugins/like.php?...) compartment(https://plusone.google.com/_/+1/fastbutton?...) compartment(http://platform.twitter.com/widgets/...utton.html?...) compartment(http://cdn.at.atwola.com/_media/uac/tcode3.html) compartment(https://s-
static.ak.fbcdn.net/connec..._proxy.php?...) compartment(http://ads.tw.adsonar.com/adserving/getads.jsp?...) (some of those compartment urls are long and have been truncated.) another thing to beware is each compartment is created for an origin (e.g.
Using Objective-C from js-ctypes
with blocks - https://developer.apple.com/library/ios/documentation/cocoa/conceptual/programmingwithobjectivec/workingwithblocks/workingwithblocks.html var _nsconcreteglobalblock = ctypes.open(ctypes.libraryname('objc')).declare('_nsconcreteglobalblock', ctypes.voidptr_t); // //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 /** * the "block descriptor" is a
static singleton struct.
Memory Management
this is not an exhaustive list, but will help you to understand memory management and how it affects your use of js-ctypes: a function or
static data declared using the declare() method will hold that library alive.
Debugger-API - Firefox Developer Tools
given a debugger.script, one can set breakpoints, translate between source positions and bytecode offsets (a deviation from the “source level” design principle), and find other
static characteristics of the code.
The JavaScript input interpreter - Firefox Developer Tools
cd("#frame1"); you can pass the iframe's global window object: var frame = document.getelementbyid("frame1"); cd(frame.contentwindow); to switch the context back to the top-level window, call cd() with no arguments: cd(); for example, suppose we have a document that embeds an iframe: <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <iframe id="frame1" src="
static/frame/my-frame1.html"></iframe> </body> </html> the iframe defines a new function: <!doctype html> <html> <head> <meta charset="utf-8"> <script> function whoareyou() { return "i'm frame1"; } </script> </head> <body> </body> </html> you can switch context to the iframe like this: cd("#frame1"); now you'll see that the global window's document is the if...
AudioWorkletNode - Web APIs
if the audioworkletprocessor has a
static parameterdescriptors getter, the audioparamdescriptor array returned from it is used to create audioparam objects on the audioworkletnode.
AudioWorkletProcessor.process - Web APIs
parameters['customgain'][i] : parameters['customgain'][0]) } }) // as this is a source node which generates its own output, // we return true so it won't accidentally get garbage-collected // if we don't have any references to it in the main thread return true } // define the customgain parameter used in process method
static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } } specifications specification status comment web audio apithe definition of 'process()' in that specification.
AudioWorkletProcessor - Web APIs
optionally, if you want custom audioparams on your node, you can supply a parameterdescriptors property as a
static getter on the processor.
CSS.escape() - Web APIs
the css.escape()
static method returns a cssomstring containing the escaped string passed as parameter, mostly for use as part of a css selector.
CSS Object Model (CSSOM) - Web APIs
managing screen orientation specifications specification status comment css typed om level 1 working draft css painting api level 1 working draft extended the css interface with the paintworklet
static property.
CSS Painting API - Web APIs
we create our paintworklet called 'hollowhighlights' using the registerpaint() function: registerpaint('hollowhighlights', class {
static get inputproperties() { return ['--boxcolor']; }
static get inputarguments() { return ['*','<length>']; }
static get contextoptions() { return {alpha: true}; } paint(ctx, size, props, args) { const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; const thecolor = props.get( '--boxcolor' ); const stroketype = ar...
Manipulating video using canvas - Web APIs
as a result, the final image has the entire green screen area 100% transparent, so that when it's drawn into the destination context in line 13, the result is an overlay onto the
static backdrop.
Basic usage of canvas - Web APIs
for example, we could provide a text description of the canvas content or provide a
static image of the dynamically rendered content.
DOMPointInit.w - Web APIs
there are two methods which use dompointinit: the
static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created.
DOMPointInit.y - Web APIs
there are two methods which use dompointinit: the
static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created.
DOMPointInit.z - Web APIs
there are two methods which use dompointinit: the
static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created.
DOMRect - Web APIs
static methods domrectreadonly.fromrect() creates a new domrect object with a given location and dimensions.
DOMRectReadOnly.fromRect() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfromrect()
static functionchrome full support 57edge full support 79firefox full support 69ie no support noopera full support 44safari full support ...
DOMRectReadOnly - Web APIs
static methods domrectreadonly.fromrect() creates a new domrect object with a given location and dimensions.
Document.querySelectorAll() - Web APIs
the document method queryselectorall() returns a
static (not live) nodelist representing a list of the document's elements that match the specified group of selectors.
Document Object Model (DOM) - Web APIs
static type svgangle svgcolor svgicccolor svgelementinstance svgelementinstancelist svglength svglengthlist svgmatrix svgnamelist svgnumber svgnumberlist svgpaint svgpathseg svgpathsegclosepath svgpathsegmovetoabs svgpathsegmovetorel svgpathseglinetoabs svgpathseglinetorel svgpathsegcurvetocubicabs svgpathsegcurvetocubicrel svgpathsegcurvetoquadraticabs s...
Element.querySelectorAll() - Web APIs
the element method queryselectorall() returns a
static (not live) nodelist representing a list of elements matching the specified group of selectors which are descendants of the element on which the method was called.
ExtendableEvent.waitUntil() - Web APIs
example using waituntil() within a service worker's install event: addeventlistener('install', event => { const precache = async () => { const cache = await caches.open('
static-v1'); return cache.addall([ '/', '/about/', '/
static/styles.css' ]); }; event.waituntil(precache()); }); specifications specification status comment service workersthe definition of 'waituntil()' in that specification.
ExtendableEvent - Web APIs
var cache_version = 1; var current_caches = { prefetch: 'prefetch-cache-v' + cache_version }; self.addeventlistener('install', function(event) { var urlstoprefetch = [ './
static/pre_fetched.txt', './
static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event.
Using Fetch - Web APIs
method: const mybody = new blob(); addeventlistener('fetch', function(event) { // serviceworker intercepting a fetch event.respondwith( new response(mybody, { headers: { 'content-type': 'text/plain' } }) ); }); the response() constructor takes two optional arguments — a body for the response, and an init object (similar to the one that request() accepts.) note: the
static method error() simply returns an error response.
HTMLContentElement - Web APIs
htmlcontentelement.getdistributednodes() returns a
static nodelist of the distributed nodes associated with this <content> element.
HTMLShadowElement - Web APIs
htmlshadowelement.getdistributednodes() returns a
static nodelist of the distributed nodes associated with this <shadow> element.
IDBKeyRange - Web APIs
methods
static methods idbkeyrange.bound() creates a new key range with upper and lower bounds.
IDBTransaction - Web APIs
the idbtransaction interface of the indexeddb api provides a
static, asynchronous transaction on a database using event handler attributes.
InputEvent() - Web APIs
ranges: (optional) an array of
static ranges that will be affected by a change to the dom if the input event is not canceled.
InputEvent - Web APIs
inputevent.gettargetranges() returns an array of
static ranges that will be affected by a change to the dom if the input event is not canceled.
InstallEvent - Web APIs
var cache_version = 1; var current_caches = { prefetch: 'prefetch-cache-v' + cache_version }; self.addeventlistener('install', function(event) { var urlstoprefetch = [ './
static/pre_fetched.txt', './
static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event.
Location: ancestorOrigins - Web APIs
the ancestororigins read-only property of the location interface is a
static domstringlist containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object.
Location - Web APIs
"click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = '#' + $(this).attr('id'); }); }); [].foreach.call(document.queryselectorall('[title]'), function (node) { node.addeventlistener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = ''; }); }); result properties location.ancestororigins is a
static domstringlist containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object.
MediaRecorder.isTypeSupported - Web APIs
the mediarecorder.istypesupported()
static method returns a boolean which is true if the mime type specified is one the user agent should be able to successfully record.
MediaRecorder - Web APIs
static methods mediarecorder.istypesupported() a
static method which returns a boolean value indicating if the given mime media type is supported by the current user agent.
MediaSource.isTypeSupported() - Web APIs
the mediasource.istypesupported()
static method returns a boolean value which is true if the given mime type is likely to be supported by the current user agent.
MediaSource - Web APIs
static methods mediasource.istypesupported() returns a boolean value indicating if the given mime type is supported by the current user agent — this is, if it can successfully create sourcebuffer objects for that mime type.
Microsoft API extensions - Web APIs
mode onmsvideoformatchanged onmsvideoframestepcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msis
statichtml navigator.mslaunchuri() mslaunchuricallback element.msmatchesselector() msprotocols msputpropertyenabled mswriteprofilermark ...
Using the Payment Request API - Web APIs
paymentrequest.canmakepayment() .then(function(res) { if (res) { // the payment handler has pre-authorized a transaction // with some
static amount, e.g., usd $1.00.
performance.clearResourceTimings() - Web APIs
example function load_resource() { var image = new image(); image.src = "https://developer.mozilla.org/
static/img/opengraph-logo.png"; } function clear_performance_timings() { if (performance === undefined) { log("browser does not support web performance"); return; } // create a resource timing performance entry by loading an image load_resource(); var supported = typeof performance.clearresourcetimings == "function"; if (supported) { console.log("run: performance.clearresourceti...
PublicKeyCredential - Web APIs
publickeycredential.isuserverifyingplatformauthenticatoravailable()secure context a
static method returning a promise which resolves to true if an authenticator bound to the platform is capable of verifying the user.
RTCConfiguration.certificates - Web APIs
using certificates when you wish to provide your own certificates for use by an rtcpeerconnection instead of having the rtcpeerconnection generate them automatically, you do so by calling the
static rtcpeerconnection.generatecertificate() function.
RTCRtpCapabilities - Web APIs
the rtcrtpcapabilities dictionary is a data type used to describe the capabilities of an rtcrtpsender or rtcrtpreceiver in response to a call to the rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities()
static functions, both of which return an array of rtcrtpcapabilities objects.
RTCRtpCodecCapability - Web APIs
an array of objects of this type is returned in the codecs property of the rtcrtpcapabilities object returned in response to a call to either of the
static functions rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities().
RTCRtpReceiver - Web APIs
static methods rtcrtpreceiver.getcapabilities() returns the most optimistic view of the capabilities of the system for receiving media of the given kind.
RTCRtpSender - Web APIs
static methods rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the system's capabilities for sending a specified kind of media data.
Using the Resource Timing API - Web APIs
function buffer_full(event) { console.log("warning: resource timing buffer is full!"); set_resource_timing_buffer_size(200); } function init() { // load some image to trigger "resource" fetch events var image1 = new image(); image1.src = "https://developer.mozilla.org/
static/img/opengraph-logo.png"; var image2 = new image(); image2.src = "http://mozorg.cdn.mozilla.net/media/img/firefox/firefox-256.e2c1fc556816.jpg" // set a callback if the resource buffer becomes filled performance.onresourcetimingbufferfull = buffer_full; } coping with cors when cors is in effect, many of the timing properties' values are returned as zero unless the server's access polic...
SVGAnimatedPoints - Web APIs
interface overview also implement none methods none properties readonly svgpointlist points readonly svgpointlist animatedpoints normative document svg 1.1 (2nd edition) properties name type description points svgpointlist provides access to the base (i.e.,
static) contents of the points attribute.
SVGStylable - Web APIs
methods name & arguments return description getpresentationattribute(in domstring name) cssvalue returns the base (i.e.,
static) value of a given presentation attribute as an object of type cssvalue.
URL.revokeObjectURL() - Web APIs
the url.revokeobjecturl()
static method releases an existing object url which was previously created by calling url.createobjecturl().
WebGL2RenderingContext.copyBufferSubData() - Web APIs
examples var srcbuffer = gl.createbuffer(); var dstbuffer = gl.createbuffer(); var data = new float32array(vertices); var length = vertices.length * 4; gl.bindbuffer(gl.array_buffer, srcbuffer); gl.bufferdata(gl.array_buffer, data, gl.
static_draw); gl.bindbuffer(gl.copy_read_buffer, srcbuffer); gl.bindbuffer(gl.array_buffer, dstbuffer); gl.bufferdata(gl.array_buffer, new float32array(length), gl.
static_draw); gl.copybuffersubdata(gl.copy_read_buffer, gl.array_buffer, 0, 0, length); specifications specification status comment webgl 2.0the definition of 'copybuffersubdata' in that specification.
WebGL2RenderingContext.getBufferSubData() - Web APIs
examples var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array(vertices), gl.
static_draw); var arrbuffer = new arraybuffer(vertices.length * float32array.bytes_per_element); gl.getbuffersubdata(gl.array_buffer, 0, arrbuffer); specifications specification status comment webgl 2.0the definition of 'getbuffersubdata' in that specification.
WebGLRenderingContext.bufferSubData() - Web APIs
examples using buffersubdata var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 1024, gl.
static_draw); gl.buffersubdata(gl.array_buffer, 512, data); specifications specification status comment webgl 1.0the definition of 'buffersubdata' in that specification.
WebGLRenderingContext.vertexAttribPointer() - Web APIs
t as an array buffer: const response = await fetch('assets/geometry.bin'); const buffer = await response.arraybuffer(); consume array buffer with webgl first, we create a new vertex buffer object (vbo) and supply it with our array buffer: //bind array buffer to a vertex buffer object const vbo = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, vbo); gl.bufferdata(gl.array_buffer, buffer, gl.
static_draw); then, we specify the memory layout of the array buffer, either by setting the index ourselves: //describe the layout of the buffer: //1.
Hello vertex attributes - Web APIs
l.points, 0, 1); document.queryselector("canvas").addeventlistener("click", function (evt) { var clickxrelativtocanvas = evt.pagex - evt.target.offsetleft; var clickxinwebglcoords = 2.0 * (clickxrelativtocanvas- gl.drawingbufferwidth/2) / gl.drawingbufferwidth; gl.bufferdata(gl.array_buffer, new float32array([clickxinwebglcoords]), gl.
static_draw); gl.drawarrays(gl.points, 0, 1); }, false); } var buffer; function initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array([0.0]), gl.
static_draw); gl.vertexattribpointer(0, 1, gl.float, false, 0, 0); } window.addeventlistener("beforeunload", cleanup, tru...
Textures from code - Web APIs
" + "error log: " + linkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl.points, 0, 1); cleanup(); } var buffer; function initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array([0.0, 0.0]), gl.
static_draw); gl.vertexattribpointer(0, 2, gl.float, false, 0, 0); } function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || can...
Data in WebGL - Web APIs
.0 ), // black vec4( 1.0, 0.0, 0.0, 1.0 ), // red vec4( 1.0, 1.0, 0.0, 1.0 ), // yellow vec4( 0.0, 1.0, 0.0, 1.0 ), // green ]; var cbuffer = gl.createbuffer(); //continued //create buffer to store colors and reference it to "vcolor" which is in glsl gl.bindbuffer( gl.array_buffer, cbuffer ); gl.bufferdata( gl.array_buffer, flatten(vertexcolors), gl.
static_draw ); var vcolor = gl.getattriblocation( program, "vcolor" ); gl.vertexattribpointer( vcolor, 4, gl.float, false, 0, 0 ); gl.enablevertexattribarray( vcolor ); //glsl attribute vec4 vcolor; void main() { fcolor = vcolor; } varyings varyings are variables that are declared by the vertex shader and used to pass data from the vertex shader to the fragment shader.
Adding 2D content to a WebGL context - Web APIs
gl.bufferdata(gl.array_buffer, new float32array(positions), gl.
static_draw); return { position: positionbuffer, }; } this routine is pretty simplistic given the basic nature of the scene in this example.
Animating textures in WebGL - Web APIs
« previous in this demonstration, we build upon the previous example by replacing our
static textures with the frames of an mp4 video file that's playing.
Lighting in WebGL - Web APIs
.0, // bottom 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, // right 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, // left -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0 ]; gl.bufferdata(gl.array_buffer, new float32array(vertexnormals), gl.
static_draw); ...
Using shaders to apply color in WebGL - Web APIs
const colors = [ 1.0, 1.0, 1.0, 1.0, // white 1.0, 0.0, 0.0, 1.0, // red 0.0, 1.0, 0.0, 1.0, // green 0.0, 0.0, 1.0, 1.0, // blue ]; const colorbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, colorbuffer); gl.bufferdata(gl.array_buffer, new float32array(colors), gl.
static_draw); return { position: positionbuffer, color: colorbuffer, }; } this code starts by creating a javascript array containing four 4-value vectors, one for each vertex color.
Using textures in WebGL - Web APIs
0.0, 1.0, // top 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // bottom 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // right 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // left 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, ]; gl.bufferdata(gl.array_buffer, new float32array(texturecoordinates), gl.
static_draw); ...
WebGL best practices - Web APIs
and to a lesser degree, vao attachments (vertexattribpointer, disable/enablevertexattribarray) drawing from
static, unchanging vaos is faster than mutating the same vao for every draw call.
WebGL model view projection - Web APIs
var gl = this.gl; // create a buffer and bind the data var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, data, gl.
static_draw); // setup the pointer to our attribute data (the triangles) gl.enablevertexattribarray(this.positionlocation); gl.vertexattribpointer(this.positionlocation, 3, gl.float, false, 0, 0); // setup the color uniform that will be shared across all triangles gl.uniform4fv(this.colorlocation, settings.color); // draw the triangles to the screen gl.drawarrays(gl.triangles, 0, 6); } ...
Writing a WebSocket server in Java - Web APIs
mentation split into parts: import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import java.net.serversocket; import java.net.socket; import java.security.messagedigest; import java.security.nosuchalgorithmexception; import java.util.base64; import java.util.scanner; import java.util.regex.matcher; import java.util.regex.pattern; public class websocket { public
static void main(string[] args) throws ioexception, nosuchalgorithmexception { serversocket server = new serversocket(80); try { system.out.println("server has started on 127.0.0.1:80.\r\nwaiting for a connection..."); socket client = server.accept(); system.out.println("a client connected."); socket methods: java.net.socket getinputstream() returns an input stream for this socket.
Window.getDefaultComputedStyle() - Web APIs
nger example <style> #elem-container { position: absolute; left: 100px; top: 200px; height: 100px; } </style> <div id="elem-container">dummy</div> <div id="output"></div> <script> var elem = document.getelementbyid("elem-container"); var thecssprop = window.getdefaultcomputedstyle(elem).position; document.getelementbyid("output").innerhtml = thecssprop; // will output "
static" </script> use with pseudo-elements the getdefaultcomputedstyle() method can pull style info from pseudo-elements (e.g., ::before or ::after).
Window - Web APIs
staticrange read only returns a
staticrange() constructor which creates a
staticrange object.
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"); wo...
XRWebGLLayer() - Web APIs
the
static xrwebgllayer function xrwebgllayer.getnativeframebufferscalefactor() returns the scale that would result in a 1:1 pixel ratio, thereby ensuring that the rendering is occurring at the device's native resolution.
XRWebGLLayer - Web APIs
static methods getnativeframebufferscalefactor() returns the scaling factor that can be used to scale the resolution of the recommended webgl framebuffer resolution to the rendering device's native resolution.
XRWebGLLayerInit - Web APIs
the
static xrwebgllayer function xrwebgllayer.getnativeframebufferscalefactor() returns the scale that would result in a 1:1 pixel ratio, thereby ensuring that the rendering is occurring at the device's native resolution.
Web APIs
rkerglobalscope slottable sourcebuffer sourcebufferlist speechgrammar speechgrammarlist speechrecognition speechrecognitionalternative speechrecognitionerror speechrecognitionerrorevent speechrecognitionevent speechrecognitionresult speechrecognitionresultlist speechsynthesis speechsynthesiserrorevent speechsynthesisevent speechsynthesisutterance speechsynthesisvoice
staticrange stereopannernode storage storageestimate storageevent storagemanager storagequota stylepropertymap stylepropertymapreadonly stylesheet stylesheetlist submitevent subtlecrypto syncevent syncmanager t taskattributiontiming text textdecoder textencoder textmetrics textrange texttrack texttrackcue texttracklist timeevent timeranges touch touchevent touchlist trackdefault track...
Using the aria-labelledby attribute - Accessibility
in addition to form elements, you can use the aria-labelledby attribute to associate
static text with widgets, groups of elements, panes, regions that have a heading, definitions, and other types of objects.
ARIA: alert role - Accessibility
nclick="triggeralert">trigger alert</button> <p class="alert">the alert will trigger when the button is pressed.</p> function triggeralert() { var alertel = document.queryselector('.alert'); alertel.addattribute("role", "alert"); } accessibility concerns the alert role should read out content that has changed, or bring the user's attention to it immediately, so it should not be used for
static content or used regularly.
ARIA: cell role - Accessibility
<tr role="row"> <td role="cell">france</td> <td role="cell">67 million</td> </tr> description the element with role="cell" is a cell within a row, optionally within a rowgroup, within a grid, table or treegrid within a
static tabular structure.
ARIA: document role - Accessibility
because ats with reading mode default to that mode for all elements except for those with a widget or application role set, document role is only useful for focusable elements within a widget or application that should be read as
static rich text.
ARIA: row role - Accessibility
<span role="cell">5.5 million</span> </div> <div role="row"> <span role="cell">france</span> <span role="cell">67 million</span> </div> </div> </div> description the element role="row" is a row within a grid, table or treegrid, and optionally within a rowgroup, that is a container for one or more cells, gridcells, columnheaders, or rowheaders within a
static tabular structure.
ARIA: table role - Accessibility
"> <span role="cell">header</span> <span role="cell">h6</span> </div> <div role="row" aria-rowindex="18"> <span role="cell">rowgroup</span> <span role="cell">thead</span> </div> <div role="row" aria-rowindex="24"> <span role="cell">term</span> <span role="cell">dt</span> </div> </div> </div> description an element with role="table" is a
static tabular structure with rows containing cells.
WAI-ARIA Roles - Accessibility
it is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list.aria: listbox rolethe listbox role is used for lists from which a user may select one or more items which are
static and, unlike html <select> elements, may contain images.aria: listitem rolethe aria listitem role can be used to identify an item inside a list of items.
Accessibility and Spacial Patterns - Accessibility
the phenomenon seems to be especially problematic for symbol/background combinations that differ only in the blue channel." distance between stripes photosensitive seizures may be caused by
static images as well as animation.
HTML To MSAA - Accessibility
ecked property of dom element returns true n/a "check"/"uncheck"/"cycle" depending on state event_object_ statechange when state is changed input type="radio" role_system_ radiobutton n/a n/a state_system_ marqueed used as state checkable state_system_ checked if checked property of dom element returns true n/a "select" event_object_ statechange when state is changed label role_system_
statictext from child nodes n/a n/a n/a n/a n/a legend role_system_
statictext n/a n/a n/a label_for (0x1002), points to caption element n/a n/a li and others role_system_ listitem n/a n/a state_system_ readonly n/a n/a n/a contains child accessible for list bullet ol, ul and others role_system_ list n/a n/a state_system_ readonly n/a n/a n/a optgroup bstr role n/a n/a n/a n/a n/a n/a ...
Accessibility documentation index - Accessibility
68 aria: listbox role aria, accessibility, needscontent the listbox role is used for lists from which a user may select one or more items which are
static and, unlike html <select> elements, may contain images.
Perceivable - Accessibility
see text alternatives for
static caption options, and audio transcripts, video text tracks, and other multimedia content for other alternatives.
border-image-width - CSS: Cascading Style Sheets
stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.</p> css p { border: 20px solid; border-image: url("/
static/external/21/214842819586a8dd293c17b38d0fd0e26430146a86dd04294a53ecaeeea7d0e2.png") 30 round; border-image-width: 16px; padding: 40px; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-image-width' in that specification.
opacity - CSS: Cascading Style Sheets
div class="heavy">this is very easy to see.</div> css div { background-color: yellow; } .light { opacity: 0.2; /* barely see the text over the background */ } .medium { opacity: 0.5; /* see the text more clearly over the background */ } .heavy { opacity: 0.9; /* see the text very clearly over the background */ } result setting opacity on hover html <img src="//developer.mozilla.org/
static/img/opengraph-logo.png" alt="mdn logo" width="128" height="146" class="opacity"> css img.opacity { opacity: 1; filter: alpha(opacity=100); /* ie8 and lower */ zoom: 1; /* triggers "haslayout" in ie 7 and lower */ } img.opacity:hover { opacity: 0.5; filter: alpha(opacity=50); zoom: 1; } result specifications specification status comment css col...
translate() - CSS: Cascading Style Sheets
10tx01ty001 10tx01ty001 100tx010ty00100001 [1 0 0 1 tx ty] formal syntax translate(<length-percentage> , <length-percentage>?) examples using a single-axis translation html <div>
static</div> <div class="moved">moved</div> <div>
static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { transform: translate(10px); /* equal to: translatex(10px) or translate(10px, 0) */ background-color: pink; } result combining y-axis and x-axis translation html <div>
static</div> <div class="moved">moved</div> <div>
static</div> css div { width: ...
translate3d() - CSS: Cascading Style Sheets
100tx010ty001tz0001 examples using a single axis translation html <div>
static</div> <div class="moved">moved</div> <div>
static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { /* equivalent to perspective(500px) translatex(10px) */ transform: perspective(500px) translate3d(10px, 0, 0px); background-color: pink; } result combining z-axis and x-axis translation html <div>
static</div> <div class="moved">moved</div> <div>st...
translateX() - CSS: Cascading Style Sheets
10t010001 10t010001 100t010000100001 [1 0 0 1 t 0] formal syntax translatex(<length-percentage>) examples html <div>
static</div> <div class="moved">moved</div> <div>
static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { transform: translatex(10px); /* equal to translate(10px) */ background-color: pink; } result specifications specification status comment css transforms level 1the definition of 'translatex()' in that specification.
translateY() - CSS: Cascading Style Sheets
10001t001 10001t001 1000010t00100001 [1 0 0 1 0 t] formal syntax translatey(<length-percentage>) examples html <div>
static</div> <div class="moved">moved</div> <div>
static</div> css div { width: 60px; height: 60px; background-color: skyblue; } .moved { transform: translatey(10px); background-color: pink; } result specifications specification status comment css transforms level 1the definition of 'translatey()' in that specification.
translateZ() - CSS: Cascading Style Sheets
html <div>
static</div> <div class="moved">moved</div> css div { position: relative; width: 60px; height: 60px; left: 100px; background-color: skyblue; } .moved { transform: perspective(500px) translatez(200px); background-color: pink; } what really matters here is the class "moved"; let's take a look at what it does.
z-index - CSS: Cascading Style Sheets
for a positioned box (that is, one with any position other than
static), the z-index property specifies: the stack level of the box in the current stacking context.
Getting Started - Developer guides
note: if you're sending a request to a piece of code that will return xml, rather than a
static html file, you must set response headers to work in internet explorer.
Constraint validation - Developer guides
calling checkvalidity() is called
statically validating the constraints, while calling reportvalidity() or submitting the form is called interactively validating the constraints.
Localizations and character encodings - Developer guides
setting some encodings to be more easily selectable from the character encoding menu the preference intl.charsetmenu.browser.
static in intl.properties makes some character encodings more easily available in the character encoding menu in the browser.
Developer guides
audio and video delivery we can deliver audio and video on the web in several ways, ranging from '
static' media files to adaptive live streams.
<img>: The Image Embed element - HTML: Hypertext Markup Language
<img src="https://udn.realityripple.com/samples/61/869e27c81e.png" alt="mdn logo" srcset="/
static/external/6c/6c98485e5d8acac9fecd7824ce30c9587f0d8548b946ee9fb1293d2eccdb6cf1.png 2x"> using the srcset and sizes attributes the src attribute is ignored in user agents that support srcset when w descriptors are included.
<menuitem> - HTML: Hypertext Markup Language
example html content <!-- a <div> element with a context menu --> <div contextmenu="popup-menu"> right-click to see the adjusted context menu </div> <menu type="context" id="popup-menu"> <menuitem type="checkbox" checked>checkbox</menuitem> <hr> <menuitem type="command" label="this command does nothing" icon="https://developer.cdn.mozilla.net/
static/img/favicon144.png"> commands don't render their contents.
itemscope - HTML: Hypertext Markup Language
structured data itemscope itemtype recipe itemprop name grandma's holiday apple pie itemprop image https://c1.
staticflickr.com/1/30/42759561_8631e2f905_n.jpg itemprop datepublished 2009-11-05 itemprop description this is my grandmother's apple pie recipe.
itemtype - HTML: Hypertext Markup Language
</span> </div> result html structured data itemscope itemtype product (http://schema.org/product) itemprop name executive anvil itemprop image https://pixabay.com/
static/uploads/photo/2015/09/05/18/15/suitcase-924605_960_720.png itemprop description sleeker than acme's classic anvil, the executive anvil is perfect for the business traveler looking for something to drop from a height.
Evolution of HTTP - HTTP
ps://developer.mozilla.org/docs/glossary/simple_header 200 ok connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: wed, 20 jul 2016 10:55:30 gmt etag: "547fa7e369ef56031dd3bff2ace9fc0832eb251a" keep-alive: timeout=5, max=1000 last-modified: tue, 19 jul 2016 00:59:33 gmt server: apache transfer-encoding: chunked vary: cookie, accept-encoding (content) get /
static/img/header-background.png http/1.1 host: developer.cdn.mozilla.net user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: */* accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate, br referer: https://developer.mozilla.org/docs/glossary/simple_header 200 ok age: 9578461 cache-control: public, max-age=315360000 connection: keep-alive content...
HTTP caching - HTTP
this includes
static files such as images, css files and javascript files, for example.
Proxy servers and tunneling - HTTP
reverse proxies have several use cases, a few are: load balancing: distribute the load to several web servers, cache
static content: offload the web servers by caching
static content like pictures, compression: compress and optimize content to speed up load time.
Enumerability and ownership of properties - JavaScript
true, true, this._enumerable); // or could use unfiltered for..in }, getownandprototypenonenumerables: function(obj) { return this._getpropertynames(obj, true, true, this._notenumerable); }, getownandprototypeenumerablesandnonenumerables: function(obj) { return this._getpropertynames(obj, true, true, this._enumerableandnotenumerable); }, // private
static property checker callbacks _enumerable: function(obj, prop) { return obj.propertyisenumerable(prop); }, _notenumerable: function(obj, prop) { return !obj.propertyisenumerable(prop); }, _enumerableandnotenumerable: function(obj, prop) { return true; }, // inspired by http://stackoverflow.com/a/8024294/271577 _getpropertynames: function getall...
Intl.PluralRules - JavaScript
static methods intl.pluralrules.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
Intl.RelativeTimeFormat - JavaScript
static methods intl.relativetimeformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
Intl - JavaScript
static methods intl.getcanonicallocales() returns canonical locale names.
JSON - JavaScript
static methods json.parse(text[, reviver]) parse the string text as json, optionally transform the produced value and its properties, and return the value.
get Map[@@species] - JavaScript
however, you might want to overwrite this, in order to return parent map objects in your derived class methods: class mymap extends map { // overwrite mymap species to the parent map constructor
static get [symbol.species]() { return map; } } specifications specification ecmascript (ecma-262)the definition of 'get map [ @@species ]' in that specification.
Map - JavaScript
static properties get map[@@species] the constructor function that is used to create derived objects.
Math.E - JavaScript
property attributes of math.e writable no enumerable no configurable no description because e is a
static property of math, you always use it as math.e, rather than as a property of a math object you created (math is not a constructor).
Math.LN10 - JavaScript
property attributes of math.ln10 writable no enumerable no configurable no description because ln10 is a
static property of math, you always use it as math.ln10, rather than as a property of a math object you created (math is not a constructor).
Math.LN2 - JavaScript
property attributes of math.ln2 writable no enumerable no configurable no description because ln2 is a
static property of math, you always use it as math.ln2, rather than as a property of a math object you created (math is not a constructor).
Math.LOG10E - JavaScript
property attributes of math.log10e writable no enumerable no configurable no description because log10e is a
static property of math, you always use it as math.log10e, rather than as a property of a math object you created (math is not a constructor).
Math.LOG2E - JavaScript
property attributes of math.log2e writable no enumerable no configurable no description because log2e is a
static property of math, you always use it as math.log2e, rather than as a property of a math object you created (math is not a constructor).
Math.PI - JavaScript
property attributes of math.pi writable no enumerable no configurable no description because pi is a
static property of math, you always use it as math.pi, rather than as a property of a math object you created (math is not a constructor).
Math.SQRT1_2 - JavaScript
property attributes of math.sqrt1_2 writable no enumerable no configurable no description because sqrt1_2 is a
static property of math, you always use it as math.sqrt1_2, rather than as a property of a math object you created (math is not a constructor).
Math.SQRT2 - JavaScript
property attributes of math.sqrt2 writable no enumerable no configurable no description because sqrt2 is a
static property of math, you always use it as math.sqrt2, rather than as a property of a math object you created (math is not a constructor).
Math.abs() - JavaScript
description because abs() is a
static method of math, you always use it as math.abs(), rather than as a method of a math object you created (math is not a constructor).
Math.acos() - JavaScript
because acos() is a
static method of math, you always use it as math.acos(), rather than as a method of a math object you created (math is not a constructor).
Math.acosh() - JavaScript
description because acosh() is a
static method of math, you always use it as math.acosh(), rather than as a method of a math object you created (math is no constructor).
Math.asin() - JavaScript
because asin() is a
static method of math, you always use it as math.asin(), rather than as a method of a math object you created (math is not a constructor).
Math.asinh() - JavaScript
description because asinh() is a
static method of math, you always use it as math.asinh(), rather than as a method of a math object you created (math is not a constructor).
Math.atan() - JavaScript
because atan() is a
static method of math, you always use it as math.atan(), rather than as a method of a math object you created (math is not a constructor).
Math.atan2() - JavaScript
because atan2() is a
static method of math, you always use it as math.atan2(), rather than as a method of a math object you created (math is not a constructor).
Math.atanh() - JavaScript
description because atanh() is a
static method of math, you always use it as math.atanh(), rather than as a method of a math object you created (math is not a constructor).
Math.cbrt() - JavaScript
description because cbrt() is a
static method of math, you always use it as math.cbrt(), rather than as a method of a math object you created (math is not a constructor).
Math.ceil() - JavaScript
description because ceil() is a
static method of math, you always use it as math.ceil(), rather than as a method of a math object you created (math is not a constructor).
Math.cosh() - JavaScript
description because cosh() is a
static method of math, you always use it as math.cosh(), rather than as a method of a math object you created (math is not a constructor).
Math.exp() - JavaScript
description because exp() is a
static method of math, you always use it as math.exp(), rather than as a method of a math object you created (math is not a constructor).
Math.expm1() - JavaScript
description because expm1() is a
static method of math, you always use it as math.expm1(), rather than as a method of a math object you created (math is not a constructor).
Math.floor() - JavaScript
description because floor() is a
static method of math, you always use it as math.floor(), rather than as a method of a math object you created (math is not a constructor).
Math.fround() - JavaScript
because fround() is a
static method of math, you always use it as math.fround(), rather than as a method of a math object you created (math is not a constructor).
Math.hypot() - JavaScript
because hypot() is a
static method of math, you always use it as math.hypot(), rather than as a method of a math object you created (math is not a constructor).
Math.imul() - JavaScript
because imul() is a
static method of math, you always use it as math.imul(), rather than as a method of a math object you created (math is not a constructor).
Math.log() - JavaScript
because log() is a
static method of math, you always use it as math.log(), rather than as a method of a math object you created (math is not a constructor).
Math.log10() - JavaScript
because log10() is a
static method of math, you always use it as math.log10(), rather than as a method of a math object you created (math is not a constructor).
Math.log1p() - JavaScript
because log1p() is a
static method of math, you always use it as math.log1p(), rather than as a method of a math object you created (math is not a constructor).
Math.log2() - JavaScript
because log2() is a
static method of math, you always use it as math.log2(), rather than as a method of a math object you created (math is not a constructor).
Math.max() - JavaScript
description because math is not a constructor, max() is a
static method of math (you always use it as math.max(), rather than as a method of an instanced math object).
Math.pow() - JavaScript
because pow() is a
static method of math, you always use it as math.pow(), rather than as a method of a math object you created (math has no constructor).
Math.round() - JavaScript
because round() is a
static method of math, you always use it as math.round(), rather than as a method of a math object you created (math has no constructor).
Math.sign() - JavaScript
description because sign() is a
static method of math, you always use it as math.sign(), rather than as a method of a math object you created (math is not a constructor).
Math.sin() - JavaScript
because sin() is a
static method of math, you always use it as math.sin(), rather than as a method of a math object you created (math is not a constructor).
Math.sinh() - JavaScript
description because sinh() is a
static method of math, you always use it as math.sinh(), rather than as a method of a math object you created (math is not a constructor).
Math.sqrt() - JavaScript
because sqrt() is a
static method of math, you always use it as math.sqrt(), rather than as a method of a math object you created (math is not a constructor).
Math.tan() - JavaScript
because tan() is a
static method of math, you always use it as math.tan(), rather than as a method of a math object you created (math is not a constructor).
Math.tanh() - JavaScript
description because tanh() is a
static method of math, you always use it as math.tanh(), rather than as a method of a math object you created (math is not a constructor).
Math.trunc() - JavaScript
because trunc() is a
static method of math, you always use it as math.trunc(), rather than as a method of a math object you created (math is not a constructor).
SharedArrayBuffer - JavaScript
sab.slice(2); // sharedarraybuffer { bytelength: 1022 } sab.slice(-2); // sharedarraybuffer { bytelength: 2 } sab.slice(0, 1); // sharedarraybuffer { bytelength: 1 } using it in a webgl buffer const canvas = document.queryselector('canvas'); const gl = canvas.getcontext('webgl'); const buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, sab, gl.
static_draw); specifications specification ecmascript (ecma-262)the definition of 'sharedarraybuffer' in that specification.
String length - JavaScript
the
static property string.length is unrelated to the length of strings, it's the arity of the string function (loosely, the number of formal parameters it has), which is 1.
String - JavaScript
static methods string.fromcharcode(num1 [, ...[, numn]]) returns a string created by using the specified sequence of unicode values.
Symbol.hasInstance - JavaScript
property attributes of symbol.hasinstance writable no enumerable no configurable no examples custom instanceof behavior you could implement your custom instanceof behavior like this, for example: class myarray {
static [symbol.hasinstance](instance) { return array.isarray(instance) } } console.log([] instanceof myarray); // true function myarray() { } object.defineproperty(myarray, symbol.hasinstance, { value: function(instance) { return array.isarray(instance); } }); console.log([] instanceof myarray); // true specifications specification ecmascript (ecma-262)the definition of...
Symbol.species - JavaScript
the species symbol lets you do this: class myarray extends array { // overwrite species to the parent array constructor
static get [symbol.species]() { return array; } } let a = new myarray(1,2,3); let mapped = a.map(x => x * x); console.log(mapped instanceof myarray); // false console.log(mapped instanceof array); // true specifications specification ecmascript (ecma-262)the definition of 'symbol.species' in that specification.
get TypedArray[@@species] - JavaScript
however, you might want to overwrite this, in order to return a parent typed array object in your derived class methods: class mytypedarray extends uint8array { // overwrite mytypedarray species to the parent uint8array constructor
static get [symbol.species]() { return uint8array; } } specifications specification ecmascript (ecma-262)the definition of 'get %typedarray% [ @@species ]' in that specification.
WebAssembly.Module - JavaScript
static properties webassembly.module.customsections() given a module and string, returns a copy of the contents of all custom sections in the module with the given string name.
WebAssembly - JavaScript
static methods webassembly.instantiate() the primary api for compiling and instantiating webassembly code, returning both a module and its first instance.
undefined - JavaScript
javascript is a
statically scoped language, so knowing if a variable is declared can be read by seeing whether it is declared in an enclosing context.
Lexical grammar - JavaScript
these are always reserved: enum the following are only reserved when they are found in strict mode code: implements interface let package private protected public
static the following are only reserved when they are found in module code: await future reserved keywords in older standards the following are reserved as future keywords by older ecmascript specifications (ecmascript 1 till 3).
this - JavaScript
all non-
static methods within the class are added to the prototype of this: class example { constructor() { const proto = object.getprototypeof(this); console.log(object.getownpropertynames(proto)); } first(){} second(){}
static third(){} } new example(); // ['constructor', 'first', 'second'] note:
static methods are not properties of this.
Transitioning to strict mode - JavaScript
ding 'use strict';, the following cases will throw a syntaxerror before the script is executing: octal syntax var n = 023; with statement using delete on a variable name delete myvariable; using eval or arguments as variable or function argument name using one of the newly reserved keywords (in prevision for ecmascript 2015): implements, interface, let, package, private, protected, public,
static, and yield declaring function in blocks if (a < b) { function f() {} } obvious errors declaring twice the same name for a property name in an object literal {a: 1, b: 3, a: 7} this is no longer the case in ecmascript 2015 (bug 1041128).
Image file type and format guide - Web media technologies
for example, the following code represents an xbm image which is 8 pixels by 8 pixels, with those pixels in a black-and-white checkerboard pattern: #define square8_width 8 #define square8_height 8
static unsigned char square8_bits[] = { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 }; mime type image/xbm, image-xbitmap file extension(s) .xbm specification none browser compatibility firefox 1–3.5, internet explorer 1–5 maximum dimensions unlimited supported color modes color mode bits ...
rotate - SVG: Scalable Vector Graphics
otate backwards along the motion path --> <path fill="blue" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="auto-reverse"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> <g transform="translate(300, 0)"> <use href="#themotionpath"/> <!-- purple arrow which will have a
static rotation of 210 degrees --> <path fill="purple" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="210"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> </svg> result specifications specification status comment svg animations level 2the definition of ...
Other content in SVG - SVG: Scalable Vector Graphics
this means, that you can use clips, masks, filters, rotations and all other tools of svg on the content: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"> <image x="90" y="-65" width="128" height="146" transform="rotate(45)" xlink:href="https://developer.mozilla.org/
static/img/favicon144.png"/> </svg> screenshotlive sample embedding arbitrary xml since svg is an xml application, you can of course always embed arbitrary xml anywhere in an svg document.
Transport Layer Security - Web security
numerous mechanisms have been disabled: renegotiation, generic data compression, digital signature algorithm (dsa) certificates,
static rsa key exchange, and key exchange with custom diffie-hellman (dh) groups.
Introduction to using XPath in JavaScript - XPath
thisnode = iterator.iteratenext(); while (thisnode) { alert( thisnode.textcontent ); thisnode = iterator.iteratenext(); } } catch (e) { alert( 'error: document tree modified during iteration ' + e ); } snapshots when the specified result type in the resulttype parameter is either: unordered_node_snapshot_type ordered_node_snapshot_type the xpathresult object returned is a
static node-set of matched nodes, which allows us to access each node through the snapshotitem(itemnumber) method of the xpathresult object, where itemnumber is the index of the node to be retrieved.